myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Volker Weber <users.myfa...@weber-oldenburg.de>
Subject Re: IF statement..?
Date Fri, 21 Oct 2005 13:40:33 GMT
Ok, that may be the reason that he didn't found an exception in his logs.

but does #{UserController.user.isPQE} works? i think not, but never tested.

Martin Marinschek wrote:
> Try using
> 
> #{
> 
> instead of
> 
> {#
> 
> ;)
> 
> regards,
> 
> Martin
> 
> On 10/21/05, Volker Weber <users.myfaces@weber-oldenburg.de> wrote:
> 
>>Try rendered="{#UserController.user.PQE}"  the 'is' is added by beanutils.
>>
>>
>>
>>Jeffrey Porter wrote:
>>
>>>What am I missing here?
>>>
>>>
>>>
>>><h:outputLabel rendered="{#UserController.user.isPQE}"
>>>for="finalLiability" value="#{my_properties['NCM_label_finalLiability']}" />
>>>
>>>
>>>
>>>&&
>>>
>>>
>>>
>>><h:selectOneRadio
>>>
>>>      rendered="{#UserController.user.isPQE}"
>>>
>>>      required="true"
>>>
>>>      disabledClass="bodyheading"
>>>
>>>      enabledClass="bodyheading"
>>>
>>>      id="finalLiability"
>>>
>>>      value="#{nonConformingMaterial.finalLiability}"
>>>
>>>      immediate="true"
>>>
>>>      layout="lineDirection"
>>>
>>>      styleClass="selectOneRadio">
>>>
>>>
>>>
>>>      <f:selectItem itemValue="0"
>>>itemLabel="#{ebusiness_properties['NCM_label_finalLiability_0']}" />
>>>
>>><f:selectItem itemValue="1"
>>>itemLabel="#{ebusiness_properties['NCM_label_finalLiability_1']}"  />
>>>
>>></h:selectOneRadio>
>>>
>>>
>>>
>>>
>>>
>>>Code…
>>>
>>>
>>>
>>>public class User implements Serializable
>>>
>>>{
>>>
>>>            ………REMOVED OTHER CODE………….
>>>
>>>
>>>
>>>    public boolean isPQE()
>>>
>>>    {
>>>
>>>        boolean x = Arrays.asList(roles).contains(User.PQE_ROLE);
>>>
>>>        return x;
>>>
>>>    }
>>>
>>>}
>>>
>>>
>>>
>>>When ever I debug I never hit the method isPQE(). Also neither of the
>>>above JSF tags get rendered, no matter what  is returned by the method.
>>>
>>>
>>>
>>>I can get other values from the user bean.
>>>
>>>
>>>
>>>e.g. this works…
>>>
>>><h:outputText value="#{UserController.user.firstName}" />
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>-----Original Message-----
>>>*From:* gramani@intellicare.com [mailto:gramani@intellicare.com]
>>>*Sent:* 20 October 2005 18:54
>>>*To:* MyFaces Discussion
>>>*Subject:* Re: IF statement..?
>>>
>>>
>>>
>>>
>>>gramani@intellicare.com wrote on 10/20/2005 01:50:37 PM:
>>>
>>>
>>>>"Jeffrey Porter" <PORTER_J@WMGMAIL.wmg.warwick.ac.uk> wrote on
>>>>10/20/2005 01:45:04 PM:
>>>>
>>>>
>>>>>
>>>>>Does MyFaces contain an IF statement?
>>>>>
>>>>>Something like…
>>>>>
>>>>><x:if user.admin == true >
>>>>><h:outputLabel value="ADMIN" />
>>>>><x:else >
>>>>><h:outputLabel value="NOT ADMIN" />
>>>>></x>
>>>>>
>>>>>
>>>>>I would put my IF statement in JSP.
>>>>>But this doesn't seem to work.
>>>>>
>>>>>For example
>>>>>
>>>>><%=user.admin%>
>>>>>
>>>>You should I think be able to use the "rendered" attribute within
>>>><h:outputLabel..? As in:
>>>><h:outputLabel value="ADMIN" rendered="user.admin" />
>>>>
>>>umm,.. sorry.. I meant: rendered="#{user.admin}"
>>>
>>>
>>>>Geeta
>>>
>>--
>>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 Trainings in English and German

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

Mime
View raw message