Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts - View html:select  RSS feed

 
alan kent
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using struts I want to load a comboBox with a disabled option
when some value is loaded

The code below in struts

<html:select name="test" property="comments" indexed="true">
<html ptions collection="collectionData" property="value" labelProperty="label"/>
</html:select>

shows the comboBox, but I want to disable when a specific value is loaded:
For instance , I make a combo of list of names. If the selected name is 'Paul', then the combo will load with Paul enabled to change but if the selected name is 'John', the combo will load with the disabled option (disabled=true).

How can I do using struts???
Thanks,
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems you need to define these property in the dispatcher, add some flags into the request, and your tag, based on the flags, to decide whether something should be disabled or not.

A simple structs tag seems not be able to cater these handling.

Nick
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!