Re: Antwort: RE: RE: Submitting value with Graphical Buttons

2003-06-05 Thread Dirk Markert
Manuel,

are you preparing your form data with an action? Then simply use
something like

  actionForm.setXyProp()

Struts will populate your jsp with the data from your action form.





ML> Hi Dirk,
ML> you are right with your statement, but this is not exactly what I want to
ML> do.
ML> You are filling an input field in the html-page and submit this value.
ML> I´d like to fill directly an field in a specified FormBean on the server.
ML> But how do I address this field in the expected FormBean?

ML> I´dont like to use your solution, because the browser caches the
ML> input-values of the form.
ML> If an user takes the back-button to go to the last form, the field will be
ML> still filled in. This causes some following problems.

ML> Is there a possibility to save the value directly in the server-FormBean?

ML> Manuel



ML> |-+>
ML> | ||
ML> | ||
ML> | ||
ML> | |Dirk Markert|
ML> | |<[EMAIL PROTECTED]>|
ML> | |05.06.2003 11:10|
ML> | |Bitte antworten an "Struts  |
ML> | |Users Mailing List" |
ML> | ||
ML> |-+>
ML>   
>|
ML>   |
|
ML>   | An:  Struts Users Mailing List <[EMAIL PROTECTED]> 
   |
ML>   | Kopie: 
|
ML>   | Thema:   RE: RE: Submitting value with Graphical Buttons   
|
ML>   
>|




ML> Hello Manuel,

ML> using a page like:
ML> 
ML> 

ML> 
ML> Test

ML> http://localhost:8088/SomeProgram";>
ML> Field 1:
ML> 
ML> 
ML> 

ML>  onClick="javascript:document.testForm.field1.value='page.jsp';
ML>  document.testForm.submit()">

ML>  Test

ML> 
ML> 
ML> ---

ML> my server received:

ML> =
ML> Here is the request line and request headers sent by your browser:
ML> GET /SomeProgram?field1=page.jsp HTTP/1.1
ML> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
ML> application/vnd.ms-powerpoint, application/vnd.ms-excel,
ML> application/msword, */*
ML> Accept-Language: de
ML> Accept-Encoding: gzip, deflate
ML> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)
ML> Host: localhost:8088
ML> Connection: Keep-Alive
ML> =

ML> I think thats exactly what you are expecting. I think your error is on
ML> the server side. Maybe your actionform?

ML> Thursday, June 5, 2003, 10:04:18 AM, you wrote:


ML>> Hi,
ML>> I have seen some examples like the one below,
ML>> but no one works with struts. I donŽt know how to address the form
ML> beans
ML>> field. And I habe to specify the paramŽs name IŽd like to save.
ML>> I tried this code, but it doesnŽt work:

ML>> > onClick="javascript:document.testForm.fieldname.value
ML>> ='page.jsp';
ML>>   document.testForm.submit()">

ML>> Where is the error?
ML>> How do I save a value in an FormBean by clicking a button?

ML>> Manuel



ML>> |-+>
ML>> | ||
ML>> | ||
ML>> | ||
ML>> | |"Rochak Sethi"  |
ML>> | |<[EMAIL PROTECTED]>  |
ML>> | |05.06.2003 08:56|
ML>> | |Bitte antworten an "Struts  |
ML>> | |Users Mailing List" |
ML>> | ||
ML>> |-+>
ML>>
ML>> >
ML> 
|

ML>>   |

ML>>   | An:  "Struts Users Mailing List"
ML> <[EMAIL PROTECTED]>
ML>>   | Kopie:

ML>>   | Thema:   RE: Submitting value with Graphical Buttons

ML>>
ML>> >
ML> 
|






ML>> hi ,
ML>>  a graphical button can be put inside a hyperlink tag and
ML>> onclick() function can be called
ML>> eg.
ML>>   onclick=fnSubmitForm
()>>>

ML>> and in javascript u can make this function :

ML>>  fnSubmitForm()
ML>> {
ML>>  document.formname.submit();
ML>> }

RE: Antwort: RE: RE: Submitting value with Graphical Buttons

2003-06-05 Thread Andrew Hill
You could use a GET request with the value for that field appended as a
query parameter. These are treated the same as POSTed parameters when the
form is populated. (Dont forget to rewrite the url to preserve session for
cookie haters).

-Of course you will lose the values for all the other fields when you get
back to the form from the server trip unless you do something tricky to
avoid reloading the page - such as fire the request in a hidden iframe (of
course if you to go to another page after this then thats probably a moot
point)

-Original Message-
From: Manuel Lenz [mailto:[EMAIL PROTECTED]
Sent: Thursday, 5 June 2003 17:23
To: Struts Users Mailing List
Subject: Antwort: RE: RE: Submitting value with Graphical Buttons





Hi Dirk,
you are right with your statement, but this is not exactly what I want to
do.
You are filling an input field in the html-page and submit this value.
I´d like to fill directly an field in a specified FormBean on the server.
But how do I address this field in the expected FormBean?

I´dont like to use your solution, because the browser caches the
input-values of the form.
If an user takes the back-button to go to the last form, the field will be
still filled in. This causes some following problems.

Is there a possibility to save the value directly in the server-FormBean?

Manuel



|-+>
| ||
| ||
| ||
| |Dirk Markert|
| |<[EMAIL PROTECTED]>|
| |05.06.2003 11:10|
| |Bitte antworten an "Struts  |
| |Users Mailing List" |
| ||
|-+>

>---
-|
  |
|
  | An:  Struts Users Mailing List <[EMAIL PROTECTED]>
|
  | Kopie:
|
  | Thema:   RE: RE: Submitting value with Graphical Buttons
|

>---
-|




Hello Manuel,

using a page like:




Test

http://localhost:8088/SomeProgram";>
Field 1:






 Test



---

my server received:

=
Here is the request line and request headers sent by your browser:
GET /SomeProgram?field1=page.jsp HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-powerpoint, application/vnd.ms-excel,
application/msword, */*
Accept-Language: de
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)
Host: localhost:8088
Connection: Keep-Alive
=

I think thats exactly what you are expecting. I think your error is on
the server side. Maybe your actionform?

Thursday, June 5, 2003, 10:04:18 AM, you wrote:


ML> Hi,
ML> I have seen some examples like the one below,
ML> but no one works with struts. I donŽt know how to address the form
beans
ML> field. And I habe to specify the paramŽs name IŽd like to save.
ML> I tried this code, but it doesnŽt work:

ML>  onClick="javascript:document.testForm.fieldname.value
ML> ='page.jsp';
ML>   document.testForm.submit()">

ML> Where is the error?
ML> How do I save a value in an FormBean by clicking a button?

ML> Manuel



ML> |-+>
ML> | ||
ML> | ||
ML> | ||
ML> | |"Rochak Sethi"  |
ML> | |<[EMAIL PROTECTED]>  |
ML> | |05.06.2003 08:56|
ML> | |Bitte antworten an "Struts  |
ML> | |Users Mailing List" |
ML> | ||
ML> |-+>
ML>
ML> >

|

ML>   |

ML>   | An:  "Struts Users Mailing List"
<[EMAIL PROTECTED]>
ML>   | Kopie:

ML>   | Thema:   RE: Submitting value with Graphical Buttons

ML>
ML> >

|






ML> hi ,
ML>  a graphical button can be put inside a hyperlink tag and
ML> onclick() function can be called
ML> eg.
ML>  >

ML> and in javascript u can make this function :

ML>  fnSubmitForm()
ML> {
ML>  document.formname.submit();
ML> }
ML> i am not too sure if i am tellng u something u dont know but i guess
this
ML> shud work.


ML> tc




ML> -Original Message-
ML> From: Manuel Lenz [mailto:[EMAIL PROTECTED]
ML> Sent: Thursday, June 05, 2003 12:20 PM
ML> To: Struts Users M