0

I have a panelGrid with multiple rows. Some rows are generated with c:forEach since ui:repeat, p:dataTable and p:dataList wont' render ( ui:repeat JSF 2.0 cannot render iterate p:row primefaces) .

My aim is to update the rows which are generated in the iteration (and vary in size + content after the update), but I have no component with an id I could refer to. And no, I can't use @form.

<p:commandButton value="Update" action="#{someBean.someAction}" process="someThing" update=" ??? ">

<p:panelGrid>
  <p:row> 
   ...
   </p:row>
  <c:forEach var="projectDto" items="#{someBean.someDtos}" varStatus="i">
    <p:row> 
     ...
     </p:row>
  </c:forEach>
</p:panelGrid>

Is there way to achieve this? Maybe some kind of dummy-component wraped around the iteration?

Jonny

P.S.: I asked this already on the Primefaces forum ( http://forum.primefaces.org/viewtopic.php?f=3&t=22999). The answer (thanks jordandenison) was really "proprietary" and nobody (including me in an half a year) would understand what that was all about. So maybe there's another way.

Community
  • 1
  • 1
user871611
  • 3,307
  • 7
  • 51
  • 73

1 Answers1

0

Bind the panelGrid to a bean property.

<p:panelGrid binding="#{someBean.panelGrid}"/>

Then add rows in the java code.

Row row = new Row();

HtmlOutputText text = new HtmlOutputText();
text.setValue("text");

column = new Column();
column.getChildren().add(text);

row.getChildren().add(column);

panelGrid.getChildren().add(row);

Row, Column and PanelGrid should be from org.primefaces.... packages.

weaselflink
  • 244
  • 2
  • 7
  • On the other hand, don't do this if your bean is more than RequestScoped, because this will cause all kinds of problems. [http://myfaces.apache.org/orchestra/myfaces-orchestra-core/component-bindings.html] – weaselflink Jul 04 '12 at 10:20