Announcement Announcement Module
Collapse
No announcement yet.
Partial page rendering and state transition Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Partial page rendering and state transition

    Is it possible to have partial page update via AJAX on state transition?

    I'm writing a marter-detail solution.

    On the page I have master table. Whenever user double clicks on a row in the master table I want the second (details) table to be shown next to the first one via partial page update. Upon changing details user presses "save" button below the second table and that should hide the second table (again via partial page update) and update the corresponding row in the master table.

    When I implement this solution withing a single state partial page rendering works like a charm. But whenever I try to split it into two states - the page refreshes as a whole! What am I missing? Is it possible at all to have a partial page update with a view-state transition?

    Here's the relevant piece of flow definition:

    HTML Code:
      <view-state id="settingSerialNumbers" model="supply" view="supplies/create/setting-serial-numbers">
        <transition on="setSerialNumbers" to="settingSerialNumbersForItem" validate="false">
          <set name="flowScope.supplyItem" value="supply.items[requestParameters.itemIndex]"/>
        </transition>
        <transition on="save" to="commitState" />
      </view-state>
    
      <view-state id="settingSerialNumbersForItem" model="supplyItem" view="supplies/create/setting-serial-numbers">
        <transition on="saveNumbers" to="settingSerialNumbers">
          <set name="flowScope.supplyItem" value="null" />
        </transition>
        <transition on="cancelNumbers" to="settingSerialNumbers" bind="false">
          <set name="flowScope.supplyItem" value="null" />
        </transition>
      </view-state>
    I'd love to leave it as a single view-state, but then I cannot manage to cope with separation of validation logic since in one case I should validate supplyItem (see above) and in another one the whole supply

  • #2
    As far as I know you need to stay in the same view state, and you need to specify the fragment that needs rerendering. So something like this:

    <view-state id="someView" view="someView">

    <transition on="ajaxtransition">
    <evaluate expression="...if you want to...." />
    <render
    fragments="yourfragmentid,yoursecondfragmentid" />
    </transition>

    </view-state>

    Comment

    Working...
    X