You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dave <ja...@yahoo.com> on 2005/11/25 03:45:42 UTC
construct view programmatically, addChildComponent()?
Hello,
I am trying to contruct a faces view(tree) programmatically(not using tags). Why there is no method to add child components in UIComponent(or its subclasses)?
I have a variable number of names(List<String>) that are rendered as commandLink(s) in one line.
Name1, Name2, Name3, ... NameN
UIPanel
CommandLink1,
CommandLink2
...
If I have the reference to UIPanel, can I get the String value to render it using <h:outputText>?
dataTable or dataList can not render them in one horizontal line, can it? Thanks for ideas/suggestions.
Dave
---------------------------------
Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
Re: construct view programmatically, addChildComponent()?
Posted by Simon Kitching <sk...@obsidium.com>.
Dave wrote:
> I have a variable number of names(List<String>) that are rendered as
> commandLink(s) in one line.
> _Name1_, _Name2_, _Name3_, ... _NameN_
> __
> UIPanel
> CommandLink1,
> CommandLink2
> ...
>
> If I have the reference to UIPanel, can I get the String value to render
> it using <h:outputText>?
If you mean, can you find out what HTML that UIPanel component would
send back to the user, then the answer is "not easily" I don't really
know why you would want that.
>
> dataTable or dataList can not render them in one horizontal line, can
> it? Thanks for ideas/suggestions.
Yes, dataList can render its children "in one horizontal line". When
layout=simple, dataList just outputs its children like it was a plain
for-list, with no layout wrapping the children - and "simple" is the
default. So as long as the children generates HTML tags that are "span"
type tags then they will automatically be output "on one line".
Regards,
Simon
Re: construct view programmatically, addChildComponent()?
Posted by Mike Kienenberger <mk...@gmail.com>.
It's component.getChildren().add(child)
On 11/24/05, Dave <ja...@yahoo.com> wrote:
> Hello,
>
> I am trying to contruct a faces view(tree) programmatically(not using tags).
> Why there is no method to add child components in UIComponent(or its
> subclasses)?
>
> I have a variable number of names(List<String>) that are rendered as
> commandLink(s) in one line.
> Name1, Name2, Name3, ... NameN
>
> UIPanel
> CommandLink1,
> CommandLink2
> ...
>
> If I have the reference to UIPanel, can I get the String value to render it
> using <h:outputText>?
>
> dataTable or dataList can not render them in one horizontal line, can it?
> Thanks for ideas/suggestions.
>
> Dave
>
>
>
> ________________________________
> Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>
>