shale-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dick Starr" <>
Subject RE: Why do I need to click my action method commandButton twice?
Date Mon, 30 Oct 2006 20:45:41 GMT
Thanks for the response.

I am using Tiles and had my <h:messages/> in my header, although I had globalOnly set
to true, which which I have now set to true.

I again went through every thing I could think of to try, but with no solution. I do however,
have a pretty good hint - I think.

Although I gave one example there are others. Generally, my action methods fail - even a simple
cancel (although sometimes they do work).

Here is what always happens when it fails. I noticed that in my Firefox browser url, before
the first click (which fails) it show the url of the previous jsp (not the one I am seeing).
Once I do the first click the url shows the jsp I am seeing; then I click the second time
and it works. Hopefully this hint will tell someone the answer.

Here are the navigation rules for my original example. Everything points to a Tile (note that
I end my <from-view-id> with a ".jsp" - as it won't work otherwise). I start with the
search jsp and click the new case.


Here is my Tiles header:

<%-- header.jsp
  2006-10-30 RJS. New.
<%@ include file="/jspf/common/taglibs.jsp" %>
<%@ include file="/jspf/common/messages.jsp" %>
<h:panelGrid columns="3" styleClass="starraHeader">
  <h:panelGroup styleClass="starraHeaderCenter">
    <h:outputText value="#{msg['']}"/>
    <h:outputText value=" #{msg['symbol.sep1']}"/>
    <h:outputText value=" #{msg['app.user']}"/>
    <h:outputText value="#{msg['symbol.equals']}"/>
    <h:outputText value="#{stateSession.logonName}"/>
  <h:form id="directJump">
        <f:selectItem itemLabel="#{home.header}" itemValue="systemDirectJumpHomeMenu"/>
        <f:selectItem itemLabel="#{admin.header}" itemValue="systemDirectJumpAdminMenu"/>
      <h:outputText value=" "/>

Thanks again.


-----Original Message-----
From:	Craig McClanahan []
Sent:	Mon 10/30/2006 11:32 AM
To:; Dick Starr
Subject:	Re: Why do I need to click my action method commandButton twice?

On 10/30/06, Dick Starr <> 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 }"
	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

	Thanks in advance,
	Dick Starr


View raw message