Results 1 to 2 of 2

Thread: Partial page rendering and state transition

  1. #1
    Join Date
    Jan 2011
    Location
    Kirovohrad, Ukraine
    Posts
    59

    Default 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. #2

    Default

    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>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •