Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java Open Source > Struts
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 8th, 2008, 03:44 AM
Authorized User
 
Join Date: Jul 2006
Location: Valencia, Valencia, Spain.
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem filling up a form

Hello all,

My problem is the following:

I have two jsp files. The first one opens the second one when a link is pressed by the user(<a> struts2 tag).
The second jsp has a form with two textfields and a combobox. I need to set the values of these input field but only the first jsp file knows which are these values.

How can I pass these values from the first jsp file to the second?

This is the first jsf file:

<%@ taglib prefix="str" uri="/struts-tags" %>
<jsp:include page="checkpass.jsp" />
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Parametros Configuración Sistema</title>

    <script>
        function onEliminarClick(parametro){
            document.forms[0].inParametro.value = parametro;
            document.forms[0].submit();
        }
    </script>
    <link href="<str:url value="/css/configuracion.css"/>" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="container">
     <div id="content">

    <table class="dataTable">
        <tr>
            <th>Parametro</th>
            <th>Valor</th>
            <th>Obligatorio</th>
        </tr>
    <str:bean name="es.uv.lisitt.dtx2.configuracion.DatosConfigu racion">
            <str:iterator value="total" status="stat">
            <tr>
                  <td><str:property value="total[#stat.index].parametro" /></td>
                  <td><str:property value="total[#stat.index].valor" /></td>
                  <td><str:property value="total[#stat.index].obligatorio" /></td>

                  <td><str:form action="EliminarParametro">
                      <str:a href="#" onclick="onEliminarClick('%{parametro} ')">[Eliminar]</str:a><br/>
                    <str:hidden name="inParametro"></str:hidden>
                    </str:form>
                </td>
                <td>
                    <str:a href="SECOND.jsp" targets="center_frame">[Editar]</str:a>
                </td>
              </tr>
              </str:iterator>

        <tr>
            <th colspan="3" align="right" >N&uacute;mero de Paramertros</th>
                <td><str:property value="NumeroDeParametros"/></td>
         </tr>
    </str:bean>
    </table>
</div>
</div>
</body>
</html>

The second jsp file:

<%@ taglib prefix="str" uri="/struts-tags" %>
<jsp:include page="checkpass.jsp" />
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Parametros Configuración Sistema</title>
    <link href="<str:url value="/css/header.css"/>" rel="stylesheet" type="text/css"/>

</head>
<body>
<div id="container">
     <div id="top">
        <h2>Editar Parametro</h2>
    </div>

    <div id="content">
        <str:form name="editForm" action="EditarParametro">
            <str:textfield name="paramField" label="Parametro" value=''/>
            <str:textfield label="Valor" name="valor" value=''/>

            <str:combobox list="{'SI','NO'}" label="Obligatorio" name="obligatorio"/>


            <str:submit value="Guardar" />
        </str:form>
    </div>
</div>
</body>
</html>



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for Auto-filling a pre-made Word form dan_thorman Excel VBA 0 January 25th, 2007 10:46 AM
Filling and submitting web form by C# application Mystic C# 0 May 2nd, 2006 04:29 AM
Filling a form in specified time (Reply ASAP) software_developer_kk Classic ASP Basics 1 March 29th, 2005 04:20 AM
Auto Filling Combo on Form penta Access 2 December 3rd, 2004 06:14 AM



All times are GMT -4. The time now is 05:14 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.