As a matter of fact, yes, there is a simple way! Excuse my
enthusiasm, but it's not often that I get to say that on the Tapestry
mailing list ;)
You want a LabeledPropertySelectionModel, which is a simple decorator
around your existing IPropertySelectionModel:
http://tapestry.apache.org/tapestry4/tapestry/apidocs/org/apache/
tapestry/form/LabeledPropertySelectionModel.html
Inside the method that creates your IPropertySelectionModel just add
something like:
(assume your existing model is in a variable named "myModel")
IPropertySelectionModel labeledModel = new
LabeledPropertySelectionModel(myModel, "Choose your item");
return labeledModel;
-Ryan
On Aug 16, 2006, at 11:59 AM, Mael Caldas wrote:
Hi
I'm using tapestry 4, and have a selection list that submits the
form on
change, without a button, but, when I have only one item on the
list, I
can't submit the form, because, of course, there is nothing to change!
Does anybody knows a simple way to have a label inside the property
selection list, like "chose your item", in the first position of the
selection list , so, if I have only one item on the list, when I
change from
"chose your item" to the "Item 1", the javascript submits the form...
Thanks!
Ryan Holmes, CISSP
[EMAIL PROTECTED]
ph. (213) 626-0026
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]