Announcement Announcement Module
Collapse
No announcement yet.
f:ajax + two forms Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • f:ajax + two forms

    I have two forms in view with two ajaxed buttons. Clicking testAjax button i see that two evaluations are made, but only one is required. How to make that only <evaluate expression="browseProductsListBean.getElems()" result="viewScope.products"/> will be triggered ?
    In other words - how to rerender only one form ?

    users-products.xhtml:
    Code:
    <!-- products -->
    <h:form>
         <ui:repeat value="#{products}" var="product" id="products" varStatus="i">
         </ui:repeat>
         <h:commandLink action="testAjax" value="testAjax">
              <f:ajax render="@form" />
         </h:commandLink>
    </h:form>
    <!-- users -->
    <h:form>
         <ui:repeat value="#{users}" var="user" id="users" varStatus="i">
         </ui:repeat>
    </h:form>
    main-flow.xml:
    Code:
    <view-state id="users-products">
       <var name="browseUsersListBean" class="beans.BrowseUsersListBean"/>
       <var name="browseProductsListBean" class="beans.BrowseAllProductsListBean"/>
       <on-render>
          <evaluate expression="browseUsersListBean.getElems()" result="viewScope.users"/>
          <evaluate expression="browseProductsListBean.getElems()" result="viewScope.products"/>
       </on-render>
       <transition on="testAjax"/>
    </view-state>
    Last edited by marioosh; Jan 12th, 2011, 05:31 AM.
Working...
X