Doesn't that break the java bean conventions?


Nebinger, David wrote:
> 
> Have you tried using disabled="#{flowScope.delete.booleanValue}"?
> 
>> -----Original Message-----
>> From: Toppac [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, November 28, 2006 4:45 PM
>> To: [email protected]
>> Subject: RE: Disabled with value binding expression
>> 
>> 
>> 
>> I wanted to add onto this to see if anyone could provide 
>> further insight. I
>> am using a custom variable resolver to access some session 
>> scoped variables.
>> I know the value is there because I can print it out. 
>> However, whenever I
>> try to reference the value in the disabled attribute of an 
>> input element,
>> the value is ignored. The value in the session scope is a 
>> Boolean (object).
>> I noticed that the attribute takes a boolean (primitive) on 
>> the getter and
>> setter methods. I am wondering if for some reason my Boolean 
>> is not being
>> translated correctly. When I just put the string "true" it 
>> works fine. But
>> using something like
>> 
>> disabled="#{flowScope.delete}"
>> 
>> does not work, where deleted is a Boolean. Printing out 
>> flowScope.delete
>> using regular EL or an outputText tag works fine.
>> 
>> I am using MyFaces 1.1.4, latest Facelets, Webflow 1.0. If 
>> anyone has any
>> ideas I would love to hear them. Thanks.
>> 
>> 
>> 
>> 
>> Toppac wrote:
>> > 
>> > Thanks for the replies guys. I am using spring webflow also 
>> and had the
>> > value scoped to a flowScope variable. I am being told that 
>> won't work so
>> > it looks like I'll need to translate my flowscoped variable 
>> to a request
>> > scoped one for the disabled attribute to pick up.
>> > 
>> > 
>> > 
>> > Tom Innes wrote:
>> >> 
>> >> See
>> >> 
>> >>  
>> >> 
>> >> http://wiki.java.net/bin/view/Projects/FaceletsFAQ
>> >> 
>> >>  
>> >> 
>> >> c:set, c:if are build time tags
>> >> 
>> >>  
>> >> 
>> >> I use Facelets as well and the following works for me
>> >> 
>> >>  
>> >> 
>> >> <h:inputText disabled="#{mybackingBean.disabled}" />
>> >> 
>> >>  
>> >> 
>> >> and my backing bean method is defined as 
>> >> 
>> >>  
>> >> 
>> >> public boolean getDisabled() {
>> >> 
>> >>             return this.disabled; 
>> >> 
>> >> }
>> >> 
>> >>  
>> >> 
>> >>  
>> >> 
>> >> Tom
>> >> 
>> >>  
>> >> 
>> >> -----Original Message-----
>> >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On 
>> Behalf Of Craig
>> >> McClanahan
>> >> Sent: Tuesday, October 31, 2006 2:45 PM
>> >> To: MyFaces Discussion
>> >> Subject: Re: Disabled with value binding expression
>> >> 
>> >>  
>> >> 
>> >>  
>> >> 
>> >> On 10/31/06, Toppac <[EMAIL PROTECTED]> wrote:
>> >> 
>> >> 
>> >> I am using Facelets with MyFaces, which allows jstl page 
>> scoped variables
>> >> to
>> >> work. Correct me if I am wrong.
>> >> 
>> >> 
>> >> Sounds like a question for the Facelets list ... but I 
>> sure wonder how
>> >> Facelets makes this happen during the Apply Request Values 
>> through Invoke
>> >> Application phases of the request processing lifecycle, 
>> when there is no
>> >> page scope because there is no page. 
>> >> 
>> >>  
>> >> 
>> >> Also another thing I tried is writing a customer taglib 
>> function that
>> >> will
>> >> parse my backing bean value and return the string true or false,
>> >> depending
>> >> on whether the calling field should be disabled. This seems to work
>> >> pretty
>> >> well the first time through, but on subsequent visits to 
>> the same page, I 
>> >> don't see the function being called again. It is only 
>> called the first
>> >> time
>> >> the page is rendered. Shouldn't the function be evaluated 
>> every time the
>> >> page is rendered?
>> >> 
>> >> 
>> >> Do you know for a fact that logonBean actually exists on 
>> the subsequent
>> >> renderings?  If it does not (as someone else in this 
>> thread pointed out),
>> >> your expression will evaluate to false with no errors or 
>> exceptions. 
>> >> 
>> >> Craig 
>> >> 
>> >>  
>> >> 
>> >>  
>> >> 
>> >>  
>> >> 
>> >> Craig McClanahan-3 wrote:
>> >>>
>> >>> On 10/31/06, Toppac < [EMAIL PROTECTED]> wrote:
>> >>>>
>> >>>>
>> >>>> Also I am using
>> >>>>
>> >>>> <c:set var="disabled" value="false" scope="page"/> 
>> >>>
>> >>>
>> >>> This is not going to work.  JSF expressions do not have 
>> access to "page"
>> >>> scope in a JSP page.  You'll need to us something in request scope
>> >>> instead.
>> >>>
>> >>> Craig 
>> >>>
>> >>> I typed the wrong thing from memory earlier
>> >>>>
>> >>>>
>> >>>>
>> >>>> Toppac wrote:
>> >>>> >
>> >>>> > I print out the value to the screen to make sure it is 
>> not empty. It 
>> >>>> > evaluates to true when I would expect it to and to 
>> false at other
>> >>>> times.
>> >>>> > But even when it is true it does not affect the 
>> inputText boxes. I
>> >>>> also
>> >>>> > use jstl tags throughout the page, so I am pretty sure 
>> the c taglib
>> >>>> is 
>> >>>> > defined.
>> >>>> >
>> >>>> >
>> >>>> >
>> >>>> > Dennis Byrne wrote:
>> >>>> >>
>> >>>> >>>I am trying to use the disabled attribute on some 
>> inputText boxes in 
>> >>>> my
>> >>>> >>>application. However, everytime I try to use a 
>> binding like this
>> >>>> >>><h:inputText disabled="#{mybackingBean.disabled}" />
>> >>>> >>
>> >>>> >> In both JSP and JSF,
>> >>>> >> 
>> #{backingBeanThatDoesNotExist.propertyThatDoesNotExist} will not
>> >>>> throw
>> >>>> an
>> >>>> >> exception; it will default to 'false'.  Whenever I 
>> find myself in
>> >>>> your
>> >> 
>> >>>> >> situation I double check expression path.
>> >>>> >>
>> >>>> >>>nothing happens. disabled is a Boolean field in the 
>> backing bean. I
>> >>>> assume
>> >>>> >>>it would auto translate to a string, but it doesnt 
>> appear to. I then 
>> >>>> tried
>> >>>> >>>using JSTl to set a value a page scoped variable
>> >>>> >>><c:set name="disabled" value="true"/>
>> >>>> >>>This does not work either when I change my input box to this 
>> >>>> >>><h:inputText disabled="#{disabled}"/>
>> >>>> >>
>> >>>> >> Perhaps you have not included the c taglib header in 
>> the JSP file?
>> >>>> The
>> >>>> >> page will silently skip the c:set tag in this case. 
>> >>>> >>
>> >>>> >> Dennis Byrne
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >>
>> >>>> >
>> >>>> >
>> >>>>
>> >>>> --
>> >>>> View this message in context: 
>> >>>>
>> >> 
>> http://www.nabble.com/Disabled-with-value-binding-expression-t
> f2546998.html#
>>> a7098480
>>>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>> 
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Disabled-with-value-binding-expression-tf2546998.html#
>>> a7100471
>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>> 
>>>  
>>> 
>>> 
>>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Disabled-with-value-binding-expression-tf2546998.html#a7588483
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Disabled-with-value-binding-expression-tf2546998.html#a7588581
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to