Problem using javascript to submit jsf form, values not submitted

Greetings!
I have a t:selectOneMenu where I want the page to be submitted when they change the selected value. At this point, I am able to get the form to submit and reload the page, which is all fine. The problem is that none of the values from the page are not set in the backing bean. I have break points on the setter methods that are not being hit.
I have tried a number of things from searching multiple forums, but here are snippets from my latest version...
<h:form>
<t:commandLink id="hiddenLink" forceId="true" value="test link"
action="#{pc_PageX.doBtnHiddenLinkAction}"></t:commandLink>
<t:selectOneMenu id="pageList_top" forceId="true" value="#{pc_PageX.ValueX}"
     onchange="jspellSync(); submitPageX();">
     <f:selectItems value="#{pc_PageX.ListX}" />
</t:selectOneMenu>
</h:form>
function submitPageX(){
     var hiddenLink = document.getElementById("hiddenLink");
     hiddenLink.click();
}Note that the <t:commandLink> is not hidden, though it will be in the final version if I can get this to work.
If I click the commandLink myself, the page is submitted with all the page values as expected. If I change the list value, thus using javascript to fire the commandLink's click event, the page is submitted with NO values.
Can anyone come up with an explanation for this behavior? Or better yet, a solution?
A couple other things I've tried...
- Not using a commandLink and using jsf's submit function -> onchange="jspellSync(); submit();"
- Clicking the link using other ways -> hiddenLink.fireEvent('onclick');
If all else fails, I'll just add a button that they have to click to submit the form.

snotmare wrote:
BalusC wrote:
I recall this problem in one of the ancient JSF versions. Which JSF version do you use? Do you have any room to upgrade to latest? We're using an IBM implementation of JSF, which is at version 7.0. The IBM implementation appears to be built on the JSF base 1.1.That's not an IBM JSF implementation, they do not have any one, they just have some component libraries which runs on top of some JSF implementation. RAD/WSAD ships by default with Sun JSF RI. Try upgrading to at least 1.1_02 which you can download from the aforementioned link. There's a gap of 2 years (and inherently a lot of bugfixes) compared to 1.1. If the application server used supports Servlet 2.5, you could even upgrade to the latest 1.2.
We've had other issues with the IBM implementation, which could be the cause in this case too. We've been talking about switching to MyFaces, but there is one feature of the IBM version that we like. It's basically a script collector (hx:scriptCollector) that allows us to do pre-processing on the page.As said before, IBM does not have a JSF implementation. So replacing RI by MyFaces wouldn't make any difference.

Similar Messages

  • Using JavaScript to submit a form with multiple submit buttons

    I am a newbie to JavaScript, so hopefully someone can answer
    this for me.
    On my user registration form, I have two buttons that submit
    the form, 'check_availability' (to check if the username is
    available) and 'register'. In my PHP script, I check which button
    was pushed by checking which POST value is set,
    $_POST['check_availability'] or $_POST['register'].
    If I set the 'register' button to a JavaScript function that
    validates the form and then submits it, how do I get my PHP script
    to think 'register' was pushed?

    Sorry I used my old captcha script there.
    [php]
    <?
    session_start();
    if(isset($_POST['button_name'])){
    //DO SOMETHING HERE
    } else {
    //Add the page data
    ?>
    [/php]
    "east99" <[email protected]> wrote in
    message
    news:fepqr8$2mr$[email protected]..
    > Firstly name your buttons then use this script:
    >
    > [php]
    > <?
    > session_start();
    > if(isset($_POST['button_name'])){
    > if ($_POST['vercode'] != $_SESSION['vercode'] OR
    $_SESSION['vercode']=='')
    > {
    > // echo '<strong>Error
    Message</strong><br>';
    > $error = '<strong><font
    color="#FF0000">Error
    > Message</font></strong><br>';
    > } else {
    >
    > //Add the page data
    >
    > }
    > ?>
    > [/php]
    >
    >
    >
    > "AngryCloud" <[email protected]> wrote
    in message
    > news:fecu6r$cl5$[email protected]..
    >>I am a newbie to JavaScript, so hopefully someone can
    answer this for me.
    >>
    >> On my user registration form, I have two buttons
    that submit the form,
    >> 'check_availability' (to check if the username is
    available) and
    >> 'register'. In
    >> my PHP script, I check which button was pushed by
    checking which POST
    >> value is
    >> set, $_POST['check_availability'] or
    $_POST['register'].
    >>
    >> If I set the 'register' button to a JavaScript
    function that validates
    >> the
    >> form and then submits it, how do I get my PHP script
    to think 'register'
    >> was
    >> pushed?
    >>
    >
    >

  • Problem with using javascript in interactive adobe form

    Hi All,
        I have a problem when accessing text field value which is present inside a subform using javascript.
    I tried giving data.page4.sub-5.<fieldname>.rawvalue but its not working. Please provide a solution.
    Thank you in Advance.

    Since this question is related to JavaScript running within the Form and not the connection between the form and Web Dynpro - it really belongs in the Interactive Forms by Adobe Forum.

  • Using javascript to redirect a form in portal to a report

    Hi. I am trying to call a report or a dynamic page from a form I created. When I select the query button I want it to show the report or dynamic page based on the parameters I passed in the URL. I have the following javascript functions that get the parameters from the comboboxes.
    Additional PL/SQL Code... before displaying the page.
    htp.p('<script language="JavaScript">');
    htp.p('function getItemInst(form,targetInst)');
    htp.p('{var objname;');
    htp.p(' var selectedInst;');
    htp.p(' for(var j =0; j < form.length; j++)');
    htp.p(' { objname = form.elements[j].name.split(".");');
    htp.p(' if(objname[2] == targetInst)');
    htp.p(' { selectedInst = form.elements[j].value;');
    htp.p(' return selectedInst;');
    htp.p(' }');
    htp.p(' }');
    htp.p('}');
    htp.p('function getItemCip(form,targetCip)');
    htp.p('{ ');
    htp.p(' var objname;');
    htp.p(' var selectedCip;');
    htp.p(' for(var j =0; j < form.length; j++)');
    htp.p(' {objname = form.elements[j].name.split(".");');
    htp.p(' if(objname[2] == targetCip)');
    htp.p(' { selectedCip = form.elements[j].value;');
    htp.p(' return selectedCip;');
    htp.p(' }');
    htp.p(' }');
    htp.p('}');
    htp.p('</script>');
    When I click the query button it uses this code:
    using a query button->onclick javascript event handler
    var v_inst = getItemInst(this.form, "INST");
    var v_cip_course = getItemCip(this.form, "CIP_COURSE");
    var exec_url = "http://"+window.location.hostname + "/pls/portal/MAJOR_APP.PROGRAMOFSTUDYSEARCHRESULTS.show?p_arg_names=p_cip_course&p_arg_values="+v_cip_course+
    "&p_arg_names=p_inst&p_arg_values="+v_inst;
    window.location.href=exec_url;
    My problem is that it doesn't use the new url I created and go to the report. It just refreshes the form page I created. I am I missing a step or something?
    Thanks ;)

    Maybe you could try it like this... I saw this question answered not too long ago.
    Submit Portal Form Values to Portal Report

  • Using Javascript to email a form in a workflow process

    I've created an Acroform which will be routed around in a workflow process.  The user will open the form, add information and hit a button which is coded in javascript usng the mailDoc function.
    It works perfectly EXCEPT that each time the document is forwarded, "Adobe Acrobat Pro.pdf" gets appended to the name of the file in the email.  It doesn't actually rename the file, so the file does open properly, but the email looks pretty goofy.
    Example.  The filename is Form14.pdf. 
    When the third person signs off and clicks the email button, the email is created, with the address, subject line and body of the email completed, and the document attached has the little icon and then
    - Form 14.pdf - Adobe Acrobat Pro.pdf - Adobe Acrobat Pro.pdf - Adobe Acrobat Pro.pdf
    Is there some way to prevent it from concatenating like this every time the document is emailed?
    Thanks!!!

    Maybe you could try it like this... I saw this question answered not too long ago.
    Submit Portal Form Values to Portal Report

  • Using CFHTTP to submit a form directly to a google docs form

    Ok so here is some background
    Google has a service where you can create forms using google docs and embed them into your webpage, Results are automatically stored in a google spreadsheet upon submission.
    I want to use my own form to submit to to the google form processing page which I can get to work however the default generic google hosted thank you page appears upon submissing.
    I know you can use cfhttp to submit a form from a coldfusion server so I was thinking that I could simply pass my form variables to a action page that resubmitted them via cfhttp and thus bypass the thank you page altogether
    however when I try this it does not work and the results do not show up in the google spreadsheet. I figured that mabye the google processing page could tell that it was not submitted from a browser so I tired adding a useragent string but still no luck.
    Here is the code I was trying to use
    <cfhttp method="POST" url="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" redirect="yes" useragent="Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)">
         <cfhttpparam type="Formfield" name="entry.0.single" value="testValue1" >
         <cfhttpparam type="Formfield" name="entry.1.single" value="testValue2" >
    </cfhttp>
    And the online spread sheet can be viewed here
    http://spreadsheets.google.com/pub?key=tlo4FjygqMuUGmvuOb2_Gjw&single=true&gid=0 &output=html
    Does anyone know why this is not working?
    To recap I am able to use the following form on my own comptuer to directly submit to the processing page and this works
    <form action="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" method="POST">
    <input type="text" name="entry.0.single" value="" >
    <input type="text" name="entry.1.single" value="">
    <input type="submit" name="submit" value="Submit">
    </form>
    Any help would be greatly appreciated

    YES!!!!!!!!!!!!!!!!!!!!!! This did it final code is as follows thanks for you help
    <cfhttp method="POST" url="https://spreadsheets.google.com/formResponse?key=tlo4FjygqMuUGmvuOb2_Gjw" useragent="Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)">
         <cfhttpparam type="Formfield" name="entry.0.single" value="final test">
         <cfhttpparam type="Formfield" name="entry.1.single" value="final test">
          <cfhttpparam type="Formfield" name="submit" value="Submit">
    </cfhttp>
    Man this is great! and has eliminated half my database requirements! now only if you could pull the results back out!

  • Form is not submitting while caling a confrim in from validation.

    Dear All,
    I am getting a typical issue in the application. the code is as shown below.
    <h:form id="registerForm" target="_top">
    <h:inputText id="prmoCode" binding="#{Register_Backing.promoCd}" ></h:inputText>
    <h:commandButton onclick="return validate();" id="submitRegister" type="submit" image="../../../images/btnSubmit.gif" action="# {Register_Backing.createSilverhutUser}" />
    </h:form>
    <Script language="javascript">
    function validate()
         if(document.getElementById('registerForm:prmoCode').value=="")
              return confirm("is it ok to continue registration without the promo_code?");
    return true;
    </script>
    when the user clicks the button I am calling a validate() method, in that one I am calling a javascript confirm() function when the prmocode is empty string.
    if the user is selectig ok in the confirmbox the form is not submitting
    the form is submitting well when the promocode is not empty.
    please provide me some solution to over come this problem.
    Thanks & Regards,
    B.V.SureshBabu

    The form HTML is incorrect.
      <form id="form1" name="form1" method="post" action"registration.php">
    you're missing a  = after action

  • Form is not submitting through Oracle Application Server

    Hi Experts,
    We are creating one Java Application and deploy this java application on Oracle Application Server Enterprise Manager release 2 through War File.
    Now, There one Form on submitting calls procedure with some 42 parameter in that 20 are Oracle Types and remaining are simple varchar or number. when going to submit this form is not raise any database error or server error , but data is saved into database.
    We creating error log on database side as well as on Server side but we did not found any error.
    We are confused because remaining all form working fine as they call with same as procedure, only difference is that this form calls procedure which having 42 parameter with 20 Type and remaining simple varcahr or number. Other Forms procedure also having Oracle Types as a parameter.
    Could any of one help me out, Please ?

    The form HTML is incorrect.
      <form id="form1" name="form1" method="post" action"registration.php">
    you're missing a  = after action

  • Using Javascript function to change the value of a request variable

    Have a javascript function that activates onchange within a form variable. Would like the javascript function to change the value of a request variable.
    The javascript function is able to obtain the current value of the request variable ( which is 0 ) however I am unsuccessful in changing the value to 1.
    I have been trying to use the following:
         var vchange = 'request.changes_made = 1 ;' ;
         eval(vchange);
    Any ideas?

    If the user makes a change to the content of the form, and then attempts to leave the form, a javascript alert pops up giving the user the option of cancelling the submit, returning to the form and saving it.
    If there have been no changes, then the user is free to migrate to another page.
    This process is to protect users from losing valuable information but not to annoy them with "R U Sure" messages.
    Knowing the status of the form content is important to the functionality of the application.
    G

  • [SOLVED] Using wget to submit a form

    Edit: Figured out I was using the wrong URL and needed some necessary POST/GET data I wasn't filling out.
    Hm, I am trying to be able to submit a form using wget. I am able to actually put data in <textarea> like I want, but I fail to submit it through wget.
    I was able to login to the site by cheating a little bit. I came up with two methods to do it, the first one is easy which is just going to ~/.mozilla/firefox/<xxxx>/cookies.sqlite, and converting it to a *.txt. Easy. Or you can do it the slightly more complicated way by going to page you want, typing the url bar javascript:document.write(document.cookie); document.close(); and manually create the cookies.txt file using the information from that. Anyhow, that is how I am able to go into the site without having to submit my username/password in the first place (I kept failing to do that, it didn't even return the page with my username and password typed in like what's going on below). Anyhow, now I am stumped at actually submitting the post I want to. I execute:
    wget --cookies=on --keep-session-cookies --load-cookies=cookie.txt --post-data="Post=test" http://www.url-to-the-site.com/
    and the end result is:
    ^This is what wget returns and what it looks like when I open it in Firefox.^
    Which is what it returns. I checked the website and it didn't post it (I expected that since it returns that and not the post itself). I know you can't see it in the image there, but there is a submit button at the bottom of the page.
    The form looks something like this (stripped down):
    <form action='<url of website>' method='post' name='REPLIER' onsubmit='return ValidateForm()'>
    <input type='hidden' name='act' value='Post' />
    <input type='hidden' name='s' value='xxxxxx' />
    <input type='hidden' name='f' value='24' />
    <input type='hidden' name='auth_key' value='xxxxxx' />
    <input type='hidden' name='CODE' value='09' />
    <input type='hidden' name='t' value='41457' />
    <input type='hidden' name='p' value='514135' />
    <input type='hidden' name='st' value='0' /><br />
    <input type="submit" name="submit" value="Add Reply" tabindex='4' class='forminput' accesskey='s' />
    <input type="submit" name="preview" value="Preview Post" tabindex='5' class='forminput' />
    </form>
    Any idea?
    **Meh, in my experience of posting here, helpers/answers/whatever usually like an answer of why I have to do this the difficult way instead of just going there and posting myself in the first place (after all, it might help you answer the question). Well, we are playing a little game in there and I wrote a little script that keeps track of the points in the game... It makes a nice little pretty table that I use cron to update every hour, but then people have to wait until I actually post the table to see how they are doing in the game. So... I'd like to have it automatically post each update.
    Then I have a second use: If I am able to successfully post this, I am trying to get into a class at college. I already wrote a script that detects whether there is available space or not in the class. I'd like to be able to have it monitoring for an open spot in the class and if so... to check it [x] and submit so I can get in the class without having to sit at the computer refreshing all day hopelessly.
    And plus I learned programming, how to use so much utilities to do whatever... why stop now?
    In advance, thank you for taking the time to help me with this.
    Last edited by Aprz (2009-12-05 11:25:51)

    have you considered using curl? Submitting forms in curl is very easy. and saving cookies is easy as well.
    for example:
    curl -s -D lccookie -d "login=$login&password=$password" http://somepage.com/index.php?
    to log in (which also is submitting a form), and
    curl -s -b lccookie -e http://somepage.com/index.php --data-urlencode "EntryEffect%3A=$entryeffect" --data-urlencode "ClosingEffect%3A=$closingeffect" --data-urlencode "Color%3A=$colour" --data-urlencode "messagefield=$OPTARG" -d "Submit=Submit" http://somepage.com/index.php?
    to reuse the cookie and submit a form. (This is from a script I wrote that sends formated messages to a page which shows them on a ledbar.)
    Last edited by Shapeshifter (2009-12-03 14:09:36)

  • Using javascript to set non database values

    I finally figured out how to set the values of a non database form field using Javascript. The only problem is, I want this
    field to be a display only field, and the value does not get set if I make the field non updateable on the form. Can
    somebody please help me!! This is urgent.

    Stan,
    One way to do this is to call the doSubmit() function and create a page branch to handle your request. This way you can use apex validations and other goodies if your requirements change. Also this will save the state of your items on the page you are leaving.
    Edit
    I forgot to mention that you can pass a string parameter to the doSubmit function. The parameter will be the request sent to apex. For instance you could use doSubmit('DO_SOMETHING') and you can have a page branch which will fire if the request is equal to DO_SOMETHING.
    Cheers,
    Tyson Jouglet
    Edited by: Tyson Jouglet on Dec 1, 2009 10:11 AM

  • Problem with JavaScript in my PDF Form buttons

    I am trying to have my user click on a button in my form on my website and e-mail the form data to me.
    I am using the following JavaScript with my form button:
    this.mailForm(false, "[email protected]", "", "", "Subject", "Message Body");
    Protected mode is off.
    When I use the above statement (whether the 1st parameter is set to true or false), nothing happens – no email gets sent and no mail dialog box appears. If I change from this.mailForm(...) to this.mailDoc(...), I get a mail dialog box but, as expected, it sends the blank form without the filled-in data due to low user privileges.
    How can I send the form data with this.mailForm(...)? (Note that I prefer to use this.mailForm(...) rather than mailto:(...) because this.mailForm(...) supposedly allows me to e-mail the form without user interaction.)
    -- Don

    Thanks for responding.  I have been using “Submit a form” in the Mouse up event.  I had that operation do a mailto: and it worked, but required user interaction on the part of the web page visitor.  I have successfully created an equivalent JavaScript including:
        var url = "mailto:[email protected]?subject=mySubject&body=MyMessage"; 
        this.submitForm(url, true);
    The above sent the FDF file successfully, but again, it required user interaction.
    Then I tried this JavaScript - as I mentioned in a previous post - after you said to use doc.submitForm():
        var url = "http://mydomain.com/submit_notice.php";
        doc.submitForm(url, false);
    The above script seemed to do nothing (with no error message). Shouldn't it bring up the PHP file in the web browser?
    I have that php file, submit_notice.php, created, but I have not written any PHP scripts to e-mail the FDF file.  I have never written a PHP script to take the posted FDF data and email it, but I have used the PHP mail() function and posted variables.
    As for what I want to happen on the client side after the submit takes place: I simply want the FDF file to go to an e-mail that I specify.  Additionally, I need it to happen without any client interaction on the part of the web page visitor.  I can expect that visitor to have Adobe reader, but no add-ons or protected mode requirement.
    Please give me an example that emails the FDF file without any user interaction.
    Thank you.
    -- Don

  • How to validate People Picket control at client side using javascript/Designer in New form.aspx

    Hi Folks,
    I have list library with 2 columns. where as 1 column is people picker control and it is not mandatory filed .
    When the user open newform.aspx and fill all the column values and submit it should show error message if user not enter any data in people picker control column though it is not a mandatory column.
    How to achieve this by using javascript or sharpoint designer.

    Hello,
    Here is script for that:
    http://social.msdn.microsoft.com/Forums/en-US/f1c2a651-a0fb-484d-af33-e7084439b6c8/validate-sharepoint-people-picker-using-javascript?forum=sharepointgeneralprevious
    http://ankursharepoint.blogspot.in/2012/10/javascript-validation-of-people-picker.html
    Edit your newform.aspx page and add content editor webpart on that page. Then add script on HTML source section.
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Using JavaScript to Determine a Form's Folder Name

    We have an awful lot of forms, and in many cases, our custom JavaScript applies to all forms in a given folder. We would like to determine the form's folder name so that we don't have to list each and every form in a giant "IF" statement.
    Has anyone figured out how to determine a form's folder using JavaScript?
    Thanks!
    - Jake

    Jake_Turrell wrote:
    I think the only solution to the "refresh" issue would be to somehow query the hsp_object table and grab the parent_id (which for a form is the folder ID). If anyone figures out how to query the application repository from JavaScript,that would be very, very cool.
    As the database is server side and javascript is client side you would have to use something like an ajax call that passes the form id into an jsp script, the jsp script would query the repository and return the value to javascript.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Major JavaScript bug - form variables not submitted

    I'm building a page where data is submitted to Paypal via a form and using Javascript to build Select statements on the fly. These appear as expected, but when the form is submitted none of the variables are POSTed through. The same page works perfectly in IE so there must be a major bug in Firefox's impementation of Javascript - this is a total show-stopper for the page I need to implement.
    Go to the URL below and then check availability for type of room ANY. On the booking confirmation page if you leave the first select alone and hit the Pay Now button you will arrive at a debug page that dumps all the POST variables in a new window. Now go back and change the room type in the first select statement just above Pay Now - this updates the second select. Maybe even click it again to go back to the original setting. Now click Pay Now - nothing comes through from the select statement and some associated hidden vars.
    Try it in IE and it works just like it should.
    == URL of affected sites ==
    http://www.west-end-bb.co.uk/test/

    Found this which has solved the problem:
    [http://www.infoqu.com/dev/javascript-development/crazy-firefox-javascript-bug-156760-1/]
    There seems to be an issue with FF and InnerHTML when a form is in a table. By moving the form tag around I was able to place it within the table definition so that it works in FF.

Maybe you are looking for

  • Crystal Reports 2008 and BOXI3.1 issue

    Hi, Can somebody please help me finding a solution ? Here is the Problem: Environment Details DEV: BOXI 3.1product version 12.1.0.882 Crystal Reports 2008 DB2 database. Environment Details UAT BOX BOXI 3.1product version 12.2.0.290 Crystal Reports 20

  • Need help with open hub

    Hi eveybody,          I was trying to wok with open hub. Created infospoke, destination i gave was a csv file named d:/openmara.csv path, saved and activated the info spoke. I went to d:/ to view the uploaded files, two file was created, when i try t

  • Has anyone actually been able to build a FLV player with Flex 2?

    I have been playing around with a FLV player in Flex 2, but I keep on running into one big problem: I never get a picture. Sound is not a problem, and all code seems to do exactly what it should. Except for the video showing up... I have tried loads

  • Program Error - Photoshop CC

    I un-installed and re-installed photoshop CC becasue everything I did came up with an error message 'program error.' It didn't help, I'm angry, have lots of retouching to do. Any suggestions? Glen

  • Remote Call

    I have written an RFC Enabled Function Module in client 140. I am calling that program from client 130. After fetching the data from 140, i cant able to see that data when the control switches back from 140 to 130. How can we export the data. I have