Vinod,

I modified the tiles sample in CVS:

-navigation.jsp:
<h:commandButton value="nested Tiles" action="#{tilesBacking.pressMe}">
  ...
</h:commandButton>

-created TilesBacking:
public class TilesBacking {

    public String pressMe(){
        System.out.println("pushed the button");
        return ("nav_page4");
    }

}

-in faces-config.xml (nothing changed):
    <navigation-rule>
        <from-view-id>*</from-view-id>
        <navigation-case>
            <from-outcome>nav_page1</from-outcome>
            <to-view-id>/page1.jsp</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>nav_page2</from-outcome>
            <to-view-id>/page2.jsp</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>nav_page3</from-outcome>
            <to-view-id>/non-tile.jsp</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>nav_page4</from-outcome>
            <to-view-id>/page4.jsp</to-view-id>
        </navigation-case>                
    </navigation-rule>


And for me it works... Sure, the pressMe() speaks not to a database, but it "logs" something out.

Should I email you dirctly the *new* tiles-example-app ?

Or would you like to use the sources from CVS instead?

-Matthias

Vinod Singh wrote:
Matthias,

I used myfaces-tiles.war for my sample applications. With and without tiles
scenarios are explained below.

Scenario #1 No Tiles
-----------------------------
I created a simple page say client.jsp and I accessed it like below

http://localhost:8080/UI/client.jsf

After submitted method Persister.saveClient() is called and data goes to
database.

Scenario #2 With Tiles
-----------------------

Inserted following in navigation.jsp

    <h:commandLink action="client">
        <h:outputText value="Client" />
    </h:commandLink>

Inserted following lines in tiles-faces-config.xml

        <navigation-case>
            <from-outcome>client</from-outcome>
            <to-view-id>/client.jsp</to-view-id>
        </navigation-case>

Inserted following lines in tiles.xml


<definition name="/client.tiles" extends="layout.example" > <put name="body" value="/client.jsp" /> </definition>

Besides above 3 settings everything else is common in both cases.
Now method Persister.saveClient() is not called when I submit the form.

Thanks,

Vinod



|--------+--------------------------------->
|        |          Matthias Wessendorf    |
|        |          <[EMAIL PROTECTED]|
|        |          endorf.de>             |
|        |                                 |
|        |          03/16/2005 12:41 PM    |
|        |          Please respond to      |
|        |          "MyFaces Discussion"   |
|        |                                 |
|--------+--------------------------------->
  
>----------------------------------------------------------------------------------------------------------|
  |                                                                             
                             |
  |      To:     MyFaces Discussion <[email protected]>         
                             |
  |      cc:                                                                    
                             |
  |      Subject:     Re: commandButton does not work with Tiles                
                             |
  
>----------------------------------------------------------------------------------------------------------|




Without tiles means

<f:subview id="xxx">
   <jsp:include page="fooBar.jsp"/>
</f:subview>

so instead of Tiles using includes ?

.-MAtthias

Vinod Singh wrote:

Hi Matthias,

Here I am saying that when I click on the submit button (<h:commandButton
id="submit" action="#{Persister.saveClient}" value


="#{Message.client_submit_button}" />) then method Persister.saveClient()

is not called. If I use this page without tiles then this method is

called.

Thanks,

Vinod



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












-- 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

Reply via email to