Help in using bean:define
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sharma_Vedula
Posted On:   Wednesday, January 8, 2003 06:45 AM

I am trying to use bean:define to define a scripting variable to be used later in the page. I need some help. I need to use the property (isReadOnly) from another bean (createContractForm). Here is my code using bean:define: name="createContractForm" property="isReadOnly" /> Then I use the scripting variable (readOnly) later in the page: property="currentForm.contractVersionDesc" size="40" maxlength="200" disabled=" <%= readOnly %>"/> I get an error message saying: setDisabled(boolean) in org.apache.struts.taglib.html.BaseHandlerTag cannot be applied to   More>>

I am trying to use bean:define to define a scripting variable to be used later in the page. I need some help.

I need to use the property (isReadOnly) from another bean (createContractForm). Here is my code using bean:define:


name="createContractForm"
property="isReadOnly" />


Then I use the scripting variable (readOnly) later in the page:


property="currentForm.contractVersionDesc"
size="40"
maxlength="200"
disabled=" <%= readOnly %>"/>


I get an error message saying:

setDisabled(boolean) in org.apache.struts.taglib.html.BaseHandlerTag cannot be applied to (java.lang.Object)
probably occurred due to an error in /contract/contractDetailsContent.jsp line 87:
disabled=" <%= readOnly %>"/> 



Can someone help me and point me in the right direction?

Thanks

Sharma

   <<Less

Re: Help in using bean:define

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, January 8, 2003 08:11 AM

I think if you use a scriptlet, then you are not using the "bean" you have "defined".



That is, when you say "<%= readOnly %>" you are asking for the value of a local variable named "readOnly".



But I think (?) though that your "bean:define" places a new attribute in the default scope. So to access it you'd have to do a "" for the "readOnly" attribute bean. You could do this if you just wanted to write out the current value, into the jsp's HTML output stream.



But, then your problem would be that you can't nest a "bean:write" tag, as the value of an attribute, nested inside an "html:text" tag, because they are not evaluated in the order necessary for that to work.

About | Sitemap | Contact