• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Disabling html:select by form bean property

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.

I am wokring on a Struts (version 1.3) page on which I am having trouble controlling the components on the page.

My situation is along the lines of the following simplified example:

- A User can define a new Order.
- They do not have to submit the order immediatly so the save it first.
- The User can make amendments to the Order when is has been saved, or submit it.

All this is provided by a single JSP page which hides the 'submit' button until the order has been saved.

Unfortunatly the database, bases the Order number (our DB Primary Key) on one of the fields in the Order, the user's location. (I have no input into the databse desing :mad :) .

This presents a problem when the user comes back to edit their order, if I allow them to update their location, the order number cannot be used to work out the location for the order.

To present an appropriate interface for this I need to disable the html:select component from which the user selects their location. I have tried some of the following with no success:


So can anyone tell me how I can bind the disable attribute of a componennt to a form bean property.

Thanks you

rich
[ December 03, 2008: Message edited by: Rich Peate ]
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're on a JSP container it might be easiest to use JSP 2.0 EL, otherwise you could try the "-rt" tag libs at do it via an rtexpr.
 
Rick Smith
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
David,

Thank you for your reply.

I thought I was using Expression Language with the line:

<html:select name="OrderForm" property="location" disabled="${not_save}">

but because that did not work I presumed either EL cannot be used to set the attribute or that that is the wrong way to specify the EL binding?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow, I managed to miss all that.

Have you verified that the bean:write in the bean efine tag is working properly? I also thought the current value would have to be "disabled", not true.
 
reply
    Bookmark Topic Watch Topic
  • New Topic