You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Matt Raible <ma...@sourcebeat.com> on 2004/12/03 20:00:35 UTC
Setting a default styleClass for a component
Is it possible to set a default styleClass for a component? All my
<h:message> tags are going to use the "fieldError" styleClass. Is there
a way to specify this in faces-config.xml, so I don't have to type it
every time?
<h:message for="confirmPassword" styleClass="fieldError"/>
Thanks,
Matt
Re: Setting a default styleClass for a component
Posted by Bill Dudney <bd...@mac.com>.
Hi Matt,
I don't know of a way to do what you suggest.
TTFN,
-bd-
On Dec 3, 2004, at 12:00 PM, Matt Raible wrote:
> Is it possible to set a default styleClass for a component? All my
> <h:message> tags are going to use the "fieldError" styleClass. Is
> there a way to specify this in faces-config.xml, so I don't have to
> type it every time?
>
> <h:message for="confirmPassword" styleClass="fieldError"/>
>
> Thanks,
>
> Matt
>
RE: Setting a default styleClass for a component
Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
MArtin,
I guess that could be a good sample on MyFaces-Homepage?
I will catch it and bring into Forrest-stuff.
Regards,
Matthias
> -----Original Message-----
> From: Martin Marinschek [mailto:martin.marinschek@gmail.com]
> Sent: Tuesday, December 07, 2004 9:43 PM
> To: MyFaces Discussion; hborders@mail.win.org
> Subject: Re: Setting a default styleClass for a component
>
>
> yes you can! the binding is a binding to a method that needs
> to return a component of the proper type, you can return a
> new component whenever this method is called.
>
> if you need that, I will go grab some sample code...
>
> regards,
>
> Martin
>
>
> On Tue, 7 Dec 2004 14:36:34 -0600, Heath Borders
> <he...@gmail.com> wrote:
> > But this won't work when you have multiple components of
> the same type
> > (let's say 3 inputText's), that all need a default styleClass. You
> > can't have all 3 inputText tags bind to the same component, right?
> >
> > On Tue, 7 Dec 2004 21:06:37 +0100, Martin Marinschek
> >
> >
> > <ma...@gmail.com> wrote:
> > > Hmmm... What I know that Manfred is doing in such a case
> (especially
> > > if there are many such parameters), is using a component
> binding -
> > > then he initializes the component in source-code, and
> only has to do
> > > that once. He widely uses this approach with data-tables,
> there is
> > > a lot to initialize there.
> > >
> > > regards,
> > >
> > > Martin
> > >
> > > On Mon, 6 Dec 2004 18:15:17 -0600, Heath Borders
> > >
> > >
> > > <he...@gmail.com> wrote:
> > > > Unfortunately, no there is not. We were hoping we could just
> > > > override the TLD definitions to provide defaults, but
> that doesn't
> > > > end up working.
> > > >
> > > > The next best solution might be to override the
> createComponent()
> > > > method of Application to do your defaulting (and back
> it with an
> > > > xml file).
> > > >
> > > >
> > > >
> > > >
> > > > On Fri, 03 Dec 2004 12:00:35 -0700, Matt Raible
> > > > <ma...@sourcebeat.com> wrote:
> > > > > Is it possible to set a default styleClass for a
> component? All
> > > > > my <h:message> tags are going to use the "fieldError"
> > > > > styleClass. Is there a way to specify this in
> faces-config.xml,
> > > > > so I don't have to type it every time?
> > > > >
> > > > > <h:message for="confirmPassword" styleClass="fieldError"/>
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Matt
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > If you don't have a GMail account, I probably have 5 invites.
> > > > Just ask! -Heath Borders-Wing hborders@mail.win.org
> > > >
> > >
> >
> >
> > --
> >
> >
> > If you don't have a GMail account, I probably have 5 invites. Just
> > ask! -Heath Borders-Wing hborders@mail.win.org
> >
>
Re: Setting a default styleClass for a component
Posted by Martin Marinschek <ma...@gmail.com>.
yes you can! the binding is a binding to a method that needs to return
a component of the proper type, you can return a new component
whenever this method is called.
if you need that, I will go grab some sample code...
regards,
Martin
On Tue, 7 Dec 2004 14:36:34 -0600, Heath Borders
<he...@gmail.com> wrote:
> But this won't work when you have multiple components of the same type
> (let's say 3 inputText's), that all need a default styleClass. You
> can't have all 3 inputText tags bind to the same component, right?
>
> On Tue, 7 Dec 2004 21:06:37 +0100, Martin Marinschek
>
>
> <ma...@gmail.com> wrote:
> > Hmmm... What I know that Manfred is doing in such a case (especially
> > if there are many such parameters), is using a component binding -
> > then he initializes the component in source-code, and only has to do
> > that once. He widely uses this approach with data-tables, there is a
> > lot to initialize there.
> >
> > regards,
> >
> > Martin
> >
> > On Mon, 6 Dec 2004 18:15:17 -0600, Heath Borders
> >
> >
> > <he...@gmail.com> wrote:
> > > Unfortunately, no there is not. We were hoping we could just override
> > > the TLD definitions to provide defaults, but that doesn't end up
> > > working.
> > >
> > > The next best solution might be to override the createComponent()
> > > method of Application to do your defaulting (and back it with an xml
> > > file).
> > >
> > >
> > >
> > >
> > > On Fri, 03 Dec 2004 12:00:35 -0700, Matt Raible <ma...@sourcebeat.com> wrote:
> > > > Is it possible to set a default styleClass for a component? All my
> > > > <h:message> tags are going to use the "fieldError" styleClass. Is there
> > > > a way to specify this in faces-config.xml, so I don't have to type it
> > > > every time?
> > > >
> > > > <h:message for="confirmPassword" styleClass="fieldError"/>
> > > >
> > > > Thanks,
> > > >
> > > > Matt
> > > >
> > > >
> > >
> > >
> > > --
> > > If you don't have a GMail account, I probably have 5 invites. Just ask!
> > > -Heath Borders-Wing
> > > hborders@mail.win.org
> > >
> >
>
>
> --
>
>
> If you don't have a GMail account, I probably have 5 invites. Just ask!
> -Heath Borders-Wing
> hborders@mail.win.org
>
Re: Setting a default styleClass for a component
Posted by Heath Borders <he...@gmail.com>.
But this won't work when you have multiple components of the same type
(let's say 3 inputText's), that all need a default styleClass. You
can't have all 3 inputText tags bind to the same component, right?
On Tue, 7 Dec 2004 21:06:37 +0100, Martin Marinschek
<ma...@gmail.com> wrote:
> Hmmm... What I know that Manfred is doing in such a case (especially
> if there are many such parameters), is using a component binding -
> then he initializes the component in source-code, and only has to do
> that once. He widely uses this approach with data-tables, there is a
> lot to initialize there.
>
> regards,
>
> Martin
>
> On Mon, 6 Dec 2004 18:15:17 -0600, Heath Borders
>
>
> <he...@gmail.com> wrote:
> > Unfortunately, no there is not. We were hoping we could just override
> > the TLD definitions to provide defaults, but that doesn't end up
> > working.
> >
> > The next best solution might be to override the createComponent()
> > method of Application to do your defaulting (and back it with an xml
> > file).
> >
> >
> >
> >
> > On Fri, 03 Dec 2004 12:00:35 -0700, Matt Raible <ma...@sourcebeat.com> wrote:
> > > Is it possible to set a default styleClass for a component? All my
> > > <h:message> tags are going to use the "fieldError" styleClass. Is there
> > > a way to specify this in faces-config.xml, so I don't have to type it
> > > every time?
> > >
> > > <h:message for="confirmPassword" styleClass="fieldError"/>
> > >
> > > Thanks,
> > >
> > > Matt
> > >
> > >
> >
> >
> > --
> > If you don't have a GMail account, I probably have 5 invites. Just ask!
> > -Heath Borders-Wing
> > hborders@mail.win.org
> >
>
--
If you don't have a GMail account, I probably have 5 invites. Just ask!
-Heath Borders-Wing
hborders@mail.win.org
Re: Setting a default styleClass for a component
Posted by Martin Marinschek <ma...@gmail.com>.
Hmmm... What I know that Manfred is doing in such a case (especially
if there are many such parameters), is using a component binding -
then he initializes the component in source-code, and only has to do
that once. He widely uses this approach with data-tables, there is a
lot to initialize there.
regards,
Martin
On Mon, 6 Dec 2004 18:15:17 -0600, Heath Borders
<he...@gmail.com> wrote:
> Unfortunately, no there is not. We were hoping we could just override
> the TLD definitions to provide defaults, but that doesn't end up
> working.
>
> The next best solution might be to override the createComponent()
> method of Application to do your defaulting (and back it with an xml
> file).
>
>
>
>
> On Fri, 03 Dec 2004 12:00:35 -0700, Matt Raible <ma...@sourcebeat.com> wrote:
> > Is it possible to set a default styleClass for a component? All my
> > <h:message> tags are going to use the "fieldError" styleClass. Is there
> > a way to specify this in faces-config.xml, so I don't have to type it
> > every time?
> >
> > <h:message for="confirmPassword" styleClass="fieldError"/>
> >
> > Thanks,
> >
> > Matt
> >
> >
>
>
> --
> If you don't have a GMail account, I probably have 5 invites. Just ask!
> -Heath Borders-Wing
> hborders@mail.win.org
>
Re: Setting a default styleClass for a component
Posted by Heath Borders <he...@gmail.com>.
Unfortunately, no there is not. We were hoping we could just override
the TLD definitions to provide defaults, but that doesn't end up
working.
The next best solution might be to override the createComponent()
method of Application to do your defaulting (and back it with an xml
file).
On Fri, 03 Dec 2004 12:00:35 -0700, Matt Raible <ma...@sourcebeat.com> wrote:
> Is it possible to set a default styleClass for a component? All my
> <h:message> tags are going to use the "fieldError" styleClass. Is there
> a way to specify this in faces-config.xml, so I don't have to type it
> every time?
>
> <h:message for="confirmPassword" styleClass="fieldError"/>
>
> Thanks,
>
> Matt
>
>
--
If you don't have a GMail account, I probably have 5 invites. Just ask!
-Heath Borders-Wing
hborders@mail.win.org