dcsimg
September 19, 2018
Hot Topics:

Implementing AJAX Components in the JWL Framework

  • April 17, 2008
  • By Aleksey Shevchenko
  • Send Email »
  • More Articles »

Update Content <hx:ajaxRefreshSubmit>

<hx:ajaxRefreshSubmit> tag allows for the content of the same JSF page to be asynchronously replaced within the parent tag. The content is retrieved using HTTP POST request. This tag is used when you want to submit the whole form to the server.

The following steps describe how you can implement this tag:

  1. Create a new JSF page ajaxRefreshSubmitExample.jsp by clicking File → New → Other → Web → Web Page.


  2. Click here for a larger image.

    Figure 8: Create a New JSF Page

  3. Open ajaxRefreshSubmitExample.jsp in Source mode.
  4. In the "Palette" pane, click "Enhanced Faces Components" (make sure you are in a Web perspective).
  5. Figure 9: The "Palette" Pane

  6. Drag and drop three input components from the palette to the page. This will produce the code shown in Listing 4:
  7. Listing 4: Three Input Text Fields Code

    <hx:scriptCollector id="scriptCollector1">
    <h:form id="form1" styleClass="form">
       <h:inputText id="text1"
                    styleClass="inputText">
       </h:inputText>
       <h:inputText id="text2"
                    styleClass="inputText">
       </h:inputText>
       <h:inputText id="text3"
                    styleClass="inputText">
       </h:inputText>
    </h:form>
    </hx:scriptCollector>
    
  8. Drag and drop Panel Group component from the palette to the page.
  9. Drag and drop Text Output component from the palette to the panel that you added in the Step 5.
  10. Select the Panel Group and click Properties → AJAX. Click "Allow Ajax Updates" and set Ajax request to "Submit".


  11. Click here for a larger image.

    Figure 10: AJAX Properties

  12. Drag and drop a Button Command and add a new behavior that will have a "group1" target action and be invoked upon a mouse click.
  13. Listing 5: Submit Button "Behavior" Code

    <hx:behavior event="onclick"
                 behaviorAction="get"
                 targetAction="group1" />
    




Page 3 of 6



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

Thanks for your registration, follow us on our social networks to keep up-to-date