users@woodstock.java.net

Asynchronous validation 4.1.1

From: Jason Suplizio <suplizio_at_gmail.com>
Date: Wed, 26 Mar 2008 17:01:07 -0700

 I have a textField, a label, and a button. When I click on the button, if
the required text field is invalid (empty) I want the validation message
(webuijsf:message) to be displayed as well as refresh the label and
textField to be invalid - andI want to do this asynchronously. When the page
is initially rendered assume it has no messages for the related text field
component, therefore the message component doesn't get rendered unless I do
a full page post/request/submit - which I am not allowed to do because of
my requirements. My question is, how can I force render the message
component to render so that I can display the validation error.

Again, on the client I want to refresh the label, the text field, and the
message to show that a required field is empty without posting (full page
refresh) to the server.

<webuijsf:message for="searchField" styleClass="errMessage" rendered="true"
visible="true"/>

<webuijsf:label id="searchFieldLabel" value="#{
simpleSearchBean.prompt.inputLabel}:" for="searchField"/>

<webuijsf:textField
                    id="searchField"
                    value="#{simpleSearchBean.prompt.value}"
                    required="true"
                    onKeyPress="return textFieldKeyPress(event);"/>

<button class="Btn2_sun4 promptBtn" type="button"
onclick="submitSearch();">#{rpMsg.go}</button>

Any help would be greatly appreciated. Oh yeah,
I've been calling searchField.refresh() and searchFieldLabel.setProps(
{valid: false} ) but I can't get a handle on a non-existent message
component.

Jason