ValueChange event to invoke navigation rule

Hi there,
Is it possible to invoke a navigation rule from a valuechange event triggert in a dropdown list?
I like to switch page if a certain value is selected.
Any help would be greatly appreciated.
Regards Erik

You don't need the valuechangeevent for this. You are not interested in the old value. Just an onchange="submit()" and letting the action method of the bean return the navigation case is sufficient.
<h:selectOneMenu value="#{myBean.selectedItem}" onchange="this.form.submit();">
</h:selectOneMenu>
<h:commandButton value="Navigate" action="#{myBean.navigate}" />
private String selectedItem; // + getter + setter
public String navigate() {
    return selectedItem; // Or so. This should at least match the navigation case in faces-config.
}

Similar Messages

  • How to update the table value in the valuechange event?

    I have an input field in the datatable with the valueChangeListener
    <rich:dataTable id="cart" value="#{cart.cartList}" var="item">
    <h:inputText value="#{item.cost}" id="qty" valueChangeListener="#{items.updateCost}" onchange="submit()">
    <h:outputText value="#{item.errorMsg}"> </h:outputText>
    in the backing bean
         Item item = (Item) model.getRowData();
    // do some update, if the cost too larger, change to max_cost
         item.setCost(max_cost);
         item.setErrorMsg("Error Msg");
    After calling the valuechange method, the screen output doesn't update the cost.
    How to update the table value in the valuechange event?

    As you're misusing the valueChangeListener to set another input field, you need to skip the update model values phase. Otherwise the value set in the valueChangeListener will be overridden by the submitted value. You can do this by calling the FacesContext#renderResponse() inside the valueChangeListener method. This will shift the current phase immediately to the render response phase, hereby skipping the update model values and invoke application phases.

  • Re: problem getting navigation rules to work

    Hello,
    I am using EA4, JDK1.4.2, Tomcat 4.1.24, under Solaris 8.
    When I click on the buttons, I always go back to the original page (EmailLookup.jsp) rather than following the navigation rules.
    I print to a file when invoke in Action is called, in my classes, so I know that when I click on the search or clear buttons that the correct action is being ran, through my properties.
    I don't know why this is not working, and would appreciate some help.
    <navigation-rule>
    <from-tree-id>/EmailLookup.jsp</from-tree-id>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <from-action-ref>EmailSearchModel.searchAction</from-action-ref>
    <to-tree-id>/response.jsp</to-tree-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>reset</from-outcome>
    <from-action-ref>EmailSearchModel.resetAction</from-action-ref>
    <to-tree-id>/index.html</to-tree-id>
    </navigation-case>
    </navigation-rule>
    resetAction = new Action() {
    public String invoke() {
    reset();
    try {
    java.io.FileOutputStream fos =
    new java.io.FileOutputStream("/usr/local/apps/tomcat/webapps/EmailLookup/debugtemp.txt", true);
    fos.write(new String("Inside getResetAction\n\n").getBytes());
    fos.write(new String("reset\n\n").getBytes());
    fos.close();
    } catch(Exception e) {
    return "reset";
    searchAction = new Action() {
    public String invoke() {
    try {
    java.io.FileOutputStream fos =
    new java.io.FileOutputStream("/usr/local/apps/tomcat/webapps/EmailLookup/debugtemp.txt", true);
    fos.write(new String("Inside getSearchAction\n\n").getBytes());
    fos.write(new String("success\n\n").getBytes());
    fos.close();
    } catch(Exception e) {
    return "success";
    <h:command_button label="Search"
    commandName="submit" actionRef="EmailSearchModel.searchAction" />
    <h:command_button label="Clear"
    commandName="reset" actionRef="EmailSearchModel.resetAction" />
    Thank you.

    Problem solved, it ended up being that the directory name was the same as the first JSP page, it appears.
    My directory was EmailLookup, and since the JSP page was EmailLookup.jsp, and EmailLookup was referenced in the faces-config.xml file, there was confusion.
    I changed the directory name to DirectorySearch, and it works fine.

  • ValueChanged Event

    It seems the value changed event fires only when the form is posted. I have a requirement to invoke the valuechange event when user select one item from dropdown list. Is there any way to achieve this? It works When I add the following line on jsf:
    onChange="this.form.submit();"
    But i am not sure if it is a good solution ....... Any help on this will be appreciated.
    -TT

    Don't worry, you're right on track. It's different calling onChange="submit()" and clicking on the commandLink/commandButton on your form.
    Could you please post the pertinent JSP form code, and the method that gets executed when the valueChangeEvent gets fired (i.e. the valueChangeListener in your managed-bean)?
    From there we should be able to tell you exactly how to set up.
    CowKing
    PS - Keep in mind that JSF is a server-side technology and that nothing can happen until a submit takes place.

  • Navigation and Creating  a navigation rule at runtime

    Hi all,
    How can I create a navigation rule at runtime?
    I got all my pages (names and locations) stored in a database table.All my pages are jspx format.
    I don't want to create navigation rules for each page, Instead I want to use the location stored in the database and create a navigation rule to navigate to.
    I tried navigating using ServletRequest :
            ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
            HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
            HttpServletRequest  request = (HttpServletRequest)ectx.getRequest();
            request.getRequestDispatcher("/faces/Titles.jspx").forward(request,response);But it blows after the first call.
    is it possible to create a navigation rule in a Bean or is there another way to call jspx pages from a Bean without loosing the session.
    Can someone help me please.
    thanks in advance,
    Ahmad Esbita

    Ahmad,
    I don't know of any way to programatically create navigation cases at runtime. However, perhaps you could try creating a NavigationHandler decorator. Let's assume you have a function called "getViewIDforAction" that does the database lookup and returns the view ID for a given action code. You could do something like this:
    package my.code;
    import javax.faces.application.NavigationHandler;
    import javax.faces.context.FacesContext;
    public class MyNavigationManager extends NavigationHandler
       NavigationHandler _base;
       public NavigationManager (NavigationHandler base)
          super();
          _base = base;
       public void handleNavigation(FacesContext fc, String actionMethod, String actionName)
          String viewID = getViewIDforAction(actionName);
          if (viewID != null && ! "".equals(viewID))
             fc.getViewRoot().setViewId(viewID);
          else
             _base.handleNavigation(fc, actionMethod, actionName);
    }You'll also need this in faces-config.xml:
    <application>
      <navigation-handler>my.code.MyNavigationManager</navigation-handler>
    ...any other stuff...
    </application>Note: I haven't tested this or anything - just to give you an idea...
    Regards,
    john

  • How can i add a navigation rule at the runtime of JSF?

    Hello,
    how can i add a navigation rule at the runtime of JSF. Maybe i should use the method "addNavigationRule()" in class "FacesConfig", but i do not know, how can i obtain the instance of class "FacesConfig". Can anybody help me?
    Thank you very much!!!

    Just curious: Why whould you want to add navigation Rules at run time. I believe the navigation rules should be set to begin with - "by s/w Architect Design".
    Else you can always use Redirect / Forward.

  • JSF navigation rules sent me to different page, with same URL

    Hello everybody,
    Have a newbie question on JSF, if anyone can help me. I am using JSF for a web application, and i have a small problem.
    If i define a navigation rule, from one page to another, and i am having a button that should send me to another page,
    the browser URL remains the same, although the page content IS correctly changed.
    Thanks,
    Andrei

    You're welcome.
    Though I should have added that the advantage of the redirect after a POST request is that refreshing the request or navigating back and forward by browser history doesn't cause a re-submit of the POST request anymore. This way you avoid duplication of submitted data. This is called POST-redirect-GET pattern. Refreshing the request after a redirect (which is always a GET request) would only cause the redirect being refreshed, not the initiating POST request.
    The disadvantage of a forward is less or more obvious: the URL remains the same and it is not really good for the user experience. If one copypasted the URL in a new window (a new GET request), one wouldn't see the forwarded page, but the originating page. That's why I would recommend to avoid navigation cases and just use the same page to postback the POST request to. For normal page-to-page navigation within a website, I would recommend just using outputlinks and not commandlinks with navigation cases. It's all better for the user experience.

  • SOS Problem with navigation rules

    Hello,
    I have been stuck for some time with a navigation problem: It seems my faces DD is read but the navigations rules are not. Unfortunately it does not give me any exception. The only thing that occurs is that the home page reloads itself instead of redirecting to the second page.
    Here is my DD:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"  "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    <faces-config>
         <!-- ==============================  Application  ============================== -->
         <application>
              <locale-config>
                   <default-locale>en</default-locale>
              </locale-config>
         </application>
         <!-- ==============================  Managed Beans ============================== -->
         <managed-bean>
              <managed-bean-name>GuideSearchManagedBean</managed-bean-name>
              <managed-bean-class>com.softwareag.test_guide.web.temp.PGSearchManagedBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <!-- ==============================   Navigation rules ============================== -->
         <navigation-rule>
              <from-view-id>/home.jsp</from-view-id>
              <navigation-case>
              <from-action>#{GuideSearchManagedBean.newSearchAction}</from-action>
              <from-outcome>displayResults</from-outcome>
              <to-view-id>/errorOccured.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
    </faces-config>Here is my jsf:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <f:view>
    <html>
    <head>
    <title>home</title>
    </head>
    <body>
    <h:form id="guide_form">
    category
    <h:selectOneMenu id="category" value="#{GuideSearchManagedBean.category}" required="true">
    <f:selectItem itemValue="2" itemLabel="resto"/>
    <f:selectItem itemValue="1" itemLabel="bar"/>
    <f:selectItem itemValue="3" itemLabel="disco"/>
    </h:selectOneMenu>
    <br /><br />
    postcode<br /><br />
    <h:selectManyListbox id="postcodes" value="#{GuideSearchManagedBean.postcodes}" required="true">
    <f:selectItem itemValue="75001" itemLabel="75001"/>
    <f:selectItem itemValue="75002" itemLabel="75002"/>
    <f:selectItem itemValue="75003" itemLabel="75003"/>
    <f:selectItem itemValue="75004" itemLabel="75004"/>
    <f:selectItem itemValue="75005" itemLabel="75005"/>
    <f:selectItem itemValue="75006" itemLabel="75006"/>
    </h:selectManyListbox>
    <br /><br />
    name
    <h:inputText id="name" value="#{GuideSearchManagedBean.name}"/>
    <br /><br />
    with comments
    <h:selectBooleanCheckbox id="commentsExist" value="#{GuideSearchManagedBean.commentsExist}"/>
    <br /><br />
    order by
    <h:selectOneRadio id="sortOrderCriterion" value="#{GuideSearchManagedBean.sortOrderCriterion}" layout="pageDirection">
      <f:selectItem itemValue="GRADES" itemLabel="note"/>
      <f:selectItem itemValue="DB_ESTABLISHMENT_NAME" itemLabel="name"/>
      <f:selectItem itemValue="DB_POSTCODE" itemLabel="postcode"/>
    </h:selectOneRadio>
    <br /><br />
    minimum note
    <h:selectOneMenu id="minimumNote" value="#{GuideSearchManagedBean.minimumNote}">
    <f:selectItem itemValue="1" itemLabel="1"/>
    <f:selectItem itemValue="2" itemLabel="2"/>
    <f:selectItem itemValue="3" itemLabel="3"/>
    <f:selectItem itemValue="4" itemLabel="4"/>
    <f:selectItem itemValue="5" itemLabel="5"/>
    </h:selectOneMenu>
    <br /><br />
    <h:commandButton id="submit" action="#{GuideSearchManagedBean.newSearchAction}" value="Submit" />
    </h:form>
    </body>
    </html>
    </f:view>Here is my Managed bean:
    package com.softwareag.test_guide.web.temp;
    import java.rmi.RemoteException;
    import java.util.List;
    import com.softwareag.test_guide.web.util.PGFactory;
    * @author Julien Martin
    public class PGSearchManagedBean {
         private String category;
         private List postcodes;
         private String name;
         private boolean commentsExist;
         private String sortOrderCriterion;
         private int minimumNote;
         public String newSearchAction(){
              System.out.println("----------within new search action--------------");//this line never gets printed
              return "displayResults";
         public String nextAction() throws RemoteException { //TODO: Remove that
              PGSearch search = PGFactory.getSearchInstance();
              String issue = search.next();
              return issue;
         public String previousAction() throws RemoteException { //TODO: Remove that
              PGSearch search = PGFactory.getSearchInstance();
              String issue = search.previous();
              return issue;
         public String getCategory() {
              return category;
         public boolean getCommentsExist() {
              return commentsExist;
         public int getMinimumNote() {
              return minimumNote;
         public String getName() {
              return name;
         public List getPostcodes() {
              return postcodes;
         public String getSortOrderCriterion() {
              return sortOrderCriterion;
         public void setCategory(String string) {
              category = string;
         public void setCommentsExist(boolean bool) {
              commentsExist = bool;
         public void setMinimumNote(int i) {
              minimumNote = i;
         public void setName(String string) {
              name = string;
         public void setPostcodes(List list) {
              postcodes = list;
         public void setSortOrderCriterion(String string) {
              sortOrderCriterion = string;
    }Can anyone help? I am really stuck. :-)
    Julien Martin.

    Hi,
    I added a messages component to your home.jsp page and saw that the page produced validation errors (often the cause for failed navigation).
    The problem is that the beans property minimumNote expects an int but gets a String. When you change the the type in the bean to String it works.
    You will probably want to add a converter to the uicomponent to get the correct type. I'd be happy to tell you how, but I'm just starting with jsf ;-).

  • Adding custom navigation rules results in strange behavior

    Hello,
    We'd like to add navigation rules to our application. To avoid post-JHeadstart-generation-steps we created an extra faces-config-custom.xml file which contains the navigation rules. When adding this file to the web.xml and run the aplication we encounter strange behavior
    - Errors are shown in duplicate
    - 'Transaction completed' messages are not shown
    Try adding the underneath faces-config-custom.xml to a standard HR demo project and you will get the same behavior.
    (1) What is the reason of this strange behavior?
    (2) How can we add custom navigation rules, without having to do post creation steps?
    Regards Leon
    [faces-config-custom.xml]
    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config xmlns="http://java.sun.com/JSF/Configuration">
    <navigation-rule>
    <from-view-id>*</from-view-id>
    <navigation-case>
    <from-outcome>BezwaarVerzoeken</from-outcome>
    <to-view-id>/pages/inboeken/BezwaarVerzoeken.jspx</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>LosseOpdrachten</from-outcome>
    <to-view-id>/pages/inboeken/LosseOpdrachten.jspx</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config>
    [Add faces-config-custom.xml to web.xml]
    <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config-custom.xml,...

    Leon,
    When you perform a drag and drop operation, JDeveloper adds the following lines to the faces-config.xml:
    <lifecycle>
    <phase-listener>
    Oracle.adf.controller.faces.lifecycle.ADFPhaselistener
    </phase-listener>
    </lifecycle>
    However, JHeadstart uses its own subclass of ADFPhaselistener, and defines the lifecycle element in JhsCommon-beans.xml. Due to a bug in ADF, ADF does not look for the lifecycle element in other files than faces-config, and adds its own element in faces-config.xml If you remove these lines, everything works fine again.
    To prevent this from happening again, you can move the following entry from JhsCommon-beans.xml to faces-config.xml:
    <lifecycle> <phase-listener>oracle.jheadstart.controller.jsf.lifecycle.JhsADFPhaseListener</phase-listener>
    </lifecycle>
    And then make a custom template for JhsCommon-beans.vm where you remove this entry.
    Steven Davelaar,
    JHeadstart team.

  • Access navigation rules programmatically?

    Hello.
    Is there any way to access the attributes of a navigation rule programmatically?
    In Struts, I was accustomed to getting the URL of a forward that I had set up by doing something like:
    <html:rewrite forward="myForwardName"...>on my JSP page, but I can't seem to find any equivalent of this functionality in JSF.
    Also, I would like to be able to access the navigation rule attributes from Java code, too, particularly the "to-view-id" attribute, which is something I did in Struts with code like:
    String path = mapping.findForward("myForwardName").getPath();I know that this isn't apples-to-apples, and that a global forward in Struts is not set up the same way as a navigation rule in JSF, but I'm hoping that there's some kindly JSF super-genius who can point me in the right direction. :-)
    Thanks!
    --Mike                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Thanks, rei_nanto--that did shed a little light on the subject!
    Now, unfortunately, I am not using the Sun reference implementation (we're using the IBM implementation), and so I don't have the ApplicationAssociate class you mentioned.
    I went out and looked at the ApplicationAssociate and NavigationHandlerImpl classes in the RI jars, though, as you suggested, and I can see how it could be done.
    The reason I'm looking for a way to get this information, especially the <to-view-id> information, is because I need to do a popup window from my JSF application page, and I would like not to hard-code the URL of the JSF page I want to appear in the popup.
    Hence, if I could get the path out of <to-view-id> programatically, I wouldn't have to hard-code the path in my popup.
    Any additional thoughts on the matter, given this additional information?
    Thanks!
    --Mike                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Change JSF navigation-rule not begin with "root"

    Dear all,
    I have a web application, call myApp, run in PC1. There is a navigation rule to control page1 jump to page2.
    normally, after deploy and run my application, url for it is: [ http://{color:#0000ff}pc1:8080{color}/{color:#008000}myApp{color}/*{color:#ff6600}page1.jsf{color}* ], and click something in my page1, it will go to [ http://{color:#0000ff}pc1:8080{color}/{color:#008000}myApp{color}/*{color:#ff6600}page2.jsf{color}* ].
    I have another machine, named PC2, and create a mapping and forward request to PC1. Therefore, if anyone type the url: [ http://*{color:#0000ff}pc2{color}*/subSection/{color:#008000}myApp{color}/{color:#ff6600}*page1.jsf*{color} ] , actuality, they are looking for [ http://{color:#0000ff}*pc1:8080*{color}/{color:#008000}myApp{color}/*{color:#ff6600}page1.jsf{color}* ].
    Now, I have a problem is that, when people browse a page [ http://{color:#0000ff}*pc2*{color}/*{color:#ff00ff}subSection{color}*/{color:#008000}myApp{color}/*{color:#ff6600}page1.jsf{color}* ] and click something, it will go to another page [ http://{color:#0000ff}*pc2*{color}/{color:#008000}myApp{color}/*{color:#ff6600}page2.jsf{color}* ], not go to [ http://{color:#0000ff}*pc2*{color}/*{color:#ff00ff}subSection{color}*/{color:#008000}myApp{color}/*{color:#ff6600}page2.jsf{color}* ]. Therefore, it makes "404 Not Found" exception.
    Does anyone help me?
    Thank you
    Kevin Tang.

    SuperCEO wrote:
    My application server is Apache Tomcat.
    May be my problem is related to Tomcat context path problem.
    I wanna to know can I modify my program, such as faces-config.xml, to fix my problem, or I need to modify my Tomcat setting ?I am suggesting you do not need to modify your program, but the configuration of whatever is doing the forwarding.

  • Dynamic Navigation mapping to Navigation Rules

    I have a situation where I need to create a javascript "hover-over" nav. I'd also like to have them define the navigation rules in their faces config. My question is, how do I code the javascript "action" for each nav item so that it somehow maps to the navigation rules I defined in my faces config? Right now I'm just rendering all of my javascript in my JSP. In order to get this to work, do I have to create a JSF component? Will it fit into the architecture more cleanly if I do? Any hints? I'd like this to fit into the JSF programming model as much as possible.
    Thanks,
    Dave

    I'm just kind of winging it at this point, basing my examples on some of the ones in Core JSF. I'm thinking my component will contain a string for the selected menu item and a collection of navigation items (display string/navigation key). Then there is the renderer for the component, followed by the Tag class and DTD. Does that sound like the right path? Since the nav is a glabal nav, I was thinking of reading in the structure from XML once, and not have all of the menu items in the JSP as child tags. I am still a bit confused as to how I will hook the action of the menu click to my backing bean action. Any help would be appreciated.
    Dave

  • Business Events related to AME Rules in iRecruitment

    Hello all,
    We have a Seeded AME rule and want to know which business event is firing that rule. Is it possible to find this out? The reason i want to know is we have a seeded rule called "Apply For Job - Manager Rule" which is related to iRecruitment. I want to know when this rule is fired. I tried so many ways to find out but couldn't.
    Thanks
    KK

    That means you want to know the condition on when this rule will be fired.
    So, search for the rule see if the Update icon is enabled. If enabled click on it there you can see the conditions.
    If update icon is not enabled, then on top you can see Conditions tab. Click on that.
    Conditions are based on the AME Attributes. There is one more attribute tab to see the definition of the tab.
    Regards,
    Peddi.

  • Problem with navigation-rules

    Hello!!!
    I'm using Jboss Jbpm with JSF and I want to navigate to other page when I fill a form and I send the data that I entered. I have declare the navigation-rules but it doesn't work and I don't know why.
    In my faces-config.xml I've added the navigation-rules:
    <managed-bean>
                   <managed-bean-name>usuario</managed-bean-name>
                   <managed-bean-class>com.miApp.UserBean</managed-bean-class>
                   <managed-bean-scope>request</managed-bean-scope>
              </managed-bean>
         <navigation-rule>
                   <from-view-id>/SolicitarAlta.xhtml</from-view-id>
                   <navigation-case>
                        <from-action>#{usuario.registrar}</from-action>
                        <from-outcome>correcto</from-outcome>
                        <to-view-id>/results/correcto.jsp</to-view-id>
                   </navigation-case>
         </navigation-rule>
         The UserBean has the method registrar:
    public String registrar() {
           if(dni==null || nombre==null || apellidos==null || ocupacion==null || mail==null || tlf==null ||
    password==null)      
                return "campos-obligatorios";
           if ((mail.trim().length() < 3) ||       (mail.indexOf("@") == -1))
                          return "mail-incorrecto";
           else if(tlf.length()!=9)     return "telefono-incorrecto";
                else if(dni.length()!=8) {return "dni-incorrecto";}
           return "correcto";
         And with this line:
    <h:commandButton type="submit" value="Enviar" action="#{usuario.registrar}"/>     the method registrar is executed and I know that this method returns the string "correcto" but ... This doesn't redirect me to the page correcto.jsp
    I thought that maybe if SolicitarAlta was an xhtml file the correcto page should be also an .xhtml file. I changed it but it doesn't work.
    Any ideas? Could it be that I have to add something more in the faces-config.xml & web.xml file???
    Thx!

    I found the solution to my problem but I don't really understand why it was not working. My problem was due to the use of command button with a render set to false. I just put them at true and all my navigation rules work!
    If someone know why it was not working, I would be glad to know!

  • Navigation-Rule

    I'm a newbie in JSF. I got some books and online tutorials. All the examples run fine, so I'm sure my basic configuration is fine.
    Now I have the problem, thatI'm not able to do some navigation. I have the following files:
    /usr/local/tomcat/webapps/fcms is my context, defined in Tomcat 5.5.7
    Where I have this file in /usr/local/tomcat/webapps/fcms /admin
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <f:view>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>Neue Seite</title>
      </head>
      <body>
        <h1>Neue Seite</h1>
    <table border="0">
    <h:form id="newpageform">
    <h:inputHidden id="website" value="#{initParam['website']}" />
    <h:inputHidden id="dataSource" value="jdbc/fcms" />
    <h:inputHidden id="id"  value="0" />
    <tr><td>Button</td>         <td><h:inputText id="buttonid"  value="#{newChapter.buttonid}"  /> </td></tr>
    <tr><td>Name</td>           <td><h:inputText id="name"      value="#{newChapter.name}"      /> </td></tr>
    <tr><td>Sortiername</td>    <td><h:inputText id="sortname"  value="#{newChapter.sortname}"  /> </td></tr>
    <tr><td>G&uuml;ltig von</td><td><h:inputText id="validfrom" value="#{newChapter.validfrom}" /> </td></tr>
    <tr><td>G&uuml;ltig bis</td><td><h:inputText id="validto"   value="#{newChapter.validto}"   /> </td></tr>
    <tr><td valign="top" >Beschreibung</td><td><h:inputTextarea id="description"
                                                                 value="#{newChapter.description}" 
                                                                 rows="5" cols="50"/></td></tr>
    <tr><td valign="top">Text</td><td><h:inputTextarea  id="text"       
                                                         value="#{newChapter.text}"
                                                         rows="24" cols="80"/>       </td></tr> 
    <tr><td colspan="2" align="center" valign="middle">
         <h:commandButton value="Speichern" action="#{newChapter.saveChapter}"/></td></tr>
    </h:form>
    </table>
    </body>
    </html>
    </f:view>Here is my faces.xml:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
    <managed-bean>
       <managed-bean-name>newChapter</managed-bean-name>
       <managed-bean-class>applications.fcms.handlers.NewChapter</managed-bean-class>
       <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
             <from-view-id>/admin/newpage.jsp</from-view-id>
             <navigation-case>
                    <from-action>#{newChapter.saveChapter}</from-action>
                    <from-outcome>success</from-outcome>
                    <to-view-id>/admin/savenewpage.jsp</to-view-id>
             </navigation-case> 
    </navigation-rule>
    </faces-config>It always stays onto newpage.jsp and does not execute my action #[newChapter.saveChapter}!
    Does anyone of you see, what I'm not able to see? What is wrong?
    Many thanks
    Fredy
    It instantiates fine the bean, because it displays the init-values. Here is the bean:
    package applications.fcms.handlers;
    import applications.fcms.ChapterRow;
    import applications.fcms.ChapterBean;
    public class NewChapter extends ChapterBean {
        int localid=0;
        public void setId(int v) {
         System.out.println("Setze ID: " + v);
            localid = v;
         if ( ( localid > 0 ) && (getDataSource() != null) ) {
             ChapterRow chapter = new ChapterRow(getDataSource());
                try {
             chapter.searchById(localid,true);
             chapter = chapter.next();
             if ( chapter != null ) {
              setId(chapter.getId());
              setButtonid(chapter.getButtonid());
              setName(chapter.getName());
              setValidfrom(chapter.getValidfrom());
              setValidto(chapter.getValidto());
              setCreationdate(chapter.getCreationdate());
              setDescription(chapter.getDescription());
              setSortname(chapter.getSortname());
              setWebsite(chapter.getWebsite());
              setText(chapter.getText());
             } catch (java.sql.SQLException sqle) {
              localid= 0;
             chapter.close();        
        public int getId() {
         return this.localid;
        public NewChapter() {
            System.out.println("init bean");
         setButtonid(0);
         setName("");
         setValidfrom(new java.sql.Date((new java.util.Date()).getTime()));
         setValidto(getSomeYears());
         setCreationdate(getValidfrom());
         setDescription("");
         setSortname("");
         setWebsite("");
         setText("");
         setId(0);
        private java.sql.Date getSomeYears() {
         java.util.Calendar today =  java.util.Calendar.getInstance();
         today.add(today.YEAR,+10);
         return (new java.sql.Date(today.getTimeInMillis()));
        String dataSource = null ;
        public void setDataSource(String v) {
         this.dataSource = v;
         System.out.println("Setze Dtasource: " + v);
        public String getDataSource() {
         return this.dataSource;
        public String saveChapter() {
            String msg="failure";
         System.out.println("SAVE CHAPTER");
            if ( (getDataSource() != null) && ( getWebsite() != null ) )  {
             ChapterRow chapter = new ChapterRow(getDataSource());
             chapter.setId(getId());
             chapter.setName(getName());
             chapter.setValidfrom(getValidfrom());
             chapter.setValidto(getValidto());
             chapter.setCreationdate(getCreationdate());
             chapter.setDescription(getDescription());
             chapter.setSortname(getSortname());
             chapter.setWebsite(getWebsite());
             chapter.setText(getText());
             if ( chapter.getId() == 0) {
              msg = chapter.insert();
             } else {
              msg= chapter.update();
             if (msg.toLowerCase().startsWith( "ok" ) ) msg = "success";
             chapter.close();
         return msg;
    }and here the initial bean:
    package applications.fcms;
    /** this has been generated by Fredy's Admin-Tool for SQL-Databases
    *  Date: 2005-5-9
    *  RDBMS:    MySQL Version: 4.1.9-standard
    *  Database: fcms
    *  Table:    chapter
    *  Description:
    *           Primarykeys:    id
    *           Columnname: id
    *           Type name : int
    *           Size      : 11
    *           Nullable  : 0
    *           Remarks   : auto_increment
    *           Column def: null
    *           Columnname: buttonid
    *           Type name : int
    *           Size      : 11
    *           Nullable  : 0
    *           Remarks   :
    *           Column def: 0
    *           Columnname: name
    *           Type name : varchar
    *           Size      : 20
    *           Nullable  : 0
    *           Remarks   :
    *           Column def:
    *           Columnname: validfrom
    *           Type name : date
    *           Size      : 10
    *           Nullable  : 0
    *           Remarks   :
    *           Column def: 0000-00-00
    *           Columnname: validto
    *           Type name : date
    *           Size      : 10
    *           Nullable  : 0
    *           Remarks   :
    *           Column def: 0000-00-00
    *           Columnname: creationdate
    *           Type name : date
    *           Size      : 10
    *           Nullable  : 0
    *           Remarks   :
    *           Column def: 0000-00-00
    *           Columnname: description
    *           Type name : varchar
    *           Size      : 250
    *           Nullable  : 1
    *           Remarks   :
    *           Column def: null
    *           Columnname: text
    *           Type name : text
    *           Size      : 65535
    *           Nullable  : 1
    *           Remarks   :
    *           Column def: null
    *           Columnname: sortname
    *           Type name : varchar
    *           Size      : 20
    *           Nullable  : 0
    *           Remarks   :
    *           Column def:
    *           Columnname: website
    *           Type name : varchar
    *           Size      : 100
    *           Nullable  : 0
    *           Remarks   :
    *           Column def:
    *  Admin is under GPL
    *  Fredy Fischer
    *  Hulmenweg 36
    *  8405 Winterthur
    *  Switzerland
    * [email protected]
    import java.io.Serializable;
    public class ChapterBean implements Serializable {
        int id;
           * get the value of the column id;
           * @return value of id;
        public synchronized int getId() { return id; }
           * set the value of the column id;
           * @param v value to assign to id;
        public synchronized void setId(int v) { this.id = v; }
        int buttonid;
           * get the value of the column buttonid;
           * @return value of buttonid;
        public synchronized int getButtonid() { return buttonid; }
           * set the value of the column buttonid;
           * @param v value to assign to buttonid;
        public synchronized void setButtonid(int v) { this.buttonid = v; }
        String name;
           * get the value of the column name;
           * @return value of name;
        public synchronized String getName() { return name; }
           * set the value of the column name;
           * @param v value to assign to name;
        public synchronized void setName(String v) { this.name = v; }
        java.sql.Date validfrom;
           * get the value of the column validfrom;
           * @return value of validfrom;
        public synchronized java.sql.Date getValidfrom() { return validfrom; }
           * set the value of the column validfrom;
           * @param v value to assign to validfrom;
        public synchronized void setValidfrom(java.sql.Date v) { this.validfrom = v; }
        java.sql.Date validto;
           * get the value of the column validto;
           * @return value of validto;
        public synchronized java.sql.Date getValidto() { return validto; }
           * set the value of the column validto;
           * @param v value to assign to validto;
        public synchronized void setValidto(java.sql.Date v) { this.validto = v; }
        java.sql.Date creationdate;
           * get the value of the column creationdate;
           * @return value of creationdate;
        public synchronized java.sql.Date getCreationdate() { return creationdate; }
           * set the value of the column creationdate;
           * @param v value to assign to creationdate;
        public synchronized void setCreationdate(java.sql.Date v) { this.creationdate = v; }
        String description;
           * get the value of the column description;
           * @return value of description;
        public synchronized String getDescription() { return description; }
           * set the value of the column description;
           * @param v value to assign to description;
        public synchronized void setDescription(String v) { this.description = v; }
        String text;
           * get the value of the column text;
           * @return value of text;
        public synchronized String getText() { return text; }
           * set the value of the column text;
           * @param v value to assign to text;
        public synchronized void setText(String v) { this.text = v; }
        String sortname;
           * get the value of the column sortname;
           * @return value of sortname;
        public synchronized String getSortname() { return sortname; }
           * set the value of the column sortname;
           * @param v value to assign to sortname;
        public synchronized void setSortname(String v) { this.sortname = v; }
        String website;
           * get the value of the column website;
           * @return value of website;
        public synchronized String getWebsite() { return website; }
           * set the value of the column website;
           * @param v value to assign to website;
        public synchronized void setWebsite(String v) { this.website = v; }
           * get the value of the bean derived out of the table chapter
           * @return value of chapterBean
        public synchronized ChapterBean getBean() {
           ChapterBean chapterBean = new ChapterBean();
           chapterBean.setId(getId());
           chapterBean.setButtonid(getButtonid());
           chapterBean.setName(getName());
           chapterBean.setValidfrom(getValidfrom());
           chapterBean.setValidto(getValidto());
           chapterBean.setCreationdate(getCreationdate());
           chapterBean.setDescription(getDescription());
           chapterBean.setText(getText());
           chapterBean.setSortname(getSortname());
           chapterBean.setWebsite(getWebsite());
           return chapterBean;
        * this is just the default constructor
        * that is here just be be here
       public ChapterBean () {
          // default constructor
          public ChapterBean (
                           int id,
                           int buttonid,
                           String name,
                           java.sql.Date validfrom,
                           java.sql.Date validto,
                           java.sql.Date creationdate,
                           String description,
                           String text,
                           String sortname,
                           String website) {
             this.setId(id);
             this.setButtonid(buttonid);
             this.setName(name);
             this.setValidfrom(validfrom);
             this.setValidto(validto);
             this.setCreationdate(creationdate);
             this.setDescription(description);
             this.setText(text);
             this.setSortname(sortname);
             this.setWebsite(website);
    }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

    Look the checklist at:
    http://www.jsf-faq.com/faqs/faces-navigation.html#111
    Sergey : jsfTutorials.net

Maybe you are looking for

  • Problem with \n

    As I can control when a user leaves a program with the commando /n or other transaction code? Thanks.

  • HT1846 32 bit or 64 bit version of Windows 7

    I have the 2007 MacBookPro3,1, Intel Core 2 Duo, 2.4 GHz. Should I purchase the 32 bit or 64 bit version of Windows 7 to run with Boot Camp? Thanks!

  • Problem Building DCs

    Hello everybody, i have set up the JDI and everything went quite well. Now when i have checked in my changes i have made via the NWDS and want them to activate i get an error at the Actication Requests view. Unfornunately there is no Activation log.

  • How to display find toolbar on firefox startup?

    I just upgraded to ff 6.0.2. My old version of ff had a change to the userChrome.css file: #FindToolbar {display: -moz-box !important;} This causes the find toolbar to appear on ff startup. I want this functionality with 6.0.2. You help is appreciate

  • Lost iphoto 6 data

    hi i recently deleted by mistake a user a/c which has i photo data in that i need. i clicked delete immediately so no back up file was made. just wondering if there is a master cache file or something similar where i can retrieve info. cheers