Bug? calling javascript click() on a hidden button causes js error on page

I call the .click() method on a hidden button to cause the page to refresh. This works OK, but when the page comes back up, it has a javascript error on it. It turns out the error is from some javascript that is trying to set the focus on the hidden button that was clicked, which causes an error in IE (This doesn't seem to bother Firefox) .
While I imagine that there are workarounds, why should the underlying faces architecture be setting the focus to a hidden button?
It's easy to duplicate:
Create new page. Add two buttons. For the first, make it invisible (uncheck visible in properties), then cause it to submit a virtual form.
For the second, add this to the onclick:
document.getElementById("form1:button1").click();return false;
Bring up the page, click on the visible button. The page will refresh, and you'll have a nice js error.
BTW: Obviously, I don't want to click one button from another. What I want is a way to cause an action to happen from javascript. I can't imagine it would work to simply submit a form from javascript, so I use this method. It works fine except for the error. Is there a better way to do this?

which causes an error in IE (This doesn't seem to bother Firefox) .Vaious browsers behave differently at times when executing javascript code. Many instances of this can be found on the net. This is a browser specific problem.So it's ok to set the focus to a hidden button because firefox is more relaxed about this obvious error than explorer is? When would anyone really want a hidden button to gain focus? What do I tell my users--don't use explorer, because it doesn't like it when faces sets the focus to a hidden button? Ignore the error message you get? What?
BTW: Obviously, I don't want to click one button from another. >>What I want is a way to cause an action to happen from javascript.Please describe in detail what action you would like to perform from javascript. It is not clear as to what the use case is.
I don't really see how the use case matters. I gave a very easy example how to duplicate this problem. The reason that I want to do this is that there are many places to enter javascript code that don't allow for an action to be triggered. I have many instances of this. For example, I'd like a mouseover on an edit field to cause an action. I can capture this in javascript, but I can't cause any server side processing. To get around this limitation, I call the hidden button's .click method, which does cause a server side event.
Here's a simpler, more direct incarnation of this error that doesn't involve javascript.
Create a new page. Put an element on it, like an edit box. Put a button on the page. For its action, put:
public String button1_action() {
getButton1().setVisible(false);
return null;
Pressing this button will cause a page refresh, and then a javascript error.
Use Case: After the user presses the button, they shouldn't be allowed to press or see it again.

Similar Messages

  • Cursor does not click the sign-out button in yahoo, rediff etc pages ?

    cursor does not click the sign-out button in yahoo, rediff etc pages. E.G once I open my yahoo page, the cursor pointer will not change it's appearance to the finger type when I try to click the sign-out or inbox button. This does not happen with chrome or explorer.

    That problem can be caused by the Yahoo! Toolbar or the Babylon extension that extents too much downwards and covers the top part of the browser window and thus makes links and buttons in that part of the screen not clickable.
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • Error occured when click on "Sign In" button at Yahoo Mail login page

    Im unable to login to my yahoo mail website.
    After filling up the username and password section.. clicking on the 'Sign In' button does nothing.
    Upon checking the Error console found there might be issue with javascript.
    Able to login with other web browsers.

    Hi Behrouz,
    Please try if you can access the site on computers outside your Company network. This could help us to narrow down the issue and see if the “The Hardware Firewall
    won't allow any Computers to access any ports Except Port 8” causes the issue.
    The error message you encountered is described in the article below, please see if it suits your situation:
    http://support.microsoft.com/kb/947124
    In addition, you could check ULS log or IIS log and see if there is any related message.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Clicking "Grant Worklist Access" button giving Unpexted error

    Hi,
    We have an R12.1.3 Oracle Apps 2 Node system running on Solaris 10 (Sparc 64) with 11.2.0.1 Database.
    We have enabled worklist. A user reported to us that when he clicks on "Worklist Access" (link is available on homepage below the worklist notifications) and goes to next page to click the "Grant Worklist Access" button, he is getting the below error.
    Error Page
    You have encountered an unexpected error. Please contact the System Administrator for assistance.
    We verified that this is reproducible for all the users including SYSADMIN.
    We are clueless what to do as there are no hits on google too.
    Please help.

    You have encountered an unexpected error. Please contact the System Administrator for assistance. This is a generic error, so please check Apache log files (error_log* and access_log*) for details.
    Thanks,
    Hussein

  • Email submit button causing required error when all required fields are filled in

    It looks like if I have more than 1 instance of subform  added,  my email submit button triggers "..at least one required " error message when all required fields are filled-in.
    I toggle subforms between "visible" and "hidden (from layout)".  Any suggestion is appreciated.
    ralph

    The fields that are hidden should have the validate.nullTest property set to "disabled", something like;
    TextField1.validate.nullTest="disabled";

  • When I click on firefox to open in my Mac, an error shows up: plug-in object Type error: id is undefined. When I click on the OK button, firefox opens. This never happened in FF 3. What is this?

    Also when I am in a site, such as an account, and click on a highlighted link, I get another error, {Javascript Application] can't create mcafee plug-in object: Type Error: components. classes [cid] is undefined. The only mcafee I had on my computer was the secure search and I uninstalled it, but I still get this message. When I click on the OK button with the error message, then the link opens up.

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • Re: AJAX-Calling JavaScript function

    Hello!
    So i've been reading abt AJAX and i'm trying it out now. I have a problem or two.
    Take a look @ this scenario plz.
    I have a Page HTML header with the the following script
    <script language="JavaScript1.1" type="text/javascript">
    function setFocus(PageItem) {
    document.getElementById(PageItem).focus();
    function validateLogin(User,Pwd) {
    alert("Here Now.");
    if (document.getElementById(User).value == "") {
    alert("Login ID must have a value provided.");
    document.getElementById(User).focus();
    else if (document.getElementById(Pwd).value == "") {
    alert("Password must have a value provided.");
    document.getElementById(Pwd).focus();
    document.getElementById(Pwd).select();
    else {
    doSubmit('SUBMIT');
    </script>
    I have a button which is supposed to call the validateLogin function . In its' Optional URL Redirect, ive set Target=URL
    and URL Target as
    javascript:validateLogin('P4_USERNAME','P4_PASSWORD);
    however when i run the page and try to press the button, i get "Error on page" at the bottom left hand corner of my browser.
    Also, u notice i put an alert
    alert("Here Now.");
    just @ the beginning of the function to see if the function is actually called but the alert didn't even get displayed.
    Am i calling my function wrongly. Hope i've explained the scenario ok. Any ideas on this plz.
    big thnx

    Hello,
    You're missing a quote at the end of 'P4_PASSWORD.... So try
    javascript:validateLogin('P4_USERNAME','P4_PASSWORD');
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • Trying to print from web, Instrutctions say first click on F'Fox button but this button is not visible when on the beb page

    how do I print from a web page Firefox "help" says 1. at top of f'fox window click on f'fox button however, when at the page from which I want to print, there is no visible f'fox button! What can I do?
    Do I need to save the page and then print from it, if so how do i save it and to what programme?

    * I think we need to update [[How to print websites]]
    * Try keyboard shortcut '''Control+P''' <br /> see [[Keyboard shortcuts - Perform common Firefox tasks quickly#w_current-page]]#w_current-page
    * You can possiby also toggle the menu bar using Alt or F10 to get a print option from the File menu
    I suppose printing whole web pages to paper is not often done these days.

  • Trying to access https site with a cert, got "The connection was interrupted" error after 30 seconds of waiting time before clicking on OK. But I can get in by clicking on Try Again button.

    I have a web site running on https. Every users need certificates to get in.
    I found out that if I didn't submit my cert within 30 seconds, Firefox displayed "The connection was interrupted". This problem is repeatable. But if I click on "Try Again" button on the error page, I can get in all the time.
    This problem doesn't happen on IE.
    Can you provide any tips to avoid seeing the error page?

    It is a miracle - After about 9 months without itunes, the new release installed on my machine today and appears to be working.
    7.0.0.70 is the verion I just installed.
    Another note to add to this now resolved issue. I bought an AirPort Express and I was not able to install the Admin software on the CD. I received the same error as I received with iTunes and Quicktime. This leads me to believe that this problem is in the registry or some other installer issue that is specific to Apple installations. I will have to go home and try to re-install that software. Maybe the new iTunes version cleared up the problem.

  • Tried to buy an album, when i click on "buy" it goes to terms and conditions.  i pick read and agree and click "agree" it goes straight to an error message (-1202).  any thoughts

    i tried to buy an album this morning after it had me update to the new 10.6.1 version of itunes.  i picked the album, put in my password and it took me the terms and conditions screen where i marked the read and agree box and clicked on the "agree" button.  An error message popped up saying "We could not complete your Itunes store request.  An unknown error occured (-1202).  There was an error in the Itunes Store.".  What the ****?

    When you reach terms and condition, try scroll down to bottom of contents of the terms and conditions before clicking the agree button.  See if it goes through this time.

  • How to call javascript function & action method on clicking jsf  button?

    I have one jsf custom button. I am checking client side validations in mail by calling javascript function & also sending mail by calling action method of a bean which will execute at server side for onclick event of that button. Because of this when I click on that button its calling both javascript function and action method. So even though validations failed its sending mail. How can I overcome this problem?? Please help me....

    I am asking regarding commanLinks in jsf. I have the following code block in jsf. Even though mailSentMessage('true'); returns false, its calling action="#{emailObjectAction.sendEmail}" method. thats why I got that doubt. try the following code.
    <h:commandLink id="mailBtn123Send"      onclick="return mailSentMessage('true');" value="send mail"     action="#{emailObjectAction.sendEmail}">          
    </h:commandLink>

  • Error in Javascript:Not fetching value on Button click

    Hi,
    I am using APEX 4.1 to build the application.
    I have 2 select list items in the page where one region consist of certain values.On calling a javascript function it is able to move the value from one select region to another. After this I click on the modify button where in the value move out of the first select list region to the second will be updated in the table.
    Although I could see the values are not being updates.
    On putting alerts after the value being fetched in the javascript function and clicking the Modify button I can see that no data is being reflected in the alert. Hence the data is not being passed from the second select list APEX item to the javascript function.
    Please do let me know if you neeed any further information.
    Thanks.

    Hi,
    I would be interested to see the way you pass the value of the select list item to the JS function and also, the way you invoke your javascript. BTW, is there a specific reason for calling the javascript function from the button? Can't you just have a simple after-submit process to update the database?
    Thanks,
    Rohit

  • How do I add multiple songs to an existing playlist from the (no longer called) Library? Highlighting multiple songs and clicking the "Add to" button will only add the with the little arrow, not all the highlighted ones!

    How do I add multiple songs to an existing playlist from the (no longer called) Library? Highlighting multiple songs and clicking the "Add to" button will only add the one with the little arrow, not all the highlighted ones! I am using the "new" iTunes.

    For the moment there isn't a way for us end-users to control what is "matched" or "uploaded." That is purely a result of Apple's server-side algorithms.
    To re-add multiple songs at once simply highlight all the songs you want to re-add, then right-click (or Control+click) the list and choose "add to iCloud."

  • Calling BAPI on click of Approve/Reject button

    Hello All,
    I have a GP Application in which the initiator fills out a form which goes for approval to the approver.....now once the Approver clicks on Approve/Reject button i want to call a BAPI to update certain fields in the R/3 ......since those 2 buttons are part of the standard SAP Visual Approval Callable Object ....please let me know if this is possible....
    Any help would be highly appreciated.
    Regards.,
    Anil

    Hello Anil!
    Basically, you have two options:
    1.) You can invoke the BAPI from your VC model when the button is clicked.
    2.) You can invoke the BAPI from the GP.
    First of all, you should consider wrapping the BAPI with a web service.
    For option 1: Import your web service into your VC model and invoke it when the button is clicked.
    For option 2: Create a callable object from you web service. In the VC you must now provide a result state, which indicates whether the approve or the reject button has been clicked. Depending on this result state you can now invoke the callable object in your GP.
    I recomment option 1.
    Best regards
    Alexander

  • Is there a way to answer the 5c without swiping? It really is a pain and hard to do at times one handed. Maybe allow favorites to be answered with a click of the home button or possibly all calls with a home button push

    Is there a way to answer the 5c without swiping? It really is a pain and hard to do at times one handed. Maybe allow favorites to be answered with a click of the home button or possibly all calls with a home button push. First smart phone I have owned and the old flip phone was much easier to answer.....just press one button.

    Is there a way to answer the 5c without swiping? It really is a pain and hard to do at times one handed. Maybe allow favorites to be answered with a click of the home button or possibly all calls with a home button push. First smart phone I have owned and the old flip phone was much easier to answer.....just press one button.

Maybe you are looking for

  • PO and Sales Order

    Hi , I am creating a PO in "A" SAP System which is autocreating a Sales Order in "B" SAP System . Now I want to know how its creating the Order . Screenshot -> PO was created in A sytem and then it goes on to create SO in B system automatically . I r

  • Problem in Condition record Creation

    I am creating condition record in ML51 My amount is 95.20 INR System is issues the error message Input must be in the format

  • Add fields in Drilldown customer reporting open items

    Hello, I have made a copy of the standard Drill down report 0SAPDUEAN-01,but I want to add fields that are not in the pooll list (like Reference - BKPF-XBLNR) or Assignment (BSEG-ZUONR). How can I do this? Any help will be rewarded Best regards, Vict

  • How to restore the Password backup in sql server 2005

    How to restore the Password backup in sql server 2005

  • Error in GR postings

    Hi All, I am doing GR for domestic PO, all values in PO condition tab are correct but when i posted GR,the FI postings are entirely different.that is GRIR clearing a/c got posted for the value which is entirely different from the actual and same amou