Forums Register Login

creating JSF components at runtime

+Pie Number of slices to send: Send
I know this is possible... but how is it done?

Any links to tutorials or sample codes would be very helpful.
+Pie Number of slices to send: Send
Yes. It is possible to add components dynamically.
Create a container bean like this one:


public class ComplexBean
{
protected UIComponent component;
public ComplexBean()
{
component = new UIPanel();
}
public UIComponent getComponent()
{
return component;
}
public void setComponent(UIComponent component)
{
this.component = component;
}
}

Use component instance binding in your page, for
instance

<h anelGrid binding="#{ComplexBean.component}"/>

(The bean should be configured as a managed bean).

Now if you add components to your
ComplexBean.getComponent(), they will appear on the
page.

Regards
Solmaz
[ April 07, 2006: Message edited by: Solmaz Anvar ]
+Pie Number of slices to send: Send
thanks solmaz!
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2690 times.
Similar Threads
‘Browse’ button component in jsf
Newbie: How to add new attribute into "input" element
Newbie Question
How to call EJB (Session beans) using Struts framework?
Select All and Clear All implementation in JSF
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:49:58.