• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using SelectItems

 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic