Problem passing hidden field

Hi,
I have created a hidden field on my jsp page and called the onsubmit method for the form hoping to pass this hidden field to my servlet. It keeps returning empty. Could someone look at my code and help me out? The on submit is calling a piece of javascript. Thanks!
JSP:
<form action="/partnerDB/servlet/editLangProfile" method="post" onSubmit="populateHidden(selectedOptions,hidden1)" style="margin:0">
<input type="hidden" name="partID" value="<%= pid %>">
<input type="hidden" name="hidden1">
<%
StringBuffer options = new StringBuffer();
ResultSet rs = statement.executeQuery("Select partid, language from partDB.profile_lang "
+ "where partid = '" + pid + "' ");
while (rs.next()) { 
options.append("<option value=\"" + rs.getString("language") + "\">" + rs.getString("language") + "</option>\n");
%>
<tr>
<td><select multiple size="10" id="availableOptions" name="availableOptions">
<%= langString %>
</select> </td>
<td valign="top">
<td class="tableimgcol" width="40" onClick="copySelected(availableOptions,selectedOptions)"><img src="/partnerDB/images/ArrowRightAdd.gif">
<br><onClick="copyAll(availableOptions,selectedOptions)"><img src="/partnerDB/images/ArrowDoubleRight.gif">
     <br>      
     <br>
<td class="tableimgcol" width="40" onClick="remSelected(selectedOptions,availableOptions)"><img src="/partnerDB/images/ArrowLeftRemove.gif">
<br><onClick="remAll(selectedOptions,availableOptions)"><img src="/partnerDB/images/ArrowDoubleLeft.gif">
</td>
<td><select id="selectedOptions" name="selectedOptions" multiple size="10">
<%=options.toString()%>
</select></td>
</tr>
<input type="submit" value=" OK " class="mmhide_btn" onmouseover="hov(this,'mmhide_btn mmhide_btnhov')" onmouseout="hov(this,'mmhide_btn')" />
<input type="button" value=" Cancel " class="mmhide_btn" onmouseover="hov(this,'mmhide_btn mmhide_btnhov')" onmouseout="hov(this,'mmhide_btn')" onclick="window.location.href='LangProfile.jsp?partID=<%= pid %>'" />
Servlet:
public class editLangProfile extends HttpServlet {
     public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
String PartID = request.getParameter("partID");
String next = null;
String[] Language = request.getParameterValues("hidden1");
if (PartID.length() != 0 ) {
                         try {
                    statement.executeUpdate("Delete * from partdb.profile_lang where partid = \"" + PartID + "\" ");
          for(int j=0; j<Language.length; j++)
                    statement.executeUpdate("Insert into partdb.profile_lang (language, partid) "
                         + " values(\"" + Language[j] + "\", \"" + PartID + "\") ");
                    next = "/partnerDB/partners/LangProfile.jsp?m=modified&partID=" + PartID;
     connection.close();
               catch (Exception e) {
               PrintWriter out = response.getWriter();
               out.println("<pre>");
               PrintWriter errorOut = new PrintWriter(out);
               e.printStackTrace(errorOut);
out.println("<br></pre>" + e);
     else {
                    next = "/partnerDB/partners/LangProfile.jsp";
response.sendRedirect(next);
     public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
               doPost(request, response);
}

Sorry about the code part, I will use the button next time. I tried out the alert and 2 messages pop up the first says that it is "calling onSubmit" the second shows my changes. Here is the javascript:
function deleteOption(object,index) {
    object.options[index] = null;
function addOption(object,text,value) {
    var defaultSelected = true;
    var selected = true;
    var optionName = new Option(text, value, defaultSelected, selected)
    object.options[object.length] = optionName;
function copySelected(fromObject,toObject) {
    for (var i=0, l=fromObject.options.length;i<l;i++) {
        if (fromObject.options.selected)
addOption(toObject,fromObject.options[i].text,fromObject.options[i].value);
function delOption(object,text,value) {
var defaultSelected = true;
var selected = true;
var optionName = new Option(text, value, defaultSelected, selected)
object.options[object.length] = optionName;
function remSelected(fromObject,toObject) {
for (var i=fromObject.options.length-1;i>-1;i--) {
if (fromObject.options[i].selected)
deleteOption(fromObject,i);
function copyAll(fromObject,toObject) {
for (var i=0, l=fromObject.options.length;i<l;i++) {
addOption(toObject,fromObject.options[i].text,fromObject.options[i].value);
function remAll(fromObject,toObject) {
for (var i=0, l=fromObject.options.length;i<l;i++) {
delOption(toObject,fromObject.options[i].text,fromObject.options[i].value);
for (var i=fromObject.options.length-1;i>-1;i--) {
deleteOption(fromObject,i);
function populateHidden(fromObject,toObject) {
var output = '';
for (var i=0, l=fromObject.options.length;i<l;i++) {
output += escape(fromObject.name) + '=' + escape(fromObject.options[i].value) + '&';
alert(output);
toObject.value = output;
/code]

Similar Messages

  • How to pass hidden field values on a click of a table row

    hi all,
    href = "bookAndNonBook.do"
    I am very new to struts. I have created a table using displaytable tag which displays results in a tabular format. In addtion, i have a hidden field (prodType), the table rows are getting highlighted when i get my mouse on a particular row.
    Following is the code from the results.jsp file
    <body
    onload="addRowHandlers('row', 'rowMouseOver')"
    bgcolor="#FFFFFF" text="#000000" leftmargin="100" topmargin="50"
    marginwidth="" marginheight="" rightmargin="30">
    <html:form action="/bookAndNonBook" method="post">
    <display:table name="sessionScope.productSearchList" id="row"
    sort="list" export="true" defaultsort="1" defaultorder="ascending"
    pagesize="15" decorator="org.displaytag.decorator.TotalTableDecorator"
    class="dataTable">
    <display:column property="prodType" title="ProdType" class="prodType"
    headerClass="prodType" media="html" />
    <display:column title="Title" property="titleName" sortable="true"
    class="title" headerClass="title" />
    </display:table>
    </html:form>
    </BODY>
    I am calling a funtion addRowHandlers which passes the table id (which is row) and the rowMouseover for highlighting the rows on mouse over.
    the code for function addRowHandlers is
    function addRowHandlers(tableId, rowClassName) {
    var previousClass = null;
    var table = document.getElementById(tableId);
    var rows = table.getElementsByTagName("tr");
    for (i = 1; i < rows.length; i++) {
    rows.onmouseover = function () {
    previousClass = this.className;
    this.className = this.className + " " + rowClassName ;
    this.style.cursor="hand";
    rows.onmouseout = function () {
    this.className = previousClass;
    this.style.cursor='';
    rows.onclick = function (){
    var cell = this.getElementsByTagName("td")[0];
    var ProdType = cell.innerHTML;
    alert("value of prodType = " + ProdType);
    when i run the above code and click on a particular row it returns me the value in the hidden field i.e. prodType for that particular row
    Now where i am having problem is i want that on the basis of prodType my jsp file should call different actions for different prodType as returned....somwhat a function like this
    function submitProduct(prodType) {
    if(prodType == "BK")
    resultsForm.action = "/bookProduct.do";
    else if(prodType == "NB")
    resultsForm.action = "/nonbookProduct.do";
    but i am unable to figure out that how do i this..
    Any help will be really appreciated
    Thanks
    Sam

    can you please suggest some good struts forums where i can post my question
    thanks in advance
    Sam

  • Pass Hidden Field (Rep ID) as Parameter when user logs into site (CFusion)

    I have set-up user validation to my site based on a userID and password, but I want to also pass a hidden field/parameter (RepID) to the rest of the site pages so that I can filter my record sets on those pages based on that RepID parameter.
    I have coded everything the way I thought it should be, but I'm getting the following error when I test it and from what I can see it is defined...
    Element PSWD is undefined in FORM.
    Here is the form coding, as well as the CF coding for the user validation...
    <form id="login" name="login" method="POST" action="<cfoutput>#MM_loginAction#</cfoutput>">
                   <table border="0" cellspacing="0" cellpadding="5">
                     <tr>
                       <td height="35" class="text_bold">Email</td>
                       <td height="35"><label for="email"></label>
                         <input type="text" name="email" id="email" /></td>
                     </tr>
                     <tr>
                       <td height="35" class="text_bold">Password</td>
                       <td height="35"><label for="pswd"></label>
                         <input name="pswd" type="password" id="pswd"  value="<cfoutput>#rsWeblogin#</cfoutput>" /></td>
                     </tr>
                     <tr>
                       <td height="35" class="text_bold"><input  name="salesman_id" type="hidden" id="salesman_id"  value="<cfoutput>#rsWeblogin.SALESMAN_ID#</cfoutput>"  /></td>
                       <td height="35"><input type="submit" name="submit" id="submit" value="Submit" /></td>
                     </tr>
                   </table>
                 </form>
    <cfparam name="FORM.email" default="1">
    <cfquery name="rsWeblogin" datasource="INSORB">
    SELECT *
    FROM dbo.WEBLOGIN
    WHERE E_MAIL = <cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="64">
    </cfquery>
    <cfif IsDefined("FORM.email")>
       <cfset MM_redirectLoginSuccess="index.cfm">
       <cfset MM_redirectLoginFailed="login.cfm">
       <cfquery  name="MM_rsUser" datasource="INSORB">
       SELECT E_MAIL,PSWD FROM dbo.WEBLOGIN WHERE E_MAIL=<cfqueryparam  value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="64"> AND  PSWD=<cfqueryparam value="#FORM.pswd#" cfsqltype="cf_sql_clob"  maxlength="15">
       </cfquery>
       <cfif MM_rsUser.RecordCount NEQ 0>
         <cftry>
           <cflock scope="Session" timeout="30" type="Exclusive">
             <cfset Session.MM_Username=FORM.email>
             <cfset Session.MM_UserAuthorization="">
           </cflock>
           <cfif IsDefined("URL.accessdenied") AND true>
             <cfset MM_redirectLoginSuccess=URL.accessdenied>
           </cfif>
           <cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
           <cfcatch type="Lock">
             <!--- code for handling timeout of cflock --->
           </cfcatch>
         </cftry>
       </cfif>
       <cflocation url="#MM_redirectLoginFailed#" addtoken="no">
       <cfelse>
       <cfset MM_LoginAction=CGI.SCRIPT_NAME>
       <cfif CGI.QUERY_STRING NEQ "">
         <cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)>
       </cfif>
    </cfif>
    Any help would be greatly appreciated!

    The userID and the repID are both unique to the user, but are used for different identification purposes. Both fields are in the same user login table...
    I was able to solve the problem by adding <cfset Session.RepID=MM_rsUser.SALESMAN_ID> and adding the SALESMAN_ID field to the <cfquery>
    Now it works great!
    Thank you for your response!

  • Pass Hidden Field (Rep ID) as Parameter when user logs into site

    I have set-up user validation to my site based on a userID and password, but I want to also pass a hidden field/parameter (RepID) to the rest of the site pages so that I can filter my record sets on those pages based on that RepID parameter.
    I have coded everything the way I thought it should be, but I'm getting the following error when I test it and from what I can see it is defined...
    Element PSWD is undefined in FORM.
    Here is the form coding, as well as the CF coding for the user validation...
    <form id="login" name="login" method="POST" action="<cfoutput>#MM_loginAction#</cfoutput>">
                    <table border="0" cellspacing="0" cellpadding="5">
                      <tr>
                        <td height="35" class="text_bold">Email</td>
                        <td height="35"><label for="email"></label>
                          <input type="text" name="email" id="email" /></td>
                      </tr>
                      <tr>
                        <td height="35" class="text_bold">Password</td>
                        <td height="35"><label for="pswd"></label>
                          <input name="pswd" type="password" id="pswd"  value="<cfoutput>#rsWeblogin#</cfoutput>" /></td>
                      </tr>
                      <tr>
                        <td height="35" class="text_bold"><input  name="salesman_id" type="hidden" id="salesman_id"  value="<cfoutput>#rsWeblogin.SALESMAN_ID#</cfoutput>"  /></td>
                        <td height="35"><input type="submit" name="submit" id="submit" value="Submit" /></td>
                      </tr>
                    </table>
                  </form>
    <cfparam name="FORM.email" default="1">
    <cfquery name="rsWeblogin" datasource="INSORB">
    SELECT *
    FROM dbo.WEBLOGIN
    WHERE E_MAIL = <cfqueryparam value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="64">
    </cfquery>
    <cfif IsDefined("FORM.email")>
        <cfset MM_redirectLoginSuccess="index.cfm">
        <cfset MM_redirectLoginFailed="login.cfm">
        <cfquery  name="MM_rsUser" datasource="INSORB">
        SELECT E_MAIL,PSWD FROM dbo.WEBLOGIN WHERE E_MAIL=<cfqueryparam  value="#FORM.email#" cfsqltype="cf_sql_clob" maxlength="64"> AND  PSWD=<cfqueryparam value="#FORM.pswd#" cfsqltype="cf_sql_clob"  maxlength="15">
        </cfquery>
        <cfif MM_rsUser.RecordCount NEQ 0>
          <cftry>
            <cflock scope="Session" timeout="30" type="Exclusive">
              <cfset Session.MM_Username=FORM.email>
              <cfset Session.MM_UserAuthorization="">
            </cflock>
            <cfif IsDefined("URL.accessdenied") AND true>
              <cfset MM_redirectLoginSuccess=URL.accessdenied>
            </cfif>
            <cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
            <cfcatch type="Lock">
              <!--- code for handling timeout of cflock --->
            </cfcatch>
          </cftry>
        </cfif>
        <cflocation url="#MM_redirectLoginFailed#" addtoken="no">
        <cfelse>
        <cfset MM_LoginAction=CGI.SCRIPT_NAME>
        <cfif CGI.QUERY_STRING NEQ "">
          <cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)>
        </cfif>
    </cfif>
    Any help would be greatly appreciated!

    I don't have anything definitive to offer other than a couple of questions based on what I see on your login form:
    1. What is rsWeblogin that you are using to initialize the password field PSWD on the form? I would have expected the password field to be left empty in generating the form...
    2. The use of "#rsWeblogin#" to initialize the PSWD field, coupled with the use of "#rsWeblogin.salesman_ID#" to initialize the hidden field strike me as odd; that second one would lead me to believe rsWeblogin is a structure of some sort, and I'm not sure what you would be getting crunched into the password field as a result...
    Maybe one of those might give you some sort of clue?
    In addition, if the password field is left empty on the form itself, you may well not be getting a FORM.pswd variable coming through the submittal. You may need to either check that it is defined (probably best) or cfparam it to a known value that would never be used for a "real" password (problematic for all sorts of reasons) before using it in the authentication logic.
    /ron

  • Problem reading hidden fields

    We have a problem with OC4J. Our web application is working perfectly fine on other application servers, such as Tomcat, but when running it on OC4J we experience some weird behavior.
    We have a HttpServlet which handles the request and prints out the response, which contains a form with some hidden input fields.
    What seems to be the problem is that these hidden fields don't seem to be included when the form is being submitted the first time, it behaves the same way as if we had open the window from the link once again, the hidden fields we set in the first request are empty. However, if I submit the form a second time, it works fine and the HttpServlet reads the hidden fields correctly.
    I'm not sure whether it is a matter of an error in our web application, or a wrong configuration of the application server.
    I hope someone understand and can help me with this, as I'm about to go mad...
    Rikard

    We think the problem is related to a difference between the tomcat and oracle api, and it seems like a bug in Oracle application server 10.1.2.0.0.
    The request.getParamaterMap() method seems to behave differently. This method always returned the correct paramater map when running on tomcat, while it happened to be empty many times on the oracle app server. Is this a known problem for Oracle app server?
    A work-around for us was to make use of the request.getParameterNames(), and then iterate through the names and get them manually with request.getParameter(attributeName). This way we always got the correct parameters.

  • Problem with Hidden Fields

    I have generated an JSPX page using JHeadStart then i added a hidden field to the page and bind it to a back bean.
    i set the value of this hidden field in the page load event of the page.
    the problem is that when the page is submitted (e.g commit action) the value if the hidden field is returned to null, although the page still in the exits and i didn't navigate to another page ????

    In that case, can you please create a test case based on the HR Schema (see http://www.oracle.com/technology/products/jdev/tips/muench/jhstutorial/index.html#setuphrschemaanddata)?
    Also include a non-JHeadstart test case in which the problem does not occur, based on the same HR Schema (possibly in a different ViewController project based on the same Model project).
    Please e-mail both to idevcoe_nl "at" oracle "dot" com,
    * removing the WEB-INF/lib folder from the web root (public_html) before zipping, it makes the zip much smaller
    * renaming the .zip file to something like .zipped before attaching it to the e-mail (otherwise our mail server will not process it)
    * including detailed steps to reproduce the problem, and how to see that it works OK in the other test case.
    Thanks,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Passing/retrieving hidden fields from Its template(IAC)  to BSP page

    Hi i m passing hidden fields from its template to custom BSP page...but not able to retrieve the hidden field in bsp page...is there any way we can retrieve the data....is there any equivalent of request.getattribute() method which we use in jsp to fetch the hidden fields....

    <i>i m passing hidden fields from its template to custom BSP page...but not able to retrieve the hidden field in bsp page...</i>
    from ITS template how are you calling/passing parameter to BSP
    thru a form submit? or are you just openning the BSP thru a url link, in either case
    you could pass the data as a form field (post) or in the url of the BSP (GET)
    for example if the form field name in ITS template is myformfiled and you are submitting that to the BSP page then in the corresponding bsp page declare a page attribute withe same name (myformfiled) and mark the auto check box.
    now the value passed from ITS template will be available within BSP in the ABAP variable myformfiled which you can use the way you want.
    Hope this is clear
    Raja

  • Safara 5.1.5 pass old value for a hidden field with new values

    Hi
    I have the JSP pages which used to be working in Safra 5.1.3. There is a hidden field: mac, submitted to and from this JSP page.
    Page A submits "mac" with value1, backend a java action received this value and change it to value2 after some calculation, value2 is set to page B. I can see the hidden field "mac" contains value2 in page B. But when I submit page B, the value being transmitted is still value1.
    I tested to change this field to a visible text field rather a hidden one. The value being passed will be the correct one: value2.
    Other browsers except Safari 5.1.5 do not have such strange behavior. 
    Is there any solution for this problem apart from changing my form filed names?
    Thanks.

    you can only list what was stored.
    changes in values for a characteristic can be monitored in CL20N via menu Environment > Change documents
    change history for classification is only stored if you activated this.
    maybe it is not set active in your system, then see SAP Note 943559 - FAQ: Frequently asked questions about the classifctn. system

  • Extraction from SAP, hidden fields problem

    Hi Expeerts,
    I have the following problem / question:
    From an SAP Datasource (2lis_11_vaitm) we have some fileds, those are HIDED, and we need them. This is a central SAP, and a lot of BW systems connect to this SAP.
    The problem is, that we need a field from that datasource (and other BWs do not need), that has 'HIDDEN' option. The SAP side is afraid of having problem, when they just uncheck that option. (TELF1; KONDA fields we need).
    Does anyone know, what is the affects on other BW systems, when we unhide this fields? Of course we load with delta from this source.
    If a field is hidden in SBIW-Maintain Datasources, am I right, that the delta does not collect those fields, or it is collected, just not sent to BW systems?
    Any good idea, how can we get that fields in other way, because it seems, that the datasource cannot be modifyed, because of the other countries' BWs, connected to teh centra SAP.
    I hope i were clear, but if not, please ask me.
    Thanks for Your help.
    Laszlo
    Edited by: László Györkös on Jan 30, 2009 11:07 AM

    Hi,
    If a field is hidden in SBIW-Maintain Datasources, am I right, that the delta does not collect those fields, or it is collected, just not sent to BW systems?
    --> As hidden fields are already available in extract strucute, unhiding will not create any problem. As far as i know hidden means it will transfer data from extract structure to further.
    --> You can try pulling this particular data using generic datasource. OR
    --> Enhance datasource by adding required fields and use. OR
    --> Unhide files and use.
    Note: Bit careful while transpporting datasource to production as time stamp changes.
    Srini

  • Pass Parameter from JSPF to JSP hidden field?

    Hi :
    I got a problem here. This is the scenario, There's a pop-up JSP page which import a jspf file. In the jspf file, I'll add several value to an array. When user click on OK button on the jspf file. I need to set the array to a hidden field in the jsp file.
    I'd try to use
    window.opener.document.getElementById("hiddenLabel").value = arrayInJspf
    but it's not working at all. So I just wonder can anyone gv me some hints on how this can be done? Thanks.

    You'll need to use some kind of formatting to dump an array in a single formfield. I usually do something like this:
    5|10|14|50|50000
    This would be an array of 5 integers. When the data is submitted, I can get the array back with the String.split() method.

  • Passing values to hidden fields in screens

    Hi ,
    I have designed a screen which has i field which is output only, and two fields which are hidden.. the output only field gets populated when i select value from an alv tht pops up on the screen based on certain conditions.. the hidden fields should also be populated than.. but the hidden fields are not getting populated i think..
    i have assigned a t-code to this screen,
    and i need to call this transaction from another program passing values to all the fields.. i used parameter id for all teh fields, but values are not getting populated in the hidden and display fields. i gets in when i make it input enabled.. but i cannot let users enter values in 1 field, and i do not want users to see the other field.. What do i do???? please give your valuable suggestions. .a ny idea how to correct the issue?
    Regards,
    Suzie

    Hi,
    If you want one of the fields to be grey mode you can do that statically in the screen painter or dynamically in the progarm
    in PBO
    loop at screen
    if screen-name = 'TO_BE_GREY_MODE'.
    SCREEN-INPUT = 0
    ENDIF
    endloop
    for hidden fields if the screen name and the variable name in the program are same the data transfer takes place but the users cannot see this.
    Regards
    Ramchander Rao.K

  • Very Strange Problem... Missing hidden field when deployed on JBOSS

    This problem is driving me nuts. Here it is... When I deploy my app to TomCat it works fine. When I deploy to JBoss everything works except the links . When I select a link rendered via JBoss the directory containing the JSP is displayed. I can also see that my filters are not being called in this case. I compared the HTML produced by TomCat to the HTML produced by JBoss and there was one minor difference. This hidden field was not rendered in JBoss:
    <input type="hidden" name="contentView:contentForm:_idcl" />When I manually include this in the JSP and run JBoss.. It works.
    I have spent a full day trying to figure out when the hidden field is not being rendered when deployed to JBoss... I would very much appreciate any suggestions.. Thanks in advance. Paul
    Here is a bigger snippit:
    <tags:layout
        heading = "/banner.jsp" 
        menu    = "/mainmenu.jsp">
         <f:subview id="contentView">
              <f:loadBundle basename="com.dygtig.bundles.labels" var="labels" />
         <h:messages layout="table" tooltip="Please review errors and resubmit."
                     fatalClass = "msgFatalText"
                     errorClass = "msgErrorText"
                     warnClass  = "msgWarnText"
                     infoClass  = "msgInfoText"/>
              <h:form id="contentForm" style="display:inline">
                   <f:verbatim><CENTER></f:verbatim>
                   <h:outputText value="Aircraft Types" styleClass="pageTitle"/>
                   <f:verbatim><br><br></f:verbatim>
                   <h:dataTable value       = "#{aCTypeListView.acTypes}"
                                var          = "ac"
                                first        = "0"
                                rows         = "15"
                                columnClasses= ""
                                styleClass   = "normaltable"
                                width        = "500px" title="Aircraft List"
                                rowClasses   = "normaltabletext1,normaltabletext2"
                                id           = "AircraftTable">
                   <h:column>
                        <f:facet name="header">
                             <h:outputText value="Action"/>
                        </f:facet>
                        <h:commandLink action="#{aCTypeListView.updateActype}">
                             <f:param name="acId" value="#{ac.id}"></f:param>
                             <h:outputText value="Upd" styleClass="commandLink"/>
                        </h:commandLink>
                        <h:outputText value=" "></h:outputText>
                        <h:commandLink action="#{aCTypeListView.deleteActype}" >
                             <f:param name="acId" value="#{ac.id}"></f:param>
                             <h:outputText value="Del" styleClass="commandLink"/>
                        </h:commandLink>
                     </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText value="Type-Suffix"/>
                        </f:facet>
                        <h:outputText value="#{ac.typeSuffixText}"/>
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText value="Model"/>
                        </f:facet>
                        <h:outputText value="#{ac.model}"/>
                   </h:column>
                   </h:dataTable>
                   <dygtig:tablescroller tables="AircraftTable" />
                   <br>
                   <h:commandLink action="#{aCTypeListView.createActype}">
                        <h:outputText value="Create New Aircraft Type" styleClass="link"/>
                   </h:commandLink>
                   <br>
                   </CENTER>
                   <br>
                   <! manually add hidden field here>          </h:form>
         </f:subview>
    </tags:layout>

    Hi Paul,
    I have the same problem under deployment to WAS, all <h:commandLink>s are out of order. The hidden form field '...:_idcl' is missing in the generated JSP, but will be generated under Tomcat.
    Have you found a solution?
    Cheers, Ralf.

  • Hidden field in form returns null value

    Hi all - I searched for this but found nothing that fit my problem although various other problems came up.
    I have a Login jsp, with a simple form for username and password:
    <form name="login" method="post" action="servlet/ControlServlet"
    onSubmit="return validateForm()"><table width="180" border="0"
    cellspacing="0" cellpadding="0">
                <tr>
                  <td width="96" class="logintext">Username</td>
                  <td width="84"> </td>
                </tr>
                <tr>
                  <td><input name="username" type="text" size="15"
    maxlength="15"></td>
                  <td><input type="submit" name="Submit" value="Login"></td>
                </tr>
                <tr>
                  <td class="logintext">Password</td>
                  <td> </td>
                </tr>
                <tr>
                  <td class="logintext"><input name="password" type="password"
    size="15" maxlength="15"></td>
                  <td><input name="actionCode" type="hidden" value="0"></td>
                </tr>
                <tr>
                  <td> </td>
                  <td><div align="center"><a href
    ="Register.jsp"><i>Register</i></a></div></td>
                </tr>
              </table>
              </form>Nothing complex in that form. my hidden field is actionCode and it should pass a 0 to my ControlServlet servlet.
    Here is a snippet from my servlet:
    import java.io.* ;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ControlServlet extends HttpServlet {
      public void doPost(HttpServletRequest request,
                        HttpServletResponse response)
          throws ServletException, IOException {
        response.setContentType("text/html");
                //get the printwriter to output for debugging
                PrintWriter out = response.getWriter();
                //read in form variables
            //String formUsername = request.getParameter("username");
            //String formPassword = request.getParameter("password");
            String action = request.getParameter("actionCode");
            //convert String to int for action
            //int actionInt = Integer.parseInt(action);
            //add action variable to request
            request.setAttribute("aktion", action);
                //debug point 1
                //use requestDispatcher to forward session info to JSP
               RequestDispatcher dispatcher =
               request.getRequestDispatcher("/mvcoutput.jsp");
               dispatcher.forward(request, response);I have commented out a bit for debugging purposes, but basically, the form variables are read in, the username and password don't give me any problems, but the actionCode does. Upon forwarding to a basic jsp for testing my output displays value "null" when using the command:
    request.getAttribute("aktion")Any reason why the hidden field is playing silly buggers ??
    cheers

    Anyone ???
    If I have a field in an html form which is hidden, do I retrieve it in the SAME WAY that I retrieve the non hidden form fields i.e. using the request.getParameter() method ??
    Cheers.

  • Pass hidden values to same page by clicking on href

    I have A.jsp page which has some dynamic hidden fields.The respective code is given below:
    <script language="javascript">
    function submitForm()
    {document.main.action="main.jsp"; document.main.submit(); }
    </script>
    <form name="main">
    HOME
    <input type="hidden" name="user_p" value="<%=user1%>"/>
    <input type="hidden" name="p" value="Hello"/>
    </form>
    When I click on link-HOME, it reconnect to A.jsp but does not pass the hiddden values. Could you help me?

    It did not work.Now after modifying the code for this (I did this because some browser does not support two functions ,like in href. By thinking that it could be the problem)
    <script language="javascript">
    function submitForm()
    document.main.action="main.jsp"; document.main.submit(); }
    </script>
    <form name="main" method="POST">
    HOME
    <input type="hidden" name="user_p" value="<%=user1%>"/>
    <input type="hidden" name="p" value="Hello"/>
    </form>
    Could you explain with working code?

  • Escaping special characters in hidden fields

    I am using a hidden field to pass values to the servlet. I am populating the hidden field from a bean. The hidden field can have any string value. My problem is that the value attribute on my hidden field is double quoted and if there is a double quote in the value of the String from my bean it messes my HTML up. Is there an easy workaround for this?
    e.g.
    <jsp:useBean id="myObject" scope="request" class="MyObject"/>
    <input type="hidden" name="myValue" value="<%=myObject.getValue()%>">
    If myObject.getValue() returns a string: 60" Mower this will mess my HTML up.
    Any suggestions?

    First off, Is the Pattern and Matcher specific to JDK 1.4.1? We are currently using 1.2.2? If this is a viable solution, is there a similar one in JDK 1.2.2?
    Also, I still don't think it's possible in HTML to escape characters that are values of attributes. Try running the following HTML code:
    <html>
    <head>
       <script language="JavaScript">
       function getHiddenValue(){
          alert(document.myForm.hiddenDescription.value);
       </script>
    </head>
    <body>
       <form name="myForm">
       <p>
          <input type="hidden" name="hiddenDescription" value="60\" Mower">
       </p>
       <p>
          <input type="button" onclick="getHiddenValue()" value="Hidden Field">
       </p>
       </form>
    </body>
    </html>

Maybe you are looking for

  • Picture in Picture in iMovie doesn't appear

    So I'm editing a tutorial video for may dad. Placing the arrows for pointing where to go is easy. But when I preview the whole movie, most of the arrow wont show. Only the first one. I even tried splitting the clip just to make sure that the 1 part o

  • Format lost when using template

    I'm using Dreamweaver CS4 on my Windows XP PC I have been following a Dreamweaver tutorial found at http://www.thesitewizard.com which has been very helpful up until now. I am at the stage where I have created my template from my index.html document

  • Outdoor 5ghz MIMO deployment.

    Hello.. We are interested in adding 5ghz N MIMO to our existing outdoor wifi 2.4ghz hotspots. Currently we have 3 x 1310 ap's with MSO24014 all-terrain antennas (seen in the attached photo) atop 19 foot towers.. I'm looking at either 3 x 1532E AP's p

  • How to modify the database by Oracle-ridc-client

    How to modify the database by Oracle-ridc-client

  • ClassCastException from appendSecondaryDocument( non-oracle-generated-XMLDocument i )

    I wrote an xsql custom handler that converts html to xhtml and includes it into my xsql-generated xml. It gets slow because appendSecondaryDocument() throws a ClassCastException if I pass in a (XML) Document that is generated by the parser in JTidy.