Announcement Announcement Module
No announcement yet.
Basic <render> and <transition> qustions Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Basic <render> and <transition> qustions

    I am learning webflow and set up very simple project.
    This is the flow:
    <?xml version="1.0" encoding="UTF-8"?>
    <flow xmlns=""
    	<view-state id="start" view="main">
    		<transition on="go">
    			<render fragments="b" />
    		<transition on="goo" to="next">
    			<render fragments="b" />
    			<!--<evaluate expression="flashScope.text='adsf'"></evaluate> -->
    	<view-state id="next" view="next">
    I use Tiles for views and both views got two fragments - a & b that just dump the current date & time.

    What was counter-intuitive for me:
    * partial rendering via <render fragment../> does not work unless I have the Spring.AjaxEventDecoration in combination - is this really how it was intended to be or am I doing something wrong? Without the ajax decoration, both fragments are rendered, regardless what I specify in <render ...>. Yes, I understand the whole page is sent, but I expected that the fragments not mentioned in the render tag would be used cached. Effectively from what I see the <render> tag makes no sense without the Ajax decoration - is this so?

    * putting <evaluate> tag in the <transition> prevents it from transiting - this is pretty unexpected and I don't remember reading this in the manual - did I miss something?


  • #2
    Yes, you need to have the Spring.AjaxEventDecoration in place for this to work.

    Partial rendering ONLY works through an AJAX request, which must be initiated through Javascript. The Spring.AjaxEventDecoration adds the Javascript to do this. Without this, there is no partial rendering and you get a full page refresh. This is expected behavior to accomodate browsers running with Javascript turned off.

    The evaluate tag will cancel the transition which contains it if it evaluates to null (I think?) or false. This side effect is unusual, but it is documented in the Executing View Transitions section of the reference docs.

    However, from the looks of things it looks like you're trying to set something into scope. I tend to use the set action rather than the evaluate action do to this, or for invoking any setter on any object:

    <set name="flashScope.text" value="'adsf'"/>
    Set actions have no side effects, I believe.