custom tag: using el inside el

View: New views
3 Messages — Rating Filter:   Alert me  

custom tag: using el inside el

by smilysep :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi all,

iam trying to make a facelets tag which should render a link which style should be depending on a request param. to avoid copy paste code it whould be nice to handle this via a facelets tag. Here is what i want to do in a tag named categoryItem:

<ui:composition>
        <h:outputLink styleClass="#{param['id']==${itemid}?'selected':'unselected'}">
                <f:param name="id" value="${itemid}" />
                <h:outputText value="${itemvalue}" />
        </h:outputLink>
</ui:composition>

the call whould be something like this:
<a:categoryItem itemid="3" itemvalue="LinkValue1"/>

if i run this it says:
javax.servlet.ServletException: Error Parsing: #{param['id']==${itemid}?'selected':'unselected'}

I dont wonder about this error message but does anyone know if it is possible to do something like this?

thanks for guesses

Re: custom tag: using el inside el

by Mike_ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

Have you tried :
#{param['id'] == itemid ? 'selected':'unselected'}
or
#{param['id'] eq itemid ? 'selected':'unselected'}

Micke

2009/5/22 smilysep <seproyal@...>

hi all,

iam trying to make a facelets tag which should render a link which style
should be depending on a request param. to avoid copy paste code it whould
be nice to handle this via a facelets tag. Here is what i want to do in a
tag named categoryItem:

<ui:composition>
       <h:outputLink
styleClass="#{param['id']==${itemid}?'selected':'unselected'}">
               <f:param name="id" value="${itemid}" />
               <h:outputText value="${itemvalue}" />
       </h:outputLink>
</ui:composition>

the call whould be something like this:
<a:categoryItem itemid="3" itemvalue="LinkValue1"/>

if i run this it says:
javax.servlet.ServletException: Error Parsing:
#{param['id']==${itemid}?'selected':'unselected'}

I dont wonder about this error message but does anyone know if it is
possible to do something like this?

thanks for guesses
--
View this message in context: http://www.nabble.com/custom-tag%3A-using-el-inside-el-tp23676678p23676678.html
Sent from the java.net - facelets users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: custom tag: using el inside el

by smilysep :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Mike,

thanks for your guess, it works perfectly with
#{param['id'] == itemid ? 'selected':'unselected'}

sometimes i dont see the wood for the trees

Mike_ wrote:
Hi

Have you tried :
#{param['id'] == itemid ? 'selected':'unselected'}
or
#{param['id'] eq itemid ? 'selected':'unselected'}

Micke

2009/5/22 smilysep <seproyal@gmx.de>

>
> hi all,
>
> iam trying to make a facelets tag which should render a link which style
> should be depending on a request param. to avoid copy paste code it whould
> be nice to handle this via a facelets tag. Here is what i want to do in a
> tag named categoryItem:
>
> <ui:composition>
>        <h:outputLink
> styleClass="#{param['id']==${itemid}?'selected':'unselected'}">
>                <f:param name="id" value="${itemid}" />
>                <h:outputText value="${itemvalue}" />
>        </h:outputLink>
> </ui:composition>
>
> the call whould be something like this:
> <a:categoryItem itemid="3" itemvalue="LinkValue1"/>
>
> if i run this it says:
> javax.servlet.ServletException: Error Parsing:
> #{param['id']==${itemid}?'selected':'unselected'}
>
> I dont wonder about this error message but does anyone know if it is
> possible to do something like this?
>
> thanks for guesses
> --
> View this message in context:
> http://www.nabble.com/custom-tag%3A-using-el-inside-el-tp23676678p23676678.html
> Sent from the java.net - facelets users mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@facelets.dev.java.net
> For additional commands, e-mail: users-help@facelets.dev.java.net
>
>