1 Reply Latest reply on Jan 5, 2009 6:16 AM by andrei_exadel

    rich:columns --- Could you help me?

    josin

      I need to manage M:N table where M and N are variables. I thought that rich:columns could help me, but I wasn't able to set up example from demos because of

      java.lang.IllegalStateException: Component ID j_id_jsp_433896525_1:columns:j_id_jsp_433896525_5 has already been found in the view.


      I'd like to create dataTable with following parameters:

      | rowTitle | column1 | column2 | ... |
      | rowTitle2 | column1 | column2 | ... |
      | rowTitle3 | column1 | column2 | ... |

      My solution was ArrayList of Rows where was title and next ArrayList which I wanted to print out using rich:columns. I don't need any header or footer, just data...

      jsp page:

      <rich:dataTable id="dataTable" value="#{mnAnswersBean.mnAnswer}" var="row">
       <rich:column id="title">
       <h:outputText value="#{row.title}" />
       </rich:column>
      
       <rich:columns id="columns" value="#{row.choices}" var="col">
       <h:outputText value="#{col}" />
       </rich:columns>
      
      </rich:dataTable>
      


      Managedbean:
      ...
      private List<MNAnswer> answers;
      ...
      


      MNAnswer class:
      ...
      private String title;
      private List<String> choices;
      ...
      



      Could anyone help me?



        • 1. Re: rich:columns --- Could you help me?

          Please don't use request variables to set array list for 'value' of columns component. Because columns needs this data on tag applying phase but dataTable in this case inits it later on rendering phase.

          Make object for columns's 'value' attribute accessible directly by bean's name.