Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using SelectItems  RSS feed

 
Garann Means
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to use some SelectItems within a custom component. I don't get an error, they just aren't rendered when the component gets to encodeChildren().

I was looking at the code for Sun's MenuRenderer, and they seem to be rendering the SelectItems from within the MenuRenderer. Should I take this to mean that I'll need to write my own renderer for SelectItem or handle its rendering within each parent component that might contain it? (My goal is to not re-invent the wheel here.)

Thanks,
g.
 
Alexander Jesse
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you writing a custom version of UISelectItems or are you writing a custom component which has UISelectItems as children?

The UISelectItems are data-carriers which usually have no visual logic. How could they know how to render themselves in a menu, a listbox, a MySpecialComponent? Therefor it is the duty of the container-component to render the UISelectItems.

regards
Alexander
 
Garann Means
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Alexander, that (unfortunately) confirms what I thought.

(Added)

But I have another question on this topic. How then do I get access to the child tags of my component? Here's what I have in the JSP:



I've tried getChildren(), getFacets(), and adding code to the encodeChildren() method, but I can't seem to get access to these child components. Can anyone help?

Thanks!
g.
[ October 28, 2005: Message edited by: Garann Means ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!