RE: Button pressed
True, but JavaScript is much more aligned than JScript to ECMA (no surprise there), as Netscape is to XHTML (much to the annoyance of sloppy HTMLers). And the Micro$oft side of Java script (or JSP script) and JDBC is ASP + ADO (the latter of which is pretty cool technology - ADO 3.0). My dev team is just releasing the alpha for the huge ecommerce site we are doing for VoiceStream to our internal QA and we are getting nailed by Communicator 4.7 failures. IE 5.x and 6.0, and Netscape 6.2 (with minor annoyances) are doing fine, but what a PITA 4.7 is turning out to be! It appears to be choking on the Struts tags - that is, the HTML the tags render, which is not XHTML-compliant. This is a major problem! (Putting on flame-retardant...SPF 35k) Mark -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 10:38 PM Yes. Surely 'java script' is what goes in jsp scriptlets to be killed, uh.. executed on the server. And of course on the client, its only JavaScript if your using Nutscraper. IE calls it JScript, and the standards blessed name is ECMAScript. (Of course the variants arent identical between browsers and even browser versions but some of the basic stuff is pretty standard) -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 02:56 To: 'Struts Users Mailing List' Subject: RE: Button pressed That's a joke, right? This reminds me of a client I consulted last year who insisted on interactive graphing with Active X rather than Java applets because of security concerns. And it's JavaScript, not java script. -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:42 PM Thanks guys, but...as a company policy, we are not suppose to use java script. -Carlos. -Original Message- From: Bharat Nagwani [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:39 PM one more alternative create a hidden field and assign a value to it (edit or continue) using javascript and check that hidden field in request.getParameter... At 02:26 PM 6/3/2002 -0400, you wrote: Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Button pressed
Yeh. Trying to get netscape 4.x to do anything useful can be quite an exercise in frustration! Luckily we have defined the base browser support for our project at ie5 ns6 :-) (Its not a public website for all and sundry but an application, so its more reasonable for us to say you need browser version X to use it... :-) -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 19:31 To: 'Struts Users Mailing List' Subject: RE: Button pressed True, but JavaScript is much more aligned than JScript to ECMA (no surprise there), as Netscape is to XHTML (much to the annoyance of sloppy HTMLers). And the Micro$oft side of Java script (or JSP script) and JDBC is ASP + ADO (the latter of which is pretty cool technology - ADO 3.0). My dev team is just releasing the alpha for the huge ecommerce site we are doing for VoiceStream to our internal QA and we are getting nailed by Communicator 4.7 failures. IE 5.x and 6.0, and Netscape 6.2 (with minor annoyances) are doing fine, but what a PITA 4.7 is turning out to be! It appears to be choking on the Struts tags - that is, the HTML the tags render, which is not XHTML-compliant. This is a major problem! (Putting on flame-retardant...SPF 35k) Mark -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 10:38 PM Yes. Surely 'java script' is what goes in jsp scriptlets to be killed, uh.. executed on the server. And of course on the client, its only JavaScript if your using Nutscraper. IE calls it JScript, and the standards blessed name is ECMAScript. (Of course the variants arent identical between browsers and even browser versions but some of the basic stuff is pretty standard) -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 02:56 To: 'Struts Users Mailing List' Subject: RE: Button pressed That's a joke, right? This reminds me of a client I consulted last year who insisted on interactive graphing with Active X rather than Java applets because of security concerns. And it's JavaScript, not java script. -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:42 PM Thanks guys, but...as a company policy, we are not suppose to use java script. -Carlos. -Original Message- From: Bharat Nagwani [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:39 PM one more alternative create a hidden field and assign a value to it (edit or continue) using javascript and check that hidden field in request.getParameter... At 02:26 PM 6/3/2002 -0400, you wrote: Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Button pressed
Sorry for not getting back sooner, I've had laptop problems. I have done it 2 different ways. 1. Create a hidden text box in the form named 'action' for each submit button (this includes the html:cancel) use onclick=JavaScript:this.action.value='whatever' where 'whatever' is your 'save' or 'update' or 'cancel'... basically whatever you can check for in the action class these are typically Constant variables setup in a static Constants.java class 2. Create all your submit buttons with the name of 'action' if you do this, then you won't need to do the above script and struts will form.setAction() as the value of the button that was pressed. the only problem with this approach is if you have i18n values as the value on the button (which often the case) if so, then you have to find out which bundle is used for that users session and check accordingly (based on the message key that was used in the jsp) Anyway, sorry if this seems 'kludgy', I'm still catching up on mail from sunday and staring at 357 'unread' messages. (argh!!) Let me know if this helps, if not I can throw together a few samples for you. James Mitchell James Mitchell Software Engineer\Struts Evangelist -Original Message- From: Daniel J. D'Cotta [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 10:19 PM To: [EMAIL PROTECTED] Subject: RE: Button pressed James, Just to confirm, you mean you would use a hidden field in your form (named 'action'), and then use JavaScript to populate it when you submit? Regards, Daniel -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 5:21 AM To: Struts Users Mailing List Subject: Re: Button pressed I think (based on at least 3 similar threads) that the best approach is to have a field on your bean named 'action' and figure out later in the action class which was pushed (e.g. form.getAction()) If you have concerns about i18n, there is a work-around for that using the same technique. Search the archives for more James - Original Message - From: Galbreath, Mark [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, June 03, 2002 2:59 PM Subject: RE: Button pressed Another kludgey way around not using JavaScript would be to put the buttons in different forms. -Original Message- From: Christian Velez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:49 PM To: 'Struts Users Mailing List' Subject: RE: Button pressed This can be placed in URL. e.g. EditFormAction.do?action=Edit EditFormAction.do?action=Continue Test the request parameter value. Christian -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:27 PM To: Struts Subject: Button pressed Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Button pressed
set the property on JSP file: html:submit property=edit value=Edit/ on action class: if (request.getParameter(edit) != null ) { // means edit was pressed } -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:27 PM To: Struts Subject: Button pressed Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos.
RE: Button pressed
You could use the DispatchAction class. See http://jguru.com/faq/view.jsp?EID=897290. Of course, this is doing more than what you have asked for -- however I suspect (going by the button names) that that's what you want. Sri -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:27 PM To: Struts Subject: Button pressed Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos.
Re: Button pressed
one more alternative create a hidden field and assign a value to it (edit or continue) using javascript and check that hidden field in request.getParameter... At 02:26 PM 6/3/2002 -0400, you wrote: Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Button pressed
Thanks guys, but...as a company policy, we are not suppose to use java script. -Carlos. -Original Message- From: Bharat Nagwani [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:39 PM To: Struts Users Mailing List Subject: Re: Button pressed one more alternative create a hidden field and assign a value to it (edit or continue) using javascript and check that hidden field in request.getParameter... At 02:26 PM 6/3/2002 -0400, you wrote: Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Button pressed
This can be placed in URL. e.g. EditFormAction.do?action=Edit EditFormAction.do?action=Continue Test the request parameter value. Christian -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:27 PM To: Struts Subject: Button pressed Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos.
Re: Button pressed
Dont know if this will work Try using IMG SRC=URL instead of regular button with the URL having a different query string for edit and continue. eg ...?action=edit At 02:26 PM 6/3/2002 -0400, you wrote: Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Button pressed
That's a joke, right? This reminds me of a client I consulted last year who insisted on interactive graphing with Active X rather than Java applets because of security concerns. And it's JavaScript, not java script. -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:42 PM Thanks guys, but...as a company policy, we are not suppose to use java script. -Carlos. -Original Message- From: Bharat Nagwani [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:39 PM one more alternative create a hidden field and assign a value to it (edit or continue) using javascript and check that hidden field in request.getParameter... At 02:26 PM 6/3/2002 -0400, you wrote: Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Button pressed
Assign a name to the button object, then in your action class iterate through all the form attributes, the pressed button will show up with it's corresponding name and a suffix of .X or .Y, it's a tedious way to do it especially if you have a large number of form elements, I prefer using JavaScript myself. -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:42 PM To: Struts Users Mailing List Subject: RE: Button pressed Thanks guys, but...as a company policy, we are not suppose to use java script. -Carlos. -Original Message- From: Bharat Nagwani [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:39 PM To: Struts Users Mailing List Subject: Re: Button pressed one more alternative create a hidden field and assign a value to it (edit or continue) using javascript and check that hidden field in request.getParameter... At 02:26 PM 6/3/2002 -0400, you wrote: Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Button pressed
Another kludgey way around not using JavaScript would be to put the buttons in different forms. -Original Message- From: Christian Velez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:49 PM To: 'Struts Users Mailing List' Subject: RE: Button pressed This can be placed in URL. e.g. EditFormAction.do?action=Edit EditFormAction.do?action=Continue Test the request parameter value. Christian -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:27 PM To: Struts Subject: Button pressed Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Button pressed
I think (based on at least 3 similar threads) that the best approach is to have a field on your bean named 'action' and figure out later in the action class which was pushed (e.g. form.getAction()) If you have concerns about i18n, there is a work-around for that using the same technique. Search the archives for more James - Original Message - From: Galbreath, Mark [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, June 03, 2002 2:59 PM Subject: RE: Button pressed Another kludgey way around not using JavaScript would be to put the buttons in different forms. -Original Message- From: Christian Velez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:49 PM To: 'Struts Users Mailing List' Subject: RE: Button pressed This can be placed in URL. e.g. EditFormAction.do?action=Edit EditFormAction.do?action=Continue Test the request parameter value. Christian -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:27 PM To: Struts Subject: Button pressed Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Button pressed
'tis no joke, unfortunately. JavaScript is disallowed for any customer applications by company policy here as well (but okay for internal apps.). The argument is that JavaScript is not evenly supported amongst different browsers. Try the counter-argument that only certain features of JavaScript are not supported by certain browsers, that the use of those features can be avoided, and that those browers are in the extreme minority in terms of number of users, and see how far you can get in the black-and-white world of marketing. Just try it. I dare you. ;) peace, Joe Barefoot -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 11:56 AM To: 'Struts Users Mailing List' Subject: RE: Button pressed That's a joke, right? This reminds me of a client I consulted last year who insisted on interactive graphing with Active X rather than Java applets because of security concerns. And it's JavaScript, not java script. -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:42 PM Thanks guys, but...as a company policy, we are not suppose to use java script. -Carlos. -Original Message- From: Bharat Nagwani [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:39 PM one more alternative create a hidden field and assign a value to it (edit or continue) using javascript and check that hidden field in request.getParameter... At 02:26 PM 6/3/2002 -0400, you wrote: Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Button pressed
No argument here...Marketing has no clue, but controls the money. -Original Message- From: Joseph Barefoot [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 6:07 PM To: Struts Users Mailing List Subject: RE: Button pressed 'tis no joke, unfortunately. JavaScript is disallowed for any customer applications by company policy here as well (but okay for internal apps.). The argument is that JavaScript is not evenly supported amongst different browsers. Try the counter-argument that only certain features of JavaScript are not supported by certain browsers, that the use of those features can be avoided, and that those browers are in the extreme minority in terms of number of users, and see how far you can get in the black-and-white world of marketing. Just try it. I dare you. ;) peace, Joe Barefoot -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 11:56 AM To: 'Struts Users Mailing List' Subject: RE: Button pressed That's a joke, right? This reminds me of a client I consulted last year who insisted on interactive graphing with Active X rather than Java applets because of security concerns. And it's JavaScript, not java script. -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:42 PM Thanks guys, but...as a company policy, we are not suppose to use java script. -Carlos. -Original Message- From: Bharat Nagwani [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:39 PM one more alternative create a hidden field and assign a value to it (edit or continue) using javascript and check that hidden field in request.getParameter... At 02:26 PM 6/3/2002 -0400, you wrote: Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Button pressed
Yes. Surely 'java script' is what goes in jsp scriptlets to be killed, uh.. executed on the server. And of course on the client, its only JavaScript if your using Nutscraper. IE calls it JScript, and the standards blessed name is ECMAScript. (Of course the variants arent identical between browsers and even browser versions but some of the basic stuff is pretty standard) -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 02:56 To: 'Struts Users Mailing List' Subject: RE: Button pressed That's a joke, right? This reminds me of a client I consulted last year who insisted on interactive graphing with Active X rather than Java applets because of security concerns. And it's JavaScript, not java script. -Original Message- From: Carlos Fernandez [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:42 PM Thanks guys, but...as a company policy, we are not suppose to use java script. -Carlos. -Original Message- From: Bharat Nagwani [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 2:39 PM one more alternative create a hidden field and assign a value to it (edit or continue) using javascript and check that hidden field in request.getParameter... At 02:26 PM 6/3/2002 -0400, you wrote: Hi guys, I'd like to know if there is a way that I will know which button was pressed. I have two buttons in the JSP (Edit and Continue). In my action class I need to know which one of those was pressed. Thanks in advance. Carlos. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]