Signup Form:
* I would recommend using the Checkbox component for the Selected Interests.
http://tapestry.sourceforge.net/doc/ComponentReference/Checkbox.html
Do these need to be dynamically generated? If not I would hard code formatting in the html file.
If you do go down the List of Objects approach [code, label, selected, bolded] you can make this list a persistent page property and save it when the formSubmit handler is called. However make sure your Object is Serializable:
public class SignupPage extends BasePage {
private List interestList;
public List getInterestList() {
return interestList;
}
public void setInterestList(List value) {
interestList = value;
fireObservedChange("interestList", value);
}
public void detach() {
interestList = null;
super.detach();
}
public void formSubmit(RequestCycle cycle) {
..
setInterestList(list);
}
}
DatePicker:
* Render problem also occurs on Mozilla, this is discussed in the Component Reference
* Extending the date range is a good idea. However I wonder what java.sql.Date does for pre Jan 1st 1970 dates.
* I think it would be good for the DatePicker to support a IValidator property for Form validation
A "net.sf.tapestry.valid.EmailValidator" class sounds handy. You should make a Feature Request.
Regards Malcolm
From: "Brien Voorhees" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: [Tapestry-developer] Several questions regarding dynamic form elements
Date: Tue, 5 Nov 2002 14:48:44 -0800
I was hoping to get some advice on how to handle the following in Tapestry. We have a user signup form in which the user is presented with a list of "interests" to select. It might look something like this :
---------------------------------------------------------------
First Name :
Last Name :
E-Mail :
etc...
SELECT INTERESTS :
[ ] Books [X] Music [ ] Movies
[ ] Finance [ ] Computers [X] Cooking
[X] Games
---------------------------------------------------------------
Each interest has a code that would get sent if it's selected. Some of the interests are displayed in a different style (bold). I'm fairly new to Tapestry and have been going through the docs and examples and can't quite figure out the best way to do this.
I was thinking of creating a list of Interest objects with {code, label, selected, bolded} properties but I'm not sure how to handle fireObservedChange().
On a side note, how DO you deal with list/map properties in a form? I think OGNL allows the expression "interests[5]" or "interests[Books].selected" but how do you make sure that change is observed by the PageRecorder?
Other issues I've encountered in my first project using Tapestry, just FYI :
The field validation framework seems very limited. It (or FieldLabel, at least) doesn't seem to apply to anything but TextFields (i.e. it doesn't work with DatePicker, CheckBox, PropertySelection, etc?). There aren't many Validators to work with, even for very common uses (e.g. Email, RegularExpressions).
The DatePicker has display problems when it attempts to display over a list box. The listbox renders on top of the DatePicker.
The DatePicker has no options for the begin date range and defaults to starting at 1990. This makes it unusable for birth dates.
Is there documentation available for the Table component yet?
Any help greatly appreciated,
Brien Voorhees
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer
