You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Eduardo Leite <ed...@quickmind.com.br> on 2005/09/27 18:30:57 UTC
t:commandLink disableOnUserRole
Guys,
just to know if I'm not reinventing the wheel...
I need a property to tell a commandLink component when it needs to print
the <a href=""> tag or not. I know that enableOnUserRole does this, but
it is tied to the J2EE security model.
I need something simpler, just like the disabled property for the
commandButton component. Is there anything like this implemented
anywhere on MyFaces?
Thanks in advance,
________________________________________
Eduardo Bastos Leite
Analista de Sistemas
QuickMind Tecnologia em Conhecimento
http://www.quickmind.com.br <http://www.quickmind.com.br/>
Tel.: +55 21 2524-2956 Ext. 215
Cel.: +55 21 9953-2223
Re: t:commandLink disableOnUserRole
Posted by Mike Kienenberger <mk...@gmail.com>.
In that case, you can always use the following pattern, even without
displayValueOnly.
<h:panelGroup>
<h:outputText rendered="if disabled" ...>
<h:commandLink rendered="if not disabled" ...>
</h:panelGroup>
On 9/27/05, Martin Marinschek <ma...@gmail.com> wrote:
> I think Eduardo still wants to render the value.
>
> There has been a discussion about using the displayValueOnly attribute
> for providing this behavior - but I am not quite sure if this is a
> good idea, as the displayValueOnly attribute is inherited from a panel
> to its children and if the displayValueOnly attribute is set on the
> parent, no link will be rendered as a link anymore...
>
> regards,
>
> Martin
>
> On 9/27/05, Mike Kienenberger <mk...@gmail.com> wrote:
> > Why not just use the "rendered" attribute? You can bind it to any
> > boolean EL expression.
> > Just make sure that your expression still evaulates the same on the
> > next page request (ie, don't bind it to request-scoped data unless
> > you're using x:saveState on it).
> >
> > On 9/27/05, Eduardo Leite <ed...@quickmind.com.br> wrote:
> > >
> > > Guys,
> > >
> > > just to know if I'm not reinventing the wheel...
> > >
> > > I need a property to tell a commandLink component when it needs to print the
> > > <a href=""> tag or not. I know that enableOnUserRole does this, but it is
> > > tied to the J2EE security model.
> > > I need something simpler, just like the disabled property for the
> > > commandButton component. Is there anything like this implemented anywhere on
> > > MyFaces?
> > >
> > > Thanks in advance,
> > >
> > > ________________________________________
> > > Eduardo Bastos Leite
> > > Analista de Sistemas
> > > QuickMind Tecnologia em Conhecimento
> > > http://www.quickmind.com.br
> > > Tel.: +55 21 2524-2956 Ext. 215
> > > Cel.: +55 21 9953-2223
> > >
> >
>
>
> --
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
>
Re: t:commandLink disableOnUserRole
Posted by Martin Marinschek <ma...@gmail.com>.
I think Eduardo still wants to render the value.
There has been a discussion about using the displayValueOnly attribute
for providing this behavior - but I am not quite sure if this is a
good idea, as the displayValueOnly attribute is inherited from a panel
to its children and if the displayValueOnly attribute is set on the
parent, no link will be rendered as a link anymore...
regards,
Martin
On 9/27/05, Mike Kienenberger <mk...@gmail.com> wrote:
> Why not just use the "rendered" attribute? You can bind it to any
> boolean EL expression.
> Just make sure that your expression still evaulates the same on the
> next page request (ie, don't bind it to request-scoped data unless
> you're using x:saveState on it).
>
> On 9/27/05, Eduardo Leite <ed...@quickmind.com.br> wrote:
> >
> > Guys,
> >
> > just to know if I'm not reinventing the wheel...
> >
> > I need a property to tell a commandLink component when it needs to print the
> > <a href=""> tag or not. I know that enableOnUserRole does this, but it is
> > tied to the J2EE security model.
> > I need something simpler, just like the disabled property for the
> > commandButton component. Is there anything like this implemented anywhere on
> > MyFaces?
> >
> > Thanks in advance,
> >
> > ________________________________________
> > Eduardo Bastos Leite
> > Analista de Sistemas
> > QuickMind Tecnologia em Conhecimento
> > http://www.quickmind.com.br
> > Tel.: +55 21 2524-2956 Ext. 215
> > Cel.: +55 21 9953-2223
> >
>
--
http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German
Re: t:commandLink disableOnUserRole
Posted by Mike Kienenberger <mk...@gmail.com>.
Why not just use the "rendered" attribute? You can bind it to any
boolean EL expression.
Just make sure that your expression still evaulates the same on the
next page request (ie, don't bind it to request-scoped data unless
you're using x:saveState on it).
On 9/27/05, Eduardo Leite <ed...@quickmind.com.br> wrote:
>
> Guys,
>
> just to know if I'm not reinventing the wheel...
>
> I need a property to tell a commandLink component when it needs to print the
> <a href=""> tag or not. I know that enableOnUserRole does this, but it is
> tied to the J2EE security model.
> I need something simpler, just like the disabled property for the
> commandButton component. Is there anything like this implemented anywhere on
> MyFaces?
>
> Thanks in advance,
>
> ________________________________________
> Eduardo Bastos Leite
> Analista de Sistemas
> QuickMind Tecnologia em Conhecimento
> http://www.quickmind.com.br
> Tel.: +55 21 2524-2956 Ext. 215
> Cel.: +55 21 9953-2223
>
Re: t:commandLink disableOnUserRole
Posted by Ken <ke...@fgood.org>.
Set up your own user role managed bean. Give it a boolean property and tie
it to the rendered attribute of the commandLink.
On 9/27/05, Eduardo Leite <ed...@quickmind.com.br> wrote:
>
> Guys,
> just to know if I'm not reinventing the wheel...
> I need a property to tell a commandLink component when it needs to print
> the <a href=""> tag or not. I know that enableOnUserRole does this, but it
> is tied to the J2EE security model.
> I need something simpler, just like the disabled property for the
> commandButton component. Is there anything like this implemented anywhere on
> MyFaces?
> Thanks in advance,
> ________________________________________
> Eduardo Bastos Leite
> Analista de Sistemas
> QuickMind Tecnologia em Conhecimento
> http://www.quickmind.com.br
> Tel.: +55 21 2524-2956 Ext. 215
> Cel.: +55 21 9953-2223
>