struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Puneet Lakhina" <>
Subject Re: setting an an html:text value with another html:text
Date Tue, 14 Nov 2006 18:37:09 GMT
On 11/14/06, Adam K <> wrote:
> Hi all , I am attempting to do the following, and it obviously isn't
> working, but I was hoping someone on the list would point me to something
> that might work instead:
> I have this text field and I want to be able to alternate the readonly
> property from true and false.  I tried to put in the below which is bolded
>                         <html:text name="OrderForm" property="shipTo"
> readonly="WANTTOTOGGLE"  ></html:text>
>                         <html:text name="OrderForm" property="shipTo"
> readonly="<html:text name="OrderForm" property="readonly"></html:text>"
> ></html:text>
> Any thoughts or ideas as to how I could do that in a nice manner would be
> greatly appreciated.
> What is going to happen is that the action is going to toggle the value
> depending on a parameter comming in from the URL.

so supposing your url has something like this

Then you could have in your JSP
<logic:present parameter="editable">
<logic:equal parameter="editable" value="true">
<bean:define id="isReadOnly" scope="page">false</bean:define>
<bean:define id="isReadOnly" scope="page">true</bean:define>
<logic:notPresent parameter="editable">
<bean:define id="isReadOnly" scope="page">true</bean:define>

So now your text box would have

<html:text property="foo" readonly='<%=new

I know this is unclean but just doing bean write instead of the scriptlet
thing didnt work for me. You could probably clean up the logic tags also.
But i havent ever done JSTL so...

thanks in advance for any thoughts or ideas.

Hope it helps

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message