-
1. Re: working with a dynamically sized Datamodel with JSF/SEAM
asookazian Sep 5, 2007 6:55 PM (in response to asookazian)every example I've seen so far of <h:dataTable> has basically hard-coded the header column value and the outputText value and typically used an Entity bean to supply the List (resultset).
Is there an alternative JSF component I should use? If yes, which one is recommended? thx. -
2. Re: working with a dynamically sized Datamodel with JSF/SEAM
asookazian Sep 5, 2007 7:13 PM (in response to asookazian)well I found interface ResultSetMetaData...
-
3. Re: working with a dynamically sized Datamodel with JSF/SEAM
pmuir Sep 6, 2007 5:20 AM (in response to asookazian)You can wrap your h:column in a c:forEach
-
4. Re: working with a dynamically sized Datamodel with JSF/SEAM
asookazian Sep 6, 2007 3:04 PM (in response to asookazian)thanks, I'm trying it out. this whole scenario is a pain in the ass man.
-
5. Re: working with a dynamically sized Datamodel with JSF/SEAM
asookazian Sep 6, 2007 5:45 PM (in response to asookazian)so does this mean replace h:dataTable with c:forEach or use both? sorry for the stupid question. if you use both, it's a double loop...
-
6. Re: working with a dynamically sized Datamodel with JSF/SEAM
pmuir Sep 6, 2007 5:48 PM (in response to asookazian)<h:dataTable ...> <c:forEach ...> <h:column> ...
-
7. Re: working with a dynamically sized Datamodel with JSF/SEAM
asookazian Sep 6, 2007 7:03 PM (in response to asookazian)Perhaps the idea is something like this, but I'm not getting any data on the JSF (screen) for this dataTable. The rendered attributes are evaluating to true after I click a run button on the JSF during the use case.
<h:dataTable var="myRole" value="#{myRoles}" rendered="#{userRoleSearch.displayViewRolesDataTable}"> <c:if test="#{userRoleSearch.displayViewRolesDataTable}"> <c:forEach items="#{myRole}" var="myVal"> <h:column> #{myVal} </h:column> </c:forEach> </c:if> </h:dataTable>
also, when userRoleSearch.displayViewRolesDataTable = true, the following JSF fragment does not output the "testing now!" string. seems strange...<h:dataTable var="myRole" value="#{myRoles}" rendered="#{userRoleSearch.displayViewRolesDataTable}"> <c:if test="# userRoleSearch.displayViewRolesDataTable}"> <h:outputText value="testing now!"/> </c:if> </h:dataTable>
also, does it matter if you're using JSF 1.1 or 1.2 regarding this problem??? -
8. Re: working with a dynamically sized Datamodel with JSF/SEAM
pmuir Sep 7, 2007 5:38 AM (in response to asookazian)I have only tested on 1.1 a while ago. If you are having problems I will check again - if its not possible then we need to get something like this into RichFaces.
-
9. Re: working with a dynamically sized Datamodel with JSF/SEAM
asookazian Sep 7, 2007 12:45 PM (in response to asookazian)I am going to pursue the .jsp versus the .xhtml route for now. I'm wondering if any other Seam/JSF users have run into this problem???
-
10. Re: working with a dynamically sized Datamodel with JSF/SEAM
asookazian Sep 7, 2007 3:32 PM (in response to asookazian)Here's an old thread (2003) from Sun Developer Network:
http://forum.java.sun.com/thread.jspa?threadID=505726
"There are a few areas
where it was impossible to get JSF and JSTL to cooperate.
1. c:forEach. You can't use it with JSF. use h:dataTable instead
2. c:if Any faces components embedded inside of this tag must have
manually defined IDs. You can't let Faces define the ID for you.
3. I18N. Faces has its own I18N and L10N mechanisms, it's best that you
use them instead of the JSTL ones."
Is the 1st item still true for JSF 1.1 or 1.2?? -
11. Re: working with a dynamically sized Datamodel with JSF/SEAM
asookazian Sep 7, 2007 3:46 PM (in response to asookazian)ICEFaces:
The columns component provides a dynamic model for adding and deleting columns at run time. It uses the standard var and value attributes.
The columns component works in conjunction with the ice:dataTable. The headerClass and columnClasses defined on the dataTable component will be applied to all generated columns as it does on a single column.
Examples<ice:dataTable var="item" value="#{columnsBean.rowDataModel}" columnClasses="columnsColumn" > <ice:columns value="#{columnsBean.columnDataModel}" var="column"> <f:facet name="header"> <ice:outputText value="#{column}" /> </f:facet/> <ice:outputText id="intCell" value="#{columnsBean.intValue}"/> </ice:columns> </ice:dataTable>
The columns component can be used in conjunction with a column component (e.g.)<ice:dataTable var="item" value="#{columnsBean.rowDataModel}" columnClasses="columnsColumn" > <ice:column> <f:facet name="header"> <ice:outputText value="id" /> </f:facet/> <ice:outputText value="#{item.id}"/> </ice:column> <ice:columns value="#{columnsBean.columnDataModel}" var="column"> <f:facet name="header"> <ice:outputText value="#{column}" /> </f:facet/> <ice:outputText value="#{columnsBean.intValue}"/> </ice:columns> </ice:dataTable>
-
12. Re: working with a dynamically sized Datamodel with JSF/SEAM
pmuir Sep 7, 2007 4:17 PM (in response to asookazian)"asookazian" wrote:
Here's an old thread (2003) from Sun Developer Network:
http://forum.java.sun.com/thread.jspa?threadID=505726
"There are a few areas
where it was impossible to get JSF and JSTL to cooperate.
1. c:forEach. You can't use it with JSF. use h:dataTable instead
2. c:if Any faces components embedded inside of this tag must have
manually defined IDs. You can't let Faces define the ID for you.
3. I18N. Faces has its own I18N and L10N mechanisms, it's best that you
use them instead of the JSTL ones."
Is the 1st item still true for JSF 1.1 or 1.2??
These comments I think apply to JSP not Facelets. Facelets has different issues with JSTL, but in this case it should work. -
13. Re: working with a dynamically sized Datamodel with JSF/SEAM
asookazian Sep 27, 2007 1:21 PM (in response to asookazian)finally got the dynamic column dataTable working with our view user role stored proc based on an example I found today using JSF + managed bean. I am currently porting it to a Seam version. This solution uses only one JSF tag (not two like the ICEFaces solution, one for dataTable and one for columns). The difference is the dataTable is programmatically manipulated in the managed bean (or SFSB/SLSB in the case of Seam) using Faces component classes.
http://balusc.blogspot.com/2006/06/using-datatables.html
see the section: Dynamically populate datatable -
14. Re: working with a dynamically sized Datamodel with JSF/SEAM
wachtda Jan 29, 2008 11:28 AM (in response to asookazian)hi asookazian
do you already ported your example to seam?
it would be ver usefull for me if you can give me your example of the seam-implementation.
greetings daniel