Announcement Announcement Module
No announcement yet.
Facelets sf:ajaxEvent renderFragments... I'm missing something.. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Facelets sf:ajaxEvent renderFragments... I'm missing something..

    Hi everybody,

    I'm still trying to change to facelets (from jsp) but now I have a problem with the ajax functionality, I'trying to do 3 dependent lists (country, state, city)
    in ajax, so far I see that the change is made in the flow (the variable take the value that the ajax fired action give it to it) but even using render

    <render fragments="hotels:departamentosFragment" />

    nothing change on the web page.

    here's the code:

    the ajax event trigger

    <sf:ajaxEvent action="clickBoton"
    							<h:selectOneMenu id="listPaises" styleClass="textfield"
    								<f:selectItem itemLabel="#{messages['list.seleccione']}" />
    								<f:selectItems value="#{flowScope.paises}" />

    the transition on the flow

    		<transition on="clickBoton">
    				<set name="flowScope.title" value="'Changed with Ajax'"></set> <!-- new value -->
    			<render fragments="hotels:departamentosFragment" />
    	<ui:define name="content">
    		<h:form id="hotels">
    <ui:fragment id="departamentosFragment"   >
    						<h:outputText value="#{flashScope.title}"/> 
    All the configuration is just fine since i'm working on an swf example (swf-booking-faces).

    What am I missing, please a little help.

    Last edited by m4rkuz; Oct 1st, 2009, 02:48 PM.

  • #2
    Appears an error in the firebug console? Appear your changes when you refresh the hole site?

    You can try this:

    <ui:fragment id="departamentosFragment">
      <div id="someId">
        <h:outputText value="#{flashScope.title}"/>


    • #3
      (Review the first post I've edited it)

      beany thanks for you're input, but sadly I'm still having the same problem...

      you'll see when I change the selected item in the selectOneMenu I can see in the debug console how the value change, but I can not see any re-rendering in my page, off course if I reload the page I see the changes, but that's not what I want, I'm missing the re-render part...

      any other input?
      Last edited by m4rkuz; Oct 1st, 2009, 02:48 PM.


      • #4
        which debug console do you mean?

        although this will not resolve your problem i would suggest to use the onclick event because in IE the onchange event is only triggered when the formular element looses its focus. and spring-js still has some problems with ajaxEvent and the onclick-event because it stops the event (Jira SWF-801)


        • #5
          i have exactly the same problem under facelet ... is it a bug???


          • #6
            Yes itīs a bug ... itīs called Internet Explorer (any version that is... !! )

            make sure you have a <div id="someId"> </div> around your <ui:fragment...

            is that is the case then, I suggest you try the onclick event but adding processIds="form:inputId" in the sf:ajaxEvent ....

            let me know if it works for you...



            • #7
              When using JSF and Facelets, I found this only worked when the IDs of the fragments I was rendering were IDs of actual JSF components. See if replacing your <ui:fragment> tag with some regular JSF tag will do the trick.


              • #8
                I still can't get it work....
                I'm using firefox, my ajax event is fired, but my fragment is not rendering...
                And i have no error message...
                Can someone post a working basic exemple Ajax event with render using <h:selectOneMenu> and facelets?



                • #9
                  ok, it's now working.... seems like i cant use <evaluate expression> before the <render fragments="..."> tag in the webflow file... really weird
                  I also had to use a JSF component like <h:outputLabel value="#{someValue}"/> instead of #{someValue}
                  Last edited by herve; Oct 1st, 2009, 07:18 PM.


                  • #10
                    Ah, that makes sense. I didn't think about that one since your example used a set action instead of evaluate.

                    If there's the possibility for your evaluate to return false or throw an exception, the remaining actions (including your render action) will not be executed. In these cases, you'll always want your render action to be the first one in your transition.