You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mississippi John Hurt <jo...@gmail.com> on 2006/11/01 21:17:58 UTC

How to make a SELECT list readonly? If set disabled, loses the value when submit.

Help, I can make <html:text> readonly by setting readonly="true" which
works.
<html:select> has no readonly attribute, only a disabled. If I use disabled
attribute, then the value of the select is no longer recognized and my form
validation says its required.  How can I make the <html:select> disabled or
readonly while keeping the values it has passing back to the action when
form is submitted. Thanks.

Re: How to make a SELECT list readonly? If set disabled, loses the value when submit.

Posted by Angelo zerr <an...@gmail.com>.
Hi,
if you see HTML specification at
http://www.w3.org/TR/html401/interact/forms.html#h-17.6, select has not
readonly (just disabled, but you can't use it for submiut value). So
proposition of Rafael, is the same solution that I use. But when you have
several select in your JSP, it begin borring to manage it. So if you want
you can see FormView project at http://formview.sourceforge.net/, which is a
taglib which manage state (READ-ONLY,READ-WRITE,...) in your JSP, to render
your inputs (eg : transform select into input hidden, without coding this
case in your JSP).

Regards Angelo

http://formview.sourceforge.net/

2006/11/1, Rafael Nami <ra...@gmail.com>:
>
> You can choose to maintain the value from this select in a hidden field,
> that will be submitted with your page. I was used to use another approach,
> making the select enabled in the submit, but it was a great meal to
> hackers.
>
> 2006/11/1, Mississippi John Hurt <jo...@gmail.com>:
> >
> > Help, I can make <html:text> readonly by setting readonly="true" which
> > works.
> > <html:select> has no readonly attribute, only a disabled. If I use
> > disabled
> > attribute, then the value of the select is no longer recognized and my
> > form
> > validation says its required.  How can I make the <html:select> disabled
> > or
> > readonly while keeping the values it has passing back to the action when
> > form is submitted. Thanks.
> >
> >
>
>

Re: [s2] Dynamically Parameterize Redirect Result

Posted by Mark Menard <ma...@mjm.net>.
On 11/10/06 6:46 PM, "Don Brown" <do...@gmail.com> wrote:

> I believe that any unknown result parameters are automatically used as
> request parameters for the redirect.  Then, use an ognl expression for
> your param value and provide a getter on your action for the value.

Hi Don,

Do you have an example of using OGNL to provide the param to the redirect?

Thanks,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Dynamically Parameterize Redirect Result

Posted by Don Brown <do...@gmail.com>.
I believe that any unknown result parameters are automatically used as
request parameters for the redirect.  Then, use an ognl expression for
your param value and provide a getter on your action for the value.

Don

On 11/10/06, Mark Menard <ma...@mjm.net> wrote:
> Is there a way to dynamically parameterize a redirect result based on an
> http request parameter that you have used in the action your are redirecting
> from?
>
> In other words I'm doing some work in an action that is based on an ID that
> was passed into it from the HTML form. I need to do some work, then I need
> to go back to a list that is parameterized on that ID. I have a result:
>
> <action name="createPartyRoleType" class="createPartyRoleTypeAction">
>   <result name="input">/ManagePartyRoleTypes.jsp</result>
>   <result name="success"
>           type="redirect-action">managePartyRoleTypes</result>
> </action>
>
> Is there a way to get a parameter that was passed to createPartyRoleType
> into the redirect on success?
>
> Thanks,
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [s2] Dynamically Parameterize Redirect Result

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark,

Mark Menard wrote:
> Is there a way to dynamically parameterize a redirect result based on an
> http request parameter that you have used in the action your are redirecting
> from?

This isn't exactly struts-2 specific, if I'm reading this correctly.

> Is there a way to get a parameter that was passed to createPartyRoleType
> into the redirect on success?

One way to do it is like this, at the end of your action:

 ActionForward next = mapping.findForward("redirect-action");
 return new ActionForward(next.getPath() + "?id=" + id,
                          next.getRedirect());

There is also ActionRedirect, which essentially wraps an existing
ActionForward:

  ActionRedirect next = new ActionRedirect(mapping.findForward("..."));
  next.addParameter("id", id);

  return next;

I personally think that ActionRedirect isn't good enough, and needs a
lot of improvement. I write my own class and submitted it as an
attachment to https://issues.apache.org/struts/browse/STR-2538, but
nobody seemed interested. Everyone is free to use this class if they'd like.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFVRAj9CaO5/Lv0PARArG7AKCMT5MGdFgUqR6WUWD2ptIxTI5odgCeJl5d
VfPtoSuUAzK49IUsAbF4F5k=
=Xoua
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


[s2] Dynamically Parameterize Redirect Result

Posted by Mark Menard <ma...@mjm.net>.
Is there a way to dynamically parameterize a redirect result based on an
http request parameter that you have used in the action your are redirecting
from?

In other words I'm doing some work in an action that is based on an ID that
was passed into it from the HTML form. I need to do some work, then I need
to go back to a list that is parameterized on that ID. I have a result:

<action name="createPartyRoleType" class="createPartyRoleTypeAction">
  <result name="input">/ManagePartyRoleTypes.jsp</result>
  <result name="success"
          type="redirect-action">managePartyRoleTypes</result>
</action>   

Is there a way to get a parameter that was passed to createPartyRoleType
into the redirect on success?

Thanks,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: why Struts 2 ? ,( justified reasons to migrate)

Posted by Ted Husted <hu...@apache.org>.
Five reasons to migrate

1. Your S1 application is ready for its own version 2.

2. Your S1 application is still under development or in the planning stages.

3. You inherited a S1 application that needs work, and you don't
understand how it works.

4. You would like to integrate a few JSF components into your application.

5. The charming quirks of S1 have become downright annoyances, and
your team is ready for an elegant yet familiar solution.


Five reasons *not* to migrate

1. Your S1 application that is stable and simply being maintained
(stay the course).

2. You're afraid S1 won't be maintained (won't happen).

3. You want to move to Ajax (try Java WebParts).

4. You want to move to Java 5 (try Strecks).

5. It's a shiny new toy.

-T.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: why Struts 2 ? ,( justified reasons to migrate)

Posted by Mark Menard <ma...@mjm.net>.
On 11/9/06 2:18 PM, "Levan Dvalishvili" <dv...@verticali.com> wrote:
> 
> Hi All! I have been recently trying to come up with at least top 5
> justifieable reasons , why one should consider migrating from struts 1.3 (or
> even 1.2.X) to struts 2,bascially , what are the gaining points that justify
> migration headache? Not talking about more cutting edge architecture, IOC,
> etc .. from pure fucntionality perperctive, what I will get that I did not
> had in 1.3 if I migrate to 2.0, is it more clear ajax support? Is it more
> faster ? etc ...

Levan,

OK, it's Friday. I waited on this one.

Personally, working in a house with a S1 commercial application, and
starting a new S2 application, I don't think there are a lot of justifiable
reasons. It appears that S1 is going to be around for a long long long time.
I seriously doubt we will see development on it cease in the next few years.

Now, I'm not a S1 expert by an means, but a lot of the advantages that are
present in S2, can also be had in S1. You can use Spring, IOC, plain
JavaBean actions (Strecks?), and I'm sure more that I don¹t know about.

I'll cover my company's situation in particular. We have a S1 application
with 167 actions, comprising 61,000 lines of code. We have additional
utility classes wrapped around working with S1 to go along with the 61k
lines. The most important thing though is the application works! The code
base is well understood, and it's highly debugged at this point. Being the
guy who writes the paycheck for this I can't really think of a justifiable
reason to tear apart a working application just to move it to a new web
framework. If it's not broken, don't fix it. Maybe I'll change my mind if S1
dies, lacks maintenance work, stops working or some such unlikely thing. But
right now I don't see it.

Well, that's just my Friday $0.02(US), take care,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


why Struts 2 ? ,( justified reasons to migrate)

Posted by Levan Dvalishvili <dv...@verticali.com>.

Hi All! I have been recently trying to come up with at least top 5
justifieable reasons , why one should consider migrating from struts 1.3 (or
even 1.2.X) to struts 2,bascially , what are the gaining points that justify
migration headache? Not talking about more cutting edge architecture, IOC,
etc .. from pure fucntionality perperctive, what I will get that I did not
had in 1.3 if I migrate to 2.0, is it more clear ajax support? Is it more
faster ? etc ...


Best Regards.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to make a SELECT list readonly? If set disabled, loses the value when submit.

Posted by "Nitin M. Mandolkar" <ni...@gmail.com>.
Is any on know other logic apart from this, then please share with us.

ni3

On 11/2/06, Nitin M. Mandolkar <ni...@gmail.com> wrote:
> i used same logic, i.e. Hidden form field.
>
> ntin
>
> On 11/2/06, Puneet Lakhina <pu...@gmail.com> wrote:
> > On 11/2/06, Gareth Evans <ga...@msoft.co.uk> wrote:
> > >
> > > You could add an onchange function that sets the selected item back to the
> > > orginal item.
> >
> >
> > I wouldnt do that..imagine yourself as the user with this kind of
> > javascript.
> >
> > Gareth
> > >
> > > Rafael Nami wrote:
> > > > You can choose to maintain the value from this select in a hidden field,
> > > > that will be submitted with your page. I was used to use another
> > > approach,
> > > > making the select enabled in the submit, but it was a great meal to
> > > > hackers.
> > > >
> > > > 2006/11/1, Mississippi John Hurt <jo...@gmail.com>:
> > > >>
> > > >> Help, I can make <html:text> readonly by setting readonly="true" which
> > > >> works.
> > > >> <html:select> has no readonly attribute, only a disabled. If I use
> > > >> disabled
> > > >> attribute, then the value of the select is no longer recognized and my
> > > >> form
> > > >> validation says its required.  How can I make the <html:select>
> > > disabled
> > > >> or
> > > >> readonly while keeping the values it has passing back to the action
> > > when
> > > >> form is submitted. Thanks.
> > > >>
> > > >>
> > > >
> > >
> > > --
> > > Gareth Evans
> > >
> > > Senior Developer
> > >
> > > MSoft eSolutions Limited
> > > Technology Centre
> > > Inward Way
> > > Rossmore Business Park
> > > Ellesmere Port
> > > Cheshire
> > > CH65 3EN
> > >
> > > --
> > > Tel:    +44 (0)870 0100 704
> > > Fax:    +44 (0)870 9010 705
> > > E-Mail: gareth@msoft.co.uk
> > > Web:    www.msoft.co.uk
> > >
> > > ----------------------------------------------
> > > Terms:
> > > Please note that any prices quoted within this e-mail are subject to VAT.
> > > All program details and code described in this e-mail are subject to
> > > copyright (c) of MSoft eSolutions Limited and remain the intellectual
> > > property of MSoft eSolutions Limited.
> > > Any proposal or pricing information contained within this e-mail are
> > > subject to MSoft eSolutions' Terms and Conditions
> > > ----------------------------------------------
> > > Disclaimer:
> > > This message is intended only for use of the addressee. If this message
> > > was sent to you in error, please notify the sender and delete this
> > > message. MSoft eSolutions Limited cannot accept responsibility for
> > > viruses,
> > > so please scan attachments. Views expressed in this message do not
> > > necessarily reflect those of MSoft eSolutions Limited who will not
> > > necessarily be bound by its contents.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > Puneet
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to make a SELECT list readonly? If set disabled, loses the value when submit.

Posted by "Nitin M. Mandolkar" <ni...@gmail.com>.
i used same logic, i.e. Hidden form field.

ntin

On 11/2/06, Puneet Lakhina <pu...@gmail.com> wrote:
> On 11/2/06, Gareth Evans <ga...@msoft.co.uk> wrote:
> >
> > You could add an onchange function that sets the selected item back to the
> > orginal item.
>
>
> I wouldnt do that..imagine yourself as the user with this kind of
> javascript.
>
> Gareth
> >
> > Rafael Nami wrote:
> > > You can choose to maintain the value from this select in a hidden field,
> > > that will be submitted with your page. I was used to use another
> > approach,
> > > making the select enabled in the submit, but it was a great meal to
> > > hackers.
> > >
> > > 2006/11/1, Mississippi John Hurt <jo...@gmail.com>:
> > >>
> > >> Help, I can make <html:text> readonly by setting readonly="true" which
> > >> works.
> > >> <html:select> has no readonly attribute, only a disabled. If I use
> > >> disabled
> > >> attribute, then the value of the select is no longer recognized and my
> > >> form
> > >> validation says its required.  How can I make the <html:select>
> > disabled
> > >> or
> > >> readonly while keeping the values it has passing back to the action
> > when
> > >> form is submitted. Thanks.
> > >>
> > >>
> > >
> >
> > --
> > Gareth Evans
> >
> > Senior Developer
> >
> > MSoft eSolutions Limited
> > Technology Centre
> > Inward Way
> > Rossmore Business Park
> > Ellesmere Port
> > Cheshire
> > CH65 3EN
> >
> > --
> > Tel:    +44 (0)870 0100 704
> > Fax:    +44 (0)870 9010 705
> > E-Mail: gareth@msoft.co.uk
> > Web:    www.msoft.co.uk
> >
> > ----------------------------------------------
> > Terms:
> > Please note that any prices quoted within this e-mail are subject to VAT.
> > All program details and code described in this e-mail are subject to
> > copyright (c) of MSoft eSolutions Limited and remain the intellectual
> > property of MSoft eSolutions Limited.
> > Any proposal or pricing information contained within this e-mail are
> > subject to MSoft eSolutions' Terms and Conditions
> > ----------------------------------------------
> > Disclaimer:
> > This message is intended only for use of the addressee. If this message
> > was sent to you in error, please notify the sender and delete this
> > message. MSoft eSolutions Limited cannot accept responsibility for
> > viruses,
> > so please scan attachments. Views expressed in this message do not
> > necessarily reflect those of MSoft eSolutions Limited who will not
> > necessarily be bound by its contents.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> Puneet
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to make a SELECT list readonly? If set disabled, loses the value when submit.

Posted by Puneet Lakhina <pu...@gmail.com>.
On 11/2/06, Gareth Evans <ga...@msoft.co.uk> wrote:
>
> You could add an onchange function that sets the selected item back to the
> orginal item.


I wouldnt do that..imagine yourself as the user with this kind of
javascript.

Gareth
>
> Rafael Nami wrote:
> > You can choose to maintain the value from this select in a hidden field,
> > that will be submitted with your page. I was used to use another
> approach,
> > making the select enabled in the submit, but it was a great meal to
> > hackers.
> >
> > 2006/11/1, Mississippi John Hurt <jo...@gmail.com>:
> >>
> >> Help, I can make <html:text> readonly by setting readonly="true" which
> >> works.
> >> <html:select> has no readonly attribute, only a disabled. If I use
> >> disabled
> >> attribute, then the value of the select is no longer recognized and my
> >> form
> >> validation says its required.  How can I make the <html:select>
> disabled
> >> or
> >> readonly while keeping the values it has passing back to the action
> when
> >> form is submitted. Thanks.
> >>
> >>
> >
>
> --
> Gareth Evans
>
> Senior Developer
>
> MSoft eSolutions Limited
> Technology Centre
> Inward Way
> Rossmore Business Park
> Ellesmere Port
> Cheshire
> CH65 3EN
>
> --
> Tel:    +44 (0)870 0100 704
> Fax:    +44 (0)870 9010 705
> E-Mail: gareth@msoft.co.uk
> Web:    www.msoft.co.uk
>
> ----------------------------------------------
> Terms:
> Please note that any prices quoted within this e-mail are subject to VAT.
> All program details and code described in this e-mail are subject to
> copyright (c) of MSoft eSolutions Limited and remain the intellectual
> property of MSoft eSolutions Limited.
> Any proposal or pricing information contained within this e-mail are
> subject to MSoft eSolutions' Terms and Conditions
> ----------------------------------------------
> Disclaimer:
> This message is intended only for use of the addressee. If this message
> was sent to you in error, please notify the sender and delete this
> message. MSoft eSolutions Limited cannot accept responsibility for
> viruses,
> so please scan attachments. Views expressed in this message do not
> necessarily reflect those of MSoft eSolutions Limited who will not
> necessarily be bound by its contents.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Puneet

Re: How to make a SELECT list readonly? If set disabled, loses the value when submit.

Posted by Gareth Evans <ga...@msoft.co.uk>.
You could add an onchange function that sets the selected item back to the orginal item.

Gareth

Rafael Nami wrote:
> You can choose to maintain the value from this select in a hidden field,
> that will be submitted with your page. I was used to use another approach,
> making the select enabled in the submit, but it was a great meal to 
> hackers.
> 
> 2006/11/1, Mississippi John Hurt <jo...@gmail.com>:
>>
>> Help, I can make <html:text> readonly by setting readonly="true" which
>> works.
>> <html:select> has no readonly attribute, only a disabled. If I use
>> disabled
>> attribute, then the value of the select is no longer recognized and my
>> form
>> validation says its required.  How can I make the <html:select> disabled
>> or
>> readonly while keeping the values it has passing back to the action when
>> form is submitted. Thanks.
>>
>>
> 

-- 
Gareth Evans

Senior Developer

MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN

-- 
Tel:    +44 (0)870 0100 704
Fax:    +44 (0)870 9010 705
E-Mail: gareth@msoft.co.uk
Web:    www.msoft.co.uk

----------------------------------------------
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
----------------------------------------------
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to make a SELECT list readonly? If set disabled, loses the value when submit.

Posted by Rafael Nami <ra...@gmail.com>.
You can choose to maintain the value from this select in a hidden field,
that will be submitted with your page. I was used to use another approach,
making the select enabled in the submit, but it was a great meal to hackers.

2006/11/1, Mississippi John Hurt <jo...@gmail.com>:
>
> Help, I can make <html:text> readonly by setting readonly="true" which
> works.
> <html:select> has no readonly attribute, only a disabled. If I use
> disabled
> attribute, then the value of the select is no longer recognized and my
> form
> validation says its required.  How can I make the <html:select> disabled
> or
> readonly while keeping the values it has passing back to the action when
> form is submitted. Thanks.
>
>

RE: How to make a SELECT list readonly? If set disabled, loses the value when submit.

Posted by Frank Russo <Fr...@sas.com>.
That's cool. I never thought of that...

-----Original Message-----
From: Lance [mailto:lance.semmens@marketpipe.com] 
Sent: Wednesday, April 18, 2007 10:56 AM
To: Struts Users Mailing List
Subject: Re: How to make a SELECT list readonly? If set disabled, loses the value when submit.

Another option is to make a disabled style in your css and blur onfocus

<html:select property="id" styleClass="disabled" onFocus="this.blur()">
:
</html:select>

Using a hidden element with the same name is slightly dodgy in that form.elements["id"] will return a different value depending if the hidden element is placed before or after the select.

Megani wrote:
> Hey, i was having the same problem...
> i needed a <html:select that was read-only, but it had to forward it's 
> id to the action servlet populate the form bean with it.
>
> i just declared a <html:hidden with the same property after it.
>
> like:
>
> <html:select property="id" disabled="true"  >
> (...)
> </html:select>				
>
> <html:hidden property="id"/>
>
> works fine ;)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to make a SELECT list readonly? If set disabled, loses the value when submit.

Posted by Lance <la...@marketpipe.com>.
Another option is to make a disabled style in your css and blur onfocus

<html:select property="id" styleClass="disabled" onFocus="this.blur()">
:
</html:select>

Using a hidden element with the same name is slightly dodgy in that 
form.elements["id"] will return a different value depending if the 
hidden element is placed before or after the select.

Megani wrote:
> Hey, i was having the same problem...
> i needed a <html:select that was read-only, but it had to forward it's id 
> to the action servlet populate the form bean with it.
>
> i just declared a <html:hidden with the same property after it.
>
> like:
>
> <html:select property="id" disabled="true"  >
> (...)
> </html:select>				
>
> <html:hidden property="id"/> 
>
> works fine ;)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to make a SELECT list readonly? If set disabled, loses the value when submit.

Posted by Megani <hj...@gmail.com>.
Hey, i was having the same problem...
i needed a <html:select that was read-only, but it had to forward it's id 
to the action servlet populate the form bean with it.

i just declared a <html:hidden with the same property after it.

like:

<html:select property="id" disabled="true"  >
(...)
</html:select>				

<html:hidden property="id"/> 

works fine ;)




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to make a SELECT list readonly? If set disabled, loses the value when submit.

Posted by Yujun Liang <yu...@gmail.com>.
Do you maintain the actionform in the http session? If you do, it doesn't
matter whether the select is disabled or not. If it is disabled, the
actionform will not be changed since there is parameter in the request.

Regards

On 11/3/06, Dean, Michael <Mi...@courts.wa.gov> wrote:
>
> MJ,
>
> This is slightly tangential...but I faced a similar problem in trying to
> prevent "double-submit"...
>
> Below is the solution jsp code...refer embedded comments...
>
>       <html:submit styleId="saveBtn" styleClass="hiddenItem"
> tabindex="100" value = "Save" />
> .
> .
> .
>
>   <!--in order to selectively disable both submit buttons(prevent the
> dreaded double submit), I moved the parameters/arguments required by the
> Struts DispatchAction sub-class to hidden fields. These are then
> selectively
> disabled/enabled, in tandem with the actual buttons, depending on the
> particular action - Refer AdvancedFilters.js -->
>
>   <input id="saveProxy" type="hidden" name="method" value="Save"/>
>
> The narrative: when the user selects the submit button, the onsubmit()
> method (defined in some external javascript) disables the button and
> enables a proxy hidden field which also ha a VALUE argument which
> matches the method name required by the DispatchAction sub-class...
>
> HTH,
> M
>
>
>
> -----Original Message-----
> From: Mississippi John Hurt [mailto:johnhurt@gmail.com]
> Sent: Wednesday, November 01, 2006 12:18 PM
> To: Struts Users Mailing List
> Subject: How to make a SELECT list readonly? If set disabled, loses the
> value when submit.
>
> Help, I can make <html:text> readonly by setting readonly="true" which
> works.
> <html:select> has no readonly attribute, only a disabled. If I use
> disabled
> attribute, then the value of the select is no longer recognized and my
> form
> validation says its required.  How can I make the <html:select> disabled
> or
> readonly while keeping the values it has passing back to the action when
> form is submitted. Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Yujun Liang
yujun.liang@acm.org

RE: How to make a SELECT list readonly? If set disabled, loses the value when submit.

Posted by "Dean, Michael" <Mi...@courts.wa.gov>.
MJ,

This is slightly tangential...but I faced a similar problem in trying to
prevent "double-submit"...

Below is the solution jsp code...refer embedded comments...

      <html:submit styleId="saveBtn" styleClass="hiddenItem"
tabindex="100" value = "Save" />
.
.
.

  <!--in order to selectively disable both submit buttons(prevent the
dreaded double submit), I moved the parameters/arguments required by the
Struts DispatchAction sub-class to hidden fields. These are then
selectively 
disabled/enabled, in tandem with the actual buttons, depending on the
particular action - Refer AdvancedFilters.js -->

  <input id="saveProxy" type="hidden" name="method" value="Save"/>

The narrative: when the user selects the submit button, the onsubmit()
method (defined in some external javascript) disables the button and
enables a proxy hidden field which also ha a VALUE argument which
matches the method name required by the DispatchAction sub-class...

HTH,
M



-----Original Message-----
From: Mississippi John Hurt [mailto:johnhurt@gmail.com] 
Sent: Wednesday, November 01, 2006 12:18 PM
To: Struts Users Mailing List
Subject: How to make a SELECT list readonly? If set disabled, loses the
value when submit.

Help, I can make <html:text> readonly by setting readonly="true" which
works.
<html:select> has no readonly attribute, only a disabled. If I use
disabled
attribute, then the value of the select is no longer recognized and my
form
validation says its required.  How can I make the <html:select> disabled
or
readonly while keeping the values it has passing back to the action when
form is submitted. Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org