You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Gooch, Allen" <go...@darden.virginia.edu> on 2004/03/10 20:48:51 UTC

presentation of required non-ValidField components

In addition to form validation of text fields (ValidField), I need to
validate input provided through DatePicker and PropertySelection
components.  What I would like to do is:

1) when the page is initially rendered all required fields
(IFormComponents) are visually indicated by asterisks before the form is
submitted.
2) when the form is submitted all required fields (IFormComponents) are
visually indicated by color and an error message is displayed at top of
page.

I have created a custom ValidationDelegate which is used to report
errors from the ValidField and non-ValidField components on the page
like the following:

		if (getJobBio().getPrevMainJobFunction() == null) {
			IFormComponent inputEnd = (IFormComponent)
getComponent("primaryJobFunctionField");
			delegate.setFormComponent(inputEnd);
			delegate.record("Primary Job Function field
required!", ValidationConstraint.CONSISTENCY);
			return;
		}

All validation errors, both ValidField and non-ValidField, are displayed
correctly upon form submission. 
 
This has raised the following questions:

1) ValidField components do not indicate requiredness until the form is
submitted, which colors the FieldLabel red and tags two red asterisks at
the end of the field, and the error message displayed at top of page.  I
would like to indicate requiredness with the asterisks at all times. How
should I go about this?
2) Other components (DatePicker and PropertySelection for example) do
not indicate requiredness ever. When the form is submitted an error
message is displayed at top of page as with ValidField, but the label
(not a FieldLabel as these are not ValidFields) does not change color to
red. How is this best done?

TIA...
-allen


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