I wrote it before:
>
> replace
> text.setParent(this.productPanel);
> with
> this.productPanel.getChildren().add(text);
add the children to the list returned by getChildren().
If you simulate setChildren(list) with somthing like:
List children = getChildren();
children.clear();
children.addAll(list);
regards
Volker
Sven Haiges wrote:
> i totally agree, but how do I SET children? that's why I used setParent,
> because there is no "set" method. how can I set the children of a
> component? if that works, then the dynamic panelGrid should be no
> problem...
>
>
> Am 05.11.2005 um 17:15 Uhr schrieb Martin Marinschek:
>
> getChildren() is a method of UIComponentBase, so it must be available
> in every JSF component.
>
> regards,
>
> Martin
>
> On 11/5/05, Sven Haiges <[EMAIL PROTECTED]> wrote:
>
> hmm, strange. that's what i tried to do. but i could not find a
> getChildren() method... can you be more specific.
>
> in the meantime i switched to a datatable, but i would consider to
> change it again.
> thanx,
> sven
> Am 01.11.2005 um 15:58 Uhr schrieb Martin Marinschek:
>
> Oh right, I didn't even see that.
>
> Of course, you need to add the text to the children list of
> the parent
> component.
>
> regards,
>
> Martin
>
> On 11/1/05, Volker Weber <[EMAIL PROTECTED]>
> wrote:
>
> Hi,
>
> Sven Haiges wrote:
>
> thanx! i first wanted to try out the programmatic
> way. I bound a
> panelGrid to a managed bean property and once I get
> the result from
> the
> db, I add some outputText elements. the outputText
> is then added to
> the
> parent, I simply call setParent(productPanel) -
> productPanel is the
> panelGrid.
>
> private HtmlPanelGrid productPanel = new
> HtmlPanelGrid();
>
> ....
>
> if (result != null) {
> log.debug("Rebuilding productPanel...");
> //this.queryResults = new ListDataModel(result);
> for (Iterator i = result.iterator(); i.hasNext();){
> log.debug("Adding outputtext to panelgrid... ");
> Product product = (Product)i.next();
> HtmlOutputText text = new HtmlOutputText();
> text.setValue(product.getOrderNumber());
> text.setParent(this.productPanel);
> }
>
>
> you don't need to set the parent of text, but you need
> to add the text
> as child to productPanel.
>
> replace
> text.setParent(this.productPanel);
> with
> this.productPanel.getChildren().add(text);
>
> than it shoud work.
>
>
>
> I get the log output that some components were
> created, but nothing
> is
> shown when the page is rendered. Somehow the
> panelGrid is empty....
> so
> is it actually impossible to add elements with a
> method like
> panelGrid.addChildComponent(UIComponent...)??
>
>
> regards
> Volker
> --
> Don't answer to From: address!
> Mail to this account are droped if not recieved via
> mailinglist.
> To contact me direct create the mail address by
> concatenating my forename to my senders domain.
>
>
>
>
> --
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
>
> ---
> Sven Haiges
> [EMAIL PROTECTED]
>
> TEL +49 89 420 958 993
> SIP [EMAIL PROTECTED]
>
>
>
>
> --
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
>
> ---
> Sven Haiges
> [EMAIL PROTECTED]
>
> TEL +49 89 420 958 993
> SIP [EMAIL PROTECTED]
>
--
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.