How to set Action of commandButton from javabean?

Hi,
How can I to set Action of commandButton from javabean with JSF 1.1?
Thanks

Try this:
import javax.faces.component.html.HtmlCommandButton;
Application application = FacesContext.getCurrentInstance().getApplication();
HtmlCommandButton button = (HtmlCommandButton) application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
MethodBinding mb = application.createMethodBinding("#{mybean.action}", null);
button.setAction(mb);

Similar Messages

  • How to set an Application Item from PL/SQL

    I am attempting to set an Application Item
    After login to my app, I want to retrieve a row from my SETTINGS table and populate some Application Items with the settings information so that I can
    display some of that settings information on every page.
    Just to start, I created one Application Item named F106_YEAR
    I then created a Shared Components Application Process which executes on New Session: After Authentication
    I created this process as an Anynomous PL/SQL block.
    declare
    aucyr varchar(4);
    begin
    select year into auctyr
    from settings;
    :F106_YEAR := aucyr;
    end;
    I've tried a couple of other Syntax tricks attempting to reference the Application Item F106_YEAR from within PL/SQL (like V('F106_YEAR') but nothing seems to be working.
    I'm sure that I am missing something simple. Can someone tell me how to set an Application Item from PL/SQL?
    Thanks in advance.

    I'm still doing something wrong because this is not working for me.
    I've tried both of the following versions as an Application Process set to run on New Session after Authentication:
    declare
    auction_year varchar(4);
    begin
    select year into auction_year
    from PBUUC.SETTINGS where rownum < 2;
    :F106_AUCTION_YEAR:=auction_year;
    end;
    and I also tried:
    declare
    auction_year varchar(4);
    begin
    select year into auction_year
    from PBUUC.SETTINGS where rownum < 2;
    APEX_UTIL.SET_SESSION_STATE (p_name, p_value);
    end;
    F106_YEAR is a global Item (shared components).
    The select statement works just fine in SQL*PLUS so I know that it is correct.
    If I run the debugger and log into the application, here is the output. Shouldn't I see my Application Process get called if it is set to run on New Session after Validation?
    My Application process is named RETRIEVE_AUCTION_SETTINGS
    0.01: A C C E P T: Request="P101_PASSWORD"
    0.01: Metadata: Fetch application definition and shortcuts
    0.01: alter session set nls_language="AMERICAN"
    0.01: alter session set nls_territory="AMERICA"
    0.01: ...NLS: Set Decimal separator="."
    0.01: ...NLS: Set NLS Group separator=","
    0.01: ...NLS: Set date format="DD-MON-RR"
    0.01: ...Setting session time_zone to -04:00
    0.01: NLS: wwv_flow.g_flow_language_derived_from=0: wwv_flow.g_browser_language=en-us
    0.01: Fetch session state from database
    0.02: ...Check session 695371898690095 owner
    0.02: ...Check for session expiration:
    0.02: ...Metadata: Fetch Page, Computation, Process, and Branch
    0.02: Session: Fetch session header information
    0.02: ...Metadata: Fetch page attributes for application 106, page 101
    0.03: ...Validate item page affinity.
    0.03: ...Validate hidden_protected items.
    0.03: ...Check authorization security schemes
    0.03: Session State: Save form items and p_arg_values
    0.03: ...Session State: Save "P101_USERNAME" - saving same value: "jps"
    0.03: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    0.03: Branch point: BEFORE_COMPUTATION
    0.03: Computation point: AFTER_SUBMIT
    0.03: Tabs: Perform Branching for Tab Requests
    0.03: Branch point: BEFORE_VALIDATION
    0.03: Perform validations:
    0.03: Branch point: BEFORE_PROCESSING
    0.03: Processing point: AFTER_SUBMIT
    0.03: ...Process "Set Username Cookie": PLSQL (AFTER_SUBMIT) begin owa_util.mime_header('text/html', FALSE); owa_cookie.send( name=>'LOGIN_USERNAME_COOKIE', value=>lower(:P101_USERNAME)); exception when others then null; end;
    0.04: ...Process "Login": PLSQL (AFTER_SUBMIT) wwv_flow_custom_auth_std.login( P_UNAME => :P101_USERNAME, P_PASSWORD => :P101_PASSWORD, P_SESSION_ID => v('APP_SESSION'), P_FLOW_PAGE => :APP_ID||':1' );
    0.06: ...Process "Clear Page(s) Cache": CLEAR_CACHE_FOR_PAGES (AFTER_SUBMIT) 101
    0.06: Nulling cache for application "106" page: 101
    0.00:
    0.00: S H O W: application="106" page="1" workspace="" request="" session="695371898690095"
    0.01: alter session set nls_language="AMERICAN"
    0.01: alter session set nls_territory="AMERICA"
    0.01: ...NLS: Set Decimal separator="."
    0.01: ...NLS: Set NLS Group separator=","
    0.01: ...NLS: Set date format="DD-MON-RR"
    0.01: ...Setting session time_zone to -04:00
    0.01: NLS: wwv_flow.g_flow_language_derived_from=0: wwv_flow.g_browser_language=en-us
    0.01: Application 106, Authentication: CUSTOM2, Page Template: 2904114531488186
    0.01: ...Session ID 695371898690095 can be used
    0.01: ...Application session: 695371898690095, user=JPS
    0.01: ...Determine if user "JPS" workspace "1040027630222986" can develop application "106" in workspace "1040027630222986"
    0.01: ...Check for session expiration:
    0.01: Session: Fetch session header information
    0.01: ...Metadata: Fetch page attributes for application 106, page 1
    0.01: Fetch session state from database
    0.02: Branch point: BEFORE_HEADER
    0.02: Fetch application meta data
    0.02: Computation point: BEFORE_HEADER
    0.02: Processing point: BEFORE_HEADER
    0.03: Show page template header
    0.03: Computation point: AFTER_HEADER
    0.03: Processing point: AFTER_HEADER     
    0.04: Computation point: BEFORE_BOX_BODY
    0.04: Processing point: BEFORE_BOX_BODY
    0.04: Region: Auction_Title F106_AUCTION_YEAR

  • Adobe Configurator - how to invoke action or script from html widget?

    How to invoke action or script from html wiget in Adobe Configurator?
    Please help! I tried to make it about 5 hours!
    I need something like that:
    I click link or image
    ...and it runs action.
    Thanks!

    If you click on the question mark ( as shown below) on the right of Configurator  2 window
    the user guide installed on your computer within Configurator 2  will open
    Anyway once you have your action or script button  in your panel you must select it and configure it in the  inspector palette

  • ERPI: how to set up drill through from Planning to EBS

    Hi,
    When you guys know how to set up drill through from Planning to EBS through ERPI ??
    I encountered the following message when I tried to drill :
    no drill through reports found at this location
    I think I didn't set up the drill through functionality properly.
    Regards,
    Eddy

    Can you check the log file for any errors? Also, check if the drill regions are created in the application. You can navigate to process details in ERPI and select the show log link for the corresponding process id. That should indicate if the drill regions were created on the target.
    Thanks,
    Bala

  • How to set the HOME link from two frame jsp page to no frame main page?

    Hi all,
    i have one main jsp page named as main.jsp.
    From the main.jsp, i can click the button and link to the twoFrame.jsp.
    This twoFrame.jsp have another two different jsp inside the frame called Aframe.jsp and Bframe.jsp.
    i try to put HOME in the Aframe.jsp(one of the page inside twoFrame.jsp) but only the Aframe.jsp manage to link to main.jsp but the Bframe still there.
    My question is: How to set the HOME link button from this twoFrame.jsp to the main.jsp? what i want is from twoFrame.jsp(two frame) to main.jsp(no frame).
    rgds,
    Bryan523

    No offense, but this is basic HTML. You shuold look into learning HTML before getting too deep into JSP. Try this: http://www.w3schools.com/html/default.asp
    But as a more specific answer, you have to set a target for the link to the _parent of your frame:
    <a href="main.jsp" target="_parent">Home</a>

  • Trouble setting action on RichCommandToolbarButton from bean

    I’m creating RichCommandToolbarButton from java bean. The issue I’m running into is setting action on the button.
    I expected RichCommandToolbarButton to work like other UIXCommand, RichCommandLink for example. But it does not. Doing the following does not work on RichCommandToolbarButton (and again, does work on RichCommandLink):
    RichCommandToolbarButton button = new RichCommandToolbarButton();
    String expr = ="#{backingBeanScope.MyBean.doSomething"
    MethodExpression me = getExpressionFactory().createMethodExpression(getElContext(), expr, String.class, new Class[]{});
    button.setActionExpression(me);
    The ONLY way I’m able to set action on RichCommandToolbarButton is the following:
    buttonn.addActionListener( new DoSomething() );
    where
    private static class DoSomething implements ActionListener
    public DoSomething ()
    public void processAction(ActionEvent actionEvent)
    String expr = ="#{backingBeanScope.MyBean.doSomething"
    MethodExpression me = getExpressionFactory().createMethodExpression(getElContext(), expr, String.class, new Class[]{});
    button.setActionExpression(me);
    I really want to set the button's action based on an expression and doing it this way seems very unexpected to me.... Is this the known and expected way that RichCommandToolbarButtons work?
    Edited by: user12869467 on Mar 11, 2013 4:35 PM

    This is a way you can try , kind of a mixed approach-
    http://hazem-adf-tips.blogspot.com/2012/08/some-useful-adf-and-jsf-code-for.html
    See section Adding Action and Action Listener to a command component
    RichCommandMenuItem menuPage1 = new RichCommandMenuItem();
    menuPage1.setId("page1");
    menuPage1.setText("Page 1");
    menuPage1.setActionExpression(getMethodExpression("page1"));
    RichCommandButton button = new RichCommandButton();
    button.setValueExpression("disabled",getValueExpression("#{!bindings."+item+".enabled}"));
    button.setId(item);
    button.setText(item);
    MethodExpression me = getMethodExpression("#{bindings."+item+".execute}");
    button.addActionListener(new MethodExpressionActionListener(me));
    footer.getChildren().add(button);

  • How to set up all requests from users should go through a specific module

    I want to set up all request from users go throuth a module.
    for example, when user request a page the request go through log module to write it.
    so please tell me the setting if it's possible, or should i make it with nsapi?

    I want to set up all request from users go throuth a module.
    for example, when user request a page the request go through log module to write it.
    so please tell me the setting if it's possible, or should i make it with nsapi?

  • How to set password for photos from home screen? Please help.

    Hi,
    Can anyone pls help to set password for my Iphone 4s.
    My friends/family often use my phone for gaming purpose. I don't want them to see my photos/gallery/videos.
    How can I protect my personal things from others?
    Thnx.
    Rgds.

    There is no way to set a password for photos. You could upload all of your photos to something like DropBox, then sign out of the app. Or, you could only let people you trust to respect your privacy touch your phone.

  • How to set Decimal Point position from right to left Serial Read Evaluate Number within Range over RS-232

    I am new to Labview, I am communicating with a TQ8800 Torque meter via RS-232. The 16 digit data stream is as follows:
    D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
    Each digit indicate the following status :
    D0 End Word
    D1 & D8 Display reading, D1 = LSD, D8 = MSD
    For example :
    If the display reading
    is 1234, then D8 to D1 is :00001234
    D9 Decimal Point(DP), position from right to the left
    0 = No DP, 1= 1 DP, 2 = 2 DP, 3 = 3 DP
    D10 Polarity
    0 = Positive 1 = Negative
    D11 & D12 Annunciator for Display
    Kg cm = 81 LB inch = 82 N cm = 83
    D13 1
    D14 4
    D15 Start Word
    I am using a modified version of the basic_serial_write_read.vi. I am attempting to parse the 16 digit data stream extracting out the number and whether it is positive or negative. I am having trouble with the decimal point placement. Is there an example that could help me with this? After the number is parsed I am then comparing it to see if it is within +/- 9.2 N cm. If it is then the test passes. I am outputing the data to a file. I have included the vi. Also how can I check for different units of the annunciator. Any help would be appreciated.  Thank you.
    Attachments:
    basic_serial_read.vi ‏100 KB

    What is the definition of the End Word?  You will likely need to figure this out experimentally (the manual doesn't seem to define it).  Whatever it is, you should set that as the termination character and enable the termination character.  That will help you in keeping your messages in sync.  Just tell the VISA Reads to read more than a message should be, something like 30 should work nicely.
    The error you are seeing is a buffer overload.  This means that the instrument is sending data to you faster than you can process it.  So you need to figure out how to perform the read faster.  File IO is slow.  So you should put that into a seperate loop so that your loop does nothing but read the data from the port as quickly as the data comes in.  Use a queue to send the data from the reading loop to the logging loop.  This is known as a Producer/Consumer.
    And here is a cleaned up version of your code.  No need for your express VI or the formula node.  Some other general cleaning up also done to make it easier to read.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    serial read.png ‏80 KB

  • How to set the ODBC driver from Micorosft ODBC manager in vista 64bit

    Dear Sir/Madam
    I just installed Vista ultimate (64 bit) on my computer.
    After that, I downloaded and installed Oracle Database 10g Client Release 2 (10.2.0.3) from http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10203vista.html
    Set up the network config from net configuration assistant is fine (tnsnames.ora).
    When I want to set up the system ODBC from Microsoft ODBC manager.
    I can't found oracle driver from Microsoft ODBC manager (only Sql Server driver is existing ).
    Why? and how to found it out?
    Thanks
    Francis SZE

    Database 10g Client Release 2 (10.2.0.3) from
    http://www.oracle.com/technology/software/products/da
    abase/oracle10g/htdocs/10203vista.htmlWhich means you will be using the 32-bit environment on top of the x64 based os (WoW64). Have you verified that the Database product is certified for Vista "x64" editions?
    http://support.microsoft.com/kb/896456/en-us
    I can't found oracle driver from Microsoft ODBC
    manager (only Sql Server driver is existing ).
    Why? and how to found it out?You are likely looking in the wrong place. DSNs with 32-bit drivers are managed through odbc admin tool in %systemroot%\syswow64\.

  • How to set HTTP status codes from BSP

    Hello,
    How can I set the HTTP status code from a BSP?
    I use response->set_status( code = 500 reason = 'Error') from OnInputProcessing event, but nothing happens...
    Tia,
    Joerg

    Hi,
    Thank you for the references, but unfortunately it still does not work for me.
    Here's what I do in my BSP:
    - The BSP displays a simple Form in which some user data
      can be entered.
    - In the OnInputProcessing event handler of this BSP the
      data is analyzed. If there is an error, the following
      code is executed:
      if l_error eq 'X'.
        data:
          res type ref to if_http_response.
        res = runtime->server->response.
        res->set_status( code   = 500
                         reason = 'Internal error' ).
      endif.
    - I would expect the Browser to display the error page,
      however I simply get the BSP Form again - the HTTP
      error is not shown at all.
    What am I doing wrong?
    Thanks, Joerg

  • Plz help me how to set values in js from form

    hi alll.......
    i have a problem in my jsp..........i had given hyperlink for second action in jsp, user will select an id from combo...and insert values in text box when they click on button i need to insert these values in database.......
    problem here is all values are passing null value........i am setting through form..i ma not getting the values from anywhere.
    i don't know the problem will u plz help me out in this.........
    thanks in advance.......]chintu

    Your question and the way you type doesn't make much sense to me. Could you be specific about the problem - maybe with code snippets.

  • How to set jump to menu from playing video?

    I tried to set jump to menu (specific menu) from playing video. Suppose I select selection 2 number 4 then it play then I realize that I don't want to see that video I click menu and go back to same selection 2 menu. I could not get it right. Not only selection 2. If I play from selection 1 number 2 video then click menu button then it go to selection 1 menu. How do I do that?

    Select the video track and in the inspector set the remote menu button destination.
    o| TOnyTOny |o

  • Web Dynpro - How to set and get info from Component Controller

    Hi Gurus!!!
    Im having some problems getting and setting info in component controller of my Web Dynpro.
    I can't see the difference between View Context and Global Context.
    How can i create a Global Context Between two views?
    Thanks!
    Regards.
    Polakinho.-

    hii
    difference between view context and global context is we can use the same component controller for all the views in the same application.but when when we create node in view context then it will be available for that view only not for any other view...so if we want to use the same node for all the views we need to create that view in the component controller.so it will become global for that application.
    for using global node you need to map that context in view controller.for that you need to go to that view then click on context tab and drag and drop node from component controller.so it will be available for that view.i hope it helps you.
    regards
    twinkal

  • How to set browser window title from FPM ?

    How do I set brwoser window title at runtime in FPM ?
    Using IDR area objetc I can set only apllication are(ident area) title, not the browser window title. Browser window title is set statically from iView name of in portal, and PFCG contect if in NWBC client.
    But in my case, I want to set it at runtime, for eg. in case of Purchase Order window, I want to set it as 'Purchase Order:<PO number>
    Is there any API to set this?
    Thanks again,
    Hari
    Edited by: Hari Krishnan P on Jun 9, 2010 10:22 AM

    When you call it as external window you may pass the title. other than that i am afraid you are left with no choice.

Maybe you are looking for

  • Bal field "Profit Center" in line item 001 not filled at the time of F-53

    We are in ECC6 I have posted a vendor document.  The entry is shown as under.      GL                           CC     PC     Segment Dr     Expense GL-1     RV01     RGV1     Hyderabad Dr     Expense GL-2     RV02     RGV2     Mumbai Cr     Vednor a

  • Export in multiply volumes

    How can i do in order to get export file in multiply volumes? Thanks.

  • WIFI is still connected but isn't working?***?

    My WIFI icon on my MacBook Pro is black but safari isn't working. If I turn the wifi off and then immediately back on it works again. When it goes out, my phone and iPad still work. Any ideas?

  • Cannot import jpg files from any devices & files

    Everytime I want to use Premiere Elements 11 with importing from hard DD from my computer or camera using usb connection, I get this error message: File Dimensions(Width/heights) too large whereas they work fine with Windows Movie Maker.  Therefore,

  • OS X 10.7 Lion and applejack v1.6

    Has anyone tried to run applejack 1.6 under OS X 10.7?  The applejack v1.6 worked great with Snow Leopard and is still installed in my iMac after upgrading to Lion. Snce I am not sure if applejack 1.6 is compatible with Lion, I have not tried to run