0

Code of JSP page

<rich:dataTable id="journalTable" value="#{sessionBean.currentPageDataList}"
                        var="row" >

            <rich:columns value="#{row}"  var="column">
                <f:facet name="header">
                        <h:outputText value="#{column}"/>
                </f:facet>
                <h:outputText value="#{column}"/>
            </rich:columns>

        </rich:dataTable>

I need to get "var" from dataTable because it creates from array of lists

List[] list = new ArrayList()[];

It looks similar to the two dimensional array and nested loops.

How can I get the access? or maybe there exsist another way?

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
alexloiko
  • 33
  • 6
  • 2
    So, each row has a different amount of columns? How exactly would you ever present that sensibly in a HTML ``? This makes just no sense. The `` should just obtain its value from `#{sessionBean}`, not from `#{row}`.
    – BalusC Jul 18 '13 at 14:21
  • Datatable's var is one list of array of lists. Columns var creates by implicit foreach, used on this list and each element of list goes to each cell from current rom. This is the mechanism. The task is to find way to use datatable's var in the columns block, using jsf 1.2 Earlier I use jsf 2.1 and I didn't have such problems. The way was to pass parameter in method call. But. There's no way to do it as I understand. – alexloiko Jul 19 '13 at 07:33
  • I didn't mean exactly that. The `` generates already the *same* columns for **every** individual row. Its value is evaluated only once. If that works for you, then you have apparently already a model with the same and fixed amount of columns in every row. That parameter which you originally passed was apparently just an unthoughtful workaround to extract the information from the 1st row itself instead of straight from the bean. You could instead just add a getter method to `#{sessionBean}` which directly extracts that data from 1st row. – BalusC Jul 19 '13 at 12:04

1 Answers1

0

Datatable's var is one list of array of lists. Columns var creates by implicit foreach, used on this list and each element of list goes to each cell from current rom. This is the mechanism. The task is to find way to use datatable's var in the columns block, using jsf 1.2 Earlier I use jsf 2.1 and I didn't have such problems. The way was to pass parameter in method call. But. There's no way to do it as I understand.

  • This is not an answer. This is a comment (which is later already posted by your original account). Please delete this "answer". – BalusC Jul 19 '13 at 12:03