You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dirk Markert <di...@dr-markert.de> on 2003/07/16 16:32:18 UTC

Re[8]: Question about the form tag

Hello Nadja,

 something like:

<html:form action="change" >
 <html:text property="name" />
 <html:submit property="f1a" >Senden A</html:submit>
 <html:submit property="f1b" >Senden B</html:submit>
 <html:submit property="f1c" >Senden C</html:submit>
</html:form>

<html:form action="change" >
 <html:text property="name" />
 <html:submit property="f2a" >Senden A</html:submit>
 <html:submit property="f2b" >Senden B</html:submit>
 <html:submit property="f2c" >Senden C</html:submit>
</html:form> 

***************************************************************

NS> Hello,

>>    my test looks like:
>>
>><html:form action="change" >
>> <html:text property="name" />
>> <html:submit property="f1" >Senden 1</html:submit>
>></html:form>
>>
>><html:form action="change" >
>> <html:text property="name" />
>> <html:submit property="f2" >Senden 1</html:submit>
>></html:form>
>>
>>Hitting button 1 gives me the text from the first and hitting button 2
>>gives me the text from the second form. Whats the difference to your
>>jsp?

NS> My difference is with the buttons. They also have the same name. I have 4
NS> different submit buttons (actually 5 but only three get displayed at one
NS> time) for every object and two more for the whole form. They have each
NS> different names but the names do not change for different objects. And
NS> since my action looks like this:

NS> if(request.getParameter("aendern")!=null){
NS>         //do change stuff
NS> }else if(request.getParameter("deinventarisieren")!=null){
NS>         //deactivate object
NS> }else if(request.getParameter("reinventarisieren")!=null){
NS>         //reactivate object
NS> }else if(request.getParameter("print_geraet")!=null ||
NS> request.getParameter("print_archiv")!=null){
NS>         //print an object (two different print views)
NS> }else if(request.getParameter("print_multiple_geraete")!=null ||
NS> request.getParameter("print_multiple_archive")!=null){
NS>         //print multiple objects (two different print views)
NS> }

NS> I cannot really change the button names for each object, else I'd never
NS> what to look for in the request...

NS> Or am I doing things too complicated here?

NS> Greetings,
NS> Nadja

NS> ---------------------------------------------------------------------
NS> Nadja  Senoucci
NS> Universitaet Hamburg
NS> Zentrum für Molekulare Neurobiologie
NS> Service-Gruppe EDV
NS> Falkenried 94
NS> 20251 Hamburg
NS> Germany
NS> Tel.:040 - 428 - 03 - 6619
NS> Fax.:040 - 428 - 03 - 6621


NS> ---------------------------------------------------------------------
NS> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
NS> For additional commands, e-mail: struts-user-help@jakarta.apache.org



Regards,
Dirk

+------- Quality leads ---------------------------------------+
| Dirk Markert                     dirk.markert@dr-markert.de |
| Dr. Markert Softwaretechnik AG                              |
| Joseph-von-Fraunhofer-Str. 20                               |
| 44227 Dortmund                                              |
+---------------------------------->>>>>>> to success! <<<<<<-+ 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Re[10]: Question about the form tag

Posted by Nadja Senoucci <Na...@zmnh.uni-hamburg.de>.
Hello Dirk,

>I set up a test jsp like above and I get values from form 2, if I
>click any button of form 2 (and vice versa). I guess either your
>struts-config or your action form is not correct.

Hmm... I guess, I will have to look into this some more tomorrow then. This
is really odd, because the form works fine if I only display one form and I
have logging information that tells me I do get the ID of the first object
even though in my second form the hidden field is correctly filled with the
ID of the second object... I assume, this will bug me for a while... <sighs>

Thanks for all your help.

Greetings,
Nadja

---------------------------------------------------------------------
Nadja  Senoucci
Universitaet Hamburg
Zentrum für Molekulare Neurobiologie
Service-Gruppe EDV
Falkenried 94
20251 Hamburg
Germany
Tel.:040 - 428 - 03 - 6619
Fax.:040 - 428 - 03 - 6621


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re[10]: Question about the form tag

Posted by Dirk Markert <di...@dr-markert.de>.
Hello Nadja,

  

***************************************************************

NS> Hello Dirk,

>> something like:
>>
>><html:form action="change" >
>> <html:text property="name" />
>> <html:submit property="f1a" >Senden A</html:submit>
>> <html:submit property="f1b" >Senden B</html:submit>
>> <html:submit property="f1c" >Senden C</html:submit>
>></html:form>
>>
>><html:form action="change" >
>> <html:text property="name" />
>> <html:submit property="f2a" >Senden A</html:submit>
>> <html:submit property="f2b" >Senden B</html:submit>
>> <html:submit property="f2c" >Senden C</html:submit>
>></html:form> 

NS> But then I would still have to be looking for "f2a" in the request, won't
NS> I? And that I could do that would mean that I'd know already which form
NS> should've been submitted and/or which forms or how many existed on page at
NS> all.

NS> This is what my forms look like at the moment (just with more and different
NS> data for each object...):

NS> <html:form action="change" >
NS>  <html:text property="name" />
NS>  <html:submit property="fa" >Senden A</html:submit>
NS>  <html:submit property="fb" >Senden B</html:submit>
NS>  <html:submit property="fc" >Senden C</html:submit>
NS> </html:form>

NS> <html:form action="change" >
NS>  <html:text property="name" />
NS>  <html:submit property="fa" >Senden A</html:submit>
NS>  <html:submit property="fb" >Senden B</html:submit>
NS>  <html:submit property="fc" >Senden C</html:submit>
NS> </html:form>

I set up a test jsp like above and I get values from form 2, if I
click any button of form 2 (and vice versa). I guess either your
struts-config or your action form is not correct.


NS> That allows me to look for "fa" in the request to find out whether it has
NS> been set/pressed or not.

NS> Greetings,
NS> Nadja

NS> ---------------------------------------------------------------------
NS> Nadja  Senoucci
NS> Universitaet Hamburg
NS> Zentrum für Molekulare Neurobiologie
NS> Service-Gruppe EDV
NS> Falkenried 94
NS> 20251 Hamburg
NS> Germany
NS> Tel.:040 - 428 - 03 - 6619
NS> Fax.:040 - 428 - 03 - 6621


NS> ---------------------------------------------------------------------
NS> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
NS> For additional commands, e-mail: struts-user-help@jakarta.apache.org



Regards,
Dirk

+------- Quality leads ---------------------------------------+
| Dirk Markert                     dirk.markert@dr-markert.de |
| Dr. Markert Softwaretechnik AG                              |
| Joseph-von-Fraunhofer-Str. 20                               |
| 44227 Dortmund                                              |
+---------------------------------->>>>>>> to success! <<<<<<-+ 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Re[8]: Question about the form tag

Posted by Nadja Senoucci <Na...@zmnh.uni-hamburg.de>.
Hello Dirk,

> something like:
>
><html:form action="change" >
> <html:text property="name" />
> <html:submit property="f1a" >Senden A</html:submit>
> <html:submit property="f1b" >Senden B</html:submit>
> <html:submit property="f1c" >Senden C</html:submit>
></html:form>
>
><html:form action="change" >
> <html:text property="name" />
> <html:submit property="f2a" >Senden A</html:submit>
> <html:submit property="f2b" >Senden B</html:submit>
> <html:submit property="f2c" >Senden C</html:submit>
></html:form> 

But then I would still have to be looking for "f2a" in the request, won't
I? And that I could do that would mean that I'd know already which form
should've been submitted and/or which forms or how many existed on page at
all.

This is what my forms look like at the moment (just with more and different
data for each object...):

<html:form action="change" >
 <html:text property="name" />
 <html:submit property="fa" >Senden A</html:submit>
 <html:submit property="fb" >Senden B</html:submit>
 <html:submit property="fc" >Senden C</html:submit>
</html:form>

<html:form action="change" >
 <html:text property="name" />
 <html:submit property="fa" >Senden A</html:submit>
 <html:submit property="fb" >Senden B</html:submit>
 <html:submit property="fc" >Senden C</html:submit>
</html:form>

That allows me to look for "fa" in the request to find out whether it has
been set/pressed or not.

Greetings,
Nadja

---------------------------------------------------------------------
Nadja  Senoucci
Universitaet Hamburg
Zentrum für Molekulare Neurobiologie
Service-Gruppe EDV
Falkenried 94
20251 Hamburg
Germany
Tel.:040 - 428 - 03 - 6619
Fax.:040 - 428 - 03 - 6621


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org