SelectOneMenu: How can I fire a backing bean method just when click

I want that when just I click one option of Dropdown list it fires a backing bean method.
The method must take the new value of dropdown, to execute a SQL to populate a new (another one) dropdown list and refresh the page.
My code
                        <h:commandButton id="button1" style="left: 216px; top: 216px; position: absolute" value="Cancelar"/>
                        <h:commandButton id="button2" style="left: 312px; top: 216px; position: absolute" value="Generar"/>
                        <h:outputLabel for="componentLabel5" id="componentLabel5" style="left: 120px; top: 0px; position: absolute">
                            <h:outputText id="componentLabel5Text" value="Título de la Página"/>
                        </h:outputLabel>
                        <h:selectOneMenu immediate="true" value="#{fgstb.ctoId}"  valueChangeListener="#{fgstb.cambiaValorCtos}" id="dropdown1" style="left: 264px; top: 72px; position: absolute; width: 120px">
                            <f:selectItems id="dropdown1SelectItems" value="#{fgstb.ctos}"/>
                        </h:selectOneMenu>
                        <h:selectOneRadio id="radioButtonList1" layout="pageDirection" style="left: 48px; top: 48px; position: absolute" value="#{fgstb.modo}">
                            <f:selectItem id="radioButton1" itemLabel="Generar Campeonato" itemValue="1"/>
                            <f:selectItem id="radioButton2" itemLabel="Generar desde Campeonato" itemValue="2"/>
                            <f:selectItem id="radioButton3" itemLabel="Generar Todos Campeonatos" itemValue="3"/>
                        </h:selectOneRadio>It works fine but when I push a button and I would like it works when I click over dropdown list.
Thank you

Hi,
You can simply add onchange="submit()" attribute to your component to allow form to be submited when the coomponent value is changed, and add also a value change listener to allow JSF to be notiifed for component value change event :
<h:selectOneMenu onchange="submit()"  valueChangeListener="#{fgstb.cambiaValorCtos}"
                          immediate="true" value="#{fgstb.ctoId}"   id="dropdown1" style="left: 264px; top: 72px; position: absolute; width: 120px">
                            <f:selectItems id="dropdown1SelectItems" value="#{fgstb.ctos}"/>
</h:selectOneMenu>

Similar Messages

  • ***How to Invoke backing bean method by DOUBLE-CLICK the table ROW!!***

    Hi,
    How can I collect the selected row value & navigate to next page by DOUBLE-CLICK the result table row.
    My application got searchResult page where I am displaying the list of user in result table. Then selecting any one row and navigating to master details page by clicking the continue button. Button Action method will collect the selected row userID which I am forwarding to the masterDetails page.
    Same functionality I want to do by double click the row instead of clicking the button!!. I want to trigger the backing bean method if the user double click the row basically. Please help me in this how to do this?
    Current button action method:
    *public String userSelected() {*
    FacesCtrlHierNodeBinding binding = (FacesCtrlHierNodeBinding) searchResultTable.getSelectedRowData();
    currentRow = binding.getRow();
    selectedNetID = (String) currentRow.getAttribute("netid");
    System.out.println("selectedNetID -->"+selectedNetID);
    requestContext.getPageFlowScope().put("netid",selectedNetID);
    return "continue";
    *}*

    Puthanampatti ,
    Yes, I am using the same. Below is my code. I am trying to get the object of the MAIN jspx page region (where I am displaying the fragments) and refresh the one. But cant able to get the object for the region it is returning null. without refresh seems the navigation wont work.
    public void doDbClick(ClientEvent clientEvent) {
    FacesCtrlHierNodeBinding binding = (FacesCtrlHierNodeBinding) searchResultTable.getSelectedRowData();
    currentRow = binding.getRow();
    selectedNetID = (String) currentRow.getAttribute("netid");
    System.out.println("selectedNetID -->"+selectedNetID);
    requestContext.getPageFlowScope().put("netid",selectedNetID);
    try{
    FacesContext facesCtx = FacesContext.getCurrentInstance();
    NavigationHandler nh = facesCtx.getApplication().getNavigationHandler();
    nh.handleNavigation(facesCtx, "", "continue");
    System.out.println("region obj -->" +facesCtx.getViewRoot().findComponent("advse1"));
    // Refresh the current region; advse1 is the id of the region component inside jspx page
    AdfFacesContext.getCurrentInstance().addPartialTarget(facesCtx.getViewRoot().findComponent("advse1"));
    catch(Exception e){
    System.out.println("Error is: " +e);
    Is this correct coding to get the region object?? actually the "result table" and "Master details" are 2 different fragments which are linked with task-flow and the task flow is part of main jspx page as a region. I am using that region ID to get the obj, but cant able to get so....!!! any idea

  • How can I incorporate new backing beans into a Webcenter Spaces Server?

    I am using the WebCenterSpaces application in Customization Developer Role to make changes to some taskflows for a customer. In order to implement a desired change in the Nav Model for the customer, I had to write 3 very small backing beans. They compiled fine, the taskflow let me add them as managed beans. It even new about these backing beans, presumably because I compiled them. I made changes to the .jsff file to use them and that worked fine. However the metadata.mar created when I deploy the application does not have these new classes, so they will not get put into the WC_Spaces server when I use WLST to import the metadata. Can anybody tell me how to get new backing beans into WebCenter Spaces?
    I cant be the only one who has had to do this.
    Thanks.

    I don't know if you can import as part of the metadata import but an alternative will be to create a shared library out of your java classes and referencing the shared lib in spaces.

  • HT201394 My Quicktype has disappeared from my messaging. How can I get it back?  I just update my IOS 8 to the 8.2

    My quicktype has disappeared from my messaging.  I have even updated to the IOS 8.2 to fix, but still not there.  How do I get quicktype back?

    The new iOS is 8.0.2, but go into Settings>General>Keyboard and see if it still shows the keyboard installed. You can also try a reset on the phone to see if that will take care of it, by holding down the sleep/wake and home buttons together until you see the Apple logo and then release. The phone will reboot. This will not affect any of your data.

  • How can I change the default app to open when clicking on a YouTube video?

    Since Firefox updated recently, I cannot long-tap to open a YouTube video with a different player (wanting to use PVStar+). Now tapping opens up the YouTube player, despite the fact it is disabled. How can I open with a custom app?

    Change the '''Action''' for '''''mailto''''' in the Applications tab of Options.
    [http://support.mozilla.com/en-US/kb/Changing+the+e-mail+program+used+by+Firefox]

  • How can I make a new Dock Icon which when clicked has apps inside

    I just seen a Youtube video for something and on the video it had a dock icon of iLife 09, and when clicked it had all the iLife 09 apps, iPhoto, imovie etc in the icon like stacks. (http://www.youtube.com/watch?v=ahiXGtP3bGA, about 22secs in he click its)
    i would like to do this and then I'd be able to remove the individual iLife 09 apps from my dock for space.
    Can someone help me on this please. I have leopard v10.5.8
    cheers

    Create a folder anywhere convenient. Place in it aliases to the iLife programs. Drag it to the Dock.
    If you want it to show with an icon rather than the generic folder icon, do this before dragging it to the dock:
    Select the program which has the icon you want to use, e.g. GarageBand. Hit command-i. In the top left-hand corner of the info pane which opens is the icon for Pages. Click this to select it and hit command-c. Close the pane.
    Select your folder: hit command-i. At the top left of the pane you will see the folder icon: click this to select it and his command-v. Now you can drag your folder to the Dock.

  • Yesterday I download Firefox 4. When I tried to open it I got message that Firefox was "working offline" How can I change this back to on-line when I can't get any farther? All other programs work fine, I just cannot access the internet.

    Computer is a desktop running Windows Vista. IE will not open either saying "there is a problem and shutting down". My laptop with Firefox 3.6 works fine.

    See https://support.mozilla.com/en-US/kb/Firefox+cannot+load+websites+but+other+programs+can

  • My fiance logged onto my iphone with his apple ID and now I can't switch it back to my username. How can I change it back to mine? ( but when I go to setting,icloud my un/pw are there)

    My fiance logged into my iphone with his apple ID and now I can't switch it back to my username. When I go to buy an app his username is in an editable format to beable to change it back to mine. How can I change it back to mine? (when I go to setting,icloud my un/pw are there) Can someone please help? Thanks!

    Had you looked in the User Guide, you would have found this:  Settings>Store.  Tap on AppleID to change.

  • How can i reinstal safari back onto my macbook pro

    my safari has stopped working and it come up with just error messages  how can i reinstal it back on my mac when it does not work and i have no back up dick

    Safari should be downloadable from apple web site -
    http://support.apple.com/kb/DL1422
    Also, you could re-install the OS, as it is part of the OS.

  • When I swipe down the notification center, I can not find "tap to tweet" or "tap to post." How can I put it back?

    When I swipe down the notification center, I can not find "tap to tweet" or "tap to post." How can I put it back?

    Hi there,
    When I swipe down the notification center, I can not find "tap to tweet" or "tap to post." How can I put it back?
    I can help you with that!
    Go to Settings > Notifications > Share Widget and toggle Notification Center to ON.
    If Notification Center is OFF in the Share Widget, then the Share Widget will be located under the sub-heading "Not In Notification Center."
    If Notification Center is ON in the Share Widget, then the Share Widget will be located under the sub-heading "In Notification Center."

  • I accidently unistalled my office apps. How can I get them back??

    I accidently uninstalled my office apps. How can I get them back? 

    Hi Deanne,
    When you deleted the apps, did you also empty the trash bin. IF NOT, It could be possible to move the apps back from the trash bin to your applications folder and your done. Otherwise do you possibly have a backup of your computer on time machine or other 3rd party backup software?
    If you don't have a backup and you emptied your trash bin, the simplest way to reinstall is to use the reinstall disc and then run all the updates again.
    Good Luck,
    Matt

  • I was typing a post on my blog and Fire Fox crashed. I lost my data. How can I get it back?

    Fire Fox has been crashing the last few days. Tonight, I was typing an article post for my blog and it crashed again. I was just finishing the article (900 words). The open sites usually come back up and they all did except the blog post site. I lost all my article post. I worked 3.75 hours on this. How can I get it back?

    Did you try:
    History menu > Restore Previous Session
    I'm not sure that's still available if you've been browsing around again for a while.
    ''Actually, you used session restore, so that's the same thing.''
    I'm not sure what blog platform you use, but I've noticed that WordPress auto-saves for me at regular intervals. If yours doesn't do that, you should definitely see about getting it set up.

  • IAM LOSTED MY MOZILLA FIRE FOX PAGE BY ASK, HOW CAN I GET IT BACK

    At the time of down loading some thing i losted my Mozilla fire fox page by Ask,I tried a lot . How can i get it back?

    Press the '''Alt''' or '''F10''' key to bring up the tool bar.
    Followed by;
    Windows; '''Tools > Options'''
    Linux; '''Edit > Preferences'''
    Mac; ''application name'' '''> Preferences'''
    Then '''General.'''
    There are two settings;
    * '''When Firefox Starts'''
    When the browser is started, what do you want to
    display. Many of us choose '''Show My Home Page.'''
    * '''Home Page'''
    When a new page is opened, what do you want displayed.
    # '''Use Current Page'''. Use what ever page(s) are open at that time.
    # '''Use Bookmark'''
    # '''Restore To Default.''' about:home shows a Mozilla page with tools.
    You can use any of these that you wish;
    '''about:home''' (Firefox default home page),
    '''about:newtab''' (shows the sites most visited),
    '''about:blank''' (a blank page),
    or you can enter any '''web page''' or '''about: ''page''''' you want.

  • I had 21 songs i my album and after syncronising i only had 15 songs left! All of them from Itunes! How can i get them back without paying for them again???

    I had 21 songs i my album and after syncronising i only had 15 songs left! All of them from Itunes! How can i get them back without paying for them again???
    Hello!!!
    I had 21 songs i my album and after syncronising i only had 15 songs left! All of them from Itunes! How can i get them back without paying for them again???
    Hello!!!
    This realy works??

    Where is the backup of the media and other important files from the computer?  Ultimately, it is the users responsibility to ensure that backups exists. Waiting until there is a problem to decide to do a backup is not smart.  Would you wait until a fire started in your home to call the insurance company and inquire about homeowners/renters insurance????
    In the event that no backup exists (stop being lazy.... keep backups of YOUR data and other important files):
    If you are in the US and running iTunes 10.3 or later, it is possible to redownload music via iCloud from purchased history.
    If you are not in the US or for some reason cannot run iTunes 10.3 or later, contact iTunes customer support and ask very nicely for the opportunity to redownload the content.  They are not required to provide this opportunity.
    It is also possible to transfer content from an iDevice that was purchased via iTunes.  On the new computer, sign into the iTunes account, authorize the computer, connect the device then select File > Transfer Purchases.
    The simplest method of all is to transfer or copy the media (and other important files) from the old computer or the backup of the old computer.  Typing "move itunes library" into the search bar here or into google will reveal step by step instructions on how to do this.

  • How can I get Genius back. Using 6.1.2

    I downloaded update 6.1.2 and noticed that my genius feature is gone when listening to music. How can I get it back??

    YOu need to get the videos into the photos app.
    So either add the videos to iPhoto, or in a folder.
    Plug in the iPad to your computer.
    fire up iTunes.
    Go to the iPad options, and then to the Photos tab.
    Select the folder with videos, or an album with the videos from iPhoto.
    MAke sure to tick the include videos tab.
    IMovie will be able to delink to the videos again.

Maybe you are looking for

  • Style is lost in conversion to RH8 from an older version

    We had all help files created in an older version of RH, went through the conversion process, but for all the topics we have not yet (or do not need to open except for this problem), the stylesheet formatting is not applied to the topic. (For example

  • Copying Invoice from Delivery notes

    Hi, I want to create an Invoice document from a Delivery document. Is there a straight-forward way in DI-API to do that? Please post any code segment you have. I'll appreciate your help. Thanks. -Geetha

  • Imac Problems with bootcamp, plz help!

    I installed windows xp on my new aluminum 2.0ghz imac, when i perform hard tasks like editing or watching video, or playing some pc games, the imac screen will crash. The monitor has been shut off but i can sill hear the video game. This happens allo

  • Passing values to an internal table and use it with the table painter

    Hi, I have seen this topic here before but the answers didn't help me. Maybe I,m doing something wrong. The problem is that I defined the following structure on the |Types| tab of the |Global Definitions| section: TYPES: BEGIN OF DETAILS,        EBEL

  • Content in front of footer.

    I want my footer fixed to the bottom of the window.  Which I have successfully done; however, when I scroll down my content goes in front of my footer instead of behind it.  I have arranged the footer on the master page to be in front.  I have arrang