Execute command button after user tabs out of inputtext

All,
I have a command button which is used to call a webservice. This works fine.
I also have an Inputtext field. What I want is to execute the action when the user tabs out of the inputtext.
Does any one have the solution for me ? I've not yet been able to achieve this for instance in a backing bean.
My code:
<af:inputText
value="#{bindings.pEan.inputValue}"
label="Ean-code"
required="#{bindings.pEan.mandatory}"
columns="#{bindings.pEan.displayWidth}"
autoSubmit="true">
<af:validator binding="#{bindings.pEan.validator}"/>
</af:inputText>
<af:commandButton id="BepaalVoorraad"
actionListener="#{bindings.GetStockQuote.execute}"
text="Bepaal Voorraad"
disabled="#{!bindings.GetStockQuote.enabled}"/>
The binding from my pageDef.xml:
<methodAction id="GetStockQuote" MethodName="GetStockQuote"
RequiresUpdateModel="true" Action="999" DataControl="GetStock"
InstanceName="GetStock" ReturnName="GetStock.methodResults.GetStock_GetStockQuote_result">
<NamedData NDName="pEan" NDType="java.math.BigDecimal"
NDValue="${bindings.GetStockQuote_pEan}"/>
</methodAction>

Set the inputText to have autosubmit on, and add a valueChangeListener to it.
<af:inputText label="Label 1"
binding="#{backing_untitled1.inputText1}"
id="inputText1"
valueChangeListener="#{backing_untitled1.valchange}"
autoSubmit="true"/>
In the method of the valueChangeListener call the method that is associated with the button.

Similar Messages

  • Preventing browser keep data information after user log out

    Is it possible to prevent browsers from remembering pages so
    they not available after user logs out and click back button pages
    with data information will be deleted?
    How to not aloud to keep it in \Local Settings\Temporary
    Internet Files
    What is the best way to do it? Is any way around this
    problem?

    Are you using 3 line just to make sure it working across
    multiple browsers?
    It looks that they doing same thing, am I right?
    I did test it on IE 6 and it looks like only
    <CFHEADER NAME="cache-control" VALUE="no-cache">
    does the trick
    and
    <CFHEADER NAME="Expires" VALUE="Mon, 06 Jan 1990 00:00:01
    GMT">
    <CFHEADER NAME="Pragma" VALUE="no-cache">
    does not make much difference.

  • How to close browser window after user log out

    Hi,
    Does anyone know how I can close browser window after user logs out. The scenario is when user clicks a log out button I will invalidate user session and close the browser right away in the backing bean.
    Your help would be appreciated.

    Try run this and you'll see that it runs fine with no exceptions:
    <%
         String someText = "bla bla bla";
         response.setContentType("text/plain");
         response.setHeader("Content-Disposition", "attachment;filename=message.txt");
         try {
              ServletOutputStream os = response.getOutputStream();
              os.write(someText.getBytes());
              os.flush();
              os.close();
         } catch (Exception e) {
              out.println("ERROR: " + e);
    %>It looks like that after I've closed the outputStream I can't do any more processing in the JSP. Even if I remove the setContentType and setHeader methods it still behaves this way.
    I'm starting to think that there's no way around this...??

  • How to ensure OC4J runs after user logs out of a W2003 Server

    Greetings,
    I have a question. We have BI Publisher running on a W2003 server. When I log into the server, a dos window starts up, and runs the OC4J stuff. When I log out of the server, this process stops.
    In order to use the scheduling part of BI Publisher (meaning, reports can be emailed out), the OC4J window must be running (meaning, I cannot log out of the W2003 server).
    How do I ensure the OC4J process remains running after I log out of the W2003 server? Note - this was fresh server, with a clean OBISE (Oracle Business Intelligence Standard Edition) install.
    Thanks,
    Colin Jensen

    Use the services created at installation time to startup Oracle AS components.
    thant should do the trick

  • How to set current row in table after use tab key on inputText

    Hello all,
    My first post .., I'm newbie in ADF and I will try to explain my problem.
    For the moment we use ADF 11g (11.1.1.4), in a jsff page I have a table with an inputText column.
    On the valueChangeListener of the inputText, I invoke a method in a viewScope bean which call an EJB method, make some services in the EJB on the line modified. After that I refresh the VO and the table (because others values on the line have been modified) and reset the focus on the same inputText modified by the user with javaScript because focus was lost after refresh.
    So far, everything works fine.
    When I use the arrow keys to change the selected row in the table, it's work fine (focus is still in the next or previous inputText), but if user try to use tab key to change the current line, the inputText on the next line have the focus but the current row of the table is not changed (I think it's normal).
    My question : how can I change the current row after tab key pressed in this case ?
    I don't know if it's really clear, not easy to explain, don't hesitate to ask more details.
    Thanks in advance.

    Frank Nimphius wrote:
    Hi,
    My question : how can I change the current row after tab key pressed in this case ?
    Use a client event to listen for the keyboard entry and intercept the tab. The use af:serverListener to call the server to set the rowKey on the table and issue a PPR for the table to re-paint
    See sample 11 on http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples
    to learn about how to use the client listener and server listener
    FrankHi,
    Thanks a lot for your advices, I used the client and server listener
    I used this code on the method call in order to change the selection after key tab pressed, I don't know if it can be easier, but it works.
              if (LOGGER.isDebugEnabled()) {
              LOGGER.debug("START changeSelectedRow");
              RowKeySet oldRowKeySet = myTable.getSelectedRowKeys(); // get oldRowKeySet
              if (oldRowKeySet == null) {
                   if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug("oldRowKeySet is null");
                   return;
              RowKeySetImpl newRowKeySet = new RowKeySetImpl(); // The new RowKeySet use to change the selectedRow
              DCIteratorBinding bindingIterator = ADFUtils.findIterator(MY_ITERATOR);
              bindingIterator.setRangeSize(-1);
              // set the new index of the current row.
              int index = bindingIterator.getCurrentRowIndexInRange();
              if (index < bindingIterator.getAllRowsInRange().length - 1) {
                   index++;
              bindingIterator.setCurrentRowIndexInRange(index);
              // get the current row after changed the index
              Row currentRow = bindingIterator.getCurrentRow();
              if (currentRow != null) {
                   ArrayList nextLst = new ArrayList(1);
                   nextLst.add(currentRow.getKey());
                   newRowKeySet.add(nextLst);
                   // set the new selectedRow
                   myTable.setSelectedRowKeys(newRowKeySet);
                   SelectionEvent selectionEvent = new SelectionEvent(oldRowKeySet, newRowKeySet, myTable);
                   selectionEvent.queue();
                   AdfFacesContext.getCurrentInstance().addPartialTarget(myTable);
              if (LOGGER.isDebugEnabled()) {
                   LOGGER.debug("END changeSelectedRow");
    Best Regards
    Benjamin

  • Rules within sequence are not completing after user logged out.

    We have been noticing since yesterday that rules within a sequence not being completed when user logs off planning.
    A. User kicks off a sequence from planning. This sequence has 4 rules.
    B. Logged off either after launching or after waiting few minutes and logged off.
    C. Next rules do not start and we noticed session is ending from AAS.
    However user closes browser sequence completes. Yes sequence has no errors. It was working fine until last week and only change was 'NETDELAY' value. Changed from 1500 to 60000.
    Not tried from SmartView yet.
    Edited by: venuramini on Jun 22, 2009 5:40 PM
    Corrected typo in title.

    Reason for changing from 1500 to 60000 was, do not remember exactly, issue with MS Excel connectivity. We implemented long ago in dev but never updated other environments.
    As far as other HBR_MAX_WAIT_FOR_RULE and HBR_MONITOR_DELAY we have tried and did not achieve desired results.
    FYI: we are using Planning 9.3.0.1 and wanted rules running longer than 60 minutes to go in background mode. But above setting would not be useful for 9.3.0.1.
    Am I confusing you?
    More info of original issue: Business rules time-out. Planning 9.3.0.1
    Since then, we have increase web session time-out to 720 min (12 hours), in-activity session timeout to 720 min to let sequence complete even if user session timed out.
    Thanks!
    Venu

  • After userA check out a page, edit the page and save, Sharepoint prompt userA have checked out the page

    In one of site collection at our SP2013 farm, we have "SharePoint Server Publishing" site feature and "SharePoint Server Publishing Infrastructure" site collection feature activated.
    One of user (UserA) create a page in a page library. The new page is marked as "checked out by UserA". It is fine.
    Then UserA open the page -> edit page -> key in something and "save". Then the page prompt him "The file Pages/subfolder/test001.aspx has been modified by i:0#.w|test\userA on 8Aug2014 xx:xx:xx" and ask him to choose "Leave
    this page" or "say at this page".  The date time is exactly the time he was editing the page.
    Whatever he choose will save the page and return to "View" mode (non-edit mode).
    It is not the only problem. When userA want to edit the same page again and save, it prompt him that "The page could not be saved because your changes conflict with recent changes made by another user. If you continue, your changes will be lost."!
    When userA choose continue or "check out". Follow screen show up:
    What can we do? In summary, userA cannot edit a page because userA have checked out! We have tried for different users have exactly same issue.

    We are having the same problem, the one thing we have found is if we use the Save Icon on the top right hand side of the page in the ribbon (next to follow), that Save works just fine.  What is causing the issue is when trying to use the Save Icon on
    the left hand side of the ribbon that has the dropdown options to 'Save', 'Save and Keep Editing' or 'Stop Editing'.  It doesn't matter if you just click on the main Icon or choose any of the dropdown options, they all cause issues with the pages.  
    Thoughts?
    Nick Hurst

  • How to call backing bean method when user tabs out of af:inputListOfValues field

    Hi,
    I am using jdev 11.1.2.4.
    I want to call a backing bean method based on the value selected in the af:inputListOfValues field.
    The requirement is similar as Frank Nimphius-Oracle has demonstrated here  https://blogs.oracle.com/jdevotnharvest/entry/how_to_notify_the_server but with Input List of Values component.
    The fields I want to call method from is
    <af:inputListOfValues id="appealNameId"
                          popupTitle="Search and Select: #{bindings.AppealName.hints.label}"
                          value="#{bindings.AppealName.inputValue}"
                          label="#{bindings.AppealName.hints.label}"
                          model="#{bindings.AppealName.listOfValuesModel}"
                          required="#{bindings.AppealName.hints.mandatory}"
                          columns="#{bindings.AppealName.hints.displayWidth}"
                          shortDesc="#{bindings.AppealName.hints.tooltip}"
                          binding="#{backingBeanScope.backing_Donation.appealNameId}"
                          autoSubmit="true" clientComponent="false">
                          <f:validator binding="#{bindings.AppealName.validator}"/>
                          <af:autoSuggestBehavior suggestedItems="#{backingBeanScope.backing_Donation.onSuggestAppeal}"/>
                          <af:clientListener method="onBlurTxtField" type="blur"/>
    </af:inputListOfValues>
    <af:serverListener type="onBlurNotifyServer"
                       method="#{backingBeanScope.backing_Donation.onBlurNotify}"/>
    as you can see,  af:serverListener is outside the af:inputListOfValues which probably is the reason its not executing this method?
    public void onBlurNotify(ClientEvent clientEvent) {
       // get a hold of the input text component
       RichSelectOneChoice inputTxt =  (RichSelectOneChoice) clientEvent.getComponent();
       //do some work on it here (e.g. manipulating its readOnly state)
       //Get access to the payload
       Map  parameters = clientEvent.getParameters();
       System.out.println("SubmittedValue = "+parameters.get("submittedValue"));
       System.out.println("LocalValue =  "+parameters.get("localValue"));
    I've tried to put serverListener tag inside the <af:inputListOfValues> but getting below error
    "Server Listener is not valid child of Input List of Values"
    any ideas please?
    thanks

    As first, check to see that you are using correct type for af:serverListener (thet one you are queue in the javaScript onBlurTxtField function)
    If still does not work, go to directly to the page source code, and put af:serverListener "by hand", as a child for af:inputListOfValues.
    Because it is possible that these messages are false alarm...

  • How can I still be able to execute some codes after user press Ctr-C

    When user press Ctr-C to exit my program, I want to do something before the program terminated, how can I do that?
    Thanks for help.

    BOOL CtrlHandler(DWORD fdwCtrlType)
    switch (fdwCtrlType)
    // Handle the CTRL+C signal.
    case CTRL_C_EVENT:
    Beep(1000, 1000);
    return TRUE;
    default:
    return FALSE;
    * Class: alexiworld_yahoo_com_CtrlCHanler
    * Method: init
    * Signature: (V)V
    JNIEXPORT void JNICALL Java_alexiworld_yahoo_com_CtrlCHanler_init
    (JNIEnv *env, jobject this)
         SetConsoleCtrlHandler((PHANDLER_ROUTINE) CtrlHandler, TRUE);
    }

  • Remotely execute batch commands for AD users?

    Alright, so I haven't found this anywhere, but is there a way to remotely execute commands for AD users?Eg. I have a user with an invalid signature in Outlook. I originally wrote up a script that would apply these signatures and set them as default on user logon, but I also made versioning available in my script, and I don't want to create an entire new version just because of a single signature, so instead I would prefer to use a command like "xcopy "\\server\deployed\signatures\%username%\signature.htm" /q /y /z" Is it possible for me to do it remotely?PS.Sorry if the question may sound stupid, I just haven't done something like this before.
    This topic first appeared in the Spiceworks Community

    Alright, so I haven't found this anywhere, but is there a way to remotely execute commands for AD users?Eg. I have a user with an invalid signature in Outlook. I originally wrote up a script that would apply these signatures and set them as default on user logon, but I also made versioning available in my script, and I don't want to create an entire new version just because of a single signature, so instead I would prefer to use a command like "xcopy "\\server\deployed\signatures\%username%\signature.htm" /q /y /z" Is it possible for me to do it remotely?PS.Sorry if the question may sound stupid, I just haven't done something like this before.
    This topic first appeared in the Spiceworks Community

  • JTable - loosing focus without tabbing out

    Hi all,
    I have a JTable and when the user goes to enter some text in a field I would like the value entered to persist to the underlying object as soon as the text is changed. This is without the user tabbing out of the JTable.
    Currently when a value is changed and the user hits a save button the value is not saved as the focus is still in the table, it all works fine as soon as the user enters the new value and tabs out of the table and then selects save,
    Does anyone have any suggestions?
    THanks,

    This can be done via your own TableCellEditor class. Create a TableCellEditor class. Implement KeyListener in this editor to save whenever the data is modified.
    You can set the default editor via setDefaultEditor() on JTable.

  • Check-out button is not disable after the check out request from the same user

    HI all,
            I want to use check out/ in procedure in solution manager along with email notification. For that, I have maintained required settings and maintenance project for the intended solution. I want to implement a team leader- manger hiearchy for any changes to the solution. When a team member requests for the check out for any process scenario/ step, the status goes to check out requested. But, the problem is, check-out button is not disable and same user can do the check out which I want to restrict. The check out can be done only by the project manger. I guess, this is related to authorization roles for both team member and manger. But I am not able to find out. Please help me to have the authorization roles for this.
    Thanks,
    Rutvik Upadhyay.

    Why not putting a af:fileDownloadActionListener inside the command button. In the bean you need an method like
        public void exportExcel(FacesContext aFacesContext, OutputStream aOutputStream)
    } You can use the output stream and when you finished just flush it. Don't close the stream and don't complete the response.
    Timo

  • Why can I not tab out of table cell after running command from keyboard

    In my Jtable I have context menu with actions that can be performed on the selected cells either using mouse, or the action can be initiated directly from the keyboard using the defined acceleratorkey.
    After the action has completed you can tab out of the selected cells using the Tab key or cursor keys if the action was initiated with the mouse, but not if initiated with the keyboard but Im at a loss as to what causes the difference.
    thanks Paul

    I found this one someWhere, maybe check your code if Cell returns true = isCellEditable(row, column)
    import java.awt.event.*;
    import javax.swing.*;
    public class TableActions extends JFrame {
        private static final long serialVersionUID = 1L;
        public TableActions() {
            JTable table = new JTable(15, 5) {
                private static final long serialVersionUID = 1L;
                @Override
                public boolean isCellEditable(int row, int column) {
                    return column % 2 == 0;
    //              return false;
            table.setPreferredScrollableViewportSize(table.getPreferredSize());
            JScrollPane scrollPane = new JScrollPane(table);
            getContentPane().add(scrollPane);
            InputMap im = table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
            //  Have the enter key work the same as the tab key
            KeyStroke tab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0);
            KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
            im.put(enter, im.get(tab));
            //  Disable the right arrow key
            KeyStroke right = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0);
            im.put(right, "none");
            //  Override the default tab behaviour
            //  Tab to the next editable cell. When no editable cells goto next cell.
            final Action oldTabAction = table.getActionMap().get(im.get(tab));
            Action tabAction = new AbstractAction() {
                private static final long serialVersionUID = 1L;
                @Override
                public void actionPerformed(ActionEvent e) {
                    oldTabAction.actionPerformed(e);
                    JTable table = (JTable) e.getSource();
                    int rowCount = table.getRowCount();
                    int columnCount = table.getColumnCount();
                    int row = table.getSelectedRow();
                    int column = table.getSelectedColumn();
                    while (!table.isCellEditable(row, column)) {
                        column += 1;
                        if (column == columnCount) {
                            column = 0;
                            row += 1;
                        if (row == rowCount) {
                            row = 0;
                        if (row == table.getSelectedRow()//  Back to where we started, get out.
                                && column == table.getSelectedColumn()) {
                            break;
                    table.changeSelection(row, column, false, false);
            table.getActionMap().put(im.get(tab), tabAction);
        public static void main(String[] args) {
            TableActions frame = new TableActions();
            frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
    }

  • AJAX request won't work after a command button has been clicked

    hello,
    i have a simple login form, with a user name text field, password text field, login button, and cancel button....there is a simple ajax request that fires on the onBlur() event of the user name text field. the purpose is to validate the user name as soon as the user enters the name. all works fine when the page is first loaded...the user enters a user name, and either tabs out of the text box, or clicks out, and the ajax request is fired, and works great...
    however, during testing, i discovered that if the user were to click the login button, or the cancel button, before entering text into the user name text field, the onBlur() code never fires after the user writes text into the text field....
    can anyone explain to me why this is, and what i need to do to fix it
    here is my javascript code
    function validateUserName()
    var xmlHttp;
      try {
        xmlHttp = new XMLHttpRequest();
      catch (trymicrosoft) {
        try {
          xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (othermicrosoft) {
          try {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (failed) {
            xmlHttp = false;
      if (!xmlHttp)
        alert("Error initializing XMLHttpRequest!");
      var UserName = document.getElementById("form1:txtUserName").value
      xmlHttp.open("GET", "faces/LoginServlet?UserName=" + UserName, true);
      xmlHttp.onreadystatechange = function () {
          if (xmlHttp.readyState == 4)
              if (xmlHttp.status == 200)
                  if (xmlHttp.responseText == "yes")
                        document.getElementById("form1:txtError").style.color = 'green';
                        document.getElementById("form1:txtError").innerHTML = 'User Name Correct';
                        document.form[0].cmdLogin.disabled = false;
                  else if (xmlHttp.responseText == "no")
                    document.getElementById("form1:txtError").innerHTML = 'User Name not found';
              //else alert(xmlHttp.status);
              //alert(xmlHttp.readyState);
      xmlHttp.send("");
    }here is my JSP page code
    <ui:textField binding="#{ui$Welcome.txtUserName}" id="txtUserName" onBlur="validateUserName();"
                                style="left: 528px; top: 312px; position: absolute; width: 168px" tabIndex="1"/>i use a servlet to handle the request, which in turn uses a Data Access Object to run a simple select query...i don't think any of that is the reason why the onBlur() code never fires...but if it would help to post that code, please let me know
    thank you in advance
    sam

    Check the following example:
    http://java.sun.com/developer/technicalArticles/J2EE/AJAX/RealtimeValidation/index.html
    Also, http://developers.sun.com/jscreator/learning/tutorials/2/textcompletion.html

  • Command button remains disabled after a request redirect to a PDF Servlet

    Hi All,
    I've a command button to generate PDF on the fly and used to work in JDev 10.1.3.3.
    When we migrated to 11g, it works for the first time on a page, and the file Open/Save dialog will come up.
    But then the command button remains grayed out, and clicking doesn't generate a server call.
    If I do something on the page which does a partial or full submit, then the button will get enabled again.
    Any suggestions?
    Thanks,
    Jaimon
    Sample code:
    Facelets:
    <af:commandButton text="Create PDF" action="#{fs02.createPDF}" />
    Java:
    public String createPDF() {
    //Validation checks here. If there are any errors, it gets added to FacesMessages to display on the same page.
    if(!validate()) {
    //sf.addInfoMessage('message here..');
    }else {
    FacesContext ctx = FacesContext.getCurrentInstance();
    HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
    HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
    RequestDispatcher rd = request.getRequestDispatcher("/pdfdownloader");
    rd.forward(request, response);
    ctx.responseComplete();
    return null;
    pdfdownloader is mapped as a servlet, which writes the actual PDF content as a stream.

    Herewith the code which is triggered with the post-forms-commit trg. As far as I can see it, there is no code to disable/enable the save button in the menubar.
    ===
    PROCEDURE validate_enbr_records IS
    CURSOR c_enbr
    IS
    SELECT exlb.exlb_length
    , enbr.enbr_ind_break
    FROM dog_envelop_breaks enbr
    , dog_extrnl_labels exlb
    WHERE enbr_appl_cod = :flow_appl_cod
    AND enbr_flow_cod = :flow_cod
    AND enbr_sort_seqnr <> :enbr_sort_seqnr
    AND enbr_appl_cod = exlb_appl_cod
    AND enbr_exlb_cod = exlb_cod;
    CURSOR c_exlb
    IS
    SELECT exlb_length
    FROM dog_extrnl_labels
    WHERE exlb_appl_cod = :flow_appl_cod
    AND exlb_cod = :enbr_exlb_cod;
    l_lengte_break_label NUMBER := 0;
    l_lengte_sort_label NUMBER := 0;
    l_length NUMBER := 0;
    l_aant NUMBER := 0;
    r_enbr c_enbr%ROWTYPE;
    mi_id MenuItem;
    BEGIN
    FOR r_enbr in c_enbr LOOP
    IF r_enbr.enbr_ind_break = 'Y'
    THEN
    l_lengte_break_label := l_lengte_break_label + r_enbr.exlb_length;
    ELSE
    l_lengte_sort_label := l_lengte_sort_label + r_enbr.exlb_length;
    END IF;
    l_aant := l_aant + 1;
    END LOOP;
    OPEN c_exlb;
    FETCH c_exlb INTO l_length;
    CLOSE c_exlb;
    IF :enbr_ind_break = 'Y' THEN
    l_lengte_break_label := l_lengte_break_label + l_length;
    ELSE
    l_lengte_sort_label := l_lengte_sort_label + l_length;
    END IF;
    IF l_lengte_break_label > 48
    THEN
    qms$errors.show_message('DOG-10194');
    END IF;
    IF l_lengte_sort_label > 50
    THEN
    qms$errors.show_message('DOG-10195');
    --set_record_property(3,'enbr',status,changed_status);
    END IF;
    IF :system.record_status = 'CHANGED' THEN
    set_menu_item_property('FILE_MENU.SAVE',ENABLED,'YES');
    END IF;
    END;
    ===
    After the message has been throughn and the OK-button has been clicked, the code is never reaching the code:
    IF :system.record_status = 'CHANGED' THEN
    set_menu_item_property('FILE_MENU.SAVE',ENABLED,'YES');
    END IF;
    The save-button remains disabled.
    Best regards
    John.

Maybe you are looking for