April 24, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

Implementing AJAX Components in the JWL Framework, Page 5

  • April 17, 2008
  • By Aleksey Shevchenko
  • Send Email »
  • More Articles »
  1. Run this page on the server (make sure you are running under Websphere 6.1 or higher).


  2. Click here for a larger image.

    Figure 15: Running the Example on the Server

  3. Test your code.


  4. Click here for a larger image.

    Figure 16: AjaxSubmitRequest Example Output

Listing 7 is the full source code of what you have just gone through. You can find full source code as an attachment at the end of this article.

Listing 7: AjaxSubmitRequest Full Source Code

<f:view>
   <body>
   <hx:scriptCollector id="scriptCollector1">
      <h:form id="form1" styleClass="form">
         <h:inputText id="text1"
                       styleClass="inputText"
                       value="#{concatenatorBean.text1}">
         </h:inputText>
         <h:inputText id="text2"
                      styleClass="inputText"
                      value="#{concatenatorBean.text2}">
         </h:inputText>
         <h:inputText id="text3"
                      styleClass="inputText"
                      value="#{concatenatorBean.text3}">
         </h:inputText>

         <hx:commandExButton type="button"
                             value="Submit"
                             id="button1"
                             styleClass="commandExButton">
            <hx:behavior behaviorAction="get;stop"
                         event="onclick"
                         targetAction>="group1" >
            </hx:behavior>
         </hx:commandExButton>

         <h:panelGroup id="group1" styleClass="panelGroup">
            <h:outputText id="text4"
                          styleClass="outputText"
                          value="#{concatenatorBean.
                                   concatenateThreeFields}">
            </h:outputText>
         </h:panelGroup>

         <hx:ajaxRefreshSubmit id="ajaxRefreshSubmit1"
                               target="group1" >
         </hx:ajaxRefreshSubmit>
      </h:form>
   </hx:scriptCollector>
   </body>
</f:view>

Get External Content <hx:ajaxExternalRequest>

<hx:ajaxExternalRequest> defines how content from a different page replaces the content of the parent tag. Content is retrieved using HTTP GET method. This tag is useful when you want to place one JSP into the content of another one.

The following steps describe how this tag is used:

  1. Create a new JSF page, ajaxExternalRequestExample.jsp, by clicking File → New → Other → Web → Web Page.
  2. Create a new JSF page, externalPage.jsp, by clicking File → New → Other → Web → Web Page. In the page, type "External Page is Loaded!".


  3. Click here for a larger image.

    Figure 17: Creating a New AjaxExternalRequestExample.jsp Page





Page 5 of 6



Comment and Contribute

 


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

 

 


Sitemap | Contact Us

Rocket Fuel