That works with only HtmlPanelGrid as the base class and not with UIInput or UIPanel.

On 2/5/06, Ali Raza <[EMAIL PROTECTED] > wrote:
But i was wondering whether i could exten my component from UIInput or something and add an HTmlPanelGrid to it as a child ??

Thanx
Ali


On 2/5/06, Ali Raza <[EMAIL PROTECTED]> wrote:
Holas Volker,

Thanx a lot for your help. I saw the way u had done it and realized my error. i was extending the component from UIPanel and then adding an Html Panel Grid to it as a child which doesnt make sense to begin with. Although even though what i was doing was wrong design wise .... it still shouldve worked ... coz i hadnt overwritten either encodeChildren or encodeEnd. Anyway thanx a lot dude ...

Regards,
Ali


On 2/5/06, Volker Weber < [EMAIL PROTECTED]> wrote:
Hi Ali,

UIPanel for base class should work, did you overwrite encodeChildren()
or encodeEnd() to do nothing?

BTW: don't expect these components between your rendered start and end
comments, they are just created here, the rendering is done in
encodeChildren() method of the superclass.

Just for make sure that my suggestions are correct i had implemented
this myself, extending HtmlPanelGrid.

See attached sources and working example at:

http://weber-oldenburg.dyndns.org/myfaces-example-simple/myPanelGrid.jsf

Regards,
  Volker

Ali Raza wrote:
> Hey Volker,
>
> I tried to add the components as you have instructed but nothing at all
> gets rendered that way. i wonder if im inheriting my component from the
> right base class .... UIPanel in my case ....
> any how the code im trying now is:
>
>     public void encodeBegin( FacesContext context )
>     {
>         try
>         {
>             ResponseWriter writer = context.getResponseWriter();
>             writer.writeComment("********************************* THIS
> IS THE START OF COMPONENT
> **************************************************");
>
>             HtmlPanelGrid panelGrid = new HtmlPanelGrid();
>             List children = panelGrid.getChildren();
>             panelGrid.setColumns(2);
>
>             UIOutput labelName = new UIOutput();
>             labelName.setValue("Enter name: ");
>             panelGrid.getChildren().add(labelName);
>
>             UIInput inputName = new UIInput();
>             children.add (inputName);
>
>             UIOutput labelAge = new UIOutput();
>             labelAge.setValue("Enter age: ");
>             children.add(labelAge);
>
>             UIInput inputAge = new UIInput();
>             children.add(inputAge);
>
>             this.getChildren().add(panelGrid);
>             super.encodeBegin(context);
>
>             writer.writeComment("********************************* THIS
> IS THE END OF COMPONENT
> **************************************************");
>         }
>         catch( IOException e )
>         {
>
>         }
>     }
>
> Thanx a lot for your help though ...
>
> Ali

--
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.





--

"A sixteenth century inventor called Wan Hu designed a rocket-propelled chair on which he planned to ascend into heaven. He built an open cabin, to which he fitted 47 rockets underneath and above, and two kites to keep him aloft. Wan Hu disappeared in flame and smoke and was never seen again. A crater on the moon is now named after him, so in one sense he made it to the heavens after all. This is the first recorded design of something approximating to a manned space rocket."

The Chinese Space Programme.
From Conception to Future Capabilities.
Brian Harvey



--
"A sixteenth century inventor called Wan Hu designed a rocket-propelled chair on which he planned to ascend into heaven. He built an open cabin, to which he fitted 47 rockets underneath and above, and two kites to keep him aloft. Wan Hu disappeared in flame and smoke and was never seen again. A crater on the moon is now named after him, so in one sense he made it to the heavens after all. This is the first recorded design of something approximating to a manned space rocket."

The Chinese Space Programme.
From Conception to Future Capabilities.
Brian Harvey



--
"A sixteenth century inventor called Wan Hu designed a rocket-propelled chair on which he planned to ascend into heaven. He built an open cabin, to which he fitted 47 rockets underneath and above, and two kites to keep him aloft. Wan Hu disappeared in flame and smoke and was never seen again. A crater on the moon is now named after him, so in one sense he made it to the heavens after all. This is the first recorded design of something approximating to a manned space rocket."

The Chinese Space Programme.
From Conception to Future Capabilities.
Brian Harvey

Reply via email to