1

I know that this question may be similar to this one but I didn't understand the answer at all.

I am using a full page layout, in the left layout I have some nested accordion panels, tabs and command links. I want this links to update center layout content form.

Left Layout:

<h:form>
    <p:accordionPanel>
        <p:tab title="Parent Tab">
             <p:accordionPanel>
                 <p:tab title="Child Tab">
                     <p:commandLink value="link" update=":contentform" />
                 </p:tab>
             </p:accordionPanel>
        </p:tab>
    </p:accordionPanel>             
</h:form>

Center Layout:

<h:form id="contentform">
    <ui:include src="#{layoutUI.viewId}" />
</h:form>

And a simple explanation will help cause the similar question lacks in that :(

Community
  • 1
  • 1
Ahmed Hassanien
  • 527
  • 5
  • 18
  • 1
    The `` doesn't support the `update` attribute at all. Is this a careless typo while formulating the question or the real code? – BalusC Feb 26 '13 at 12:38
  • @BalusC Yes I am sorry it is a typo. I meant `` and my problem is simple I just can't find a good article on ajax content updating. – Ahmed Hassanien Feb 26 '13 at 12:55
  • Edit your question then. Well now I don't see any problem. Provided that this code is placed in a completely blank template (i.e. directly in `` without any other tags), it should work fine. What exactly is your problem/question? Does it actually not work? Or does it work and do you not understand why you need to prefix the client ID with `:`? – BalusC Feb 26 '13 at 12:57
  • @BalusC I edited my question, restarted the IDE and killed all the java processes in my PC, ran the application again and everything is fine now and I don't know what happened? What I need as an answer is a details to understand the attribute update value. And thank you for your effort this is the second time to help me :D – Ahmed Hassanien Feb 26 '13 at 13:36
  • That part is already answered in http://stackoverflow.com/questions/8634156/how-to-reference-components-in-jsf-ajax-cannot-find-component-with-identifier/8644762#8644762 – BalusC Feb 26 '13 at 13:37
  • @BalusC Thank you for your effort – Ahmed Hassanien Feb 26 '13 at 13:46

1 Answers1

0

The proper use of the built in Ajax functionality of the p:commandLink component is to specify that the link will invoke an Ajax call with the ajax attribute.

<p:commandLink value="link" ajax="true" update=":contentform" />

Using the : in front will signify that you are looking for the ID of a component on the ViewRoot rather than its direct Naming Container so this is correct. The only thing missing is the ajax attribute.

maple_shaft
  • 10,435
  • 6
  • 46
  • 74