Setting the value of a hidden field in a Visual Web jsf page

Hey All,
I am new to jsf and need some help with the following. I have written a method in the java portion of the jsf page that will get the selection(s) from a listbox and return them as a string. I need to assign the value of that string to a hidden field in the jsp portion of the page, so that I can pass the string as a parameter to a servlet. I have tried the following code in the "button_action", in the java portion of the jsf page, to assign the value of the string, returned from method, to the hidden field:
hiddenField.setValue(string);
This is not working. Any and all help on this matter is greatly appreciated.
Thanks in advance.

Here is the tag for the hidden field when the "hidden field" component is added from the pallette, I addded the "value" and "id". The name of the class is ReportStandard, which extends the AbstractPageBean.
<webuijsf:hiddenField binding="#{ReportStandard.utilSelHF}" id="utilSelHF" value="#{ReportStandard.utilParams}"/>This is how I am calling the hidden field in the servlet:
utils = request.getParameter("form1:utilSelHF_field");Here is the code for the button_action:
public String runReport_button_action() {
       this.utilParams = get_utilSelection();
       return "sRptrslts";
}

Similar Messages

  • Why my JSP page can't get the value of a hidden field

    Hi, I got an interesting question here.
    I use req.getParameter() method to get a hidden field in Servlet, it works just fine.
    However, when I use the JSP to catch the value of that hidden field, JSP just can't, but if I change the type from hidden to text, it works fine again.
    the code is as follows:
    there are two jsp pages:game.jsp and GameMonitor.jsp.
    In game page:
    ============================================================
    <FORM action=GameMonitor.jsp method=post
    webbot-action="--WEBBOT-SELF--">Display the names of all the players currently
    connected to the server       <INPUT tabIndex=1 type=submit value=Lookup name=B1>
    <INPUT TYPE=hidden,value=1 name=p1>
    <P></P></FORM>
    ===========================================================
    I want GameMonitor.jsp to catch the value of hidden field "p1" by calling request.getParameter()
    the code catching it in the GameMonitor.jsp is:
    ============================================================
    String option = request.getParameter("p1");
              out.println("option=["+option+"]");
              try{
                   if(option.equals("1")){
    ===========================================================
    supurisingly, the result is option=[], which means it didn't catch the value of the p1 submitted by POST method.
    Does anybody here can tell what's wrong in the code?

    Thank you so much, I also found this error, which makes JSP not able to catch the hidden field, however, if I change it to text type, even the comma exists, it still works. pretty interesting!
    >
    <INPUT TYPE=hidden,value=1 name=p1>Modify the above lline and write like this....
    <INPUT TYPE="hidden" name="p1" value="1">
    And ensure that you're submitting the form data.
    Though nothing much has been changed, just try whether
    these help!!!
    fun_one

  • I need to get the value of a text field that is located in another page JSP

    I need to get the value of a text field that is located in another page JSP. How do I do that?

    Well you see, I have a page at angelfire.com, which
    does not support JSP. I want to call a script located
    at mycgisever and then, when pressing a link on the
    former page, the JSP page is loaded, and the script
    get the value from the text field on the OTHER page.
    Is this possible?I know nothing about cgi. But that should not prevent me from understanding what can and cannot be done, assuming cgi is sort of comparable with jsps.
    I'm unable to understand your description clearly. Try to explain it better. Give precise steps that you intend to follow and I should be able to help you further.
    So you have a page1.
    You hit submit from page1.
    That goes to the cgiserver.
    From the cgiserver, programmatically load up the jsp.
    search this for the text field.
    Display it on your page2.
    Is that what you are trying to do?
    BTW, won't be able to help you with cgi scripting at all. Can help with Java and Jsp.

  • Using Auto Suggest To Set The Value Of Multipe Form Fields

    I would like to use the Spry 1.5 Preview Auto Suggest widget
    to provide the value for multiple form fields based on the row the
    user selects in the auto suggestion data set. I've placed an
    example of what I want to do here:
    http://www.brucephillips.name/spry/Spry_P1_5_Preview/autosuggest/autosuggestMultipleFields .cfm
    It appears that when the user clicks on one of the rows in
    the auto suggestion data set, the current row for the data set is
    not updated but remains the default (first row in the data set).
    Therefore, if you have a spry:detailregion that uses that data set,
    the values for that detail region are from the first row in the
    data set and not the row the user selected.
    Is it possible to set the current row of the auto suggest
    data set to the row the user clicked on in the auto suggestion data
    set so that the spry:detailregion will have the values from the row
    the user clicked on?
    I had previously modified the Spry 1.4 Auto Suggest widget to
    do this. See:
    http://www.brucephillips.name/blog/index.cfm/2006/11/6/Modifing-Sprys-Auto-Suggest-Widget- to-Bind-Users-Selection-to-A-Form
    Thank you for any assistance.

    Cristian: thank you for the reply. I understand your concern
    about the user changing the auto suggest field after updating the
    complimentary fields. I think that could be handled through user
    instruction. Additionally, instead of using form fields to hold the
    complimentary data I could use non-editable paragraphs.
    I hope the change is not too difficult. I think this
    modification would make the auto suggest widget even more useful.
    For example think about a product auto suggest. User starts to type
    in the name of the product, selects the full product name from the
    auto suggestions, and now the page can immediately show in a
    spry:detailregion all the product details.
    Thanks again for considering my request. I really appreciate
    all the work the Spry team is doing. I'm looking forward to the
    official release of Spry.

  • Adding a check box to my page clears the value in a hidden field on page 0

    Hello, I hope that someone can assist me. I have a page that has multiple submit buttons on it. When I click a submit button the page refreshes to render the new content. I have a hidden field, and its region is set to one on page 0. Without any check boxes on my page, I can set a value in the hidden field, and it remains there even if I click on any submit buttons. If I put a check box on the page and then press a submit button, the value is cleared in the hidden element which is not desired. I did notice that in this case with the check box, if I refresh the browser the hidden field value is not cleared. Perhaps the page is being rendered differently after the submit because of the checkbox. Does anyone have any ideas of what is happening?

    That doesn't sound right. Adding a checkbox shouldn't have that effect. Please try to reproduce this on htmldb.oracle.com so we can take a look or post a screenshot of your relevant page components.

  • How do I update the value of a hidden field?

    Jsp has hidden field. The value of the hidden field is set.
    <%= RequestCtx.getSessionInfoAsHiddenParam() %>
    <INPUT type ="HIDDEN" name=billtoContactPartyId" Value="<%=billtoContactPartyId %>">
    Based on some logic I've added to the jsp. I want to update the value of the hidden field. This does not work. How do I update the value?
    windowForm.elements['billtoContactPartyId'].value = windowForm.elements['defaultcontactPartyId'].value;

    Hi,
    If you create a function to return wwctx_api.get_user you could
    call this inside an update trigger, you could put in an
    exception to return USER if there is an error, this would then
    work for users connected directly and users using Portal.
    Regards Michael
    e.g.
    CREATE OR REPLACE FUNCTION F_PORTAL_USER RETURN VARCHAR2 IS
         vRet VARCHAR2(50) := wwctx_api.get_user;
    BEGIN
         RETURN(vRet);
    EXCEPTION
         WHEN OTHERS THEN
              RETURN (USER);
    END F_PORTAL_USER;

  • Using radio buttons to set the value of a text field

    I have a set of three radio buttons on a form (a performance evaluation). If I select the "1" button, I want 1 to populate in the text field. The same goes for "2" and "3"
    I have not been able to code the buttons correctly for this scenario, and can't figure out how to do it.
    From a previous post, I was able to get check boxes to do what I want, but they won't really work because I can't set them so that only one back may be selected.
    Can this be done?
    Thanks!

    The information for this specific case isn't anywhere. The best that you can do is understand what triggers each of the events, then ask yourself which of those triggers are pertinent to your current issue.
    http://help.adobe.com/en_US/livecycle/es/LiveCycle_Designer_Scripting_Basics.pdf ...
    The above link contains a great deal of information regarding how to use scripts within Livecycle Designer. The section that you would be most interested in in order to learn about the available events can be found under "Events >> List of Events".
    You needed to use the initialize event so that the text field would be updated when the document was opened. This ensure that the text field has the value of the default radio button when it is opened for the first time.
    You needed to use the change event so that, when the use selects a different radio button, the text field is updated with the new value.
    That's about it. That PDF file that I link to above is a bit long, but it's a great place to get a good grasp of the basics of scripts.
    If you have any further questions, feel free to ask. =) Have a good one.
    - Scott

  • Maintain the status of a Visual Web JSF page

    Hello,
    I have a JSF page in which I display several images.And when the user click on one image it will be viewed on her real size. So the user will be redirected to another page. Then, if he go back to the previous page will be displayed containing the associated images. But when he click on an image, the event of the click is not handled and the second page is not displayed.
    I think that it is due to the life cycle of the page.But I don't know How to do.
    How can I please maintain the state of the page listing the images in order to have the events still handled.
    Thanks in advance.

    Here is the tag for the hidden field when the "hidden field" component is added from the pallette, I addded the "value" and "id". The name of the class is ReportStandard, which extends the AbstractPageBean.
    <webuijsf:hiddenField binding="#{ReportStandard.utilSelHF}" id="utilSelHF" value="#{ReportStandard.utilParams}"/>This is how I am calling the hidden field in the servlet:
    utils = request.getParameter("form1:utilSelHF_field");Here is the code for the button_action:
    public String runReport_button_action() {
           this.utilParams = get_utilSelection();
           return "sRptrslts";
    }

  • Unable to set  size and scroll bar to table components in visual web jsf

    Hi Friends,
    Good day all of you,
    my requirement is to display multible tables in the same jsp page with same size.
    if some tables have more columns than other tables then that table need horizontal scroll bar...

    Hi BalusC,
    Good day,
    we didn't use any CSS sheets.is there any other way to set.

  • How to set a value on a hidden required input field.

    I have a form that I need to set a value that is stored within the session onto it. I would like the input field to be hidden when a new row is created and just set the value with a value that I have stored with sessionScope.
    Is this possible?
    Any help would be appreciated.

    Frank,
    I sure can access the session attribute. I just wasn't sure how to set it. Here is a snippet of my jsp
    <af:inputText value="#{bindings.Createdby.inputValue}"
    binding="#{backing_Project.inputText3}"
    id="inputText3">
    If I set the value="" attribute to be say value="#{sessionScope.userInfo.userId}" then how does ADF know to update the CreatedBy column? This is where I got confused. I figured the value="#{bindings.Createdby.inputValue}" had to stay that way in order for the column to be updated correctly.
    Basically what I am wanting is to programatically set the userId of the person who is creating the row into the CreatedBy column and then show the user's readonly name when a user edits an existing row.
    Any help would be greatly appeciated.
    Marty

  • How do I set the value of a dynamic row text field

    I have a repeated row form which contains a button and multiple text fields.  There is a text field (Input Data Field) further up with some information I want to place in the table and multiple buttons that I want to read the value of and set to the table.  I apologize there are multiple questions I have and I am using pseudocode to describe it.
    Top form looks like
    InputField
    | ButtonX1 | ButtonY1 | DescriptionX1 (read only Text Field)
    | ButtonXn | ButtonY1 | DescriptionXn
    OutputRow looks like
    | ButtonOutput | OutputField1 | OutputField2 | OutputField3 |
    So I would like it to do
    ButtonX1.click
    OutputTable.OutputRow.addInstance(true)  //this works - everything else I have questions on
    OutputTable.OutputRow.OutputField1.rawValue = DescriptionX1.rawValue
    Question 1
    How do I address the location in each table to set a value
    Question 2
    How do I get the value of the description field in the same table and row as the button
    I would like to say something to the effect of  OutputTable.OutputRow[??].OutputField1.rawValue = this.parent.DescriptionX
    OutputTable.OutputRow.OutputField2 = InputField.rawValue
      Same question as above - how do I specify a dynamic row - is this the proper syntax for getting the value from the input field?
    OutputTable.OutputRow.OutputField3 = this.ButtonLabel
    Question 3
      How can I get the value of the button's label to set in the field
      There should be very many of these buttons and buttons will be added - I would prefer to set the value based on the button's label to make the value easier - not requiring changing the code
    Question 4 - unrelated to those above.
    Is it possible to build the first table
    | ButtonX | ButtonY | Description |
    from an XML File.  I have seen examples of how to build if it is just data, but can the XML be pushed into a form with code to do the above actions?

    Each object in a form must have a unique name. I doing so it is not neccessarily the name but the path or SomExpression associated with that object that must be unique. In your case you have a Table.Row.object configuration. The Row is the part that is repeating so to give each object a unique name an instance number is placed on the repeating part. So objects in the 1st row woudl be Table.Row[0].object...objects in the second row woudl be Table.Row[1].object etc .....You can see this by adding a debug instruction on the Enter event of the description field. Put the code app.alert(this.somExpression) and when you enter the field you will see what the somExpression is. Do this for a few rows and you will see the pattern (don't forget to remove the debug code from the enter event). Now you know what you have to use to address the fields. If no instance is given it is assumed to be 0 ..that is why only the 1st row is being affected.
    So now to answer your questions:
    Question1: The square bracket notation is an issue for javascript (this is the notation for an array) so we have to use a different means of addressing the field to include the instance number. So to address the Description in the 3rd row we woudl use:
    xfa.resolveNode("Table.Row[2].Description").rawValue = "This is my new description";
    Note that the instance number is 2 for the 3rd row because the instance numbers are 0 based.
    Question2. The resolveNode notation allows you to pass a string so you can also concatinate expressions to make the string. If you are writing code on a button in the same row you can get the instance that you are on by using the expression this.parent.index. The "this" portion refers to the current object (the button) and the parent.index gets you th eindex of the Buttons parent. If the button is embedded deeper in a hierarchy then you can continue to add parent indicators until you get back to the node that you want. So rewriting your expression from Q1 it woudl be:
    xfa.resolveNode("Table.Row[" + this.parent.index + "].Description").rawValue = "This is my new description";
    Question3: The buttons caption can be retrieved by using ButtonName.caption.value.text.value
    Question4: When you say build from an XML file. What are you expecting to come from the XML file? The caption that goes on the button? Typically the XML file carries data (not to say that it cannot carry other things). Just need a bit of clarification on this one first.
    Hope that helps
    Paul

  • Setting the value of a field based on a dropdown list

    I am using the latest production release of JHeadstart 10.1.3.0.91. I am trying to set the value of a field based on selecting the value of another field (drop down list). The drop down list field has the following attributes set autoSubmit="true" immediate="true" valueChangeListener="#{jhsPageLifecycle.updateModelValue}".
    The other field has the partialtrigger set to the first field. ie "depends on" selection from JHeadStart file. The value of the second field is set in the setter of the VO RowImpl java file.
    The value of that field is only populated on the screen if it is set to disabled="true". This seems a bit bizzare behaviour. Can you explain why it cannot set the value of the field when it is not disabled.

    Worked out that if i set the "Clear/Refresh value" attribute on the field that i want updated then it will work ok
    Alan

  • Set the value of a non database field in forms

    hai friends ,
    Have been struggling a lot with the problem now . Could anyone suggest me how to go about it.
    I want to set the value of a field in a form . I know the function set_value and set_value_as_(data type ) does the work . But then is there any constraint on the position where it is called.
    My requirement is on querying a form the data from the tables mut be populated( which the portal handles) and I want to populate the non database bound fields with certain values.
    Could any one help me out with this ..
    null

    I need to set value to one of the object attributes if that attribute is blank.This is some kind of a default value that you want, then? If so then just take care of that when you output it. Use <c:if>, and if the attribute is blank then output the default value, otherwise output the attribute.
    Or have the servlet that created that request attribute take care of that requirement.

  • How to set the values to a field?

    I have created a page which is used to create the records by using "Add Another Row" button.
    If i click on "Add Another Row",a blank row will be created.
    The requirement is,after clicking the "Add Another Row" , a default value should be set to one of the fields of the blank row.
    Can anybody help me !!!!.
    Thanks,
    Srinivas

    In processFormRequest write the below code
    if("addRows".equals(eventName) && "<AdvancedTabldID>".equals(pageContext.getParameter("source"))){
    am.invokeMethod("populateValues");
    In AMImpl write the below code:
    public void populateValues(){
    XyzVOImpl vo = getXyzVO();
    XyzVORowImpl row = (XyzVORowImpl ) vo.first();
    while ( row != null )
    if( identify the new ly added row here using some unique id or someother condition etc..)
    row.setFieldxyzvalue("set the value here");
    row = (XyzVORowImpl ) vo.next();
    }

  • How to set the value to non enabled UDF fields

    Dear All,
    I created a UDF at titile level of PO and that UDF item always disabled (i.e oItem.Enabled=false). Now how can set a value through coding.
    I wrote like this:
    oForm = SBO_Application.Forms.GetFormByTypeAndCount(-142, 1);
                                oItem = oForm.Items.Item("U_Poap");
                                if (oItem.Enabled == false) { oItem.Enabled = true; }
                                oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
                                oEdit.Value = "1";
                                oItem.Enabled = false; 
    But system throws an error at : oItem.Enabled=true statement.
    How to solve issue.
    Thanks in advance
    Suresh Yerra

    Hi,
    You can set the values using datasource object
    oDBs_Head = objForm.DataSources.DBDataSources.Item("@TableName")
    oDBs_Head.SetValue("U_FieldName", 0, "Value")
    regards:
    SANDY
    Sandeep Saini | Roorkee | India on Dec 26, 2008 11:01 AM

Maybe you are looking for

  • Why can't i copy and paste a calendar event?

    Why does Apple not implement copy/paste of events in the iPhone and iPod calendar. People have asked for this very simple feature for years now, and Apple is unresponsive. Furthermore, I have been told by several calendar app developers that Apple wi

  • Can't drag and drop or import into files

    I moved my audio files from "c" drive to another drive and had a bear of a time getting itunes to recognize it...but after reinstalling finally it seems to be working okay... Except when I copy and paste my audio files into itunes nothing happens. Wh

  • Acro v8.1.2 &  Word 2002 with DM normal.dot grows each time I close Word

    Using Acro v8.1.2 and opening/exiting a Word 2002 document stored in DM (v5.1.0.56181) the normal.dot grows after (almost) every exit of Word. It doesn't grow if remove the PDFMaker for MS Office or if I open/exit a Word 2002 doc outside of DM. Is th

  • Problems in inserting in jtable

    hi, I am using a jtable in my application. values are set through a table model. i am using renderers and editors. Rows can be added to the table using an insert button which i have provided. It inserts a new row through TableModel.insertNewRow(); Th

  • Gaussian blur brush?

    Is it possible to select the brush tool and have it work as a gaussian blur brush? I'd like to be able to brush in the blur if possible to small areas rather than use the lasso tool method. THANKS