Hi there, 

What I'm trying to do is re-use the same jsp for ADD/UPDATE modes. In
order to do this, certain field attributes will be different depending
on the modes and sometimes even on the user's security credentials or
the 'status' of the customer row.

To this end I need to pass in the form bean whether a particular field
is disabled or not

I've searched the archives to no avail. I'm trying to set the disable=''
attribute on the html:text tag to a value in the form bean I'm passing
in.

eg:

formbean.isCustomerCodeEnabled()

returns a boolean true/false

formbean.getCustomerCode()

is the value of customer code.

I'm trying (hoping) to do something like this:

<html:text property="customerCode" maxlength="8"size="8" 
disable="!CustomerCodeEnabled"  />

I've tried lots of different approaches, all failing. I've also scanned
the examples to no avail.

Latest attempt is:

<bean:define id="customerCodeEnabled"
name="CustomerFormWindowMainTabActionForm"
property="CustomerCodeEnabled"
    type="boolean" value="true"/>

<% boolean customerCodeDisabled=(!customerCodeEnabled); %>
<TD><html:text property="customerCode" maxlength="8"size="8" 
disabled="<%=customerCodeDisabled%>"  /></TD>

Which fails with:

customerCodeEnabled = null; [javac] ^ An error occurred at line: 87 in
the jsp file: /CustomerFormWindowMainTabBody.jsp Generated servlet
error:
[javac]/home/sfg/javadev/jboss-3.2.3/server/default/work/MainEngine/localhost/pimsweb/CustomerFormWindowMainTabBody_jsp.java:175:
 inconvertible types 
[javac] found : java.lang.Object [javac] required: boolean [javac]
customerCodeEnabled = (boolean)
pageContext.findAttribute("customerCodeEnabled"); [javac] ^ [javac] 2
errors '



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to