CommandButton doesn't invode the function in backing bean.

I have a jsp page which contains three buttons, and based on a session level state, only one shown at the beginning. Once this button is clicked, the other two are shown and the first one is hidden.
When the first button (add) is clicked, the other two are shown correctly. But when I clicked any one of them, none of their backing bean methods are called. I checked the log, no exception.
Then I tried to show all buttons at begining, and click them. Both backing bean methods are invoked.
Did I miss something in the life cycle of JSF?
Here is the part of jsp page:
<h:commandButton action="#{manageBranches.doAddBranches}" image="/images/add.gif" rendered="#{!manageBranches.isAdd}"
styleClass="toolbaricon" title="#{messages['branches.dropdown.add.branches']}"
onmouseover="swapImage( this, 'add.gif', 'add_down.gif' );"
onmouseout="swapImage( this, 'add.gif', 'add_down.gif' );" />
<h:commandButton action="#{manageBranches.doEditBranches}" image="/images/edit_icon.gif" rendered="#{manageBranches.isAdd}"
styleClass="toolbaricon" title="#{messages['branches.dropdown.edit.branches']}"
onmouseover="swapImage( this, 'edit_icon.gif', 'edit_icon_down.gif' );"
onmouseout="swapImage( this, 'edit_icon.gif', 'edit_icon_down.gif' );" immediate="true" />
<h:commandButton action="#{manageBranches.doSaveBranches}" image="/images/save.gif" rendered="#{manageBranches.isAdd}"
styleClass="toolbaricon" title="#{messages['branches.dropdown.save.branches']}"
onmouseover="swapImage( this, 'save.gif', 'save_down.gif' );"
onmouseout="swapImage( this, 'save.gif', 'save_down.gif' );" />
Here are corresponding backing bean methods:
     public String doAddBranches()
          Logger.logEnterPublic(MY_CLASS, "doAddBranches()");
          setIsAdd(true);
          return null;
     public String doSaveBranches()
          Logger.logEnterPublic(MY_CLASS, "doSaveBranches()");
          String forward = null;
          if(addedBranchIds ==null || addedBranchIds.length()==0)
MessageFactory.addErrorMessage( null, "branches.selectAtLeastOneBranch", null );
this.successMsg = false;
return forward;
          else
               String[] branchIdArray = addedBranchIds.split(":");
          this.successMsg = true;
          //TODO: add save logic
          return forward;
     public String doEditBranches()
          Logger.logEnterPublic(MY_CLASS, "doEditBranches()");
          String forward = null;
          setIsAdd(false);
          return forward;
The add button worked fine. But when save and edit button were shown and add button was hidden. Both save and edit button can't access the backing bean methonds. I put a break point on the constructor of the backing bean, it WAS accessed!
Very confusing!
Thanks for any helps.
jm.

Ok, I'm not 100% on this, but it's something you can try. In your action methods, you often return null when you want the page to just be reloaded. I believe in JSF, returning null and returning a string that represents the same page is quite different. I think this is because the component tree will get re-initialized when you return a proper string. It's quite possible that you need to have the component tree re-initialized for everything to work properly.
Therefore, whenever you want to reload "pageA" then return an abbreviation called "A" (or whatever you want). In your faces-config.xml set up a rule that when outcome "A" is received (while on pageA) then load pageA.jsp.
Hope that makes some sense! Let me know if it works.
CowKing

Similar Messages

  • How to call a Javascript function from backing bean without any event

    Hi,
    Someone knows how to call a Javascript function from backing bean without any event ?
    thanks

    Please review the following thread:
    ADF Faces call javascript
    Luis.

  • How to call javascript function in back bean of jsf

    hi,
    i am trying to call java script function in back bean but not done. Is there any code for call javascript function in bean file.

    Java runs at server side.
    JSF produces HTML output.
    Server sends HTML output to client.
    Java stops running.
    HTML runs at client side.
    JS starts to run in HTML.
    Clear? Java is a server side language. JS is a client side language. To run JS using JSF, simply print it out to the HTML so that it get invoked when the HTML runs.

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

  • I'm getting a "The procedure entrypoint ssSr192x__​ssSr192drv​ssSrReset could no be located in the dynamic link library ssSR192x.d​ll" because the ActiveX instrument driver DLL doesn't have the function names in the export table.

    Is there a way for my CVI project to reference the functions in the ActiveX without including the instrument .fp in the project?
    Thanks much.
    I'm confused on how CVI uses ActiveX components and hope someone can help.
    I'm using an ActiveX driver from an instrument manufacturer and I use the .TLB to generate a .fp, .c, and .h file. If I register the .dll and load the .fp in my project, all is well. Unfortunately in my application the functions to control this instrument are in another DLL whose .lib I include in my CVI projec
    t. Running the CVI project this way gives me "The procedure entrypoint ssSr192x__ssSr192drvssSrReset could no be located in the dynamic link library ssSR192x.dll" because the instrument function names aren't in the export table in the instrument DLL. Non-ActiveX DLLs have the export tables so everything works for them.
    Program structure with non-ActiveX DLLs:
    CVI project (.exe with common.lib in project list)
    |
    V
    Common DLL (MeasDMM() with hp1234.lib in project list)
    |
    V
    Instrument DLL (hp1234_measure())
    Since I get a .c and .h file from the .TLB, I've tried recompiling the DLL (.dll and .lib produced) and the functions seem to work, but I get "Class not registered" errors unless I play games with the registry so I'm obviously violating numerous Microsoft rules!
    Is there a way for my CVI project to reference the functions in the ActiveX without including the instrument .fp in the project? Thanks much.
    Jeff Fish
    Advisory Test Engineer
    StorageTek

    Hello Jeff,
    Where were your getting the .lib file for the ActiveX DLL? Did you use the "hp1234"
    ActiveX driver generated by the "Create ActiveX Automation Controller" CVI Tool to build a static library? If you open an include file and choose Options >> Generate DLL..., it will generate source code or a static import library to load the specified DLL and load functions specified in the include file (this only works if the functions are exported from a DLL). However, in the case of our ActiveX Automation Controllers, ActiveX calls are used to access a DLL. This means that you do not need an import library. You should be able to open the "hp1234" source file and click Options >> Create Object File. Simply #include "hp1234.h" and add "hp1234.obj" to your Common DLL project;
    the .fp file is not necessary. If this does not answer your questions or if you experience further difficulty, please post further details on what you are doing and the errors that are being encountered ("play games with the registry" and "recompiling 'the' DLL" are a bit vague in this case).
    Jeremiah
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Executing Javascript AFTER the action in Backing Bean

    I have a commandButton on my JSP which is bound to a method in my backing bean by the action attribute. However, I also have a Javascript function call in onClick. But, the Javascript function call is always executed first and then my action method is executed. Is there a way to execute the action method first and THEN the Javascript call? I simply just want to popup a message that says 'Save successful' or something to that effect.

    put a onload on your body.
    The javascript function reads a form value and if a certain condition is true you show the alert.
    For example, i've this to clean up error messages. (JavaScript)
    // Cleans the application error messages if there are jsf errors
    function cleanErrorMessages(){
        if(document.getElementById('form1:jsfErrorMessages') != null){
            document.getElementById('form1:applicationErrorMessages').innerText='';
    }

  • Can we call a javascript function from backing bean class?

    I have a requirement. In a multiselect table, when users selects some rows and clicks a button. Depending upon some condition, an alert box should appear with 2 buttons 'Yes' and 'No'. On clicking yes, certain field values in the selected rows of table should change. On clicking no, the alert box should close. As far as i know alert box can be done only in JS.
    Please help me, if a javascript function can be called in backing bean method or suggest some way where alert boxes can appear through ADF.

    I need to go back to the backing bean as i need to iterate through each selected row of the table in a method( method written for command button) and then if atleast one of the selected rows has job field='Manager', then an alert box needs to be displayed. If none of the rows have job field as 'manager', alert box should not be displayed.
    If I write the function for onclick, i cannot iterate through the selected rows of the table in JS function.
    Please suggest a way to do this.

  • ADF Question: call javascript function from backing bean?

    Hi all,
    I am running JDeveloper 10.1.3.3 with ADF BC.
    Heres my situation:
    I have a table, and after inserting a new row, then committing, I want to call a javascript function. I tried using the onkeyup javascript to force a click of the save button, and then call my function after that. However, I really only want the second function to be called AFTER the commit has occurred.
    I have tried putting a setTimeout on the second function, but this never executes then. Is there some way that I can call the second javascript function from the backing bean? Is there a better workaround for this? Here is some code:
            function submitCreate(e) {
                var _event = (window.event) ? event : e;
                var KeyID = _event.keyCode;
                switch (KeyID)
                    case 13:
                        document.getElementById("form1:tvoTable:commitButton").onclick();
                        doAjax();
                        break;
            function doAjax() {
                var item = document.getElementById("form1:inputText3").innerHTML;
                getAjax(item, "FULL");
            }Thanks,
    Heather

    Maybe try adding an af:script block in your jsp as a partial target in your backing bean when you commit to the database? We are doing something similar when we get a tab DisclosureEvent but the principle should be the same.
    In our jsp we have:
    <af:script id="scriptID" text="alert('javascript here');"/>
    In the backing bean we have:
    method(DisclosureEvent de) {
    // get a component somehow or the component, we get it from the disclosure event
    // but you could use a binding also. if you don't have the exact script element you need
    // to find it like we do below.
    UIComponent c = de.getComponent();
    // Find our real script component
    UIComponent target = c.findComponent(":scriptID");
    // get the adf context
    AdfFacesContext adfContext = AdfFacesContext.getCurrentInstance();
    // add the script as a partial target.
    if(target != null) {
    adfContext.addPartialTarget(target);
    This relies on PPR though, which you may not be doing. If you are navigating to a new page you could set an indication in a backing bean and then access that in an <af:script> block in the new page or even generate the Javascript you want depending on your logic and access all of it via an EL binding on the af:script tag:
    <af:script id="scriptID" text="#{bbean.generatedScript}"/>
    Hope this helps!
    Steve

  • Passing long values from inputItem to function  in backing bean

    hi,
    in my backing bean i intend to call function func1(Long pAmount)
    on my page there is an inputItem bound in the BB.
    So, in me backing bean i'd like to achieve long value (oracle db number(10,2)) from the bound text item.
    How can i get long value ? by default it's coming easy as Number ( (Number)(itPTPAmount.getValue()).toString())
    but even though i can't convert it to Long;
    what i have is going thru String, but this way below cuts fractions:
    try{
    ptpAmount=new Long((itPTPAmount.getValue()).toString());
    catch(Exception e){System.out.println("error ptpAmount:"+e.getMessage());return;}
    please advise

    you can use doubleValue()
    http://docs.oracle.com/cd/E12839_01/apirefs.1111/e10655/oracle/jbo/domain/Number.html#doubleValue%28%29

  • Re: JDeveloper debugger crashes the JRE in backing bean of a jsff.

    Have you find a solution for this problem ?
    I face the same problem , I noticed the problem occurred when you change the code in previous written method in managed bean
    Regards,

    fine,
    thanks for your replay Timo,
    first of all I'm working in the following environment:
    OS Windows 7 Ultimate Service Pack 1 64 bit
    JDeveloper 11.1.2.4.0
    Using the embedded  JDK 6.0_24-b50
    Also I tried to solve the problem So I change the JDK to another Installed in my device 6.0_41 , but with no benefit.
    Problem Description :
    I create an ADF page fragment , create a manged bean (Request scope) , and create Some action listeners in the managed bean, also I change the "Hot class reload policy" from Tools -- Preferences -- Run -- WebLogic and make it Fast Swap, after that I run my application in debug mode. the page work properly but sometimes If you change the code at run-time in the manged bean and recompile the managed bean and try put break point , The embedded Weblogic application Server automatically shut down!! and raise the following in stack trace:
    # A fatal error has been detected by the Java Runtime Environment:
    #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6da61294, pid=1216, tid=6860
    # JRE version: 6.0_24-b50
    # Java VM: Java HotSpot(TM) Client VM (19.1-b02 mixed mode windows-x86 )
    # Problematic frame:
    # V  [jvm.dll+0x1c1294]
    # An error report file with more information is saved as:
    # C:\Oracle\Middleware\system11.1.2.4.39.64.36.1\DefaultDomain\hs_err_pid1216.log
    # If you would like to submit a bug report, please visit:
    #   http://java.sun.com/webapps/bugreport/crash.jsp
    [Server Instance IntegratedWebLogicServer is shutting down.  All applications currently running will be terminated and undeployed.]
    [Application termination requested.  Undeploying application AppointmentApp.]
    Debugger connection to debuggee process has been lost.
    Process exited.
    Debugger disconnected from local process.
    [04:35:25 PM] [J2EE Deployment SPI:260010]Unable to connect to 't3://localhost:7101' as user, 'weblogic'. Error received: null
    [04:35:25 PM] [J2EE Deployment SPI:260010]Unable to connect to 't3://localhost:7101' as user, 'weblogic'. Error received: null
    [04:35:25 PM] [J2EE Deployment SPI:260010]Unable to connect to 't3://localhost:7101' as user, 'weblogic'. Error received: null
    [04:35:25 PM] t3://localhost:7101: Destination unreachable; nested exception is:
      java.net.ConnectException: Connection refused: connect; No available router to destination
    [04:35:25 PM] Destination unreachable; nested exception is:
      java.net.ConnectException: Connection refused: connect; No available router to destination
    #### Cannot terminate application AppointmentApp due error undeploying from IntegratedWebLogicServer.
    [Application AppointmentApp stopped and undeployed from Server Instance IntegratedWebLogicServer]
    [sending request to shutdown server...]
    C:\Oracle\Middleware\system11.1.2.4.39.64.36.1\DefaultDomain\bin\stopWebLogic.cmd
    Stopping Weblogic Server...
    Initializing WebLogic Scripting Tool (WLST) ...
    Welcome to WebLogic Server Administration Scripting Shell
    Type help() for help on available commands
    Connecting to t3://localhost:7101 with userid weblogic ...
    This Exception occurred at Thu Jul 11 16:35:34 EEST 2013.
    javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7101: Destination unreachable; nested exception is:
      java.net.ConnectException: Connection refused: connect; No available router to destination]
      at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)
      at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:788)
      at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:366)
      at weblogic.jndi.Environment.getContext(Environment.java:315)
      at weblogic.jndi.Environment.getContext(Environment.java:285)
      at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
      at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
      at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
      at javax.naming.InitialContext.init(InitialContext.java:223)
      at javax.naming.InitialContext.<init>(InitialContext.java:197)
      at weblogic.management.scripting.WLSTHelper.populateInitialContext(WLSTHelper.java:520)
      at weblogic.management.scripting.WLSTHelper.initDeprecatedConnection(WLSTHelper.java:573)
      at weblogic.management.scripting.WLSTHelper.initConnections(WLSTHelper.java:313)
      at weblogic.management.scripting.WLSTHelper.connect(WLSTHelper.java:203)
      at weblogic.management.scripting.WLScriptContext.connect(WLScriptContext.java:61)
      at weblogic.management.scripting.utils.WLSTUtil.initializeOnlineWLST(WLSTUtil.java:147)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.python.core.PyReflectedFunction.__call__(Unknown Source)
      at org.python.core.PyMethod.__call__(Unknown Source)
      at org.python.core.PyObject.__call__(Unknown Source)
      at org.python.core.PyObject.invoke(Unknown Source)
      at org.python.pycode._pyx4.connect$1(<iostream>:16)
      at org.python.pycode._pyx4.call_function(<iostream>)
      at org.python.core.PyTableCode.call(Unknown Source)
      at org.python.core.PyTableCode.call(Unknown Source)
      at org.python.core.PyFunction.__call__(Unknown Source)
      at org.python.pycode._pyx15.f$0(C:\Oracle\Middleware\system11.1.2.4.39.64.36.1\DefaultDomain\shutdown.py:6)
      at org.python.pycode._pyx15.call_function(C:\Oracle\Middleware\system11.1.2.4.39.64.36.1\DefaultDomain\shutdown.py)
      at org.python.core.PyTableCode.call(Unknown Source)
      at org.python.core.PyCode.call(Unknown Source)
      at org.python.core.Py.runCode(Unknown Source)
      at org.python.util.PythonInterpreter.execfile(Unknown Source)
      at weblogic.management.scripting.WLST.main(WLST.java:124)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at weblogic.WLST.main(WLST.java:29)
    Caused by: java.net.ConnectException: t3://localhost:7101: Destination unreachable; nested exception is:
      java.net.ConnectException: Connection refused: connect; No available router to destination
      at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:216)
      at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:170)
      at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)
      at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:345)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
      at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:340)
      ... 38 more
    Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
      java.net.ConnectException: Connection refused: connect; No available router to destination
      at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:470)
      at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:321)
      at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:254)
      at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:197)
      at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:238)
      at weblogic.rjvm.RJVMFinder.findOrCreateRemoteCluster(RJVMFinder.java:316)
      at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:205)
      ... 44 more
    Problem invoking WLST - Traceback (innermost last):
      File "C:\Oracle\Middleware\system11.1.2.4.39.64.36.1\DefaultDomain\shutdown.py", line 6, in ?
      File "<iostream>", line 22, in connect
      File "<iostream>", line 646, in raiseWLSTException
    WLSTException: Error occured while performing connect : Error getting the initial context. There is no server running at t3://localhost:7101
    Use dumpStack() to view the full stacktrace
    Done
    Stopping Derby Server...
    So how can I solve This problem?

  • Using the functional methods with workflows

    Hi All,
    I'm passing the plant number to a workflow by triggering an event in a user-exit. The workflow uses a functional method of an ABAP class and retrives the plant details. While binding the functional method back to the workflow, the binding includes a partial expression like this..
    &_WI_OBJECT_ID.PLANT(W_PLANT=)&
    Here, if I give &_WI_OBJECT_ID.PLANT(W_PLANT='1000')& I get no error and the details of plant 1000 are retrived successfully. How do I pass this value dynamically?
    Regards
    Indu.

    Aditya,
    Thanks for your input. But there were no start conditions.
    The import parameter should be filled in the partial expression as &PLANT& which was not taking its value earlier. But now, its working. Thanks anyway.
    Regards
    Indu.

  • How to track PropertyChangeEvent for the backing beans?

    Hello
    I'm working on JSF 1.2 + JDK 1.6. Would like to know wether any direct support for tacking the PropertyChangeEvent for the backing bean. Objective is to keep track of the modified entities ( backing bean) and update the corresponding Database records at later stage with the modified attribute/record.
    E.g:
    Assume a datatable is populated with list, and 3 rows alone is modified, So the DB update is supposed to happen only for those rows. I prefer to have the PropertyChange tracking logic in one place. Dont want to add PropertyChangeListener for all backing beans.
    Can anybody help me on this.
    Thanks in advance
    Jobinesh
    Edited by: JobineshP on Jun 20, 2008 6:52 AM

    This is no direct support in JSF for PropertyChangeEvents.
    As for other solutions to your problem, first looking specifically at the database updates, Hibernate tracks modifications to fields and can be configured to only update the needed columns (see the dynamic-update attribute). So perhaps Hibernate can suit your needs or you could use their techniques to solve your problem.
    Taking a wider view of the general problem of adding PropertyChangeListeners to managed beans, I would be inclined to use Spring and AOP to add the PropertyChangeEvents to all the setters. Spring might also help the configuration of the PropertyChangeListeners. Although I have to say that I think that PropertyChangeEvents are of limited use in a web application.
    Another approach might be to hook into the JSF EL expression engine. You could add a special ELResolver whose purpose is to discover when the property changes happen. The drawback is that all the setting must be done via the EL in order for this to work.

  • We should NEVER use the session back bean?

    Because the user can open a new window by right click the link, and the session scope back bean is not thread-safe.
    So we should forget it?

    Your concern makes really no sense, or you must be storing request scoped data in a session scoped bean instead of a request scoped bean, which can indeed lead to undesireable behaviour in multiple requests on the same session.

  • How to show popup from backing bean code immediately?

    Hi,
    I'm using JDeveloper 11.1.2.1.0 and have problems with showing popups. I have a button with an action on my page and a method in backing bean.
    I want to rise up few popups from this method in backing bean (for example just an anouncement that something will happen) or a dialog
    (for example a question if you want to continue).
    I understand how to get a dialog response to deal with it in code, but the problem is that the popup doesn't show up immediately, but only when
    this method called on button finishes. I'd like to handle dialog responses in the middle of the action and then the code to continue with the execution.
    Here is my backing bean code:
    private RichPopup popup;
    public String test() {
    //Some code...
    RichPopup.PopupHints hints = new RichPopup.PopupHints();
    popup.show(hints);
    //Here is the place for code which I want to be executed after popup closes,
    //but is executed before the popup shows...
    return null;
    And here is part of my jssf:
    <af:commandButton text="Test" id="cb1"
    action="#{popupBean.test}"/>
    <af:popup id="popup" binding="#{popupBean.popup}">
    <af:dialog id="dialog" type="yesNo"
    title="Dialog"
    dialogListener="#{popupBean.onDialogAction}"
    binding="#{popupBean.dialog}" clientComponent="true">
    <af:outputText value="Do you want to continue?" id="ot1"/>
    <af:clientListener method="onDialogCancel" type="dialog"/>
    <af:serverListener type="DialogCancelHandlerEvent" method="#{popupBean.onDialogCancel}"/>
    </af:dialog>
    </af:popup>
    Can someone give me some answer how to show the popup from backing bean code immediately?
    Thanks in advance,
    Tina

    If you want to execute code after popup closes, then put this code in PopupCanceledListener or in DialogListener(you can't block method execution).
    Dario

  • Unable to execute javascript from backing bean

    Hello experts,  I want to execute  javascript function from backing bean method.   
    In my .jsff  page,  I have added  the javascript as :
    <jsp:root  ..... >
    <af:resource type="javascript" >
              function fileDownloadJS() {
                                alert(" tesing js from backing bean");
        </af:resource>
    </jsp:root>
    in my backing bean method  :
    public void callJSfuntion(ActionEvent actionEvent) {
            RenderKit rk = FacesContext.getCurrentInstance().getRenderKit();
            ExtendedRenderKitService erks = (ExtendedRenderKitService) Service.getService(rk, ExtendedRenderKitService.class);
            erks.addScript(context, "fileDownloadJS();");
    I have table in my .jsff page,   inside table column,  I have command link  and when I click the link,   I am invoking bean method  :
    <af:table  ....>
        <af:column sortProperty="title" sortable="true"  
                           headerText="File name" width="250px" id="Title"
                           clientComponent="true">
                  <af:commandLink   id="cl1"    actionListener="#{MyBean.callJSfuntion}" clientComponent="true">  
                    <af:outputText value="#{row.title}" id="ot1"/> 
                  </af:commandLink>
         </af:column>
    .</table>
    But when  I  run my taskflow and  click on  the link inside the table column,    JS function is not invoked.
    Absolutely  no clue what  is the issue.
    Appreciate if you can  help me out to resolve this issue.   Thank you.

    For debugging purpose can you try :
    <script type="javascript" >
              function fileDownloadJS() {
                                alert(" tesing js from backing bean");
    </script>
    put it on top of the page and let me know what happens.
    If it doesn't work try writing the function itself in your addScript(context, script); to see if it works.

Maybe you are looking for

  • How do you add contacts to new web text service?

    This has been an obnoxious experience with Verizon's new text service from the web site to any device. I tried to get started doing exactly what they said to do.  I selected all my contacts that appeared in the list to add to the contacts in the web

  • How do you manually manage podcasts with the new iTunes?

    Like the subject line says: How do you manually manage podcasts with the new iTunes? With the previous version of iTunes, when I plugged in my iPod, I could select the iPod, select podcasts, and manually delete episodes. With the new iTunes, I can't

  • Select Empno,name,sum()..group by empno only  Is this possible?

    select empno,name,sum(sal) from emptable where year=' ' groub by empno order by empno. this query getting error because i didn't include empname in group by. But if i include this name, my sum is not correct. so i want to empno,name but i don't want

  • Pdf not accessible cfpdfform

    I am trying to write a Flex app to launch a PDF. The Flex app is able to grab data from the database ok.... however when I click a button on the Flex app to invoke a CFC to invoke <cfpdffrom>... an error message indicates...      Unable to invoke CFC

  • Authentication Questions Deleted When Saving User View

    I am working with IDM version 6, SP1 We wish to start using the user self server reset password function. Howerver, the user authentication questions and answeres keep getting deleted. Any time a user view is checked out and checked back in, the ques