You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Vinod Singh <Vi...@rmsi.com> on 2005/03/15 09:57:32 UTC

commandButton does not work with Tiles

Hi All,

I have created a simple jsf page, when I acces this page without tiles then
everything works fine but with tiles control does not transfer to the
desired class specified in the action attribute of commandButton.

Can anybody tell where I am wrong?

Thanks,

Vinod


<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:loadBundle basename="Message" var="Message"/>

<f:view>
<html>
<head><title>Client</title></head>
  <body>
    <h:form id="clientForm">
      <h:message for="clientForm" /><br />
      <h:panelGrid columns="3">
        <h:outputText value="#{Message.client_name_label}" />
        <h:inputText id="client_id" value="#{Client.client_id}" required="
true">
          <f:validateLength maximum="30" minimum="3" />
        </h:inputText>
        <h:message for="client_id" />

        <h:outputText value="#{Message.client_desc_label}" />
        <h:inputText id="description" value="#{Client.description}"
required="true">
          <f:validateLength maximum="50" minimum="1" />
        </h:inputText>
        <h:message for="description" />
        <h:commandButton id="submit" action="#{Persister.saveClient}" value
="#{Message.client_submit_button}" />
      </h:panelGrid>
    </h:form>
  </body>
</html>
</f:view>



Re: commandButton does not work with Tiles

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Vinod,

when you use Subviews (<f:subview/>)

then you must use "global" navigation rulez for

command components (commadnButton or commandLink)

if you use something like:

<h:commandButton id="submit" action="myoutcome" value
="#{Message.client_submit_button}" />

you must have something like that in faces.-config.xml



	<navigation-rule>
		<from-view-id>*</from-view-id>
		<navigation-case>
			<from-outcome>myoutcome</from-outcome>
			<to-view-id>/myPageWithTiles.jsp</to-view-id>
		</navigation-case>
	</navigation-rule>


HTH,
Matthias


Vinod Singh wrote:
> Hi All,
> 
> I have created a simple jsf page, when I acces this page without tiles then
> everything works fine but with tiles control does not transfer to the
> desired class specified in the action attribute of commandButton.
> 
> Can anybody tell where I am wrong?
> 
> Thanks,
> 
> Vinod
> 
> 
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <f:loadBundle basename="Message" var="Message"/>
> 
> <f:view>
> <html>
> <head><title>Client</title></head>
>   <body>
>     <h:form id="clientForm">
>       <h:message for="clientForm" /><br />
>       <h:panelGrid columns="3">
>         <h:outputText value="#{Message.client_name_label}" />
>         <h:inputText id="client_id" value="#{Client.client_id}" required="
> true">
>           <f:validateLength maximum="30" minimum="3" />
>         </h:inputText>
>         <h:message for="client_id" />
> 
>         <h:outputText value="#{Message.client_desc_label}" />
>         <h:inputText id="description" value="#{Client.description}"
> required="true">
>           <f:validateLength maximum="50" minimum="1" />
>         </h:inputText>
>         <h:message for="description" />
>         <h:commandButton id="submit" action="#{Persister.saveClient}" value
> ="#{Message.client_submit_button}" />
>       </h:panelGrid>
>     </h:form>
>   </body>
> </html>
> </f:view>
> 
> 
> 

-- 
Matthias Weßendorf
Aechterhoek 18
DE-48282 Emsdetten
Germany
phone: +49-2572-9170275
cell phone: +49-179-1118979
email: matzew AT apache DOT org
url: http://www.wessendorf.net
callto://mwessendorf (Skype)
icq: 47016183