Calling action on navigation bean skips setters on form bb

Hi,
I'm new to these forums so please bare me out :)
I'm trying to always save the current form on a navigation event. Using facelets, so the navigation is general over all pages. I'm using t:panelNavigation2 for this (tomahawk) with commandNavigation2 items. The current form is always defined in an ui:define block.
I'm trying to always call the save action on the current page before handling navigation. The way I was thinking is this:
I put an updateActionListener in all the commandNavigation2 tags, which set the next navigation-rule outcome on my HistoryManager. Then in another manager I call an action handleNavigation, which sorts out the current bean and calls save on it. The problem is that at the time handleNavigation is called, the properties i defined in my bean are not set yet. Normally when I call some sort of action on the pages backing bean, all properties are set first.
Is there some way to force this? To make myself a little clearer (I hope) here's my code:
public class ApplicationManager {
   private HistoryManager historyManager;
   private String nextBean;
   public String handleNavigation() throws BeanNotFoundException {
      Map requestMap = FacesUtils.getExternalContext().getRequestMap();
      FormBaseBb bean = (FormBaseBb) requestMap.get(historyManager.getCurrentForm());
      bean.save();
      historyManager.setCurrentForm(nextBean);
      return nextBean.substring(0, nextBean.length() - 2);
   public void setNextBean(String nextBean) {
      this.nextBean = nextBean;
   public HistoryManager getHistoryManager() {
      return historyManager;
   public void setHistoryManager(HistoryManager historyManager) {
      this.historyManager = historyManager;
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:t="http://myfaces.apache.org/tomahawk">
<f:loadBundle var="general_msg"
     basename="nl.tempel.tipharma.logic.jsf.resource.general_messages" />
<f:loadBundle var="admin_msg"
     basename="nl.tempel.tipharma.logic.jsf.resource.admin_messages" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><ui:insert name="window_title">TI Pharma</ui:insert></title>
<style type="text/css" media="all">
          /* <![CDATA[ */
               @import url(css/layout_common.css);
               @import url(css/layout_complex.css);
               @import url(css/navigation_left.css);
               @import url(css/content.css);
          /* ]]> */
     </style>
</head>
<body>
<div id="master_container"><h:form id="f">
     <div id="master_header">&#xA0;</div>
     <div id="top_navigation"><ui:insert name="top_navigation">
          <div class="top_link_active">Form</div>
          <div class="top_link_inactive"><h:commandLink
               action="information" styleClass="top_link" value="Information" /></div>
          <div class="top_link_inactive"><h:commandLink
               action="#{authenticationBb.logout}" styleClass="top_link"
               value="Log Out" /></div>
     </ui:insert></div>
     <div id="nav_line">&#xA0;</div>
     <div id="main_wrapper">
     <div id="navigation_wrapper"><t:panelNavigation2
          id="panel_navigation" layout="list" styleClass="navigation_list"
          itemClass="item" activeItemClass="active_item"
          openItemClass="open_item">
          <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
               activeOnViewIds="/form_general.xhtml" value="1. General data"
               immediate="false">
               <h:outputText value="1. General data" />
               <t:updateActionListener property="#{applicationManager.nextBean}"
                    value="#{formGeneralBb.beanName}" />
          </t:commandNavigation2>
          <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
               value="2. Project content" immediate="false">
               <h:outputText value="2. Project content" />
               <t:updateActionListener property="#{applicationManager.nextBean}"
                    value="#{formSummaryAndGoalsBb.beanName}" />
               <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
                    activeOnViewIds="/form_summary_and_goals.xhtml"
                    value="a. Summary and goals" immediate="false">
                    <h:outputText value="a. Summary and goals" />
                    <t:updateActionListener property="#{applicationManager.nextBean}"
                         value="#{formSummaryAndGoalsBb.beanName}" />
               </t:commandNavigation2>
               <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
                    activeOnViewIds="/form_milestones.xhtml" value="b. Milestones"
                    immediate="false">
                    <h:outputText value="b. Milestones" />
                    <t:updateActionListener property="#{applicationManager.nextBean}"
                         value="#{formMilestonesBb.beanName}" />
               </t:commandNavigation2>
               <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
                    activeOnViewIds="/form_characterization.xhtml"
                    value="c. Characterization" immediate="false">
                    <h:outputText value="c. Characterization" />
                    <t:updateActionListener property="#{applicationManager.nextBean}"
                         value="#{formCharacterizationBb.beanName}" />
               </t:commandNavigation2>
               <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
                    activeOnViewIds="/form_publications.xhtml" value="d. Publications"
                    immediate="false">
                    <h:outputText value="d. Publications" />
                    <t:updateActionListener property="#{applicationManager.nextBean}"
                         value="#{formPublicationsBb.beanName}" />
               </t:commandNavigation2>
          </t:commandNavigation2>
          <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
               value="3. Project budget" immediate="false">
               <h:outputText value="3. Project budget" />
               <t:updateActionListener property="#{applicationManager.nextBean}"
                    value="#{formCostsResearchersBb.beanName}" />
               <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
                    activeOnViewIds="/form_costs_researchers.xhtml"
                    value="a. Costs researchers" immediate="false">
                    <h:outputText value="a. Costs researchers" />
                    <t:updateActionListener property="#{applicationManager.nextBean}"
                         value="#{formCostsResearchersBb.beanName}" />
               </t:commandNavigation2>
               <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
                    activeOnViewIds="/form_costs_materials.xhtml"
                    value="b. Costs materials & Supplies" immediate="false">
                    <h:outputText value="b. Costs materials & Supplies" />
                    <t:updateActionListener property="#{applicationManager.nextBean}"
                         value="#{formCostsMaterialsBb.beanName}" />
               </t:commandNavigation2>
               <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
                    activeOnViewIds="/form_investments.xhtml" value="c. Investments"
                    immediate="false">
                    <h:outputText value="c. Investments" />
                    <t:updateActionListener property="#{applicationManager.nextBean}"
                         value="#{formInvestmentsBb.beanName}" />
               </t:commandNavigation2>
               <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
                    activeOnViewIds="form_partner_contribution.xhtml"
                    value="d. Partner contribution" immediate="false">
                    <h:outputText value="d. Partner contribution" />
                    <t:updateActionListener property="#{applicationManager.nextBean}"
                         value="#{formPartnerContributionBb.beanName}" />
               </t:commandNavigation2>
               <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
                    activeOnViewIds="/form_external_grants.xhtml"
                    value="e. External grants" immediate="false">
                    <h:outputText value="e. External grants" />
                    <t:updateActionListener property="#{applicationManager.nextBean}"
                         value="#{formExternalGrantsBb.beanName}" />
               </t:commandNavigation2>
          </t:commandNavigation2>
          <t:commandNavigation2 action="#{applicationManager.handleNavigation}"
               activeOnViewIds="/form_submission.xhtml" value="4. Submission"
               immediate="false">
               <h:outputText value="4. Submission" />
               <t:updateActionListener property="#{applicationManager.nextBean}"
                    value="#{formSubmissionBb.beanName}" />
          </t:commandNavigation2>
     </t:panelNavigation2></div>
     <div id="content_wrapper">
     <div id="page_title"><ui:insert name="page_title">INSERT PAGE TITLE</ui:insert>
     </div>
     <div id="page_content"><ui:insert name="page_content">INSERT CONTENT</ui:insert>
     </div>
     <div id="page_footer"><ui:insert name="page_footer" /></div>
     </div>
     </div>
</h:form></div>
</body>
</html>And then i have some form where i call properties in some form backing bean. They just aren't set before this action gets called.
The only thing I can think of as a workaround right now is to define the navigation in every page and implement a custom EL function to handle navigation. This just seems like much of a hassle and I can't imagine there's not another soultion to this problem.
Any help would be greatly appreciated! Thanks in advance.
Regards,
Jan

After some further investigation I think this is a definite bug. All works fine when I use a commandButton or commandLink to accomplish the same. When I debug this in eclipse i notice that in the apply model values phase properties get set to null, although the form fields have some data in them.
It looks like the apply model values phase or even the apply request values phase is completely skipped.
Message was edited by:
jteb

Similar Messages

  • How to call action and actionListner in javascript

    Hi to all
    i want to call <h:commandLink> action and actionListner in javaScript
    for example
    <h:commandLink id="link" onclick="javascript:unction();"/>
    <Script>
    function()
    document.getElementById("link").action="#{someBean.someActon}"
    </Script>
    can i do like that in jsf
    waiting for ur reply

    You can't change the bean action in JS. Just change/delegate the actual action in the bean action method.

  • EJB is not throwing exception to calling Action class in Unix environment

    Hi
    We are using Weblogic Server 9.2.3.0.
    One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
    Somehow the EJB is swallowing the exception.
    any idea? I suspect it may be environmental issue?
    thank you

    Hi
    We are using Weblogic Server 9.2.3.0.
    One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
    Somehow the EJB is swallowing the exception.
    any idea? I suspect it may be environmental issue?
    thank you

  • Calling function from Backing Bean or JSP page

    We are on Jdeveloper 10.1.3.3.0, ADF Faces, JSF Faces .., Currently there is a function call from Javascript event (onmouseover) in the JSP page. I want to call this function from a backing bean or JSP page, as I have to pass some values to this function.
    For Ex., I have a function call like return submit('A','B','Test'); on the Javascript event (onmouseover) in jsp page. I want to remove this function from the javascript event and call from backing bean or jsp page to pass some values into the submit() function. I appreciate if anyone can give some example of how to call this function from backing bean or jsp page in the <SCRIPT> or <SCRIPTLET>
    Thanks,
    Ram

    A use case would be helpful so that we can get a better idea of what you want to do.
    As a general rule, there is no way to call a client side Javascript function from a backing bean, which is server side. However, there are ways to inject information from a backing bean into your Javascript call. For instance, I have an application that uses Google Maps API. It has an onload call to a Javascript function that builds the map and designates it's center point. The center point comes from a backing bean as latitude and longitude properties. So here is my body tag:
    <afh:body onload="initialize(#{backing_searchResults.latitude},#{backing_searchResults.longitude},#{searchCriteria.distance})"
              onunload="GUnload()">onload calls the Javascript function called initialize, and passes the latitude, longitude, and distance from the bean. Is the function really being called from my backing bean? No - the parameters are hard coded into the onload event code when the page is rendered. Does it do the job? Sure it does.

  • Calling Actions in ABAP Programming.

    Hi,
    Is it possible to call ACTIONS in ABAP programming?
    Regards,

    Hi Pushpa,
    The receiver type is the workflow you want to start, when the event occurs, of corresponding object type.
    I Never had the need to develop at workflow level, but search a little in the foruns and you'll find a lot of info about this. I also advice you to open new threads when asking new questions: It's more appropriate and will bring you more answers
    Kind regards,
    Garcia

  • 1) Second thread call to stateful session bean.

    Hi Friend,
    I read your threads on otn and i compared your problem with us and i analysed that your application and my application is same, So Plese can you help me in some issues.
    Friend, Please help me in these issues, Thanks for this
    We have very big ADF Swing+BC Application and deployed as Stateful Session Bean. in my application there are 500 Application Modules,For each application module i created Stateful session beans and deployed it on OC4J Container but when working on deployed application then i am getting time out error after 15 min of working.
    1). I set that parameter that you mentioned i.e jbo.ejb.txntimeout = 86400,but still it is giving me same error.
    2). Second Issue is of ---ORA-01000: maximum open cursors exceeded
    For this issue i chaged the Database Parameter i.e OpenCurser=2000, but still it is giving me same error,
    is there any parameter on application module required to change so that this error will not come.
    3). When i close the form then application module is not releasing database connection.
    4). (oracle.oc4j.rmi.OracleRemoteException) Second thread call to stateful session bean
    This error is also coming when I am using deployed application for long time i.e more than 15 min for Heavy Transactions

    Hi Suyog,
    How r u?
    We all are fine.
    I alerady tried for the Max Curser Property but it is not helpfull.
    I think again i have to go for closing opened db RS and statements.
    Thanks
    Vijay

  • Is it possible to trigger action in backing bean on page unload event?

    Hi,
    There is a RichPopup in my page which has a Listener to save data or not by user choice "Data change detected, do you want to save those changes?"
    I've tried with the javascript event 'window.onbeforeunload', but this way must be fit with a Servlet function which I am not allowed to use.
    The attibute 'onunload' in the tag '<af:document>' seems useless. Even there is few description or example in the 'Tag Reference'.
    So, is it possible to trigger action in backing bean on page unload event? Thanks in advance for helping.
    Viva

    Hi Frank
    Thanks for helping, I've tried in your way. My codes are like below:
    Page codes:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1" clientComponent="true" title="viva test">
          <af:resource type="javascript">
            if (!window.addEventListener) {
                // alert('window.addEventListener is not supported in IE8. Override it!');
                window.addEventListener = function (type, listener, useCapture) {
                    window.attachEvent('on' + type, function() {listener(event)});
            window.addEventListener('beforeunload', function (){performUnloadEvent()}, false);
            function performUnloadEvent() {
              var eventSource = AdfPage.PAGE.findComponentByAbsoluteId('d1');
              //var x and y are dummy variables obviously neeed to keep the page
              //alive for as long it takes to send the custom event to the server
              var x = AdfCustomEvent.queue(eventSource, 'handleOnUnload', {args:'noargs'}, false);
              var y = 0;
          </af:resource>
          <af:serverListener type="handleOnUnload" method="#{vivaTestBean.testOnUnload}"/>
          <!--
          <af:form id="f1">
            <af:commandButton text="Unload" id="cb1" action="unload"/>
          </af:form>
          -->
        </af:document>
      </f:view>
    </jsp:root>The backing bean codes:
    public class VivaTestBean {
        public VivaTestBean() {
        public void testOnUnload(ClientEvent clientEvent) {
            System.out.println("Thanks God");
    }The first way which triggers a 'unload' event by clicking a button DO WORKS. :)
    But when I changed the triggered way by changing the <af:document> to clientComponent as what you did, the 'onbeforeunload' event won't come out when I refreshed or closed the page.
    That doesn't make sence, since I think the two ways to trigger a 'unload' event are the same.
    Edited by: 841766 on 2011-3-7 上午1:13

  • OrionRemoteException: Second thread call to stateful session bean

    What happen for "com.evermind.server.rmi.OrionRemoteException: Second thread call to stateful session bean".
    I am using JSP/Servlet/EJB and OC4J. When user click the JSP page button to fast, sometimes the error will appear, and then the OC4J will stop, I need to restart the OC4J.
    I am using standlone OC4J 9.0.3.0.0
    Thanks in advance,
    Perry

    Have you cached the remote object you obtained for the stateful session beamn and are reusing the same object on subsequent requests from the JSP page? So in effect, you are making a second call to the bean before the first method call completes?
    Without knowing anything about what you are doing or how you app is constructed, you may want to set some form of flag for the user session to indicate whether the bean is in use, which you can check before using the bean in requests. When the bean method call completes, open the gate again. If the bean is in use, return a nice message to the user telling them to hold off for a short while.
    -steve-

  • Need urgent help: how to avoid concurrent calls on statefull session beans

    Hi,
    I need a little advice in designing a EJB session facade using JSPs, servlets, session and
    entity beans.
    My current design is:
    - JSP pages: here are only getMethods for the session bean used. All set-methods are handled by a
    - servlet: I have got one servlet handling several JSP pages. The servlet basically takes the
    form fields and stores them in the session bean and than dispatches to the next JSP-page
    - stateful session bean: here is, where all the business logic is conducted. There is one session
    bean per servlet using several
    - CMP entity beans: to talk to the database (Oracle 8i)
    The application server is JBoss 3.0.3.
    My problem is, if a user clicks on a submit button of a JSP page more than once before the next
    page builds up, I may get a "javax.ejb.EJBException: Application Error: no concurrent calls on
    stateful beans" error. I already synchronized (by the "session") the code in the servlet, but
    it happens in the JSP pages as well.
    I know, that Weblogic is able to handle concurrent calls, by JBoss isn't and it's clearly stated
    in the spec, that a user should avoid to have concurrent calls to a stateful bean.
    The big question is now: How can I avoid this? How can I prohibit the user to submit a form several
    times or to ignore anything, which arrives after the first submit?
    Thanks for any help,
    Thorsten.

    Synchronizing on the session is probably your best bet.
    You'll need to do all the data access and manipulation in the servlet. Cache any data you need using request.setAttribute() and then not access the EJB on the JSP page.
    If performance is an issue, you may also want to use create a user transaction to wrap all the EJB access in, otherwise each EJB call from the servlet is a new transaction. Just make sure you use a finally block to properly commit/rollback the transaction before you redirect to the JSP.
    UserTransaction utx    = null;
    synchronized (request.getSession())
      try {
        Context ctx = new InitialContext();
        utx = (UserTransaction) ctx.lookup("javax/transaction/UserTransaction");
        utx.begin();
        // ... Create session bean ...
        request.setAttribute("mydata", sessionBean.getMyData());
        try {
          utx.commit();
        catch (Exception ex) {
          log.warn("Transaction Rolled Back (" + ex.getClass().getName() + "): "
            + ex.getMessage(), ex);
        utx = null;
      } // try
      finally {
        if(utx != null)
          try {
            utx.rollback();
          catch (Exception e) {
            log.warn(e.getMessage(), e);
          } // catch
        } // if
      } // finally
    } // syncrhonized(session)

  • Calling actions and release compound path (CS4)

    Is there any way to call an action using Illustrator script?
    I can call actions in Photoshop so why is it not working for Illustrator?
    Also, how to script 'release compound path' in Illustrator. Usual method not working...
    Juz0

    Can you NOT just move the compoundPathItem's pathItems to another location before/after? Kind of like this…
    #target illustrator
    var docRef = app.activeDocument;
    with(docRef) {
         with(compoundPathItems[0]) {
              var x = pathItems.length;
              for (var i = x-1; i >= 0; i--) {
                   pathItems[i].move(compoundPathItems[0], ElementPlacement.PLACEBEFORE);

  • Looking for an idea to call action listner or other way to call java code

    Hi
    I'm building some project on JSF2
    I'm Looking for an idea to call action listner or other way to call java code from link(not commandlink)
    and i got a sign out button which i want to invalidate the session when its clicked...
    i cant do a redirect to a jsp... its a "special" link that does the log out , so i cant use the link for the session invalidation
    I dont want to use commandLink cause i need to put it into a form, and i don't to make my code uglier...
    any ideas?
    Im using JSF 2 (new to it)

    Under the constraints you have given the only thing I can think of is some kind of "pretty url" technique combined with JSF. Google can help you out. (Although that might be overkill for what you need.)
    Other than that I think you are looking at straight Java or JSP solutions that do not involve JSF.

  • Is there any way to call 'Action' in web.xml ?

    Dear All,
    My requirement is like, in my Deployement descriptior (web.xml) I would like to call "action" instead of calling welcome page(*.jsp).
    Iam using JBOSS with Jetty5.0 Servlet Container.Is there any way to call action in my deployment descriptor?
    Thanx in advance

    You can, but you have change your server configuration file. I am using Sun App server where we have a default-web.xml file in the config directory where it specifies which default file will be loaded, instead of calling the welcome.jsp. In Sun App server there is a parameter called <welcome-file-list> where you can specifiy which one to be loaded. I strongly believe there must be something like that in JBoss. Check out all the xml files in the JBoss config directory where you can find a solution to it.

  • Calling action unixActions2.2.0.18.0  touchFile

    Hi,
    I try to install Oracle 9.2.0.4 for 64-bit Linux platform on Suse 9.0.
    I have DELL Poweredge 2850 . I performed pre-installation tasks
    next I executed ./runInstaller from Disk1 . I see Universal Installer but when
    installation comes to the 18 percent and UI tries to install "Installing
    Oracle Reguaired Files 32-bit 9.2.0.1.0" my installation do not go further
    . Maybe you can help me?
    I present below the end of my log file.       
    copyAsText = null
            JarLoc = /tmp/OraInstall2006-03-10_04-22-02PM/temp36
            gpEntries = [[libvsn_ee9.a ->%ORACLE_HOME%/lib32/libvsn9.a 2214 plats=2=>[46] langs=2=>[en,fr,ar,bn,pt_BR,bg,fr_CA,ca,hr,cs,da,nl,ar_EG,en_GB,et,fi,de,el,iw,hu,is,in,it,ja,ko,es,lv,lt,ms,es_MX,no,pl,pt,ro,ru,zh_CN,sk,sl,es_ES,sv,th,zh_TW,tr,uk,vi]]
    , [libntcps9.a ->%ORACLE_HOME%/lib32/libntcps9.a 52696 plats=2=>[46] langs=2=>[en,fr,ar,bn,pt_BR,bg,fr_CA,ca,hr,cs,da,nl,ar_EG,en_GB,et,fi,de,el,iw,hu,is,in,it,ja,ko,es,lv,lt,ms,es_MX,no,pl,pt,ro,ru,zh_CN,sk,sl,es_ES,sv,th,zh_TW,tr,uk,vi]]
    , [naeet.o ->%ORACLE_HOME%/lib32/naeet.o 6029 plats=2=>[46] langs=2=>[en,fr,ar,bn,pt_BR,bg,fr_CA,ca,hr,cs,da,nl,ar_EG,en_GB,et,fi,de,el,iw,hu,is,in,it,ja,ko,es,lv,lt,ms,es_MX,no,pl,pt,ro,ru,zh_CN,sk,sl,es_ES,sv,th,zh_TW,tr,uk,vi]]
            DllGroup = false
    Calling action unixActions2.2.0.18.0  touchFile
            source = /oracle/DP5/920_64/lib/ldflags
    Thanks in advance
    Steven

    Problem resolved when
    export LD_ASSUME_KERNEL=2.4.21
    Thanks a lot,mj

  • Using side navigation bean in CRM navigation (jtfcrmchrome)

    Hi,
    I’m facing a problem using side navigation regions in OSO.
    I’ve created an OAF page with side navigation bean (OASideNavBean, OAHeaderBean) and it worked fine.
    When I added the OAF page into the OSO (Oracle Sales Online, a JSP based application) – I used “jtfcrmchrome.jsp?page/oracle/apps/…” instead of
    “OA.jsp?page/oracle/apps/…” in order to keep the look and feel of the CRM, the side-navigation region is not displayed.
    Is there a way to use the side-navigation bean in the “jtfcrmchrome.jsp?” environment?
    Best regards,
    Rona

    Rona,
    JTF and OAF are different tech stacks. You can't use it the way you are looking for. Check " JTT/OA Framework Interoperability" section of dev guide for more details and list of restrictions of interoperability.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Create Form Beans from JSP/HTML forms

    In the Builder certification objectives, there is one called "Create Form Beans from JSP/HTML forms". How can I do that? How can I create a form beam starting from the JSP form or HTML form?

    Guys, no one from forum can answer this question?

Maybe you are looking for