Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

nesting h:panelGrid within h:dataTable

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a situation where I'm trying to display a simple ArrayList<MyRecord> within an <h:dataTable> outtput:

<h:dataTable value="#{form.queryBean.Records}" var="item">
...
<h:column>
<h:outputText value="#{item.firstValue}"/>

<h:outputText value="#{item.secondValue}"/>
...
</h:column>

(This works fine.)

However, I have a new situation now where I want to bind a nested <h:panelGrid> and define this within the MyRecord class.


So, instead of MyRecord being some simple bean with primitive objects and appropriate getters / setters, it now contains this embedded HtmlPanelGrid object:

public class MyRecord
{
private String firstValue;
private String secondValue;

private HtmlPanelGrid myPanel;

// appropriate getters and setters ...

public HtmlPanelGrid getMyPanel()
{
// set up and declare a list of children nodes inside here to be displayed back... This will
// be a collection of <h:outputText> and <h:commandLink> children...
}

}

...................

What I'd like to do is this: (modified from the original)

<h:dataTable value="#{form.queryBean.Records}" var="item">
...
<h:column>
<h:outputText value="#{item.firstValue}"/>

<h:outputText value="#{item.secondValue}"/>

<h:panelGrid binding="#{item.myPanel}"/>

</h:column>

</h:dataTable>

...and call it done.

JSF 1.2 barfs on this declaration because it is trying to evaluate "item" here prematurely. (This dataTable is being built
after certain events happen on the form itself and is rendered appropriately once the data gets populated.) It makes sense to
do this inner binding in the application that I'm working with.

The question is - How do I get the appropriate syntax to work ? I've tried using the 'rendered' attribute, but JSF 1.2 seems to
ignore it when it's embedded like this. (rendered set within the parent <h:dataTable> tag.)


What am I doing wrong here ?

Appreciate any inputs.

Thanks,
Chad

 
Grow your own food... or this tiny ad:
ScroogeXHTML - fast RTF to HTML and XHTML conversion
https://coderanch.com/t/749563/ScroogeXHTML-fast-RTF-HTML-XHTML
reply
    Bookmark Topic Watch Topic
  • New Topic