Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6046133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:12:12+00:00 2026-05-23T07:12:12+00:00

I get result to JavaScript from native NPAPI/XPCOM/ActiveX. Previously user activate native GUI by:

  • 0

I get result to JavaScript from native NPAPI/XPCOM/ActiveX. Previously user activate native GUI by:

   <h:commandLink styleClass="send-doc-link" value="#{msg.send}"
       onclick="javascript:signDocument('data');return true;"
       action="#{internalPayment.sendDocument}"/>

and JavaScript function ‘signDocument’ finish execution after user quit from add-on GUI.

I switch native code to asynhronouse model. So JS func ‘signDocument’ return execution imediatly and result must be fetched lately.

I write JS code, like this:

function signDocument(dataTagID, tagID4Event) {
    var npapi = document.getElementById("npapi");
    npapi.Sign(langId, content, desc, ts, sign);
    mylog("OK");
    var scheduler = setInterval(
           function() {
                    mylog("FAIL");
                    if (npapi.AddonGetState() != "finished")
                        return;
                    clearInterval(scheduler);
                    out_sign = npapi.SignValue();
                    fireHTMLEvent(tagID4Event, 'click');
            }, 1000);
    }
}

which try get result in 1 sec interval and emulate link pressing by firing ‘click’ event.
All work fine on test static HTML test.

I rewrite .jsf file to:

  <h:commandLink styleClass="send-doc-link" value="#{msg.send}"
    onclick="javascript:signDocument('data', 'signDocumentCallbackID');return true;"/>
  <t:commandLink styleClass="hidden" id="signDocumentCallbackID" forceId="true"
    onclick="return true;" action="#{internalPayment.sendDocument}"/>

I expect that scheduler fetch result and fire event. But scheduler do not invoked because after user click to first link (visible) JS call native code which create separate thread for GUI and execution returned to JS. Next page reloaded and seems all JS object die as page die (I check this by ‘mylog’ func).

Really first h:commandLink tag converted to:

<a href="#" onclick="var cf = function(){javascript:signDocument('data', 'signDocumentCallbackID');return true;};var oamSF = function(){return oamSubmitForm('j_id_jsp_179411707_1','j_id_jsp_179411707_1:j_id_jsp_179411707_5');};return (cf()==false)? false : oamSF();" class="send-doc-link">...

So to my JS code added oamSubmitForm which seems reload my page and delete sheduler.

How stop include special code to onclick=""?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:12:12+00:00Added an answer on May 23, 2026 at 7:12 am

    If you don’t need to invoke a synchronous backing bean action with a link, then just replace <h:commandLink> by <h:outputLink> or just <a>.

    <h:outputLink styleClass="send-doc-link" onclick="signDocument('data', 'signDocumentCallbackID')">
        <h:outputText value="#{msg.send}" />
    </h:outputLink>
    

    or

    <a href="#" styleClass="send-doc-link" onclick="signDocument('data', 'signDocumentCallbackID')">
        <h:outputText value="#{msg.send}" />
    </a>
    

    Note that the javascript: pseudoprotocol and the return true; are totally superfluous. Both are already the default. You would probably also use return false; instead so that the link’s default action (going to top of page) will be blocked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

// synchronous Javascript var result = db.get('select * from table1'); console.log('I am syncronous'); //
How can I get result from action? I need to show the commentID on
I'm using ajax to retrieve some data from the backend. I get the result
following from javascript jquery and using eval i still could not get jquery to
Greetings! I'm calling a Web service from Javascript when a user clicks on a
I'm trying to build up a string array in JavaScript and get the results
How can i get result My Dream Table Result CREATE TABLE #temp( [count] int
page contents: aa<b>1;2'3</b>hh<b>aaa</b>.. .<b>bbb</b> blabla.. i want to get result: 1;2'3aaabbb match tag is
how can we get distinct result by using criteria in hibernate.
I'm looking to get the result of a command as a variable in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.