Announcement Announcement Module
No announcement yet.
aja: fragment not updating Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • aja: fragment not updating


    I am stuck with ajax and fragment rendering.

    I am new to both, spring and webflow, and try to do some ajax stuff. Ic ould not get the fragment to rerender so I stripped my code to a minimum.

    have a bean with a "testNumber", an increaseTestNumber Method and a ui:fragment on my xhtml which only shows this number.

    		<transition on="changeAddress">			
    			<evaluate expression="card.owner.address.incNumber()" />
    			<render fragments="testFragmentXYZ" />			
    xhtml fragment:
    					    <ui:fragment id="testFragmentXYZ">
    xhtml-action button
    <sf:commandLink action="addressLookup" processIds="*" >

    when i click the button, the "testNumber" gets increased correctly, means that the ajax call is succesful. the fragment does not seem to be rendered/updated. when i hit f5 and reload the entire page, the updated number is shown.

    what am I doing wrong?
    Last edited by Mulder_; Feb 15th, 2010, 09:27 AM.

  • #2
    I'm not sure but you might need to use form or panel instead of fragment. It works in my case.

    <h:form id="testFragmentXYZ">


    • #3
      thx, that already helped me, its working.
      too much confusion with fragments i guess.

      so far I have only been able to get it to work with forms (passing the form id into the render.fragfments attribute, e.g. <render fragments="myFormId" />

      the problem is, that I want to partially render the form.

      I could not find any info about which components I can use in the fragments attribute of render. if i use a div, it doesnt work, a outputlabel doesnt work.


      • #4
        To my knowledge, only JSF elements will work. HTML is out, and I've never had any success with ui:fragment, which is a faclets tag with no relation or connection to the render fragments action in SWF.


        • #5
          in the booking example, they use a "fragment". if the fragment is within a form they address it formid:fragmentid. will try it tomorrow at work.


          • #6
            Try adding a <div> as the first child of the ui:fragment. I believe its the contents of the fragment that are reloaded and not the fragment itself, therefore fragment needs a root node.