You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Fanny Aenvie <Fa...@gmx.de> on 2005/03/03 00:15:51 UTC

Layouting with PanelGrid

hi, im quite new in java server faces and
i'm a little bit trapped in what i call the
panelgrid-layout-problem. because my project 
can not and does not use jsp, i have to build 
my form-layout programmatically. but how can i 
get a proper layout with a colspan then ?

i think one thing, that could be very helpful
for me, would be a specialized PanelGrid that can be
build by a PanelGridBuilder parameterized  
by a layout.
 
similar to what the forms-libary by karsten
letzsch (www.jgoodies.com) does for swing-panels.
but simpler, cut back to the possibilities of a
html-<table>-layout.

here an example:

FormLayout layout = new FormLayout(...);

DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.setDefaultDialogBorder();
builder.appendSeparator(“Segment”);
builder.append(“Identifier”, idField, 2); //spans 2 main-columns
builder.nextLine();
builder.append(“PTI [kW]”, ptiField);
builder.append(“Power [kW]”, powerField);
builder.append(“len [mm]”, lenField);
builder.nextLine();
builder.appendSeparator(“Diameters”);
builder.append(“da [mm]”, daField);
builder.append(“di [mm]”, diField);
builder.append(“da2 [mm]”, da2Field);

ExtendedPanelGrid panelGrid = builder.getPanelGrid();


how about that kind of thing ? any other
sugestions ?

regards fanny

-- 
Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail

Re: Layouting with PanelGrid

Posted by Heath Borders <he...@gmail.com>.
For any HTML output that you don't want to bother creating components
for, you can literally define it using either UIOutputs with
escape="false" (that's what a <f:verbatim /> is), or you can access
the ResponseWriter directly and use it.


On Wed, 9 Mar 2005 10:42:27 +0100, Martin Marinschek
<ma...@gmail.com> wrote:
> Have you looked at the component-binding feature?
> 
> with binding="#{xbackingBean.ycomponent}"
> 
> you can deliver a programmatically defined grid to your jsp - a small
> jsp wrapper around it, and the thing is done...
> 
> For things like colspan you will need to extend the current grid and
> write a custom component/renderer, as it does not have this ability
> right now.
> 
> regards,
> 
> Martin
> 
> On Wed, 9 Mar 2005 06:59:31 +0100 (MET), Fanny Aenvie
> <Fa...@gmx.de> wrote:
> > stupid idea or poor description of what i want ?
> >
> > see at hans bergstens jsf-book and his article
> > "Improving JSF by Dumping JSP". in the book there
> > are examples of using jsf without jsp. my idea is
> > based on this but goes a step further.
> >
> > we have a running impementation of this
> > using RI but want to change to myfaces.
> >
> > i wanted to check it out a little bit first.
> > so i have run the newsservice-example from
> > the jsf-book with myfaces. it uses a custom ViewHandler
> > (ClassViewHandler) and a View called SubscribeView.
> > this is really a nice proof of myfaces because
> > good jsf-implementations are not jsp- or html-
> > centistic.
> >
> > i had to make changes to get it to run with myfaces
> > (cvs 08.03.2005).
> >
> > *problem 1*
> >
> > ClassCastException in class HtmlFormRendererBase line 85
> >
> > maybe this is a bug in myfaces. i changed the cast
> >
> > from
> >
> > >> UIForm htmlForm = (HtmlForm)component;
> >
> > to
> >
> > >> UIForm htmlForm = (UIForm)component;
> >
> > *problem 2*
> >
> > SubscribeView line 42 attribut colums for
> > UIPanel must be Integer instead of String.
> > change line 42.
> >
> > from
> >
> > >> grid.getAttributes().put("columns", "2");
> >
> > to
> >
> > >> grid.getAttributes().put("columns", new Integer(2));
> >
> > *problem 3*
> >
> > it produces a mimetype text/xml but i want
> > text/xml. how to force that ?
> >
> > *problem 4*
> >
> > the output has no frameing-tags (html, head, body). must
> > implement and register a Rendering for UIViewRoot ?
> > any better idea ?
> >
> > regards fanny
> >
> >
> > > hi, im quite new in java server faces and
> > > i'm a little bit trapped in what i call the
> > > panelgrid-layout-problem. because my project
> > > can not and does not use jsp, i have to build
> > > my form-layout programmatically. but how can i
> > > get a proper layout with a colspan then ?
> > >
> > > i think one thing, that could be very helpful
> > > for me, would be a specialized PanelGrid that can be
> > > build by a PanelGridBuilder parameterized
> > > by a layout.
> > >
> > > similar to what the forms-libary by karsten
> > > letzsch (www.jgoodies.com) does for swing-panels.
> > > but simpler, cut back to the possibilities of a
> > > html-<table>-layout.
> > >
> > > here an example:
> > >
> > > FormLayout layout = new FormLayout(...);
> > >
> > > DefaultFormBuilder builder = new DefaultFormBuilder(layout);
> > > builder.setDefaultDialogBorder();
> > > builder.appendSeparator("Segment");
> > > builder.append("Identifier", idField, 2); //spans 2 main-columns
> > > builder.nextLine();
> > > builder.append("PTI [kW]", ptiField);
> > > builder.append("Power [kW]", powerField);
> > > builder.append("len [mm]", lenField);
> > > builder.nextLine();
> > > builder.appendSeparator("Diameters");
> > > builder.append("da [mm]", daField);
> > > builder.append("di [mm]", diField);
> > > builder.append("da2 [mm]", da2Field);
> > >
> > > ExtendedPanelGrid panelGrid = builder.getPanelGrid();
> > >
> > >
> > > how about that kind of thing ? any other
> > > sugestions ?
> > >
> > > regards fanny
> > >
> > > --
> > > Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
> > > GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
> > >
> >
> > --
> > SMS bei wichtigen e-mails und Ihre Gedanken sind frei ...
> > Alle Infos zur SMS-Benachrichtigung: http://www.gmx.net/de/go/sms
> >
> 


-- 
-Heath Borders-Wing
hborders@mail.win.org

Re: Layouting with PanelGrid

Posted by Martin Marinschek <ma...@gmail.com>.
Have you looked at the component-binding feature?

with binding="#{xbackingBean.ycomponent}"

you can deliver a programmatically defined grid to your jsp - a small
jsp wrapper around it, and the thing is done...

For things like colspan you will need to extend the current grid and
write a custom component/renderer, as it does not have this ability
right now.

regards,

Martin


On Wed, 9 Mar 2005 06:59:31 +0100 (MET), Fanny Aenvie
<Fa...@gmx.de> wrote:
> stupid idea or poor description of what i want ?
> 
> see at hans bergstens jsf-book and his article
> "Improving JSF by Dumping JSP". in the book there
> are examples of using jsf without jsp. my idea is
> based on this but goes a step further.
> 
> we have a running impementation of this
> using RI but want to change to myfaces.
> 
> i wanted to check it out a little bit first.
> so i have run the newsservice-example from
> the jsf-book with myfaces. it uses a custom ViewHandler
> (ClassViewHandler) and a View called SubscribeView.
> this is really a nice proof of myfaces because
> good jsf-implementations are not jsp- or html-
> centistic.
> 
> i had to make changes to get it to run with myfaces
> (cvs 08.03.2005).
> 
> *problem 1*
> 
> ClassCastException in class HtmlFormRendererBase line 85
> 
> maybe this is a bug in myfaces. i changed the cast
> 
> from
> 
> >> UIForm htmlForm = (HtmlForm)component;
> 
> to
> 
> >> UIForm htmlForm = (UIForm)component;
> 
> *problem 2*
> 
> SubscribeView line 42 attribut colums for
> UIPanel must be Integer instead of String.
> change line 42.
> 
> from
> 
> >> grid.getAttributes().put("columns", "2");
> 
> to
> 
> >> grid.getAttributes().put("columns", new Integer(2));
> 
> *problem 3*
> 
> it produces a mimetype text/xml but i want
> text/xml. how to force that ?
> 
> *problem 4*
> 
> the output has no frameing-tags (html, head, body). must
> implement and register a Rendering for UIViewRoot ?
> any better idea ?
> 
> regards fanny
> 
> 
> > hi, im quite new in java server faces and
> > i'm a little bit trapped in what i call the
> > panelgrid-layout-problem. because my project
> > can not and does not use jsp, i have to build
> > my form-layout programmatically. but how can i
> > get a proper layout with a colspan then ?
> >
> > i think one thing, that could be very helpful
> > for me, would be a specialized PanelGrid that can be
> > build by a PanelGridBuilder parameterized
> > by a layout.
> >
> > similar to what the forms-libary by karsten
> > letzsch (www.jgoodies.com) does for swing-panels.
> > but simpler, cut back to the possibilities of a
> > html-<table>-layout.
> >
> > here an example:
> >
> > FormLayout layout = new FormLayout(...);
> >
> > DefaultFormBuilder builder = new DefaultFormBuilder(layout);
> > builder.setDefaultDialogBorder();
> > builder.appendSeparator("Segment");
> > builder.append("Identifier", idField, 2); //spans 2 main-columns
> > builder.nextLine();
> > builder.append("PTI [kW]", ptiField);
> > builder.append("Power [kW]", powerField);
> > builder.append("len [mm]", lenField);
> > builder.nextLine();
> > builder.appendSeparator("Diameters");
> > builder.append("da [mm]", daField);
> > builder.append("di [mm]", diField);
> > builder.append("da2 [mm]", da2Field);
> >
> > ExtendedPanelGrid panelGrid = builder.getPanelGrid();
> >
> >
> > how about that kind of thing ? any other
> > sugestions ?
> >
> > regards fanny
> >
> > --
> > Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
> > GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
> >
> 
> --
> SMS bei wichtigen e-mails und Ihre Gedanken sind frei ...
> Alle Infos zur SMS-Benachrichtigung: http://www.gmx.net/de/go/sms
>

Re: Layouting with PanelGrid

Posted by Fanny Aenvie <Fa...@gmx.de>.
stupid idea or poor description of what i want ?

see at hans bergstens jsf-book and his article
"Improving JSF by Dumping JSP". in the book there 
are examples of using jsf without jsp. my idea is
based on this but goes a step further.

we have a running impementation of this 
using RI but want to change to myfaces. 

i wanted to check it out a little bit first. 
so i have run the newsservice-example from
the jsf-book with myfaces. it uses a custom ViewHandler 
(ClassViewHandler) and a View called SubscribeView.
this is really a nice proof of myfaces because 
good jsf-implementations are not jsp- or html-
centistic. 

i had to make changes to get it to run with myfaces 
(cvs 08.03.2005).

*problem 1*

ClassCastException in class HtmlFormRendererBase line 85  

maybe this is a bug in myfaces. i changed the cast

from

>> UIForm htmlForm = (HtmlForm)component;

to

>> UIForm htmlForm = (UIForm)component;

*problem 2*

SubscribeView line 42 attribut colums for
UIPanel must be Integer instead of String.
change line 42.

from

>> grid.getAttributes().put("columns", "2");

to

>> grid.getAttributes().put("columns", new Integer(2));

*problem 3*

it produces a mimetype text/xml but i want
text/xml. how to force that ?

*problem 4*

the output has no frameing-tags (html, head, body). must
implement and register a Rendering for UIViewRoot ?
any better idea ?

regards fanny


> hi, im quite new in java server faces and
> i'm a little bit trapped in what i call the
> panelgrid-layout-problem. because my project 
> can not and does not use jsp, i have to build 
> my form-layout programmatically. but how can i 
> get a proper layout with a colspan then ?
> 
> i think one thing, that could be very helpful
> for me, would be a specialized PanelGrid that can be
> build by a PanelGridBuilder parameterized  
> by a layout.
>  
> similar to what the forms-libary by karsten
> letzsch (www.jgoodies.com) does for swing-panels.
> but simpler, cut back to the possibilities of a
> html-<table>-layout.
> 
> here an example:
> 
> FormLayout layout = new FormLayout(...);
> 
> DefaultFormBuilder builder = new DefaultFormBuilder(layout);
> builder.setDefaultDialogBorder();
> builder.appendSeparator(“Segment”);
> builder.append(“Identifier”, idField, 2); //spans 2 main-columns
> builder.nextLine();
> builder.append(“PTI [kW]”, ptiField);
> builder.append(“Power [kW]”, powerField);
> builder.append(“len [mm]”, lenField);
> builder.nextLine();
> builder.appendSeparator(“Diameters”);
> builder.append(“da [mm]”, daField);
> builder.append(“di [mm]”, diField);
> builder.append(“da2 [mm]”, da2Field);
> 
> ExtendedPanelGrid panelGrid = builder.getPanelGrid();
> 
> 
> how about that kind of thing ? any other
> sugestions ?
> 
> regards fanny
> 
> -- 
> Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
> GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
> 

-- 
SMS bei wichtigen e-mails und Ihre Gedanken sind frei ...
Alle Infos zur SMS-Benachrichtigung: http://www.gmx.net/de/go/sms