How to get-set Hidden field value from JSP ?

Hii,
I am quite newbie about jsp and looking for some help..
I have several url links on my jsp page.
I when I click one of them, I want to reload my page with new request parameter(s) but also keep the older one(s) in hidden field(s)...
but I dont know how to set and get hidden field value "syntax" and I am not sure about where/when should I do this... at first I though that I can do it in "onClick" property of url..
Thanks..

Hy,
I have a problem just like that. I am trying to send the value of an subdomain is to another page to be able to modify an entry.
So in listsubdomains.jsp I have
<input type = "hidden" name = "subdomainid" value="<%=subdomains.SubdomainID%>"><%=subdomains[i].SubdomainID%>.
This shouls send the id of the subdomain.
I an sending this to modifysubdomain.jsp with <form name = "listsubdomains" method = "post" action = "modifysubdomain.jsp">
and there I retrieve the value like this:
Integer id = new Integer (request.getParameter("subdomainid"));
          out.println(request.getParameter("subdomainid"));
My problem is that no matter what is the value I chose to modify it always sends the first value. If I another value manually it works, but just then.
Please give me some ideas.

Similar Messages

  • How to get readonly text field value in backing bean?

    Below is my code in JSF.
    <h:inputText id="prodLine" value="#{fbackingBean.value}" required="true" styleClass="readOnlyField" readonly="true"/>
    This is a readonly field, and the value will been pass in by a pop up window. after the value had been passed in, i try to store the data which i had selected, but the value in readonly field (which show in above) return a null value.
    May i noe how can i get the readonly field value in backing bean? thanks!

    Why not keep track of the value in the backing bean? If it's a read only value set from a backing bean it should be simple to retrieve from a backing bean.
    I'm new to JSF, but one thing that I have figured out is to try to put everything in the backing beans possible and to do as little as possible within the JFS web page components.

  • How to set hidden field value in form?

    I've encountered a problem while developing a forum using JSF. See this code:
    <h:form id="commmentForm" formName="commentForm" >
         <h:input_hidden id="pageId" valueRef="CommentBean.pageId" value="${article.id}"/>
         <h:input_text id="userName" valueRef="CommentBean.userName"/>
         <h:input_text id="userEmail" valueRef="CommentBean.userEmail"/>
         <h:input_text id="userURL" valueRef="CommentBean.userURL"/>
         <h:input_textarea id="content" valueRef="CommentBean.content"/>
         <h:command_button id="submit" label="Leave A Comment" commandName="submit" actionRef="CommentBean.createAction" />
    </h:form>
    I was trying to specify a hidden field that represents the unique ID number of the current article using <h:input_hidden> tag above. But RI complains that runtime expression is not permitted in 'value' attribute. So I set the attribute 'value' to arbitrary number such as '2', but it seems that CommentBean.pageId is still null.
    So the question is:
    1. Why can't I use EL in JSF tags attributes?
    2. How can I resolve my problem mentioned above?
    Thanks very much in advance!

    To solve the problem, you have to use two hiddenfields, say:
    <h:input_hidden id="pageId"valueRef="CommentBean.pageId" />
    <h:input_hidden id="articleId" valueRef="article.id"/>
    I want to set the value of CommentBean.pageId to
    ${article.id} (article is not a managed bean) and to
    let CommentBean.createAction insert a database row
    whose page_id column is ${article.id}, so I think the
    tags you suggested won't work for me.Why can't you interrogate your ComponentBean for its pageId property during your invoke() method? By the time your invoke() method is called, the value from the hidden field will have been pushed to the model, so this should be no problem. You could do Application.getValueBinding("ComponentBean.pageId").getValue() to do so.
    Ed

  • Can't set a hidden field value from onClick event with a runtime expression

    Hi,
    I need to set a hidden field in an onClick event of button but it's not working.
    <html:submit styleClass="btnLink" onclick="document.empForm.hidden.value='<%= empID%>'">
    <%= empID%>
    </html:submit>
    Althought the second expression is evaluated and written successfully "the button value"
    I heard that this is because you can't mix the value of an attribute of a custom tag with both string literal and run time expressions.
    Is there any work around to solve that?
    I can't use EL as I'm using old JSP version

    I guess, it should work; instead of html:submit, try with button.

  • How  to retrieve a column field value from an ADF table ?

    All,
    I have a backing bean where I have bounded a field of an ADF table.
    I would like, in the bean, to read the value of that field so that I can use it inside a task flow router.
    The question: how to read a value from a ADF table column field ?
    In the bean I have the getter and setter of the RichInputText ADF table field. But when I type:
    System.out.println("the name is: " + this.getName().getValue());
    or
    System.out.println("the name is: " + this.Name().getValue());
    I get a null pointer exception.
    Thanks in advance,
    Sergio.

    Thanks Marvin, but this is not really what I'm looking for. Or at least, it does not sounds like to be :)
    I need to get the value contained in a row cell of an ADF table.
    Let's say the table (two rows, three cells) contains these values:
    "table_A", "123", "John"
    "table_B", "456", "Peter"
    When I click on the first row, I need the value: "table_A". Once I got that value, I extract the last char, in this case: "A", and then I call a specific task flow from a task flow router (specified in the task flow router Cases property).
    When I click on the second row, the same process applies, only the router now points to another flow view.
    So to summarize, I need to get the value of a row cell in an ADF table. How to do that from within a javaBean in JDeveloper 11g Release 2 ?
    This is what I have in the bean; so far I've bounded the related row cell (herkunft) to the bean. Each time I select a row on the ADF table, the function setHerkunft() runs - I see that from within the JDeveloper console - but when I try to get its value, I get a null value - hence the surrounding if statement.
    package bean;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ValueChangeEvent;
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    +public class taskFlowBean {+
    public RichInputText herkunft;
    public static String taskFlowView = "C";
    +public taskFlowBean() {+
    System.out.println("taskFlowBean constructor call");
    +}+
    +public void setHerkunft(RichInputText herkunft) {+
    System.out.println("set herkunft");
    this.herkunft = herkunft;
    if (this.getHerkunft().getValue() != null )
    System.out.println("herkunft is: " + this.getHerkunft().getValue());
    +//here taskFlowView will set accordingly with the herkunft value.+
    +}+
    +public RichInputText getHerkunft() {+
    System.out.println("get herkunft");
    return herkunft;
    +}+
    +public String getTaskFlowView() {+
    System.out.println("get taskFlowView ! : " this.taskFlowView);+
    return this.taskFlowView;
    +}+
    +}+
    Regards,
    Sergio.

  • How do I pass a field value from one form to another?

    Hi,
    Please help me.
    First application.
    I have login form.
    One field P48_USERNAME, no password required.
    Enter the User name and press Login button.
    The Login redirects to page 4.
    On Page 4, I need to populate a hidden field called user with the value from P48_USERNAME.
    How can I do this?
    Apex version - Application Express 4.0.2.00.07
    Zac

    Hi Ola,
    What do you have to in the taget page the branches alone does not work.
    No password is required, no password is entnered, no field available to enter a password.
    Any any ideas?
    Zac

  • How to get sales org. field value in CUSTOMER_ADD_DATA~SAVE_DATA  ?

    Dear Guru ,
    The requirment is we send some information to external email system when user save the customer master data ( XD01 , XD02 ) .
    I try to use badi CUSTOMER_ADD_DATA~SAVE to satisfy this requirment , but i can't get the Sales Org value ( KNVV-VKORG ) in this badi in XD02 ...
    Has someone guide me how to do that ?
    Below abap code can get the Sales Org value in tcode XD01 , but not in tcode XD02 .
            DATA :  lv_knvv type char30 value '(SAPMF02D)KNVV'  .
            DATA : l_vkorg type vkorg .
      FIELD-SYMBOLS : <fs_xknvv> type knvv .
      ASSIGN : (lv_knvv) TO <fs_xknvv> .
    * Now i have the Sales Org in XD01 !
          l_vkorg = <fs_xknvv>-vkorg .
    Thanks .
    Best Regards,
    Carlos

      DATA :
             lv_knb1 type char30 value '(SAPMF02D)KNB1' ,
             lv_knvv type char30 value '(SAPMF02D)KNVV' ,
             lv_kna1 type char30 value '(SAPMF02D)KNA1' .
      FIELD-SYMBOLS : <fs_xknb1> type knb1 .
      FIELD-SYMBOLS : <fs_xknvv> type knvv .
      FIELD-SYMBOLS : <fs_xkna1> type kna1 .
      ASSIGN : (lv_kna1) TO <fs_xkna1> .
      ASSIGN : (lv_knb1) TO <fs_xknb1> .
      ASSIGN : (lv_knvv) TO <fs_xknvv> .
    Edited by: Carlos Zhang on Dec 17, 2010 3:25 PM

  • How to get a specific tag value from SAX parser

    I am using the SAX method to parse my xml file.
    My Question is how to get the returning characters parsed after calling?
    esp the value of <body> tag?
    Here is my xml file, and i want to get the parsed <body> value after call sax parser.
    <?xml version="1.0" encoding="UTF-8"?>
    <article>
    <content>
    <title>floraaaaa</title>
    <date>2004-03-19</date>
    <body>
    Details of an article, and i want to get the article details
    </body>
    </content>
    </article>

    here is the parser code I am using:
    import java.io.*;
    import org.apache.xerces.parsers.SAXParser;
    import org.xml.sax.Attributes;
    import org.xml.sax.ContentHandler;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.Locator;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.XMLReader;
    import org.xml.sax.helpers.XMLReaderFactory;
    public class test2 {
         public String m_xmlDetail;
         public void readDetail(String url) {
              System.out.println("Parsing XML File: " + url + "\n\n");
              try {
                   XMLReader parser = new SAXParser();
                   ContentHandler contentHandler = new MyContentHandler();
                   parser.setContentHandler(contentHandler);
                   parser.parse(url);
              } //try ends here
              catch (IOException e) {
                   System.out.println("Error reading URI: " + e.getMessage());
              } //catch ends here
              catch (SAXException e) {
                   System.out.println("Error in parsing: " + e.getMessage());
              } //catch ends here
         } //function
    }//close class
    public class MyContentHandler implements ContentHandler {
         private Locator locator;
         //public String m_bodyDetail=new String();
         public void setDocumentLocator(Locator locator) {
              System.out.println(" * setDocumentLocator() called");
              this.locator = locator;
         public void startDocument() throws SAXException {
              System.out.println("Parsing begins...");
         public void endDocument() throws SAXException {
              System.out.println("...Parsing ends.");
         public void processingInstruction(String target, String data)throws SAXException {
              System.out.println("PI: Target:" + target + " and Data:" + data);
         public void startPrefixMapping(String prefix, String uri) {
              System.out.println("Mapping starts for prefix " + prefix + " mapped to URI " + uri);
         public void endPrefixMapping(String prefix) {
              System.out.println("Mapping ends for prefix " + prefix);
         public void startElement(String namespaceURI, String localName,String rawName, Attributes atts)throws SAXException {
              System.out.print("startElement: " + localName);
              if (!namespaceURI.equals("")) {
                   System.out.println(" in namespace " + namespaceURI + " (" + rawName + ")");
              else {
                   System.out.println(" has no associated namespace");
              for (int i=0; i<atts.getLength(); i++)
                   System.out.println(" Attribute: " + atts.getLocalName(i) +"=" + atts.getValue(i));
         public void endElement(String namespaceURI, String localName, String rawName) throws SAXException {
              System.out.println("endElement: " + localName + "\n");
         public void characters(char[] ch, int start, int end) throws SAXException {
              String s = new String(ch, start, end);
              System.out.println("characters: " + s);
         public void ignorableWhitespace(char[] ch, int start, int end)throws SAXException {
              String s = new String(ch, start, end);
              System.out.println("ignorableWhitespace: [" + s + "]");
         public void skippedEntity(String name) throws SAXException {
              System.out.println("Skipping entity " + name);
    } //close class

  • Access HTML hidden field value in JSP

    Hi,
    I have a JSP and need to access the hidden fields on that HTML page,
    i.e. in HTML i have a hidden tag
    <form name="login">
    <input type="hidden" name="language" value="en">
    </form>
    in my jsp i want to read the value of hidden field language
    how can i do it???

    You read it as any other field :
    String lng=request.getParameter("language");
    The string lng will contain the value "en"
    regards

  • How to get the following field values?

    I have an invoice number. How can I find out (from which tables and fields) the ship date, vessel, port of loading, port of discharge. I think it is VTTK table and fields are datbg, text1, add01 and add02, but if so what should I give in VTTK table to get these values?
    Please give your input.
    I appreciate and points assured for helpful answers.
    Krishen

    Hi Krishen,
    For ship date you can find the data in LIKP table itself. All other details like vessel, port of laoding and port of discharge will be found at the shipping point level.
    Select the delivery number in VL03n and from the menu GOTOITEMSHIPMENT you will find the shipping point details.
    Cheers
    VJ

  • How to get all the column values from a table source

    Hi,
    I have created one table source on a employee table and some customized attributes using global settings>search attributes.
    Now these customized attributes mapped with the table columns through attribute mapping from the sorce tab.
    Using doOracleSearch method i passed last parameter i.e. Integer array of customized attributes.
    After execution of doOracleSearch method i am getting the results but customized attributes are not coming.
    getCustomAttributes method returns null instead of some values.
    Please refer following code for more info:
    Integer[] fetchAttr=new Integer[2];
    fetchAttr[0]=new Integer(137);
    fetchAttr[1]=new Integer(138);
    result =
    stub.doOracleSearch("BTM",
    new Integer(1),
    new Integer(10),
    Boolean.TRUE,
    Boolean.TRUE,
    group,
    "en",
    "en",
    Boolean.TRUE,
    null,
    null,
    fetchAttr);
    ResultElement[] resElements = result.getResultElements();
    for(int i = 0; i < resElements.length; i++)
    System.out.println("Title : " + resElements[0].getTitle());
    System.out.println("Snippet : " + resElements[0].getSnippet());
    System.out.println("URL : " + resElements[0].getUrl());
    System.out.println("non default : " + resElements[0].getCustomAttributes()); // it returns null here
    }

    Confirm the attributes you are asking SES for match those on the data source being searched. One thing to try is to simply tell SES to return all custom attributes for your search. Here is a snippet to build a list of all attribute IDs and pass them to your search...
    // Create and set SOAP URL
    OracleSearchService searchService = new OracleSearchService();
    searchService.setSoapURL("http://myserver:7777/search/query/OracleSearch");
    // Set attributes to fetch (all)
    Attribute[] attributesAll = searchService.getAllAttributes("en");
    ArrayList<Integer> attributeIds = new ArrayList<Integer>();
    for(Attribute a: attributesAll)
    attributeIds.add(a.getId());
    Integer attributeIdArrayAll[] = new Integer[attributeIds.size()];
    attributeIdArrayAll = attributeIds.toArray(attributeIdArrayAll);      
    // Query
    OracleSearchResult result = searchService.doOracleSearch("some text", ..........[other params], attributeIdArrayAll);
    // Print out results
    ResultElement[] resElements = result.getResultElements();
    for(int i = 0; i < resElements.length; i++)
    // Get document
    ResultElement doc = resElements;
    // Print Title
    System.out.println("Title: " + doc.getTitle());
    // Print custom attributes
    CustomAttribute[] attributes = doc.getCustomAttributes();
    for(int j = 0; j < attributes.length; j++)
    CustomAttribute attr = attributes[j];
         System.out.println("[Custom Attribute] " + attr.getName() + ": " + attr.getValue());
    Hope this helps.

  • How to get the short text values from F4 SEARCH HELP

    Hi Friends,
       My requirement is in  Module -pool Screen Programming,  i have Designed one field in a custom screen and  provided a F4 search help to that field..
    For eg the F4 help is displayed as below.
    Value                   short text
      1                    A          
      2                              B
      3                       C
      4                              D
      5                       E
      6                       F
      7                          G
    When i select the first option (1) then value 1 appears in the field.
    now i want the text relevant to the value 1 to appear by the side of the field.
    Eg :            1                  A      (A should appear by the side of the value 1)
    How do i achieve it?
    Kindly help me.
    Regards,
    K.S.Kannan.
    Edited by: kannan ks on Dec 8, 2008 4:05 PM

    hi
    1) place a field adjacent to your value field on which F4 is operated
    so now you will have 2 fields.
    iam considering it as for ex: field1 & field2
    2)
    BOLD one is import in FM call
    CLEAR: t_dynpfld_mapping,
    e_dynpfld_mapping.
    e_dynpfld_mapping-fldname = 'F0001'.           
    e_dynpfld_mapping-dyfldname =      -
    > name of field1  (for ex: your 1 value field name)
    APPEND e_dynpfld_mapping TO t_dynpfld_mapping.
    e_dynpfld_mapping-fldname = 'F0002'.
    e_dynpfld_mapping-dyfldname =   -
    > name of field2  (for ex: your short text field name)
    APPEND e_dynpfld_mapping TO t_dynpfld_mapping.
    3))))))))
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield =    
    dynpprog = sy-repid
    dynpnr = sy-dynnr
    dynprofield = -
    > name of field1  (for ex: your 1 value field name)
    value_org = 'S'
    TABLES
    value_tab = itab
    dynpfld_mapping = t_dynpfld_mapping
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3

  • How to Get and Update properties values from XML tag Using Xquery or PL Sql

    Hi
    I have this tag
    <Solicitud Pais = "1">
    How i can get Pais value?
    How i can update Pais Value?
    Y can use Xquery funtions or PL SQL for this?
    Thak's
    Angel

    How i can get Pais value? ExtractValue
    How i can update Pais Value?UpdateXML
    Y can use Xquery funtions or PL SQL for this?Yes
    Without knowing more about your requirements, where information resides, or even a version of Oracle, that is the best I'll do.

  • How to get xkomv-kwert (condition value) from a pricing condition ZZP1

    Hi experts,
       I have a pricing condition zcust that I need to modify in the sales order.   The calculation of ZCUST is dependent on the condition value in another price condition ZZP1.   The price for ZZP1 is a fixed amount of $6 which is split among line items in the order.    In sapmv45A, when the code hits userexit_save_document_prepare, the value of xkomv-kwert (condition value) exist.   In other user-exits in sapm45A, I was unable to find xkomv-kwert.  My question is:  How can I find the value of xkomv-kwert  as i don't  know how ZZP1 is calculated ??  There is no routine attached to ZZP1.
        THE ZCUST has a routine 993 which is similar to 3.   Here in program saplv61A, i was trying to get xkomv-kwert for ZZP1 but unable to get any data.   Can anyone suggest where i can get the data (xkomv-kwert) for ZZP1 in saplv61a ?
    I looked at userexit_xkomv_bewerten_end in saplv61a but it does not help.
    XKomv-kbetr  always has data.    If i have ZZP1 data, then i can modify ZCUST.
    Many thanks.
    Joyce

    Hi Jelena,
      In VOFM, it is Formula/Condition Base Value for routine 993.   In Pricing Procedure, it falls in column "Base Type" for 993.
    Let's see if i can simplify this: In a sales order with 2 line items:
                   prices                    Amt                      Condition Value (USD)
    Line 10     ZS1   sell price     2.30                                 1150
                     ZPP1 charge        6.36                                 3.40  (note the distribution **)
                     ZL1                      3                                      3
                    ZR1 %                  1.000%                            11.50
                    ZR2                      0.01                                   5
                    Suggested price =  2.35                             1172.90
                      ZCUST               2.34                                1170
                      total price            2.34                               1170  
    Note:  The ZCUST price is wrong.  It is missing the ZPP1 charge which is 3.40.  Zcust should be 1170 + 3.40 = 1173.40
    Line 20     ZS1   sell price     25                                 1000
                     ZPP1 charge        6.36                                 2.96  (note the distribution **)
                     ZL1                      3                                      3
                    ZR1 %                  1.000%                            10
                    ZR2                      0.01                                   0.6
                    Suggested price =  25.41                              1016.56
                      ZCUST                   25.34                           1013.60 (should be 1013.60 + 2.96)
                   Total price                25.34                            1013.60
    You can see the ZCUST is calculated incorrectly.  The routine calculate zcust as $1170 and $1013.60 for each item which did not include the distribution amount of  ZPP1 ($3.40 and $2.96).  
    When i debug the routine, the xkomv-kwert is zero.   I  am trying to get $3.40 and $2.96 so i can add to to zcust in the routine.
    Am trying to determine in saplv61A at which include that i can see #3.40 and $2.96 for both line items in xkomv-kwert.
    Then maybe i can modify the routine or saplv61A so it shows the correct zcust price  after entering the 2 line items in the sales order  create (VA01) ?     Can you pls suggest  ?
    If i make the changes in USEREXIT_SAVE_DOCUMENT_PREPARE, then user cannot see the correct zcust until the order is saved.  This would be too late to know the zcust price ahead of time.
    Pls view in the Edit mode... i see my texts have been compressed.
    Many thanks
    Joyce
    Edited by: Joyce Chan on Jul 9, 2009 10:24 PM
    Edited by: Joyce Chan on Jul 9, 2009 10:25 PM

  • Help:How to get a java String value from a C char array?

    Hi,everyone,could you help me?
    the following is a C struct that i want to recieve a short message:
    struct MO_msg{
    unsigned long long msgID;          //Message ID
    char      dest_id[21]; //Destination Mobile Phone Number
    char      service_id[10];     //
    Now I want to put the "dest_id " value of this struct into a Java String variable.But I dont know how to implement it!
    The following is a block of source code that i implement this functions.But it cant get a String value ,and throw out a Exception:
    java.lang.NullPointerException
    at java.lang.StringBuffer.append(StringBuffer.java:389)
    JNIEXPORT jint JNICALL Java_md_EMAP_thread_RubeMOTSSX_getMO
    (JNIEnv * env, jobject obj, jint connId, jobject mo){
         struct MO_msg MO;
         tssx_cmpp_api_debug_flag = 1;
         int result = CMPP_Get_MO((int)connId,&MO);
         if (result == 0){
              jclass cls = (*env)->GetObjectClass(env,mo);
              jfieldID msgId = (*env)->GetFieldID(env,cls,"msgId","J");
              jfieldID dest_Id = (*env)->GetFieldID(env,cls,"dest_Id","Ljava/lang/String;");
              jfieldID serviceId = (*env)->GetFieldID(env,cls,"serviceId","Ljava/lang/String;");          
              (*env)->SetLongField(env,mo,msgId,MO.msgID);               
              (*env)->SetCharField(env,mo,dest_Id,*destId);
              (*env)->SetCharField(env,mo,serviceId,MO.service_id);
         return result;
    Please help me!Thanks!

    bschauwe:Thank you for your help!
    Yes,just as you say,using NewString Or NewStringUTF can import a C char array into a Java String variable! But now I have another question,when i use these two functions ,i found that it cant deal with Chinese character!
    do you have such experiences to deal with another language charset?if you have ,can you tell me how to deal with it.

Maybe you are looking for