Problem with ui:repeat and p:commandLink

UI Components for JSF
Post Reply
neroir
Posts: 15
Joined: 07 Mar 2011, 18:30

18 Jul 2011, 18:01

Hi.

I'm new in JSF and PrimerFaces, and I'm having some problems trying to make p:commandLink work with ui:repeat.

I have a simple example in which I'm trying to update a h:ouputText tag using an actionListener in a commandLink, and it works as expected: when I click the link, the listener method is executed and the otuputText is updated.

Code: Select all

<p:commandLink update="display" actionListener="#{pprBean.savePerson}" style="margin-right:20px;">
   <h:outputText value="Ajax Submit" />
</p:commandLink>
<p:panel id="display" header="Information" style="margin-top:10px;">
   <h:outputText value="#{pprBean.userIdx}" />
</p:panel>
The problem appears when I include the same commandLink inside an ui:repeat tag. In this situation, the actionListener is executed but the outputText is not updated

Code: Select all

<ui:repeat value="#{pprBean.employees}" var="employee">
   <p:commandLink update="display" actionListener="#{pprBean.savePerson}" style="margin-right:20px;">
      <h:outputText value="Ajax Submit" />
   </p:commandLink>
</ui:repeat>
Does anybody know why the commandLink do not update the text when it's inside the ui repeat?

neroir
Posts: 15
Joined: 07 Mar 2011, 18:30

18 Jul 2011, 18:08

I've found that using <c:forEach> instead of <ui:repeat> works fine. I think i have to investigate the differences between these two tags

rdeoliveira
Posts: 61
Joined: 23 Jun 2011, 11:40

18 Jul 2011, 18:12

I had this problem and i used p:datatable (with no css skin) instead of ui:repeat.

You can try also to use ui:repeat but with h:commandLink instead of p:commandLink.
JSF 2.0
Primefaces 3.0.M3
Tomcat 7.0
--
French user of primefaces

SteveTaylor
Posts: 56
Joined: 27 Sep 2010, 17:15

10 Sep 2011, 17:11

I have the problem too. I tried h:commandLink instead of p:commandLink, but with no success. In my case, I'm using nested ui:repeats, so this doesn't easily translate to a data table without some extra code in the backing bean. However, I will try that as an almost last resort (last resort is c:forEach) and see how I go.

This is obviously a shortcoming of JSF or Mojarra, not primefaces.
GlassFish 3.1.1 (Mojarra 2.1.3) | Primefaces 3.0 | UrlRewriteFilter | Jrebel 4.5.3

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 28 guests