struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Markert <dirk.mark...@dr-markert.de>
Subject Re: Antwort: RE: RE: Submitting value with Graphical Buttons
Date Thu, 05 Jun 2003 09:34:51 GMT
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> |         |<dirk.markert@dr-markert.de>|
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 <struts-user@jakarta.apache.org> 
                                                  |
ML>   |     Kopie:                                                                    
                                            |
ML>   |     Thema:   RE: RE: Submitting value with Graphical Buttons                  
                                            |
ML>   >----------------------------------------------------------------------------------------------------------------------------|




ML> Hello Manuel,

ML> using a page like:
ML> --------------------
ML> </HEAD>

ML> <BODY BGCOLOR="#FDF5E6">
ML> <H2 ALIGN="CENTER">Test</H2>

ML> <FORM Name="testForm" ACTION="http://localhost:8088/SomeProgram">
ML> Field 1:
ML> <INPUT TYPE="TEXT" NAME="field1"><BR>
ML> <INPUT TYPE="SUBMIT">
ML> </FORM>

ML> <a href="#"  style="text-decoration:none;"
ML>             onClick="javascript:document.testForm.field1.value='page.jsp';
ML>                      document.testForm.submit()">

ML>                      Test</a>

ML> </BODY>
ML> </HTML>
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>> <a href="#"  style="text-decoration:none;"
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>> |         |<Rochak_Sethi@infosys.com>  |
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> <struts-user@jakarta.apache.org>
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>>              <a href="something" ><img src="something"
ML> onclick=fnSubmitForm
()>>></a>

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
ML> this
ML>> shud work.


ML>> tc




ML>> -----Original Message-----
ML>> From: Manuel Lenz [mailto:LzM@viessmann.com]
ML>> Sent: Thursday, June 05, 2003 12:20 PM
ML>> To: Struts Users Mailing List
ML>> Subject: Submitting value with Graphical Buttons




ML>> Hi to all,
ML>> I still have problems with submitting values by clicking graphical
ML> buttons.
ML>> By using javascript there must be an function named "on click ...."
ML> which
ML>> sets a value into a FormBean by pressing a graphical button.
ML>> To get a forwarding page a submit must be initialized too. A link to
ML> this
ML>> page might also work.
ML>> The value must be a constant one to identiy the page from which the
ML> user
ML>> has submitted.

ML>> Has anybody an idea how this works?

ML>> Greetings,
ML>> Manuel



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


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







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



ML> --
ML> Best regards,
ML> Dirk


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







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


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


Mime
View raw message