On 10/30/06, Dick Starr <[EMAIL PROTECTED]> wrote:
I am using the 10/4/06 version of Shale.
I have an h:form containing a h:panelGrid whose footer contains a
h:commandButton in its footer as follows:
<h:commandButton action="#{systemOperatorMnt.create}"
id="mntButtonsCreate"
value="Create"/>
I fill in the form and click the "Create" button and my form clears
without the "create" method being executed.
I fill in the form again (so I get past validation) and click the
"Create" button. This time the "create" method is executed.
I must be missing something. Could you please tell me:
Why is my form being cleared the first time I click "Create"?
Why do I need to click the "Create" button twice?
The most common cause for this type of scenario (generic to JSF apps, not
specific to Shale) is that some conversion or validation error occurred, but
you don't have message components to show them. In that situation, JSF's
standard behavior is to abort the request processing lifecycle after the
phase in which the error is encountered -- which is usually Process
Validations.
In your case, you have <h:message> components for each input field ... but
what happens if an error occurs that is not associated with a particular
input component? Try sticking an <h:messages/> component somewhere on the
page, to see if it lists any additional errors.
Thanks in advance,
Dick Starr
Craig