myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "CONNER, BRENDAN \(SBCSI\)" <bc1...@sbc.com>
Subject RE: IF statement..?
Date Fri, 21 Oct 2005 16:30:22 GMT
Yes, the question I had is: Would the JSP work by specifying
value="#{myBean.uRL}"?

- Brendan

-----Original Message-----
From: stefan.maric@bt.com [mailto:stefan.maric@bt.com] 
Sent: Friday, October 21, 2005 11:24 AM
To: users@myfaces.apache.org
Subject: RE: IF statement..?



In my bean I have
	public void setURL(URL u){
		url = u;
	}
	
	public URL getURL(){
		return url;
	}

And in my jsp I have
<h:outputLink id="url" value="#{myBean.URL}" 	target="_blank" >
	<h:outputText id="urlText" 
		value="#{myBean.URL}" />
</h:outputLink>

Where mYBean is defined in faces-config.xml


Works fine - no problem

Am using MyFaces v1.1.0 deploying war file to JBoss

14:54:49,647 INFO  [Server] Release ID: JBoss [Zion] 4.0.2 (build:
CVSTag=JBoss_4_0_2 date=200505022023) 

Stefan Maric | IT & Professional Services | BT Global Services

E: stefan.maric@bt.com  |  www.bt.com/globalservices 

 

This electronic message contains information from British
Telecommunications plc, which may be privileged 

or confidential.  The information is intended for use only by the
individual(s) or entity named above.  If you 

are not the intended recipient, be aware that any disclosure, copying,
distribution or use of the contents of 

this information is strictly prohibited.  If you have received this
electronic message in error, please notify 

me by telephone or email (to the number or email address above)
immediately.

 

Activity and use of the British Telecommunications plc e-mail system is
monitored to secure its effective 

operation and for other lawful business purposes. Communications using
this system will also be monitored 

and may be recorded to secure effective operation and for other lawful
business purposes.

 

British Telecommunications plc. Registered office:  81 Newgate Street
London EC1A 7AJ   Registered in 

England no:  1800000

-----Original Message-----
From: CONNER, BRENDAN (SBCSI) [mailto:bc1378@sbc.com] 
Sent: Friday, October 21, 2005 5:06 PM
To: MyFaces Discussion
Subject: RE: IF statement..?

Man, that's annoying.  One would think that following the regular rule
of capitalization would work, and that this special case of recognizing
a capitalized first letter would be supported as an additional feature.
It's hard for me to understand why the regular rule of capitalization
would be specifically prohibited, thus forcing everyone to follow a
special case.  Maybe, for example, the first character is a stand-alone
abbreviation for something and not part of a larger acronym, in which it
would make sense to list the variable as mEBA, and the getter as
isMEBA(), and thus the bean reference as #{bean.mEBA}.

Out of curiosity, why would an implementation specifically not work with
#{bean.mE}?  Wouldn't it just always do a toUpperCase() on the first
character to come up with the corresponding method name?

- Brendan

-----Original Message-----
From: Martin Marinschek [mailto:martin.marinschek@gmail.com] 
Sent: Friday, October 21, 2005 10:47 AM
To: MyFaces Discussion
Subject: Re: IF statement..?


it should work with #{bean.ME}

anything else would be a bug.

regards,

Martin

On 10/21/05, CONNER, BRENDAN (SBCSI) <bc1378@sbc.com> wrote:
> So, according to the specification, should it work with either
> #(bean.ME} or #{bean.mE}?  I personally hate special case situations
> built into a spec, but, hey, if it works, ... ;-)
>
> - Brendan
>
> -----Original Message-----
> From: Martin Marinschek [mailto:martin.marinschek@gmail.com]
> Sent: Friday, October 21, 2005 10:16 AM
> To: MyFaces Discussion
> Subject: Re: IF statement..?
>
>
> If this works, we have a bug in our implementation!
>
> no lowercasing should be done if more than one uppercase characters,
> this is in the beans specification.
>
> regards,
>
> Martin
>
> On 10/21/05, Martin Marinschek <martin.marinschek@gmail.com> wrote:
> > @Brendan:
> >
> > you are right in that if you have bean.getMe, you'll need to write
> bean.me.
> >
> > if you have bean.getME though, you will need to write bean.ME - if
> > there is more than one uppercase character already, no lowercasing
is
> > necessary.
> >
> >
> > regards,
> >
> > Martin
> >
> > On 10/21/05, CONNER, BRENDAN (SBCSI) <bc1378@sbc.com> wrote:
> > > Actually, it is allowed, if you reference it correctly.  In your
> case,
> > > it would be:
> > >
> > > #{UserController.user.pQE}
> > >
> > > Normally, if you have a boolean method isXyz() in your bean
MyBean,
> you
> > > can reference it using #{MyBean.xyz}
> > >
> > > - Brendan
> > >
> > > -----Original Message-----
> > > From: Mike Kienenberger [mailto:mkienenb@gmail.com]
> > > Sent: Friday, October 21, 2005 9:48 AM
> > > To: MyFaces Discussion
> > > Subject: Re: IF statement..?
> > >
> > >
> > > Yeah, I think the only thing that works for sure is "public
boolean
> > > getIsPQE()."
> > > "public boolean isPQE" isn't allowed as a managed bean property.
> > >
> > > On 10/21/05, Volker Weber <users.myfaces@weber-oldenburg.de>
wrote:
> > > > 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.
> > > >
> > >
> >
> >
> > --
> >
> > http://www.irian.at
> > Your JSF powerhouse -
> > JSF Trainings in English and German
> >
>
>
> --
>
> http://www.irian.at
> Your JSF powerhouse -
> JSF Trainings in English and German
>


--

http://www.irian.at
Your JSF powerhouse -
JSF Trainings in English and German

Mime
View raw message