You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ali Raza <al...@gmail.com> on 2006/02/03 08:02:40 UTC

Panel Grid custom component

Greetings again,

Instead of adding components by rendering the htl myself i am adding chilid
components and calling their encode methods as following:

public void encodeBegin( FacesContext context )
    {
        try
        {
            ResponseWriter writer = context.getResponseWriter();
            writer.writeComment("********************************* THIS IS
THE START OF COMPONENT **************************************************");

            HtmlPanelGrid panelGrid = new HtmlPanelGrid();
            panelGrid.setColumns(2);
            panelGrid.encodeChildren(context);

            addComponentBegin(context, "panelGridId", this, panelGrid);
            addComponentEnd(context, panelGrid);

            UIOutput labelName = new UIOutput();
            labelName.setValue("Enter name: ");
            addComponentBegin(context, "nameId", panelGrid, labelName);
            addComponentEnd(context, labelName);

            UIInput inputName = new UIInput();
            addComponentBegin(context, "inputNameId", panelGrid, inputName);
            addComponentEnd(context, inputName);

            UIOutput labelAge = new UIOutput();
            labelAge.setValue("Enter age: ");
            addComponentBegin(context, "ageId", panelGrid, labelAge);
            addComponentEnd(context, labelAge);

            UIInput inputAge = new UIInput();
            addComponentBegin(context, "inputAgeId", panelGrid, inputAge);
            addComponentEnd(context, inputAge);




            writer.writeComment("********************************* THIS IS
THE END OF COMPONENT **************************************************");
        }
        catch( IOException e )
        {

        }
    }

    public static void addComponentBegin( FacesContext context, String
componentId, UIComponent parentComponent, UIComponent childComponent )
throws IOException
    {
        if( componentId != null )
        {
            childComponent.setId( componentId );
        }

        childComponent.setParent( parentComponent );
        childComponent.encodeBegin( context );
    }

    public static void addComponentEnd( FacesContext context, UIComponent
childComponent ) throws IOException
    {
        childComponent.encodeEnd( context );
    }

My problem is that the layout of the panel grid (2 columns) that i have
added is not maintained and all encoded children get rendered ina straight
line quite like flowlayout in swing. can i use column wise layout without
having to encode the html myself ???

Thanx a lot,
Ali

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

Re: Panel Grid custom component

Posted by Ali Raza <al...@gmail.com>.
That works with only HtmlPanelGrid as the base class and not with UIInput or
UIPanel.

On 2/5/06, Ali Raza <al...@gmail.com> 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 <al...@gmail.com> 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 < users.myfaces@weber-oldenburg.de> 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

Re: Panel Grid custom component

Posted by Ali Raza <al...@gmail.com>.
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 <al...@gmail.com> 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 <us...@weber-oldenburg.de> 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

Re: Panel Grid custom component

Posted by Ali Raza <al...@gmail.com>.
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 <us...@weber-oldenburg.de> 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

Re: Panel Grid custom component

Posted by Volker Weber <us...@weber-oldenburg.de>.
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.

Re: Panel Grid custom component

Posted by Ali Raza <al...@gmail.com>.
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

On 2/3/06, Volker Weber <us...@weber-oldenburg.de> wrote:
>
> Hi Ali,
>
> there are some things you made wrong:
>
> First, and this seems to be a popular error: you can't add a component
> to another by setting the parent of the child! use
> parent.getChildren().add(child) instead.
>
> Than: You dont neet to invoke encoding on every component, just create
> then component tree and let jsf do the rest.
>
> Try this :
>
> public void encodeBegin( FacesContext context )
> {
>
>    HtmlPanelGrid panelGrid = new HtmlPanelGrid();
>    panelGrid.setColumns(2);
>    List children = panelGrid.getChildren();
>
>    UIOutput labelName = new UIOutput();
>    labelName.setValue("Enter name: ");
>    labelName.setId("nameId");
>    children.add(labelName);
>
>    UIInput inputName = new UIInput();
>    inputName.setId("inputNameId");
>    // UIInput needs a valueBinding
>    children.add(inputName);
>
>    UIOutput labelAge = new UIOutput();
>    labelAge.setValue("Enter age: ");
>    labelName.setId("ageId");
>    children.add(labelAge);
>
>    UIInput inputAge = new UIInput();
>    inputAge.setId("inputAgeId");
>    // UIInput needs a valueBinding
>    children.add(inputAge);
>
>    this.getChildren.add(panelGrid);
>
>    super.encodeBegin(context);
> }
>
>
> Regards,
>   Volker
>
>
> Ali Raza wrote:
> > Greetings again,
> >
> > Instead of adding components by rendering the htl myself i am adding
> > chilid components and calling their encode methods as following:
> >
> > public void encodeBegin( FacesContext context )
> >     {
> >         try
> >         {
> >             ResponseWriter writer = context.getResponseWriter();
> >             writer.writeComment("********************************* THIS
> > IS THE START OF COMPONENT
> > **************************************************");
> >
> >             HtmlPanelGrid panelGrid = new HtmlPanelGrid();
> >             panelGrid.setColumns(2);
> >             panelGrid.encodeChildren(context);
> >
> >             addComponentBegin(context, "panelGridId", this, panelGrid);
> >             addComponentEnd(context, panelGrid);
> >
> >             UIOutput labelName = new UIOutput();
> >             labelName.setValue("Enter name: ");
> >             addComponentBegin(context, "nameId", panelGrid, labelName);
> >             addComponentEnd(context, labelName);
> >
> >             UIInput inputName = new UIInput();
> >             addComponentBegin(context, "inputNameId", panelGrid,
> inputName);
> >             addComponentEnd(context, inputName);
> >
> >             UIOutput labelAge = new UIOutput();
> >             labelAge.setValue("Enter age: ");
> >             addComponentBegin(context, "ageId", panelGrid, labelAge);
> >             addComponentEnd(context, labelAge);
> >
> >             UIInput inputAge = new UIInput();
> >             addComponentBegin(context, "inputAgeId", panelGrid,
> inputAge);
> >             addComponentEnd(context, inputAge);
> >
> >
> >
> >
> >             writer.writeComment("********************************* THIS
> > IS THE END OF COMPONENT
> > **************************************************");
> >         }
> >         catch( IOException e )
> >         {
> >
> >         }
> >     }
> >
> >     public static void addComponentBegin( FacesContext context, String
> > componentId, UIComponent parentComponent, UIComponent childComponent )
> > throws IOException
> >     {
> >         if( componentId != null )
> >         {
> >             childComponent.setId( componentId );
> >         }
> >
> >         childComponent.setParent( parentComponent );
> >         childComponent.encodeBegin ( context );
> >     }
> >
> >     public static void addComponentEnd( FacesContext context,
> > UIComponent childComponent ) throws IOException
> >     {
> >         childComponent.encodeEnd( context );
> >     }
> >
> > My problem is that the layout of the panel grid (2 columns) that i have
> > added is not maintained and all encoded children get rendered ina
> > straight line quite like flowlayout in swing. can i use column wise
> > layout without having to encode the html myself ???
> >
> > Thanx a lot,
> > Ali
> >
> > --
> > "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
>
> --
> 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

Re: AW: AW: Panel Grid custom component

Posted by Mike Kienenberger <mk...@gmail.com>.
A facet is an arbitrary generic attribute (container, really) of a
component.   Just because one component supports a "header" facet
doesn't mean that another one will.   Each facet's meaning is unique
to each component, and the same facet name can mean different things
to different components.   Think of facets as component variable
names.


On 2/3/06, Matthias Kahlau <mk...@web.de> wrote:
> Ok,
>
> but with a dataTable, there's a similar problem. Both HtmlDataTable and
> HtmlPanelGrid are subclasses of UIComponentBase, and facet related methods
> are defined in this superclass (e. g. getFacets()).
>
> UIData does additionally provide convenience methods for setting the header
> and the footer, as you can read in the API doc of UIData:
>
> public void setHeader(javax.faces.component.UIComponent header) Set the
> header facet of this component. A convenience method for
> getFacets().put("header", header).
>
> http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/faces/compone
> nt/UIData.html#setHeader(javax.faces.component.UIComponent)
>
>
> That looks to me like the facet thing of HtmlPanelGrid and HtmlDataTable is
> the same...
>
>
>
> Regards,
>
> Matthias
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: users-return-16462-mkahlau=web.de@myfaces.apache.org
> > [mailto:users-return-16462-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > von Volker Weber
> > Gesendet: Freitag, 3. Februar 2006 16:04
> > An: MyFaces Discussion
> > Betreff: Re: AW: AW: Panel Grid custom component
> >
> >
> > Hi,
> >
> > the masterDetail example uses dataTable not panelGrid.
> >
> >
> > Matthias Kahlau wrote:
> > > Thanks Volker,
> > >
> > > you can take a look at the following example:
> > >
> > > http://www.irian.at/myfaces/masterDetail.jsf
> > >
> > >
> > > When you look at the source code, you can see that the <f:facet
> > > name="header"> ... </f:facet> element is used in more than one column.
> > >
> > >
> > >
> > > Regards,
> > >
> > > Matthias
> > >
> > >
> > >
> > >
> > >>-----Ursprüngliche Nachricht-----
> > >>Von: users-return-16454-mkahlau=web.de@myfaces.apache.org
> > >>[mailto:users-return-16454-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > >>von Volker Weber
> > >>Gesendet: Freitag, 3. Februar 2006 13:03
> > >>An: MyFaces Discussion
> > >>Betreff: Re: AW: Panel Grid custom component
> > >>
> > >>
> > >>Hi Matthias,
> > >>
> > >>no i don't know.
> > >>
> > >>according to the sun spec this is not possible for h:panelGrid:
> > >>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan
> > >>elGrid.html
> > >>
> > >>and i don't find any hint to such an addition in the tomahawk
> > version at:
> > >>http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html
> > >>
> > >>But if you point me to a working example, and i can take a look at the
> > >>jsp sources i can figure out how to build it programatically.
> > >>
> > >>Regards
> > >>  Volker
> > >>
> > >>Matthias Kahlau wrote:
> > >>
> > >>>Hi Volker,
> > >>>
> > >>>
> > >>>do you know how to programmatically add a table header to the
> > >>
> > >>HtmlPanelGrid
> > >>
> > >>>for each column?
> > >>>
> > >>>
> > >>>Regards,
> > >>>
> > >>>Matthias
> > >>>
> > >>>
> > >>
> > >>--
> > >>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.
> > >
> > >
> >
> > --
> > 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.
>
>

Re: AW: AW: AW: Panel Grid custom component

Posted by Martin Marinschek <ma...@gmail.com>.
This is actually something for which a patch would be willingly accepted ;)

regards,

Martin

On 2/3/06, Matthias Kahlau <mk...@web.de> wrote:
> Hi!
>
> > So you are right, in this point UIData and panelGrid are similar, but i
> > think this are not the headers you want.
>
> No, I see. I don't explicitely use columns in a panelGrid, so I can't add
> facets as children of column components, neither in JSP nor
> programmatically.
>
> It seems like I have to use HtmlDataTable, but this will be more complex
> than using a simple HtmlPanelGrid...
>
>
> Regards,
>
> Matthias
>
> > -----Ursprüngliche Nachricht-----
> > Von: users-return-16466-mkahlau=web.de@myfaces.apache.org
> > [mailto:users-return-16466-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > von Volker Weber
> > Gesendet: Freitag, 3. Februar 2006 17:40
> > An: MyFaces Discussion
> > Betreff: Re: AW: AW: AW: Panel Grid custom component
> >
> >
> > Hi,
> >
> > the header facet of a UIData renders a common header over all columns,
> > To render a header for each column you must set a header facet on the
> > column component.
> > See:
> > http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/dat
> > aTable.html
> >
> > So you are right, in this point UIData and panelGrid are similar, but i
> > think this are not the headers you want.
> >
> > Regards,
> >   Volker
> >
> > Matthias Kahlau wrote:
> > > Ok,
> > >
> > > but with a dataTable, there's a similar problem. Both HtmlDataTable and
> > > HtmlPanelGrid are subclasses of UIComponentBase, and facet
> > related methods
> > > are defined in this superclass (e. g. getFacets()).
> > >
> > > UIData does additionally provide convenience methods for
> > setting the header
> > > and the footer, as you can read in the API doc of UIData:
> > >
> > > public void setHeader(javax.faces.component.UIComponent header) Set the
> > > header facet of this component. A convenience method for
> > > getFacets().put("header", header).
> > >
> > >
> > http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/fac
> > es/compone
> > > nt/UIData.html#setHeader(javax.faces.component.UIComponent)
> > >
> > >
> > > That looks to me like the facet thing of HtmlPanelGrid and
> > HtmlDataTable is
> > > the same...
> > >
> > >
> > >
> > > Regards,
> > >
> > > Matthias
> > >
> > >
> > >
> > >>-----Ursprüngliche Nachricht-----
> > >>Von: users-return-16462-mkahlau=web.de@myfaces.apache.org
> > >>[mailto:users-return-16462-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > >>von Volker Weber
> > >>Gesendet: Freitag, 3. Februar 2006 16:04
> > >>An: MyFaces Discussion
> > >>Betreff: Re: AW: AW: Panel Grid custom component
> > >>
> > >>
> > >>Hi,
> > >>
> > >>the masterDetail example uses dataTable not panelGrid.
> > >>
> > >>
> > >>Matthias Kahlau wrote:
> > >>
> > >>>Thanks Volker,
> > >>>
> > >>>you can take a look at the following example:
> > >>>
> > >>>http://www.irian.at/myfaces/masterDetail.jsf
> > >>>
> > >>>
> > >>>When you look at the source code, you can see that the <f:facet
> > >>>name="header"> ... </f:facet> element is used in more than one column.
> > >>>
> > >>>
> > >>>
> > >>>Regards,
> > >>>
> > >>>Matthias
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>>-----Ursprüngliche Nachricht-----
> > >>>>Von: users-return-16454-mkahlau=web.de@myfaces.apache.org
> > >>>>[mailto:users-return-16454-mkahlau=web.de@myfaces.apache.org]I
> > m Auftrag
> > >>>>von Volker Weber
> > >>>>Gesendet: Freitag, 3. Februar 2006 13:03
> > >>>>An: MyFaces Discussion
> > >>>>Betreff: Re: AW: Panel Grid custom component
> > >>>>
> > >>>>
> > >>>>Hi Matthias,
> > >>>>
> > >>>>no i don't know.
> > >>>>
> > >>>>according to the sun spec this is not possible for h:panelGrid:
> > >>>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan
> > >>>>elGrid.html
> > >>>>
> > >>>>and i don't find any hint to such an addition in the tomahawk
> > >>
> > >>version at:
> > >>
> > >>>>http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html
> > >>>>
> > >>>>But if you point me to a working example, and i can take a look at the
> > >>>>jsp sources i can figure out how to build it programatically.
> > >>>>
> > >>>>Regards
> > >>>> Volker
> > >>>>
> > >>>>Matthias Kahlau wrote:
> > >>>>
> > >>>>
> > >>>>>Hi Volker,
> > >>>>>
> > >>>>>
> > >>>>>do you know how to programmatically add a table header to the
> > >>>>
> > >>>>HtmlPanelGrid
> > >>>>
> > >>>>
> > >>>>>for each column?
> > >>>>>
> > >>>>>
> > >>>>>Regards,
> > >>>>>
> > >>>>>Matthias
> > >>>>>
> > >>>>>
> > >>>>
> > >>>>--
> > >>>>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.
> > >>>
> > >>>
> > >>--
> > >>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.
> > >
> > >
> >
> > --
> > 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 Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

AW: AW: AW: AW: Panel Grid custom component

Posted by Matthias Kahlau <mk...@web.de>.
Hi!

> So you are right, in this point UIData and panelGrid are similar, but i
> think this are not the headers you want.

No, I see. I don't explicitely use columns in a panelGrid, so I can't add
facets as children of column components, neither in JSP nor
programmatically.

It seems like I have to use HtmlDataTable, but this will be more complex
than using a simple HtmlPanelGrid...


Regards,

Matthias

> -----Ursprüngliche Nachricht-----
> Von: users-return-16466-mkahlau=web.de@myfaces.apache.org
> [mailto:users-return-16466-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> von Volker Weber
> Gesendet: Freitag, 3. Februar 2006 17:40
> An: MyFaces Discussion
> Betreff: Re: AW: AW: AW: Panel Grid custom component
>
>
> Hi,
>
> the header facet of a UIData renders a common header over all columns,
> To render a header for each column you must set a header facet on the
> column component.
> See:
> http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/dat
> aTable.html
>
> So you are right, in this point UIData and panelGrid are similar, but i
> think this are not the headers you want.
>
> Regards,
>   Volker
>
> Matthias Kahlau wrote:
> > Ok,
> >
> > but with a dataTable, there's a similar problem. Both HtmlDataTable and
> > HtmlPanelGrid are subclasses of UIComponentBase, and facet
> related methods
> > are defined in this superclass (e. g. getFacets()).
> >
> > UIData does additionally provide convenience methods for
> setting the header
> > and the footer, as you can read in the API doc of UIData:
> >
> > public void setHeader(javax.faces.component.UIComponent header) Set the
> > header facet of this component. A convenience method for
> > getFacets().put("header", header).
> >
> >
> http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/fac
> es/compone
> > nt/UIData.html#setHeader(javax.faces.component.UIComponent)
> >
> >
> > That looks to me like the facet thing of HtmlPanelGrid and
> HtmlDataTable is
> > the same...
> >
> >
> >
> > Regards,
> >
> > Matthias
> >
> >
> >
> >>-----Ursprüngliche Nachricht-----
> >>Von: users-return-16462-mkahlau=web.de@myfaces.apache.org
> >>[mailto:users-return-16462-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> >>von Volker Weber
> >>Gesendet: Freitag, 3. Februar 2006 16:04
> >>An: MyFaces Discussion
> >>Betreff: Re: AW: AW: Panel Grid custom component
> >>
> >>
> >>Hi,
> >>
> >>the masterDetail example uses dataTable not panelGrid.
> >>
> >>
> >>Matthias Kahlau wrote:
> >>
> >>>Thanks Volker,
> >>>
> >>>you can take a look at the following example:
> >>>
> >>>http://www.irian.at/myfaces/masterDetail.jsf
> >>>
> >>>
> >>>When you look at the source code, you can see that the <f:facet
> >>>name="header"> ... </f:facet> element is used in more than one column.
> >>>
> >>>
> >>>
> >>>Regards,
> >>>
> >>>Matthias
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>-----Ursprüngliche Nachricht-----
> >>>>Von: users-return-16454-mkahlau=web.de@myfaces.apache.org
> >>>>[mailto:users-return-16454-mkahlau=web.de@myfaces.apache.org]I
> m Auftrag
> >>>>von Volker Weber
> >>>>Gesendet: Freitag, 3. Februar 2006 13:03
> >>>>An: MyFaces Discussion
> >>>>Betreff: Re: AW: Panel Grid custom component
> >>>>
> >>>>
> >>>>Hi Matthias,
> >>>>
> >>>>no i don't know.
> >>>>
> >>>>according to the sun spec this is not possible for h:panelGrid:
> >>>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan
> >>>>elGrid.html
> >>>>
> >>>>and i don't find any hint to such an addition in the tomahawk
> >>
> >>version at:
> >>
> >>>>http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html
> >>>>
> >>>>But if you point me to a working example, and i can take a look at the
> >>>>jsp sources i can figure out how to build it programatically.
> >>>>
> >>>>Regards
> >>>> Volker
> >>>>
> >>>>Matthias Kahlau wrote:
> >>>>
> >>>>
> >>>>>Hi Volker,
> >>>>>
> >>>>>
> >>>>>do you know how to programmatically add a table header to the
> >>>>
> >>>>HtmlPanelGrid
> >>>>
> >>>>
> >>>>>for each column?
> >>>>>
> >>>>>
> >>>>>Regards,
> >>>>>
> >>>>>Matthias
> >>>>>
> >>>>>
> >>>>
> >>>>--
> >>>>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.
> >>>
> >>>
> >>--
> >>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.
> >
> >
>
> --
> 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.


Re: AW: AW: AW: Panel Grid custom component

Posted by Volker Weber <us...@weber-oldenburg.de>.
Hi,

the header facet of a UIData renders a common header over all columns,
To render a header for each column you must set a header facet on the
column component.
See:
http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/dataTable.html

So you are right, in this point UIData and panelGrid are similar, but i
think this are not the headers you want.

Regards,
  Volker

Matthias Kahlau wrote:
> Ok,
> 
> but with a dataTable, there's a similar problem. Both HtmlDataTable and
> HtmlPanelGrid are subclasses of UIComponentBase, and facet related methods
> are defined in this superclass (e. g. getFacets()).
> 
> UIData does additionally provide convenience methods for setting the header
> and the footer, as you can read in the API doc of UIData:
> 
> public void setHeader(javax.faces.component.UIComponent header) Set the
> header facet of this component. A convenience method for
> getFacets().put("header", header).
> 
> http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/faces/compone
> nt/UIData.html#setHeader(javax.faces.component.UIComponent)
> 
> 
> That looks to me like the facet thing of HtmlPanelGrid and HtmlDataTable is
> the same...
> 
> 
> 
> Regards,
> 
> Matthias
> 
> 
> 
>>-----Ursprüngliche Nachricht-----
>>Von: users-return-16462-mkahlau=web.de@myfaces.apache.org
>>[mailto:users-return-16462-mkahlau=web.de@myfaces.apache.org]Im Auftrag
>>von Volker Weber
>>Gesendet: Freitag, 3. Februar 2006 16:04
>>An: MyFaces Discussion
>>Betreff: Re: AW: AW: Panel Grid custom component
>>
>>
>>Hi,
>>
>>the masterDetail example uses dataTable not panelGrid.
>>
>>
>>Matthias Kahlau wrote:
>>
>>>Thanks Volker,
>>>
>>>you can take a look at the following example:
>>>
>>>http://www.irian.at/myfaces/masterDetail.jsf
>>>
>>>
>>>When you look at the source code, you can see that the <f:facet
>>>name="header"> ... </f:facet> element is used in more than one column.
>>>
>>>
>>>
>>>Regards,
>>>
>>>Matthias
>>>
>>>
>>>
>>>
>>>
>>>>-----Ursprüngliche Nachricht-----
>>>>Von: users-return-16454-mkahlau=web.de@myfaces.apache.org
>>>>[mailto:users-return-16454-mkahlau=web.de@myfaces.apache.org]Im Auftrag
>>>>von Volker Weber
>>>>Gesendet: Freitag, 3. Februar 2006 13:03
>>>>An: MyFaces Discussion
>>>>Betreff: Re: AW: Panel Grid custom component
>>>>
>>>>
>>>>Hi Matthias,
>>>>
>>>>no i don't know.
>>>>
>>>>according to the sun spec this is not possible for h:panelGrid:
>>>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan
>>>>elGrid.html
>>>>
>>>>and i don't find any hint to such an addition in the tomahawk
>>
>>version at:
>>
>>>>http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html
>>>>
>>>>But if you point me to a working example, and i can take a look at the
>>>>jsp sources i can figure out how to build it programatically.
>>>>
>>>>Regards
>>>> Volker
>>>>
>>>>Matthias Kahlau wrote:
>>>>
>>>>
>>>>>Hi Volker,
>>>>>
>>>>>
>>>>>do you know how to programmatically add a table header to the
>>>>
>>>>HtmlPanelGrid
>>>>
>>>>
>>>>>for each column?
>>>>>
>>>>>
>>>>>Regards,
>>>>>
>>>>>Matthias
>>>>>
>>>>>
>>>>
>>>>--
>>>>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.
>>>
>>>
>>--
>>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.
> 
> 

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

AW: AW: AW: AW: Panel Grid custom component

Posted by Matthias Kahlau <mk...@web.de>.
Thanks Martin,


this sounds good and helpful, but I'm pressed for time because of working
for my diploma thesis in the context of JSF ;)

I think I have to try the HtmlDataTable...


Regards,

Matthias

> -----Ursprüngliche Nachricht-----
> Von: users-return-16485-mkahlau=web.de@myfaces.apache.org
> [mailto:users-return-16485-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> von Martin Marinschek
> Gesendet: Freitag, 3. Februar 2006 19:43
> An: MyFaces Discussion
> Betreff: Re: AW: AW: AW: Panel Grid custom component
>
>
> Ok,
>
> I tell you how it would work - maybe you want to try to provide
> that to MyFaces:
>
> You'll need to create a new, custom tag and component (let's call it
> t:header) which you can add to the (t:)panel-grid. (t:header cause it
> will be used in t:panelGrid, and so we cannot add it to the sandbox.
>
> We'd do it with a facet, but facets accept only one child, and that's
> not enough in this case ;)
>
> regards,
>
> Martin
>
> On 2/3/06, Matthias Kahlau <mk...@web.de> wrote:
> > Thanks,
> >
> > but only formatting some components as headers is not
> sufficient in my case,
> > because the HTML output needs to contain structural header elements to
> > comply to accessibility requirements...
> >
> >
> > Regards,
> >
> > Matthias
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: users-return-16475-mkahlau=web.de@myfaces.apache.org
> > >
> [mailto:users-return-16475-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > > von Volker Weber
> > > Gesendet: Freitag, 3. Februar 2006 18:36
> > > An: MyFaces Discussion
> > > Betreff: Re: AW: AW: AW: Panel Grid custom component
> > >
> > >
> > > Hi,
> > >
> > > You can add as many 'header' components as you need (ie number of
> > > columns) as the first children, and use css to format them visualy as
> > > headers.
> > >
> > > Regards,
> > >   Volker
> > >
> > > Matthias Kahlau wrote:
> > > > Hi Volker,
> > > >
> > > >
> > > > as I read in Bergsten's JSF book, JSF distinguishes between a
> > > table header
> > > > facet and column header facets.
> > > >
> > > > - table header facet: rendered as one <th> element (with a
> > > colspan attribute
> > > > set to the number of children) within a <tr> element
> > > > - column header facets: rendered as <th> elements within a
> separate <tr>
> > > > element
> > > > -> a <thead> element encloses both header <tr> elements
> > > >
> > > > Looks like the column header facets are what I searched for,
> > > and the facet
> > > > elements are used as children of the column elements.
> > > >
> > > > But columns are not explicitely used with a panelGrid... and
> > > column header
> > > > facets are not supported, as you already mentioned:
> > > >
> > > >
> > > >>>>according to the sun spec this is not possible for h:panelGrid:
> > > >>
> > > >>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/
> > > panelGrid.h
> > > >
> > > > tml
> > > >
> > > >
> > > > Is there any way out when programmatically creating the UI?
> > > Maybe I can use
> > > > a HtmlDataTable, but I don't know if this is possible because I
> > > don't have a
> > > > simple list of objects to iterate over. I need to add a
> HtmlOutputText
> > > > component in the first column (it's value may be fetched from
> > > an object of
> > > > the data set) and radiobuttons (with spread layout) in the remaining
> > > > columns.
> > > >
> > > >
> > > > Regards,
> > > >
> > > > Matthias
> > > >
> > > >
> > > >>-----Ursprüngliche Nachricht-----
> > > >>Von: users-return-16464-mkahlau=web.de@myfaces.apache.org
> > >
> >>[mailto:users-return-16464-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > > >>von Matthias Kahlau
> > > >>Gesendet: Freitag, 3. Februar 2006 16:24
> > > >>An: MyFaces Discussion
> > > >>Betreff: AW: AW: AW: Panel Grid custom component
> > > >>
> > > >>
> > > >>Ok,
> > > >>
> > > >>but with a dataTable, there's a similar problem. Both
> HtmlDataTable and
> > > >>HtmlPanelGrid are subclasses of UIComponentBase, and facet
> > > related methods
> > > >>are defined in this superclass (e. g. getFacets()).
> > > >>
> > > >>UIData does additionally provide convenience methods for setting
> > > >>the header
> > > >>and the footer, as you can read in the API doc of UIData:
> > > >>
> > > >>public void setHeader(javax.faces.component.UIComponent
> header) Set the
> > > >>header facet of this component. A convenience method for
> > > >>getFacets().put("header", header).
> > > >>
> > > >>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/fac
> > > >>es/compone
> > > >>nt/UIData.html#setHeader(javax.faces.component.UIComponent)
> > > >>
> > > >>
> > > >>That looks to me like the facet thing of HtmlPanelGrid and
> > > >>HtmlDataTable is
> > > >>the same...
> > > >>
> > > >>
> > > >>
> > > >>Regards,
> > > >>
> > > >>Matthias
> > > >>
> > > >>
> > > >>
> > > >>>-----Ursprüngliche Nachricht-----
> > > >>>Von: users-return-16462-mkahlau=web.de@myfaces.apache.org
> > >
> >>>[mailto:users-return-16462-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > > >>>von Volker Weber
> > > >>>Gesendet: Freitag, 3. Februar 2006 16:04
> > > >>>An: MyFaces Discussion
> > > >>>Betreff: Re: AW: AW: Panel Grid custom component
> > > >>>
> > > >>>
> > > >>>Hi,
> > > >>>
> > > >>>the masterDetail example uses dataTable not panelGrid.
> > > >>>
> > > >>>
> > > >>>Matthias Kahlau wrote:
> > > >>>
> > > >>>>Thanks Volker,
> > > >>>>
> > > >>>>you can take a look at the following example:
> > > >>>>
> > > >>>>http://www.irian.at/myfaces/masterDetail.jsf
> > > >>>>
> > > >>>>
> > > >>>>When you look at the source code, you can see that the <f:facet
> > > >>>>name="header"> ... </f:facet> element is used in more
> than one column.
> > > >>>>
> > > >>>>
> > > >>>>
> > > >>>>Regards,
> > > >>>>
> > > >>>>Matthias
> > > >>>>
> > > >>>>
> > > >>>>
> > > >>>>
> > > >>>>
> > > >>>>>-----Ursprüngliche Nachricht-----
> > > >>>>>Von: users-return-16454-mkahlau=web.de@myfaces.apache.org
> > > >>>
> > >
> >>>[mailto:users-return-16454-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > > >>>
> > > >>>>von Volker Weber
> > > >>>>Gesendet: Freitag, 3. Februar 2006 13:03
> > > >>>>An: MyFaces Discussion
> > > >>>>Betreff: Re: AW: Panel Grid custom component
> > > >>>>
> > > >>>>
> > > >>>>Hi Matthias,
> > > >>>>
> > > >>>>no i don't know.
> > > >>>>
> > > >>>>according to the sun spec this is not possible for h:panelGrid:
> > > >>>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan
> > > >>>>elGrid.html
> > > >>>>
> > > >>>>and i don't find any hint to such an addition in the tomahawk
> > > >>
> > > >>version at:
> > > >>
> > > >>>>http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html
> > > >>>>
> > > >>>>But if you point me to a working example, and i can take
> a look at the
> > > >>>>jsp sources i can figure out how to build it programatically.
> > > >>>>
> > > >>>>Regards
> > > >>>> Volker
> > > >>>>
> > > >>>>Matthias Kahlau wrote:
> > > >>>>
> > > >>>>
> > > >>>>>Hi Volker,
> > > >>>>>
> > > >>>>>
> > > >>>>>do you know how to programmatically add a table header to the
> > > >>>>
> > > >>>>HtmlPanelGrid
> > > >>>>
> > > >>>>
> > > >>>>>for each column?
> > > >>>>>
> > > >>>>>
> > > >>>>>Regards,
> > > >>>>>
> > > >>>>>Matthias
> > > >>>>>
> > > >>>>>
> > > >>>>
> > > >>>>--
> > > >>>>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.
> > > >>>
> > > >>>
> > > >>--
> > > >>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.
> > > >
> > > >
> > >
> > > --
> > > 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 Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces


Re: AW: AW: AW: Panel Grid custom component

Posted by Martin Marinschek <ma...@gmail.com>.
Ok,

I tell you how it would work - maybe you want to try to provide that to MyFaces:

You'll need to create a new, custom tag and component (let's call it
t:header) which you can add to the (t:)panel-grid. (t:header cause it
will be used in t:panelGrid, and so we cannot add it to the sandbox.

We'd do it with a facet, but facets accept only one child, and that's
not enough in this case ;)

regards,

Martin

On 2/3/06, Matthias Kahlau <mk...@web.de> wrote:
> Thanks,
>
> but only formatting some components as headers is not sufficient in my case,
> because the HTML output needs to contain structural header elements to
> comply to accessibility requirements...
>
>
> Regards,
>
> Matthias
>
> > -----Ursprüngliche Nachricht-----
> > Von: users-return-16475-mkahlau=web.de@myfaces.apache.org
> > [mailto:users-return-16475-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > von Volker Weber
> > Gesendet: Freitag, 3. Februar 2006 18:36
> > An: MyFaces Discussion
> > Betreff: Re: AW: AW: AW: Panel Grid custom component
> >
> >
> > Hi,
> >
> > You can add as many 'header' components as you need (ie number of
> > columns) as the first children, and use css to format them visualy as
> > headers.
> >
> > Regards,
> >   Volker
> >
> > Matthias Kahlau wrote:
> > > Hi Volker,
> > >
> > >
> > > as I read in Bergsten's JSF book, JSF distinguishes between a
> > table header
> > > facet and column header facets.
> > >
> > > - table header facet: rendered as one <th> element (with a
> > colspan attribute
> > > set to the number of children) within a <tr> element
> > > - column header facets: rendered as <th> elements within a separate <tr>
> > > element
> > > -> a <thead> element encloses both header <tr> elements
> > >
> > > Looks like the column header facets are what I searched for,
> > and the facet
> > > elements are used as children of the column elements.
> > >
> > > But columns are not explicitely used with a panelGrid... and
> > column header
> > > facets are not supported, as you already mentioned:
> > >
> > >
> > >>>>according to the sun spec this is not possible for h:panelGrid:
> > >>
> > >>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/
> > panelGrid.h
> > >
> > > tml
> > >
> > >
> > > Is there any way out when programmatically creating the UI?
> > Maybe I can use
> > > a HtmlDataTable, but I don't know if this is possible because I
> > don't have a
> > > simple list of objects to iterate over. I need to add a HtmlOutputText
> > > component in the first column (it's value may be fetched from
> > an object of
> > > the data set) and radiobuttons (with spread layout) in the remaining
> > > columns.
> > >
> > >
> > > Regards,
> > >
> > > Matthias
> > >
> > >
> > >>-----Ursprüngliche Nachricht-----
> > >>Von: users-return-16464-mkahlau=web.de@myfaces.apache.org
> > >>[mailto:users-return-16464-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > >>von Matthias Kahlau
> > >>Gesendet: Freitag, 3. Februar 2006 16:24
> > >>An: MyFaces Discussion
> > >>Betreff: AW: AW: AW: Panel Grid custom component
> > >>
> > >>
> > >>Ok,
> > >>
> > >>but with a dataTable, there's a similar problem. Both HtmlDataTable and
> > >>HtmlPanelGrid are subclasses of UIComponentBase, and facet
> > related methods
> > >>are defined in this superclass (e. g. getFacets()).
> > >>
> > >>UIData does additionally provide convenience methods for setting
> > >>the header
> > >>and the footer, as you can read in the API doc of UIData:
> > >>
> > >>public void setHeader(javax.faces.component.UIComponent header) Set the
> > >>header facet of this component. A convenience method for
> > >>getFacets().put("header", header).
> > >>
> > >>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/fac
> > >>es/compone
> > >>nt/UIData.html#setHeader(javax.faces.component.UIComponent)
> > >>
> > >>
> > >>That looks to me like the facet thing of HtmlPanelGrid and
> > >>HtmlDataTable is
> > >>the same...
> > >>
> > >>
> > >>
> > >>Regards,
> > >>
> > >>Matthias
> > >>
> > >>
> > >>
> > >>>-----Ursprüngliche Nachricht-----
> > >>>Von: users-return-16462-mkahlau=web.de@myfaces.apache.org
> > >>>[mailto:users-return-16462-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > >>>von Volker Weber
> > >>>Gesendet: Freitag, 3. Februar 2006 16:04
> > >>>An: MyFaces Discussion
> > >>>Betreff: Re: AW: AW: Panel Grid custom component
> > >>>
> > >>>
> > >>>Hi,
> > >>>
> > >>>the masterDetail example uses dataTable not panelGrid.
> > >>>
> > >>>
> > >>>Matthias Kahlau wrote:
> > >>>
> > >>>>Thanks Volker,
> > >>>>
> > >>>>you can take a look at the following example:
> > >>>>
> > >>>>http://www.irian.at/myfaces/masterDetail.jsf
> > >>>>
> > >>>>
> > >>>>When you look at the source code, you can see that the <f:facet
> > >>>>name="header"> ... </f:facet> element is used in more than one column.
> > >>>>
> > >>>>
> > >>>>
> > >>>>Regards,
> > >>>>
> > >>>>Matthias
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >>>>>-----Ursprüngliche Nachricht-----
> > >>>>>Von: users-return-16454-mkahlau=web.de@myfaces.apache.org
> > >>>
> > >>>[mailto:users-return-16454-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > >>>
> > >>>>von Volker Weber
> > >>>>Gesendet: Freitag, 3. Februar 2006 13:03
> > >>>>An: MyFaces Discussion
> > >>>>Betreff: Re: AW: Panel Grid custom component
> > >>>>
> > >>>>
> > >>>>Hi Matthias,
> > >>>>
> > >>>>no i don't know.
> > >>>>
> > >>>>according to the sun spec this is not possible for h:panelGrid:
> > >>>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan
> > >>>>elGrid.html
> > >>>>
> > >>>>and i don't find any hint to such an addition in the tomahawk
> > >>
> > >>version at:
> > >>
> > >>>>http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html
> > >>>>
> > >>>>But if you point me to a working example, and i can take a look at the
> > >>>>jsp sources i can figure out how to build it programatically.
> > >>>>
> > >>>>Regards
> > >>>> Volker
> > >>>>
> > >>>>Matthias Kahlau wrote:
> > >>>>
> > >>>>
> > >>>>>Hi Volker,
> > >>>>>
> > >>>>>
> > >>>>>do you know how to programmatically add a table header to the
> > >>>>
> > >>>>HtmlPanelGrid
> > >>>>
> > >>>>
> > >>>>>for each column?
> > >>>>>
> > >>>>>
> > >>>>>Regards,
> > >>>>>
> > >>>>>Matthias
> > >>>>>
> > >>>>>
> > >>>>
> > >>>>--
> > >>>>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.
> > >>>
> > >>>
> > >>--
> > >>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.
> > >
> > >
> >
> > --
> > 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 Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

AW: AW: AW: AW: Panel Grid custom component

Posted by Matthias Kahlau <mk...@web.de>.
Thanks,

but only formatting some components as headers is not sufficient in my case,
because the HTML output needs to contain structural header elements to
comply to accessibility requirements...


Regards,

Matthias

> -----Ursprüngliche Nachricht-----
> Von: users-return-16475-mkahlau=web.de@myfaces.apache.org
> [mailto:users-return-16475-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> von Volker Weber
> Gesendet: Freitag, 3. Februar 2006 18:36
> An: MyFaces Discussion
> Betreff: Re: AW: AW: AW: Panel Grid custom component
>
>
> Hi,
>
> You can add as many 'header' components as you need (ie number of
> columns) as the first children, and use css to format them visualy as
> headers.
>
> Regards,
>   Volker
>
> Matthias Kahlau wrote:
> > Hi Volker,
> >
> >
> > as I read in Bergsten's JSF book, JSF distinguishes between a
> table header
> > facet and column header facets.
> >
> > - table header facet: rendered as one <th> element (with a
> colspan attribute
> > set to the number of children) within a <tr> element
> > - column header facets: rendered as <th> elements within a separate <tr>
> > element
> > -> a <thead> element encloses both header <tr> elements
> >
> > Looks like the column header facets are what I searched for,
> and the facet
> > elements are used as children of the column elements.
> >
> > But columns are not explicitely used with a panelGrid... and
> column header
> > facets are not supported, as you already mentioned:
> >
> >
> >>>>according to the sun spec this is not possible for h:panelGrid:
> >>
> >>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/
> panelGrid.h
> >
> > tml
> >
> >
> > Is there any way out when programmatically creating the UI?
> Maybe I can use
> > a HtmlDataTable, but I don't know if this is possible because I
> don't have a
> > simple list of objects to iterate over. I need to add a HtmlOutputText
> > component in the first column (it's value may be fetched from
> an object of
> > the data set) and radiobuttons (with spread layout) in the remaining
> > columns.
> >
> >
> > Regards,
> >
> > Matthias
> >
> >
> >>-----Ursprüngliche Nachricht-----
> >>Von: users-return-16464-mkahlau=web.de@myfaces.apache.org
> >>[mailto:users-return-16464-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> >>von Matthias Kahlau
> >>Gesendet: Freitag, 3. Februar 2006 16:24
> >>An: MyFaces Discussion
> >>Betreff: AW: AW: AW: Panel Grid custom component
> >>
> >>
> >>Ok,
> >>
> >>but with a dataTable, there's a similar problem. Both HtmlDataTable and
> >>HtmlPanelGrid are subclasses of UIComponentBase, and facet
> related methods
> >>are defined in this superclass (e. g. getFacets()).
> >>
> >>UIData does additionally provide convenience methods for setting
> >>the header
> >>and the footer, as you can read in the API doc of UIData:
> >>
> >>public void setHeader(javax.faces.component.UIComponent header) Set the
> >>header facet of this component. A convenience method for
> >>getFacets().put("header", header).
> >>
> >>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/fac
> >>es/compone
> >>nt/UIData.html#setHeader(javax.faces.component.UIComponent)
> >>
> >>
> >>That looks to me like the facet thing of HtmlPanelGrid and
> >>HtmlDataTable is
> >>the same...
> >>
> >>
> >>
> >>Regards,
> >>
> >>Matthias
> >>
> >>
> >>
> >>>-----Ursprüngliche Nachricht-----
> >>>Von: users-return-16462-mkahlau=web.de@myfaces.apache.org
> >>>[mailto:users-return-16462-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> >>>von Volker Weber
> >>>Gesendet: Freitag, 3. Februar 2006 16:04
> >>>An: MyFaces Discussion
> >>>Betreff: Re: AW: AW: Panel Grid custom component
> >>>
> >>>
> >>>Hi,
> >>>
> >>>the masterDetail example uses dataTable not panelGrid.
> >>>
> >>>
> >>>Matthias Kahlau wrote:
> >>>
> >>>>Thanks Volker,
> >>>>
> >>>>you can take a look at the following example:
> >>>>
> >>>>http://www.irian.at/myfaces/masterDetail.jsf
> >>>>
> >>>>
> >>>>When you look at the source code, you can see that the <f:facet
> >>>>name="header"> ... </f:facet> element is used in more than one column.
> >>>>
> >>>>
> >>>>
> >>>>Regards,
> >>>>
> >>>>Matthias
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>-----Ursprüngliche Nachricht-----
> >>>>>Von: users-return-16454-mkahlau=web.de@myfaces.apache.org
> >>>
> >>>[mailto:users-return-16454-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> >>>
> >>>>von Volker Weber
> >>>>Gesendet: Freitag, 3. Februar 2006 13:03
> >>>>An: MyFaces Discussion
> >>>>Betreff: Re: AW: Panel Grid custom component
> >>>>
> >>>>
> >>>>Hi Matthias,
> >>>>
> >>>>no i don't know.
> >>>>
> >>>>according to the sun spec this is not possible for h:panelGrid:
> >>>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan
> >>>>elGrid.html
> >>>>
> >>>>and i don't find any hint to such an addition in the tomahawk
> >>
> >>version at:
> >>
> >>>>http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html
> >>>>
> >>>>But if you point me to a working example, and i can take a look at the
> >>>>jsp sources i can figure out how to build it programatically.
> >>>>
> >>>>Regards
> >>>> Volker
> >>>>
> >>>>Matthias Kahlau wrote:
> >>>>
> >>>>
> >>>>>Hi Volker,
> >>>>>
> >>>>>
> >>>>>do you know how to programmatically add a table header to the
> >>>>
> >>>>HtmlPanelGrid
> >>>>
> >>>>
> >>>>>for each column?
> >>>>>
> >>>>>
> >>>>>Regards,
> >>>>>
> >>>>>Matthias
> >>>>>
> >>>>>
> >>>>
> >>>>--
> >>>>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.
> >>>
> >>>
> >>--
> >>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.
> >
> >
>
> --
> 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.


Re: AW: AW: AW: Panel Grid custom component

Posted by Volker Weber <us...@weber-oldenburg.de>.
Hi,

You can add as many 'header' components as you need (ie number of
columns) as the first children, and use css to format them visualy as
headers.

Regards,
  Volker

Matthias Kahlau wrote:
> Hi Volker,
> 
> 
> as I read in Bergsten's JSF book, JSF distinguishes between a table header
> facet and column header facets.
> 
> - table header facet: rendered as one <th> element (with a colspan attribute
> set to the number of children) within a <tr> element
> - column header facets: rendered as <th> elements within a separate <tr>
> element
> -> a <thead> element encloses both header <tr> elements
> 
> Looks like the column header facets are what I searched for, and the facet
> elements are used as children of the column elements.
> 
> But columns are not explicitely used with a panelGrid... and column header
> facets are not supported, as you already mentioned:
> 
> 
>>>>according to the sun spec this is not possible for h:panelGrid:
>>
>>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/panelGrid.h
> 
> tml
> 
> 
> Is there any way out when programmatically creating the UI? Maybe I can use
> a HtmlDataTable, but I don't know if this is possible because I don't have a
> simple list of objects to iterate over. I need to add a HtmlOutputText
> component in the first column (it's value may be fetched from an object of
> the data set) and radiobuttons (with spread layout) in the remaining
> columns.
> 
> 
> Regards,
> 
> Matthias
> 
> 
>>-----Ursprüngliche Nachricht-----
>>Von: users-return-16464-mkahlau=web.de@myfaces.apache.org
>>[mailto:users-return-16464-mkahlau=web.de@myfaces.apache.org]Im Auftrag
>>von Matthias Kahlau
>>Gesendet: Freitag, 3. Februar 2006 16:24
>>An: MyFaces Discussion
>>Betreff: AW: AW: AW: Panel Grid custom component
>>
>>
>>Ok,
>>
>>but with a dataTable, there's a similar problem. Both HtmlDataTable and
>>HtmlPanelGrid are subclasses of UIComponentBase, and facet related methods
>>are defined in this superclass (e. g. getFacets()).
>>
>>UIData does additionally provide convenience methods for setting
>>the header
>>and the footer, as you can read in the API doc of UIData:
>>
>>public void setHeader(javax.faces.component.UIComponent header) Set the
>>header facet of this component. A convenience method for
>>getFacets().put("header", header).
>>
>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/fac
>>es/compone
>>nt/UIData.html#setHeader(javax.faces.component.UIComponent)
>>
>>
>>That looks to me like the facet thing of HtmlPanelGrid and
>>HtmlDataTable is
>>the same...
>>
>>
>>
>>Regards,
>>
>>Matthias
>>
>>
>>
>>>-----Ursprüngliche Nachricht-----
>>>Von: users-return-16462-mkahlau=web.de@myfaces.apache.org
>>>[mailto:users-return-16462-mkahlau=web.de@myfaces.apache.org]Im Auftrag
>>>von Volker Weber
>>>Gesendet: Freitag, 3. Februar 2006 16:04
>>>An: MyFaces Discussion
>>>Betreff: Re: AW: AW: Panel Grid custom component
>>>
>>>
>>>Hi,
>>>
>>>the masterDetail example uses dataTable not panelGrid.
>>>
>>>
>>>Matthias Kahlau wrote:
>>>
>>>>Thanks Volker,
>>>>
>>>>you can take a look at the following example:
>>>>
>>>>http://www.irian.at/myfaces/masterDetail.jsf
>>>>
>>>>
>>>>When you look at the source code, you can see that the <f:facet
>>>>name="header"> ... </f:facet> element is used in more than one column.
>>>>
>>>>
>>>>
>>>>Regards,
>>>>
>>>>Matthias
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>-----Ursprüngliche Nachricht-----
>>>>>Von: users-return-16454-mkahlau=web.de@myfaces.apache.org
>>>
>>>[mailto:users-return-16454-mkahlau=web.de@myfaces.apache.org]Im Auftrag
>>>
>>>>von Volker Weber
>>>>Gesendet: Freitag, 3. Februar 2006 13:03
>>>>An: MyFaces Discussion
>>>>Betreff: Re: AW: Panel Grid custom component
>>>>
>>>>
>>>>Hi Matthias,
>>>>
>>>>no i don't know.
>>>>
>>>>according to the sun spec this is not possible for h:panelGrid:
>>>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan
>>>>elGrid.html
>>>>
>>>>and i don't find any hint to such an addition in the tomahawk
>>
>>version at:
>>
>>>>http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html
>>>>
>>>>But if you point me to a working example, and i can take a look at the
>>>>jsp sources i can figure out how to build it programatically.
>>>>
>>>>Regards
>>>> Volker
>>>>
>>>>Matthias Kahlau wrote:
>>>>
>>>>
>>>>>Hi Volker,
>>>>>
>>>>>
>>>>>do you know how to programmatically add a table header to the
>>>>
>>>>HtmlPanelGrid
>>>>
>>>>
>>>>>for each column?
>>>>>
>>>>>
>>>>>Regards,
>>>>>
>>>>>Matthias
>>>>>
>>>>>
>>>>
>>>>--
>>>>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.
>>>
>>>
>>--
>>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.
> 
> 

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

AW: AW: AW: Panel Grid custom component

Posted by Matthias Kahlau <mk...@web.de>.
Hi Volker,


as I read in Bergsten's JSF book, JSF distinguishes between a table header
facet and column header facets.

- table header facet: rendered as one <th> element (with a colspan attribute
set to the number of children) within a <tr> element
- column header facets: rendered as <th> elements within a separate <tr>
element
-> a <thead> element encloses both header <tr> elements

Looks like the column header facets are what I searched for, and the facet
elements are used as children of the column elements.

But columns are not explicitely used with a panelGrid... and column header
facets are not supported, as you already mentioned:

> >>according to the sun spec this is not possible for h:panelGrid:
>
>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/panelGrid.h
tml


Is there any way out when programmatically creating the UI? Maybe I can use
a HtmlDataTable, but I don't know if this is possible because I don't have a
simple list of objects to iterate over. I need to add a HtmlOutputText
component in the first column (it's value may be fetched from an object of
the data set) and radiobuttons (with spread layout) in the remaining
columns.


Regards,

Matthias

> -----Ursprüngliche Nachricht-----
> Von: users-return-16464-mkahlau=web.de@myfaces.apache.org
> [mailto:users-return-16464-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> von Matthias Kahlau
> Gesendet: Freitag, 3. Februar 2006 16:24
> An: MyFaces Discussion
> Betreff: AW: AW: AW: Panel Grid custom component
>
>
> Ok,
>
> but with a dataTable, there's a similar problem. Both HtmlDataTable and
> HtmlPanelGrid are subclasses of UIComponentBase, and facet related methods
> are defined in this superclass (e. g. getFacets()).
>
> UIData does additionally provide convenience methods for setting
> the header
> and the footer, as you can read in the API doc of UIData:
>
> public void setHeader(javax.faces.component.UIComponent header) Set the
> header facet of this component. A convenience method for
> getFacets().put("header", header).
>
> http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/fac
> es/compone
> nt/UIData.html#setHeader(javax.faces.component.UIComponent)
>
>
> That looks to me like the facet thing of HtmlPanelGrid and
> HtmlDataTable is
> the same...
>
>
>
> Regards,
>
> Matthias
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: users-return-16462-mkahlau=web.de@myfaces.apache.org
> > [mailto:users-return-16462-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> > von Volker Weber
> > Gesendet: Freitag, 3. Februar 2006 16:04
> > An: MyFaces Discussion
> > Betreff: Re: AW: AW: Panel Grid custom component
> >
> >
> > Hi,
> >
> > the masterDetail example uses dataTable not panelGrid.
> >
> >
> > Matthias Kahlau wrote:
> > > Thanks Volker,
> > >
> > > you can take a look at the following example:
> > >
> > > http://www.irian.at/myfaces/masterDetail.jsf
> > >
> > >
> > > When you look at the source code, you can see that the <f:facet
> > > name="header"> ... </f:facet> element is used in more than one column.
> > >
> > >
> > >
> > > Regards,
> > >
> > > Matthias
> > >
> > >
> > >
> > >
> > >>-----Ursprüngliche Nachricht-----
> > >>Von: users-return-16454-mkahlau=web.de@myfaces.apache.org
> >
>>[mailto:users-return-16454-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> >>von Volker Weber
> >>Gesendet: Freitag, 3. Februar 2006 13:03
> >>An: MyFaces Discussion
> >>Betreff: Re: AW: Panel Grid custom component
> >>
> >>
> >>Hi Matthias,
> >>
> >>no i don't know.
> >>
> >>according to the sun spec this is not possible for h:panelGrid:
> >>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan
> >>elGrid.html
> >>
> >>and i don't find any hint to such an addition in the tomahawk
> version at:
> >>http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html
> >>
> >>But if you point me to a working example, and i can take a look at the
> >>jsp sources i can figure out how to build it programatically.
> >>
> >>Regards
> >>  Volker
> >>
> >>Matthias Kahlau wrote:
> >>
> >>>Hi Volker,
> >>>
> >>>
> >>>do you know how to programmatically add a table header to the
> >>
> >>HtmlPanelGrid
> >>
> >>>for each column?
> >>>
> >>>
> >>>Regards,
> >>>
> >>>Matthias
> >>>
> >>>
> >>
> >>--
> >>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.
> >
> >
>
> --
> 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.


AW: AW: AW: Panel Grid custom component

Posted by Matthias Kahlau <mk...@web.de>.
Ok,

but with a dataTable, there's a similar problem. Both HtmlDataTable and
HtmlPanelGrid are subclasses of UIComponentBase, and facet related methods
are defined in this superclass (e. g. getFacets()).

UIData does additionally provide convenience methods for setting the header
and the footer, as you can read in the API doc of UIData:

public void setHeader(javax.faces.component.UIComponent header) Set the
header facet of this component. A convenience method for
getFacets().put("header", header).

http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/faces/compone
nt/UIData.html#setHeader(javax.faces.component.UIComponent)


That looks to me like the facet thing of HtmlPanelGrid and HtmlDataTable is
the same...



Regards,

Matthias


> -----Ursprüngliche Nachricht-----
> Von: users-return-16462-mkahlau=web.de@myfaces.apache.org
> [mailto:users-return-16462-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> von Volker Weber
> Gesendet: Freitag, 3. Februar 2006 16:04
> An: MyFaces Discussion
> Betreff: Re: AW: AW: Panel Grid custom component
>
>
> Hi,
>
> the masterDetail example uses dataTable not panelGrid.
>
>
> Matthias Kahlau wrote:
> > Thanks Volker,
> >
> > you can take a look at the following example:
> >
> > http://www.irian.at/myfaces/masterDetail.jsf
> >
> >
> > When you look at the source code, you can see that the <f:facet
> > name="header"> ... </f:facet> element is used in more than one column.
> >
> >
> >
> > Regards,
> >
> > Matthias
> >
> >
> >
> >
> >>-----Ursprüngliche Nachricht-----
> >>Von: users-return-16454-mkahlau=web.de@myfaces.apache.org
> >>[mailto:users-return-16454-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> >>von Volker Weber
> >>Gesendet: Freitag, 3. Februar 2006 13:03
> >>An: MyFaces Discussion
> >>Betreff: Re: AW: Panel Grid custom component
> >>
> >>
> >>Hi Matthias,
> >>
> >>no i don't know.
> >>
> >>according to the sun spec this is not possible for h:panelGrid:
> >>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan
> >>elGrid.html
> >>
> >>and i don't find any hint to such an addition in the tomahawk
> version at:
> >>http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html
> >>
> >>But if you point me to a working example, and i can take a look at the
> >>jsp sources i can figure out how to build it programatically.
> >>
> >>Regards
> >>  Volker
> >>
> >>Matthias Kahlau wrote:
> >>
> >>>Hi Volker,
> >>>
> >>>
> >>>do you know how to programmatically add a table header to the
> >>
> >>HtmlPanelGrid
> >>
> >>>for each column?
> >>>
> >>>
> >>>Regards,
> >>>
> >>>Matthias
> >>>
> >>>
> >>
> >>--
> >>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.
> >
> >
>
> --
> 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.


Re: AW: AW: Panel Grid custom component

Posted by Volker Weber <us...@weber-oldenburg.de>.
Hi,

the masterDetail example uses dataTable not panelGrid.


Matthias Kahlau wrote:
> Thanks Volker,
> 
> you can take a look at the following example:
> 
> http://www.irian.at/myfaces/masterDetail.jsf
> 
> 
> When you look at the source code, you can see that the <f:facet
> name="header"> ... </f:facet> element is used in more than one column.
> 
> 
> 
> Regards,
> 
> Matthias
> 
> 
> 
> 
>>-----Ursprüngliche Nachricht-----
>>Von: users-return-16454-mkahlau=web.de@myfaces.apache.org
>>[mailto:users-return-16454-mkahlau=web.de@myfaces.apache.org]Im Auftrag
>>von Volker Weber
>>Gesendet: Freitag, 3. Februar 2006 13:03
>>An: MyFaces Discussion
>>Betreff: Re: AW: Panel Grid custom component
>>
>>
>>Hi Matthias,
>>
>>no i don't know.
>>
>>according to the sun spec this is not possible for h:panelGrid:
>>http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan
>>elGrid.html
>>
>>and i don't find any hint to such an addition in the tomahawk version at:
>>http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html
>>
>>But if you point me to a working example, and i can take a look at the
>>jsp sources i can figure out how to build it programatically.
>>
>>Regards
>>  Volker
>>
>>Matthias Kahlau wrote:
>>
>>>Hi Volker,
>>>
>>>
>>>do you know how to programmatically add a table header to the
>>
>>HtmlPanelGrid
>>
>>>for each column?
>>>
>>>
>>>Regards,
>>>
>>>Matthias
>>>
>>>
>>
>>--
>>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.
> 
> 

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

AW: AW: Panel Grid custom component

Posted by Matthias Kahlau <mk...@web.de>.
Thanks Volker,

you can take a look at the following example:

http://www.irian.at/myfaces/masterDetail.jsf


When you look at the source code, you can see that the <f:facet
name="header"> ... </f:facet> element is used in more than one column.



Regards,

Matthias



> -----Ursprüngliche Nachricht-----
> Von: users-return-16454-mkahlau=web.de@myfaces.apache.org
> [mailto:users-return-16454-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> von Volker Weber
> Gesendet: Freitag, 3. Februar 2006 13:03
> An: MyFaces Discussion
> Betreff: Re: AW: Panel Grid custom component
>
>
> Hi Matthias,
>
> no i don't know.
>
> according to the sun spec this is not possible for h:panelGrid:
> http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan
> elGrid.html
>
> and i don't find any hint to such an addition in the tomahawk version at:
> http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html
>
> But if you point me to a working example, and i can take a look at the
> jsp sources i can figure out how to build it programatically.
>
> Regards
>   Volker
>
> Matthias Kahlau wrote:
> > Hi Volker,
> >
> >
> > do you know how to programmatically add a table header to the
> HtmlPanelGrid
> > for each column?
> >
> >
> > Regards,
> >
> > Matthias
> >
> >
>
> --
> 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.


Re: AW: Panel Grid custom component

Posted by Volker Weber <us...@weber-oldenburg.de>.
Hi Matthias,

no i don't know.

according to the sun spec this is not possible for h:panelGrid:
http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/panelGrid.html

and i don't find any hint to such an addition in the tomahawk version at:
http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html

But if you point me to a working example, and i can take a look at the
jsp sources i can figure out how to build it programatically.

Regards
  Volker

Matthias Kahlau wrote:
> Hi Volker,
> 
> 
> do you know how to programmatically add a table header to the HtmlPanelGrid
> for each column?
> 
> 
> Regards,
> 
> Matthias
> 
> 

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

AW: Panel Grid custom component

Posted by Matthias Kahlau <mk...@web.de>.
Hi Volker,


do you know how to programmatically add a table header to the HtmlPanelGrid
for each column?


Regards,

Matthias

> -----Ursprüngliche Nachricht-----
> Von: users-return-16452-mkahlau=web.de@myfaces.apache.org
> [mailto:users-return-16452-mkahlau=web.de@myfaces.apache.org]Im Auftrag
> von Volker Weber
> Gesendet: Freitag, 3. Februar 2006 12:14
> An: MyFaces Discussion
> Betreff: Re: Panel Grid custom component
>
>
> Hi Ali,
>
> there are some things you made wrong:
>
> First, and this seems to be a popular error: you can't add a component
> to another by setting the parent of the child! use
> parent.getChildren().add(child) instead.
>
> Than: You dont neet to invoke encoding on every component, just create
> then component tree and let jsf do the rest.
>
> Try this :
>
> public void encodeBegin( FacesContext context )
> {
>
>    HtmlPanelGrid panelGrid = new HtmlPanelGrid();
>    panelGrid.setColumns(2);
>    List children = panelGrid.getChildren();
>
>    UIOutput labelName = new UIOutput();
>    labelName.setValue("Enter name: ");
>    labelName.setId("nameId");
>    children.add(labelName);
>
>    UIInput inputName = new UIInput();
>    inputName.setId("inputNameId");
>    // UIInput needs a valueBinding
>    children.add(inputName);
>
>    UIOutput labelAge = new UIOutput();
>    labelAge.setValue("Enter age: ");
>    labelName.setId("ageId");
>    children.add(labelAge);
>
>    UIInput inputAge = new UIInput();
>    inputAge.setId("inputAgeId");
>    // UIInput needs a valueBinding
>    children.add(inputAge);
>
>    this.getChildren.add(panelGrid);
>
>    super.encodeBegin(context);
> }
>
>
> Regards,
>   Volker
>
>
> Ali Raza wrote:
> > Greetings again,
> >
> > Instead of adding components by rendering the htl myself i am adding
> > chilid components and calling their encode methods as following:
> >
> > public void encodeBegin( FacesContext context )
> >     {
> >         try
> >         {
> >             ResponseWriter writer = context.getResponseWriter();
> >             writer.writeComment("********************************* THIS
> > IS THE START OF COMPONENT
> > **************************************************");
> >
> >             HtmlPanelGrid panelGrid = new HtmlPanelGrid();
> >             panelGrid.setColumns(2);
> >             panelGrid.encodeChildren(context);
> >
> >             addComponentBegin(context, "panelGridId", this, panelGrid);
> >             addComponentEnd(context, panelGrid);
> >
> >             UIOutput labelName = new UIOutput();
> >             labelName.setValue("Enter name: ");
> >             addComponentBegin(context, "nameId", panelGrid, labelName);
> >             addComponentEnd(context, labelName);
> >
> >             UIInput inputName = new UIInput();
> >             addComponentBegin(context, "inputNameId",
> panelGrid, inputName);
> >             addComponentEnd(context, inputName);
> >
> >             UIOutput labelAge = new UIOutput();
> >             labelAge.setValue("Enter age: ");
> >             addComponentBegin(context, "ageId", panelGrid, labelAge);
> >             addComponentEnd(context, labelAge);
> >
> >             UIInput inputAge = new UIInput();
> >             addComponentBegin(context, "inputAgeId", panelGrid,
> inputAge);
> >             addComponentEnd(context, inputAge);
> >
> >
> >
> >
> >             writer.writeComment("********************************* THIS
> > IS THE END OF COMPONENT
> > **************************************************");
> >         }
> >         catch( IOException e )
> >         {
> >
> >         }
> >     }
> >
> >     public static void addComponentBegin( FacesContext context, String
> > componentId, UIComponent parentComponent, UIComponent childComponent )
> > throws IOException
> >     {
> >         if( componentId != null )
> >         {
> >             childComponent.setId( componentId );
> >         }
> >
> >         childComponent.setParent( parentComponent );
> >         childComponent.encodeBegin ( context );
> >     }
> >
> >     public static void addComponentEnd( FacesContext context,
> > UIComponent childComponent ) throws IOException
> >     {
> >         childComponent.encodeEnd( context );
> >     }
> >
> > My problem is that the layout of the panel grid (2 columns) that i have
> > added is not maintained and all encoded children get rendered ina
> > straight line quite like flowlayout in swing. can i use column wise
> > layout without having to encode the html myself ???
> >
> > Thanx a lot,
> > Ali
> >
> > --
> > "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
>
> --
> 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.


Re: Panel Grid custom component

Posted by Volker Weber <us...@weber-oldenburg.de>.
Hi Ali,

there are some things you made wrong:

First, and this seems to be a popular error: you can't add a component
to another by setting the parent of the child! use
parent.getChildren().add(child) instead.

Than: You dont neet to invoke encoding on every component, just create
then component tree and let jsf do the rest.

Try this :

public void encodeBegin( FacesContext context )
{

   HtmlPanelGrid panelGrid = new HtmlPanelGrid();
   panelGrid.setColumns(2);
   List children = panelGrid.getChildren();

   UIOutput labelName = new UIOutput();
   labelName.setValue("Enter name: ");
   labelName.setId("nameId");
   children.add(labelName);

   UIInput inputName = new UIInput();
   inputName.setId("inputNameId");
   // UIInput needs a valueBinding
   children.add(inputName);

   UIOutput labelAge = new UIOutput();
   labelAge.setValue("Enter age: ");
   labelName.setId("ageId");
   children.add(labelAge);

   UIInput inputAge = new UIInput();
   inputAge.setId("inputAgeId");
   // UIInput needs a valueBinding
   children.add(inputAge);

   this.getChildren.add(panelGrid);

   super.encodeBegin(context);
}


Regards,
  Volker


Ali Raza wrote:
> Greetings again,
> 
> Instead of adding components by rendering the htl myself i am adding
> chilid components and calling their encode methods as following:
> 
> public void encodeBegin( FacesContext context )
>     {
>         try
>         {
>             ResponseWriter writer = context.getResponseWriter();
>             writer.writeComment("********************************* THIS
> IS THE START OF COMPONENT
> **************************************************");
>            
>             HtmlPanelGrid panelGrid = new HtmlPanelGrid();
>             panelGrid.setColumns(2);
>             panelGrid.encodeChildren(context);
>            
>             addComponentBegin(context, "panelGridId", this, panelGrid);
>             addComponentEnd(context, panelGrid);
>            
>             UIOutput labelName = new UIOutput();
>             labelName.setValue("Enter name: ");
>             addComponentBegin(context, "nameId", panelGrid, labelName);
>             addComponentEnd(context, labelName);
>            
>             UIInput inputName = new UIInput();
>             addComponentBegin(context, "inputNameId", panelGrid, inputName);
>             addComponentEnd(context, inputName);
>            
>             UIOutput labelAge = new UIOutput();
>             labelAge.setValue("Enter age: ");
>             addComponentBegin(context, "ageId", panelGrid, labelAge);
>             addComponentEnd(context, labelAge);
>            
>             UIInput inputAge = new UIInput();
>             addComponentBegin(context, "inputAgeId", panelGrid, inputAge); 
>             addComponentEnd(context, inputAge);
>            
>            
>            
>            
>             writer.writeComment("********************************* THIS
> IS THE END OF COMPONENT
> **************************************************");
>         }
>         catch( IOException e )
>         {
> 
>         }
>     } 
>    
>     public static void addComponentBegin( FacesContext context, String
> componentId, UIComponent parentComponent, UIComponent childComponent )
> throws IOException
>     {
>         if( componentId != null )
>         {
>             childComponent.setId( componentId );
>         }
>        
>         childComponent.setParent( parentComponent );
>         childComponent.encodeBegin ( context );
>     }
>    
>     public static void addComponentEnd( FacesContext context,
> UIComponent childComponent ) throws IOException
>     {
>         childComponent.encodeEnd( context );
>     }
> 
> My problem is that the layout of the panel grid (2 columns) that i have
> added is not maintained and all encoded children get rendered ina
> straight line quite like flowlayout in swing. can i use column wise
> layout without having to encode the html myself ???
> 
> Thanx a lot,
> Ali
> 
> -- 
> "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

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