Populating values in jsp without submitting the form

Hi,
I have a jsp page in which i have 2 select boxes. The values to these select boxes should come from database. When i change the selection of select box, the corresponding values from database should be displayed in the other select box without submitting the form.
How to accomplish that.
Any one having any idea about how to implement this stuff, please reply.
Thanks in advance,
Joby.

You should devide the JSP into two frames and make one frame size to 0 so it should not be visible to the use ,and put one jsp in this frame ,tht will work as the hidden jsp.
now in other frame put ur main jsp and on the change event of th select call a java script function and in this function pass the parametr to the hidden jsp like
parent.frames["hiddenframename"].document.location="hiddenJspName.jsp?parameter1=value1
and now in hodden jsp populate the data frm database based on passed parameter and after getting the data fillup the select on the second frame.
try it and if not work thn write me...
Bye.

Similar Messages

  • How to trigger a value change listener in JSF without submitting the form

    hi friends,
    I have a JSF Page which contains a check box and a text box.
    I made the text box property as readonly.
    when i click the check box , i want to make my text box as editable.
    i achieved the above task by submitting the whole form when i click the check box.
    i want to acheive the same functionality with out submitting the form.
    In one of the references it is stated that "Value-changed handlers are executed if the page is submitted and the value of the component has changed."
    hope you got the question.
    please let me know, if you know the answer.

    Hi,
    If at all you dont want to submit the form and wanna reflect same form's field(s) as per the change in drop-down/check-box,
    you can simply achive it using traditional way of 'JavaScript'.
    For that you may typically give <h:form> tag any specific id say
    <h:form id="myForm"> and for dropdown/checkbox also you may give id say
    <h:selectBooleanCheckbox id="group" onchange="javascript:reflectChangedValue();"  ... >
    </h:selectBooleanCheckbox>and in the same JSP you can write any JS function say reflectChangedValue() as
    function reflectChangedValue()  {
         var formPrefix  = "myForm:";
         var groupId = formPrefix + "group";
         var value = document.getElementById(groupId).value;
          if(value) {
               // enale textbox here
          } else {
               // disable textbox here
    }For formPrefix and groupId, f you are having any doubts, you can refer to 'view source' from the browser,
    generated HTML of the working JSP.

  • Passing javascript values to jsp without refreshing the page

    Hi,
    How do u pass a value of a javascript variable to the jsp without refreshing the page ?
    For example, a file called test.jsp in which a javascript variable x contains value 254. I need to pass the value of x to a method declared in test.jsp(same page).

    Hi Mona,
    when i say refresh i do mean a blink of the browser.
    This is a small example i wrote to show you how you can pass javascript varables to JSP variables. If you don't want the refresh to be seen by the user just include this code in a hidden frame on a page and instead of refreshing the entire page, refresh the hidden frame.
    i have to say, i didn't test the code so i don't guarantee it's flawless.
    if you need an more detailed example just tell me, i'll create one, but it won't be for today :)
    <html>
    <head>
         <title>Log in to the system</title>
    </head>
    <body>
    <script>
    //we retrieve the parameter 'user' from the URL
    <%
      String username = request.getParameter("user");
    %>
    var user = "<%= username%>";
    //check if there is a username in the URL
    if(user=="null")
      //there is no username so we log the person in as a guest
      user="guest";
      //we refresh the page and set the user parameter to 'guest'
      //the parameter now contains the javascript variable 'user'.
      //The parameter can be read by the JSP (see the top op this script).
      //This way we gave the javascript variabele to the JSP variable
      location="login.jsp?user="+user;
    else if(user=="guest")
    {  alert("Welcome "+user+", I hope you like this site"); }
    else
    {  alert("Welcome "+user+", I'm glad to see you again"); }
    </script>
    </body>
    </html>

  • How to Save State on an Entry Form prior to Submitting the Form?

    I want to be able to save the values the user enters to fields on the entry form if they navigate away from the page and come back (without the user clicking the submit button for the form.) For example, one of the input fields has a goLink to go to another page to lookup a field value - when the user returns from the page, all other form field values are cleared. If the user does submit the form by clicking the command button, then all form field values are saved (if the user navigates from the page and comes back, all values are retained.) What I'm trying to do then is somehow save the values (passivate the state) for the field the user has filled in when the user navigates from the page without submitting the form. Any suggestions?
    I am using a read-only View Object with all transient values. The VO is configured to passivate state including all transient values. The initial row is created programmatically; there will only be one row for the VO used as an entry form. I am not using a backing bean for the values and would prefer not to use one, but would rather use the VO's capability to passivate state to save the data values. The question then seems to be how to force the VO to passivate state prior to the form being submitted.
    thanks
    Message was edited by:
    javaX

    "My hunch is that the real problem is that the fields are not being set into the bindings due to the use of immediate="true"."
    Yes. Now I see that is the real problem. Is there anyway to force setting the bindings from the input form field values if the user navigates from the page using a goLink, or commandButton with immediate="true" other than overriding the default FacesPageLifecycle classes?
    I'd prefer not to have to do that unless necessary, and, if I over-ride that method, then how could I get it to work normally when the user presses the commandButton at the end of the form and I do want all validation checks to be performed (immediate=false for the form's submit button; immediate=true only for lookup commandButtons used for certain fields)?
    Here's an overview of how I set the page up:
    1. create transient view object; all attributes marked as always updateable; passivate state=true for VO and all transient values; no key id field selected (will only ever be one row - just using VO to save values that will eventually be used to do an insert to the database);
    2. transient VO added to Application Module
    3. Add data control to .jspx page as an ADF Form (not an ADF Creation Form)
    4. Add code to AM to create the initial row for the input form
    protected void prepareSession(Session session) {
    super.prepareSession(session);
    insertTransientViewObjRows();
    private void insertTransientViewObjRows() {
    ViewObject transientvo = getViewObj1();
    transientvo.clearCache();
    transientvo.insertRow(transientvo.createRow());
    --- Entry Form .jspx pagedef.xml snippet ---
    <executables>
    <iterator id="MyIterator" RangeSize="10" Binds="MyView"
    DataControl="AMDataControl"/>
    </executables>
    <bindings>
    <attributeValues id="sponsorid" IterBinding="MyIterator">
    <AttrNames>
    <Item Value="sponsorid"/>
    </AttrNames>
    </attributeValues>
    --- Entry Form .jspx page snippet ---
    <h:form>
    <af:panelForm>
    <af:panelLabelAndMessage label="#{bindings.sponsorid.label}">
    <af:panelGroup layout="horizontal">
    <af:inputText value="#{bindings.sponsorid.inputValue}"/>
    // state will not be saved for other form field values if use immediate="true" when temporarily navigate away from page and return; don't want to validate other form fields here
    <af:commandButton text="Lookup Details"
    action="lookup-page" immediate="true"/>
    </af:panelGroup>
    </af:panelLabelAndMessage>....
    // state will be saved with immediate="false" when user submit forms at end of entry (need to perform validation of form's required fields here)
    <af:commandButton text="Continue to Next Step" immediate="false"
    action="nextpage"/>
    Message was edited by:
    javaX

  • Getting the value of iframe to next page while submitting the form

    hi,
    I have used iframe to change the text as bold or italic . This is changing the text as bold or italic.
    iframe has properties name & id, by using i have tried to get the value while submitting the form , I couldn't get the value.
    can u please help me how to read the iframe content.
    the html code is
    *<div><iframe id="xxx" name="xxxx"></frame></div>*

    Hi Anjan,
    I am using this workflow for an employee to send leave request. I have created an event in a program using SAP_WAPI_CREATE_EVENT to create an event zabsence_form. This event is used to trigger the workflow. I have created a table for leave details. The container used in the form is of that table type.
    The agent for ZFILL_ABS_FORM (for filling leave application)  is the workflow initiator and ZABS_APPROVE is a user who is his manager.
    Now the scenario is that I need to do some screen changes for those two users. For that, I need to get the workflow initiator value in the PBO of the form screen. Any way to do that?

  • Is there a way that you can have two different text fields (email, phone) that one at least one of them must be completed before submitting the form? Can it be done using javascript in the validation tab? if so, how?

    Is there a way that you can have two different text fields (email, phone) that one at least one of them must be completed before submitting the form? Can it be done using javascript in the validation tab? if so, how?

    Here is one solution:
    // mouse up action for submit button;
    function GetField(cName) {
    // get field object for cName field with error checking;
    var oField = this.getField(cName);
    if(oField == null) app.alert("Error accessing field named " + cName + "\nPleae verigy field name, spelling and capitalizeation.", 1, 0);
    return oField;
    } // end GetField function;
    var oPhone = GetField("phone");
    oPhone.required = oPhone.value == oPhone.defaultValue;
    var oEmail = GetField("email");
    oEmail.required = oEmail.value == oEmail.defaultValue;
    if(oPhone.required && oEmail.required) {
    app.alert("Missing required fields.", 1, 0);
    } else {
    app.alert("Submitting form", 3, 0);
    // additional code for submission;

  • How does APEX check for null values in Text Fields on the forms?

    Hello all,
    How does APEX check for null values in Text Fields on the forms? This might sound trivial but I have a problem with a PL/SQL Validation that I have written.
    I have one select list (P108_CLUSTER_ID) and one Text field (P108_PRIVATE_IP). I made P108_CLUSTER_ID to return null value when nothing is selected and assumed P108_PRIVATE_IP to return null value too when nothign is entered in the text field.
    All that I need is to validate if P108_PRIVATE_IP is entered when a P108_CLUSTER_ID is selected. i.e it is mandatory to enter Private IP when a cluster is seelcted and following is my Pl/SQL code
    Declare
    v_valid boolean;
    Begin
    IF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := FALSE;
    ELSIF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := FALSE;
    END IF;
    return v_valid;
    END;
    My problem is it is returning FALSE for all the cases.It works fine in SQL Command though..When I tried to Debug and use Firebug, I found that Text fields are not stored a null by default but as empty strings "" . Now I tried modifying my PL/SQL to check Private_IP against an empty string. But doesn't help. Can someone please tell me how I need to proceed.
    Thanks

    See SQL report for LIKE SEARCH I have just explained how Select list return value works..
    Cheers,
    Hari

  • How can I add check boxes without using the form widget?

    I would like to use check boxes for our facets for our search engine.  You can see an example below.  Is there anyway to do this without using the form widget?
    PJM - Site Updates

    It is not possible to accomplish this with the Muse's Form Widgets. You may need to look for other online solutions and fetch the source code and add to the Muse page using the Insert HTML feature.
    Cheers,
    Vikas

  • Hi.  I purchased Adobe Acrobat Xi Pro from a store (card).  I submitted the number (under the scratch area on the card) on the adobe website, with my personal details etc.  When I submitted the form, I got an error message:  413 header length too large (a

    Hi.  I purchased Adobe Acrobat Xi Pro from a store (card).  I submitted the number (under the scratch area on the card) on the adobe website, with my personal details etc.  When I submitted the form, I got an error message:  413 header length too large (and on top the page reads JRun Servelet Error).  What does this mean? What should I do next?

    Hi.  I purchased Adobe Acrobat Xi Pro from a store (card).  I submitted the number (under the scratch area on the card) on the adobe website, with my personal details etc.  When I submitted the form, I got an error message:  413 header length too large (and on top the page reads JRun Servelet Error).  What does this mean? What should I do next?

  • Error"There was an internal error when submitting the form" URM Disposition

    Hello
    I get the following error - "*There was an internal error when submitting the form*" - when i allocate a Retention Disposition to a Retention Category.
    Any Ideas how this can be solved?
    Thank you

    Not based on the minimal information provided.
    Error messages in 11g, from a UI standpoint, are severely deficient. How about looking in the content server logs and posting some more information?

  • How can I create a long employment form without making the form widget drag?

    How can I create a long employment form without making the form widget drag?

    Sorry Sachin, I mean that I created a simple form on the page from the widget and started adding fields to it. The more fields I add the slower the delay becomes in creating a new field. Even when I try to select and drag or move an item, there's a huge delay and sometimes the program feezes,  loose what i've done and have ot restart.
    I'm doing an enployment form that has more than 20 fields, at least, and I need to be able to build the fields in separate categories, like Education, Past Employment, etc... quickly without delay issues.
    I can probably send you a snap shot of what I'm talking about if I cna post it or attach it here..?
    ~Andy

  • Dunning Level needs to update without printing the Form

    HI,
    we have 4 level dunning, we have a requirement that when the customer reaches Level 4 dunning, The process is off the system - Meaning no Correspondance from SAP to be issued.
    Is it possible for standard SAP dunning to update the Customer Master to Level 4 without printing the form?
    We remvoved  the Dunning form associated to level 4 but when the dunning program  reaches level 4, its not updating the Customer master data with Dunning Level4. The last update on the customer master is level 3.
    Is printing dunning letter is a mandatory for the Dunning program to update the customer master data with the Dunning level?
    Has anyone got a workaround or solution for this situation.
    Thanks
    Kema

    Hi Kema,
    How you doing? Hope all good.
    Well the Customer Master update is done by the form printing program so printing form will be needed to update the customer master. The work around would be to have dummy blank form. If you are doing a fax or email then you can control the sending from user exit.
    Hope this helps.
    Francis Yesudas

  • My iPhone 4S locked to Tmobile so I contacted to Tmobile and submitted unlocking form, but I got a replied said my IMEI number was not recognized. So I tried second and third time submitted the form and got same reply.

    My iPhone 4S locked to Tmobile so I contacted to Tmobile and submitted unlocking form, but I got a replied said my IMEI number was not recognized. So I tried second and third time submitted the form and got same reply.  I've been using same handset they issued to and never changed. But I have know idea why they said they don't recognised my IMEI number. Can anyone help me to solve this issue. Thanks

    You need to call T-Mobile or visit a T-Mobile retail store.

  • How to get the database value without submitting the jsp page

    Hi,
    I have a form that has many fields (textbox/listbox). when user enter/change a value in the first textbox, I need to pass this value to the database to check whether it exist and get the other values to be displayed to other fields in that form (i cannot get the javascript value to be pass to jsp without reload/refresh/submit. But, I need to get the user entered value, so I thought of hidden popup, iframe, etc but not sure how I could apply and which best suit this case). If I submit the page then I can easily get the value thru 'request.getParameter("fieldname") but cannot use this because I cannot submit the page.
    Pls help and possible provide me with the sample coding
    Thanks

    The best way for you is surely AJAX. But there is another way to stay compatible with older browsers:
    Since the default method a browser supposed to get data is refresh, there is nothing unnatural in it. Browsers are optimized to refreshes, like cached images, etc..
    So for these step-by-step things, you need to roll forward your data from page to page, and make the page to respond according the data it actually have. This can be easily achived with type="hidden" input fields in a form: the user will send you back all the data. Optionally you may show him the data you already have as visible text too.
    A more generalised way to "pull" the data: you make a whole page you include every time you need an additional data. This page will receive 2 parameters from where you've included it. This 2 parameters are each indexed arrays with the datas you have to pull in (here the default value), and you need to push forward. Optionally there is a 3rd parameter, the url it have to return (as the form's action property).
    And for them who now say that it would me more culture way to store this data in the session: Beware! Common mistake: Sessions are to store data about the user itself, not the datas for the next page! You never know what will be the next page! The user click some backward button and refresh button, and depending on your script, it may go stupid! Ok, not all the codes, but I've seen some. It's ok to store a sent file (fx. image) on the server, but always think the evil refresh and back buttons!

  • How can I change a hex value to normal without changing the characters

    How can I change "3932" (hex displayed string) to "39 32" (normal displayed string with space)
    Solved!
    Go to Solution.
    Attachments:
    Hex to Normal without changing value.vi ‏5 KB

    I think your VI works and if I understand what your input data looks like and the output that you want is, does it?I really can't see a better way. Does it not work for what you want? What form is the actual data in as you receive it? (not how it is displayed by the display setting of the string control) You have the string control set the “Hex display” and that may be confusing some of us as to what the actual input data is.
    And what you want your output to look like. Do you get a “stream” of bytes that are the actual numbers in the form of a string?or Do you get a “string” of ASCII char that represent numbers?
    These are two different things, but may look alike depending on the display setting of your controls are set.
     Changing the display mode of a control or indicator does not change the under lying data. It only changes the way your eye “see” it, not how LabVIEW “sees” it.  We need to know what your raw input string looks like.
    tbob's snipit assume your data is one way and your VI assumes another.
    Omar
    Omar

Maybe you are looking for

  • Why is text on Google lists smaller than it is in my Internet Explorer browser?

    I have already solved this problem myself, but don't know how to get rid of my question! In Settings, I opted under Options for a certain size of type, and that solved my problem, and I learned that Control and two plus characters will increase the s

  • Separator Field in ALV

    Hi everybody. Is there any way to add a separator field whithin an ALV??? Is there any pre-built field or property for this requirement?? Thanks in advance.

  • External Hard Drive for Mac AND PC

    I need to purchase an external Hard Drive to be able to back up both my iMac and my partner's PC. I am currently looking at buying either: Iomega UltraMax Hard Drive 500GB FireWire 400/USB 2.0 OR Iomega 500GB Minimax Hard Drive with Dual Interface +

  • Very much regret upgrading to Infinity!

    We were plagued by calls from the company BT use to sell Infinity for over a year, often receiving 2 calls per week! We were quite happy with standard broadband which was fast enough for our BB needs and didn't want to incur any additional monthly co

  • Passing IDOC to BAPI

    Is there any way of passing an IDOC contents to a BAPI directly, rather than reading the data from the IDOC segments and populating the BAPI structures manually? The IDOC is generated from a Purchase Order created in the same client and so cannot be