On Thu, 07 Nov 2013 14:52:31 -0200, Michael Wyraz <michael.wy...@evermind.de> wrote:

No I did not. Thougt this was "by intend" - tapestry complains as soon
as the page root is not "html":

    *The root element of the rendered document was <div>, not <html>. A
    root element of <html> is needed when linking JavaScript and
    stylesheet resources.**

Not actually. It complains after rendering when DocumentLinker tries to add CSS and JavaScript to the page. I think we can add something that tells DocumentLinker to not add stuff to the rendered markup in that request.

Also tapestry would always inject it's stuff to the page. It might be
hard to change this.

It's actually easy, even without changing the sources (but you actually need to take a look at TapestryModule sources first), but I want Tapestry to provide an easy way to do that.

3. Tweak angularjs to use some zone update mechanism to load the
templates.
I have no idea if/how this is possible. If someone already did such,
please let me know.
Hmm, that would probably be more complex than worth in the end.

Not really. I started to investigate in it:

What you describe below is correct and clever, but it doesn't use zones, so I told it would be hard to do, but we ended up talking about different stuff. :P What you're doing is basically returning a Block from an AJAX request.

In my page html I have:
     <script type="text/javascript">
         var templateBaseUri="${templateBaseUri}";
     </script>

This returns an eventlink like "/mypage:gettemplate/"

In my angularjs-router I use this template URI in the following way:
             .when('/', {
                 templateUrl: templateBaseUri+"startseite",

This mages angularjs read all the templates via tapestry event
"gettemplate". The code there is:

         public Object onGetTemplate(String templateName)
         {
             try
             {
                 Block block=resources.getBlock(templateName);
                 System.err.println("Block: "+block);
                 return block; // TODO render block as html fragment
             }
             catch (BlockNotFoundException ex)
             {
                 System.err.println("Template not found: "+templateName);
                 return new
    TextStreamResponse("text/html","<div>Template not found:
    "+templateName+"</div>");
             }
         }

Not in my tml I change
<script type="text/ng-template" id="startseite">
to
<t:block t:id="startseite">

That's all. The only thing left ist to render the block to HTML. If
anyone know how it is done, please let me know.

There are solutions on the mailing lists and tapestry-offline.

Or, better yet, use different pages for different views. Please file the JIRA

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tapestry.apache.org
For additional commands, e-mail: dev-h...@tapestry.apache.org

Reply via email to