Can I put multiple lists in different columns of the same h: datatable?

I have a form where I have to fill 3 columns of the table with data. Each of these columns has an ArrayList with attached bean support. Each of ArrayLists contains the same number of instances of the same type of "LabValue". Each LabValue has a name ("Parameter") and a block ("Einheit"), but I need both columns only once for the first datatable (Figure below).

Since a h:datatablecan only hold one List so far, I solved the problem by putting three sets of data in one line h:panelgrid, as shown in the figure below:

Form with three datatables in a one-row panelgrid

, : Datatable1, , Datatable2 & 3 (, Chrome Firefox , Safari - ).

. Safari 2 3 ( ). .

, , datatable , , .

JSF 2.0 , ?

+3
2

, .

. http://wiki.apache.org/myfaces/Parameters_In_EL_Functions

jsf :

<h:dataTable value="#{myBean.myList}" var="labValue">
    <h:column><h:outputText value="#{labValue.label}" /></h:column>
    <h:column><h:outputText value="#{myBean.secondList[myBean.firstListIndex[labValue]].label}" /></h:column>
</h:dataTable>

java:

class MyWrapper implements Map {
     ...
     public Integer getIndex(Object firstRowElement) {
         int index = firstList.indexOf(firstRowElement);
         return index;
     }
     public Object get(Object obj) {
         return getIndex(obj);
     }
}
public Map getFirstListIndex() {
    return myWrapper;
}
+2

JSF 2.0 ?

, - , ?

+1

All Articles