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

  • aja: fragment not updating

    Hi,

    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.

    flow:
    Code:
    		<transition on="changeAddress">			
    			<evaluate expression="card.owner.address.incNumber()" />
    			<render fragments="testFragmentXYZ" />			
    		</transition>
    xhtml fragment:
    Code:
    					    <ui:fragment id="testFragmentXYZ">
    					    		#{card.owner.address.currentNumber}
    					    </ui:fragment>
    xhtml-action button
    Code:
    <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, 10:27 AM.

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

    Code:
    <h:form id="testFragmentXYZ">
    #{card.owner.address.currentNumber}
    </h:form>

    Comment


    • #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.

      Comment


      • #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.

        Comment


        • #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.

          Comment


          • #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.

            Comment

            Working...
            X