RE: html:submit

2001-03-14 Thread Kyle Robinson

In the onchange event of your select I would make it look like
onchange="javascript:submit();"

-Original Message-
From: Steve A Drake [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 14, 2001 12:18
To: [EMAIL PROTECTED]
Subject: html:submit


 I'm having a problem with the html:submit tag. The scenario is that I
have a number of select menus, each of which invokes form.submit() on the
onchange event, i.e.:




The problem is that the html:submit tag creates a Submit input type with
the name "submit". I think this name is conflicting with the 
form.submit() Javascript function. The html:submit tag :


  


creates an input type that looks like:



By hardwiring the input type (not using the html:submit tag) with a "name"
attribute other than "submit", the select menus properly invoke
form.submit(). Otherwise, the select menus generate the Javascript error:

Javascript Error: form.submit is not a function

Any advice is appreciated.





RE: html:submit

2001-03-14 Thread Steve A Drake

On Wed, 14 Mar 2001, Kyle Robinson wrote:

> In the onchange event of your select I would make it look like
> onchange="javascript:submit();"

 Thanks for the idea, but I tried that and still get the Javascript error.




Re: html:submit question

2002-12-03 Thread Gemes Tibor
2002. december 3. 16:30 dátummal Kevin HaleBoyes ezt írtad:

> The way it works now, I have to compare the value of the operation
> property of the form bean against the string that is displayed to
> the user.  That seems a bit fragile - suppose the customer wants the
> "Reject Loan" to be "Cancel Loan" instead.  I'd have to change code
> in my action to effect the change.

Use LookupDispatchAction then. 

Tib

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: html:submit question

2002-12-03 Thread Kevin HaleBoyes

--- Gemes Tibor <[EMAIL PROTECTED]> wrote:
> 2002. december 3. 16:30 dátummal Kevin HaleBoyes ezt írtad:
> 
> > The way it works now, I have to compare the value of the
> operation
> > property of the form bean against the string that is displayed to
> > the user.  That seems a bit fragile - suppose the customer wants
> the
> > "Reject Loan" to be "Cancel Loan" instead.  I'd have to change
> code
> > in my action to effect the change.
> 
> Use LookupDispatchAction then. 

Wonderful!  That is it exactly!
Thanks

> Tib

Kevin.


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: html:submit button

2002-02-21 Thread rob

You can setup a property in your form bean to receive the value of the
button and just pack the button value with the product id (since if I
understand correctly you have a button for every product entry)

ie. 
and 

in your action you can retrieve the property and compare it.

if (form.getButton().startsWith("view product list")) {
String value = form.getButton();
tokenize out the id with StringTokenizer or something.
   .. do the view product list stuff ...;
}
if (form.getButton().equals("do something else")) {
same as above just do the something else
}

If I understand correctly the above is one solution although I might suggest
using a radio button(s) for product selection and then only one pair of
buttons.


- Original Message -
From: "Konstantina Stamopoulou" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 21, 2002 9:02 PM
Subject: html:submit button


Hello,
I have a problem and I can't fingure out the solution to it. Here is my
case:

I have a list of products (PoductBean) on my .jsp and each one of it have
two buttons (html:submit)  :

Button1 --> Display Information for this product
Button2 --> Use the information to do something else

My question is: How can I decide which product has been selected so as to
display its information on my next page?
>From what I have seen the html:submit tag does not contain any attributes to
pass request parameters.

Thank U in advance,
Konstantina








--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: html:submit button

2002-02-21 Thread Konstantina Stamopoulou

Hi  Rob,

I tried this solution but the thing is that the "value" is set as the label
of the button. Isn't there a more elegant way to do this? As far as the
radio buttons concerned, my submit buttons do not apply only to the name of
product but to some other configuration parameters too. So I have 10 lines
of config parameters and two buttons under these.

Thank you for your instant reply,
Konstantina

- Original Message -
From: "rob" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 21, 2002 12:32 PM
Subject: Re: html:submit button


> You can setup a property in your form bean to receive the value of the
> button and just pack the button value with the product id (since if I
> understand correctly you have a button for every product entry)
>
> ie. 
> and 
>
> in your action you can retrieve the property and compare it.
>
> if (form.getButton().startsWith("view product list")) {
> String value = form.getButton();
> tokenize out the id with StringTokenizer or something.
>.. do the view product list stuff ...;
> }
> if (form.getButton().equals("do something else")) {
> same as above just do the something else
> }
>
> If I understand correctly the above is one solution although I might
suggest
> using a radio button(s) for product selection and then only one pair of
> buttons.
>
>
> - Original Message -
> From: "Konstantina Stamopoulou" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, February 21, 2002 9:02 PM
> Subject: html:submit button
>
>
> Hello,
> I have a problem and I can't fingure out the solution to it. Here is my
> case:
>
> I have a list of products (PoductBean) on my .jsp and each one of it have
> two buttons (html:submit)  :
>
> Button1 --> Display Information for this product
> Button2 --> Use the information to do something else
>
> My question is: How can I decide which product has been selected so as to
> display its information on my next page?
> From what I have seen the html:submit tag does not contain any attributes
to
> pass request parameters.
>
> Thank U in advance,
> Konstantina
>
>
>
>
>
>
>
>
> --
> 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: html:submit button

2002-02-21 Thread SUPRIYA MISRA

On your jsp




On Action Page
String button1=request.getParameter("X");
String button1=request.getParameter("Y");

if(button1 != null){
//X was clicked
//do whatever like forward to another actionpage
}
else if(button2 != null){
//Y was clicked
//do whatever like forward to another actionpage
}

else
{
//neither was clicked
}
>From: "Konstantina Stamopoulou" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>,   "rob" 
><[EMAIL PROTECTED]>
>Subject: Re: html:submit button
>Date: Thu, 21 Feb 2002 13:23:27 +0200
>
>Hi  Rob,
>
>I tried this solution but the thing is that the "value" is set as the label
>of the button. Isn't there a more elegant way to do this? As far as the
>radio buttons concerned, my submit buttons do not apply only to the name of
>product but to some other configuration parameters too. So I have 10 lines
>of config parameters and two buttons under these.
>
>Thank you for your instant reply,
>Konstantina
>
>- Original Message -
>From: "rob" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Sent: Thursday, February 21, 2002 12:32 PM
>Subject: Re: html:submit button
>
>
> > You can setup a property in your form bean to receive the value of the
> > button and just pack the button value with the product id (since if I
> > understand correctly you have a button for every product entry)
> >
> > ie. 
> > and 
> >
> > in your action you can retrieve the property and compare it.
> >
> > if (form.getButton().startsWith("view product list")) {
> > String value = form.getButton();
> > tokenize out the id with StringTokenizer or something.
> >.. do the view product list stuff ...;
> > }
> > if (form.getButton().equals("do something else")) {
> > same as above just do the something else
> > }
> >
> > If I understand correctly the above is one solution although I might
>suggest
> > using a radio button(s) for product selection and then only one pair of
> > buttons.
> >
> >
> > - Original Message -
> > From: "Konstantina Stamopoulou" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Thursday, February 21, 2002 9:02 PM
> > Subject: html:submit button
> >
> >
> > Hello,
> > I have a problem and I can't fingure out the solution to it. Here is my
> > case:
> >
> > I have a list of products (PoductBean) on my .jsp and each one of it 
>have
> > two buttons (html:submit)  :
> >
> > Button1 --> Display Information for this product
> > Button2 --> Use the information to do something else
> >
> > My question is: How can I decide which product has been selected so as 
>to
> > display its information on my next page?
> > From what I have seen the html:submit tag does not contain any 
>attributes
>to
> > pass request parameters.
> >
> > Thank U in advance,
> > Konstantina
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > 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]>
>




_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: html:submit button

2002-02-21 Thread Mattos, John

Hi Konstantina,

I don;t know if you have a solution yet, but I have two separate ones for
you. The first is more struts oriented. If you have the following in your
JSP:














//you need to create 3 attributes in your "ActionForm" object that's being
populated when this form gets submitted, called 
// with associated getters and setters...
boolean btnProcess, btnViewOrg, btnViewProd;

// then in the Action.perform(), simply look at the variables to see which
one is true
boolean isProcess=false, isViewProd=false, isViewOrg=false;

// Get and cast a reference to the ActionForm object for use
MyActionForm theForm=(MyActionForm)form;
   
// What button was pushed
String process =
(theForm.getBtnProcess().equals(null)?"":theForm.getBtnProcess());
String viewOrg =
(theForm.getBtnViewOrg().equals(null)?"":theForm.getBtnViewOrg());
String viewProd =
(theForm.getBtnViewProd().equals(null)?"":theForm.getBtnViewProd());

The following code will also work

// Getting what button was pressed looping through parameters 
String button_pressed = null;
Enumeration e = request.getParameterNames();
while (e.hasMoreElements()) {
String param = (String) e.nextElement();
if (param.startsWith("btn")) {
button_pressed = param;
break;
}
}
System.out.println("button_pressed="+button_pressed);

John Mattos
Sr. Developer and Architect
iNDEMAND
345 Hudson St. 16th Floor
New York, New York
10014

-Original Message-
From: Konstantina Stamopoulou [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 5:02 AM
To: Struts Users Mailing List
Subject: html:submit button


Hello,
I have a problem and I can't fingure out the solution to it. Here is my
case:

I have a list of products (PoductBean) on my .jsp and each one of it have
two buttons (html:submit)  :

Button1 --> Display Information for this product
Button2 --> Use the information to do something else

My question is: How can I decide which product has been selected so as to
display its information on my next page? 
>From what I have seen the html:submit tag does not contain any attributes to
pass request parameters.

Thank U in advance,
Konstantina






--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: html:submit button

2002-02-21 Thread stak

Hi John,
I was suggested to use the tag  where I can store any
information I want without this to be visible to the user and it works. I
really appreciate the detail of your answer.

Have a nice day,
Konstantina

- Original Message -
From: "Mattos, John" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, February 21, 2002 3:56 PM
Subject: RE: html:submit button


> Hi Konstantina,
>
> I don;t know if you have a solution yet, but I have two separate ones for
> you. The first is more struts oriented. If you have the following in your
> JSP:
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> file://you need to create 3 attributes in your "ActionForm" object that's
being
> populated when this form gets submitted, called
> // with associated getters and setters...
> boolean btnProcess, btnViewOrg, btnViewProd;
>
> // then in the Action.perform(), simply look at the variables to see which
> one is true
> boolean isProcess=false, isViewProd=false, isViewOrg=false;
>
> // Get and cast a reference to the ActionForm object for use
> MyActionForm theForm=(MyActionForm)form;
>
> // What button was pushed
> String process =
> (theForm.getBtnProcess().equals(null)?"":theForm.getBtnProcess());
> String viewOrg =
> (theForm.getBtnViewOrg().equals(null)?"":theForm.getBtnViewOrg());
> String viewProd =
> (theForm.getBtnViewProd().equals(null)?"":theForm.getBtnViewProd());
>
> The following code will also work
>
> // Getting what button was pressed looping through parameters
> String button_pressed = null;
> Enumeration e = request.getParameterNames();
> while (e.hasMoreElements()) {
> String param = (String) e.nextElement();
> if (param.startsWith("btn")) {
> button_pressed = param;
> break;
> }
> }
> System.out.println("button_pressed="+button_pressed);
>
> John Mattos
> Sr. Developer and Architect
> iNDEMAND
> 345 Hudson St. 16th Floor
> New York, New York
> 10014
>
> -Original Message-
> From: Konstantina Stamopoulou [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 21, 2002 5:02 AM
> To: Struts Users Mailing List
> Subject: html:submit button
>
>
> Hello,
> I have a problem and I can't fingure out the solution to it. Here is my
> case:
>
> I have a list of products (PoductBean) on my .jsp and each one of it have
> two buttons (html:submit)  :
>
> Button1 --> Display Information for this product
> Button2 --> Use the information to do something else
>
> My question is: How can I decide which product has been selected so as to
> display its information on my next page?
> From what I have seen the html:submit tag does not contain any attributes
to
> pass request parameters.
>
> Thank U in advance,
> Konstantina
>
>
>
>
>
>
> --
> 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: html:submit button

2002-02-21 Thread Christian Velez

Hi Konstantina,

The html:submit is used to pass the parameters of the html:form it applies
to. Whatever properties you
include in your form, they are included in the request parameter.

Here is an example:




   -- Select --
   RequiredParent
   RequiredChild


 



Christian/>



-Original Message-
From: Konstantina Stamopoulou [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 5:02 AM
To: Struts Users Mailing List
Subject: html:submit button


Hello,
I have a problem and I can't fingure out the solution to it. Here is my
case:

I have a list of products (PoductBean) on my .jsp and each one of it have
two buttons (html:submit)  :

Button1 --> Display Information for this product
Button2 --> Use the information to do something else

My question is: How can I decide which product has been selected so as to
display its information on my next page? 
>From what I have seen the html:submit tag does not contain any attributes to
pass request parameters.

Thank U in advance,
Konstantina








RE: html:submit button

2002-02-21 Thread Maturo, Larry

Hi Konstantina,

Since you haven't supplied enough details, I'll assume that
you have a table, and each row contains info on one product,
plus two buttons, one for displaying info and one for do
something with the product.

In this case you then make each button look like an array, in 
your form bean, declare something like:

private int editIndex = -1;
private int infoIndex = -1;
private String editString = "";
private String infoString = "";

public String getEditString(int index) {
return editString;
}

public final void setEditString(int index, String editString){
this.editString = editString;
this.editIndex = index;
}

   public int getEditIndex () {
return editIndex;
   }

public String getInfoString(int index) {
return infoString;
}

   public final void setInfoString(int index, String infoString){
this.infoString = infoString;
this.infoIndex = index;
   }

   public int getInfoIndex() {
   return infoIndex;
   }

In your jsp, inside your iterate, you woud use:

 
 

When submitted you can use getInfoString and getEditString
to see which button was pressed (the pressed button will have
a value other than "") and then use the appropriate get index
to see which item was selected.

-- Larry Maturo
   [EMAIL PROTECTED]


-Original Message-
From: Konstantina Stamopoulou [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 4:02 AM
To: Struts Users Mailing List
Subject: html:submit button


Hello,
I have a problem and I can't fingure out the solution to it. Here is my
case:

I have a list of products (PoductBean) on my .jsp and each one of it have
two buttons (html:submit)  :

Button1 --> Display Information for this product
Button2 --> Use the information to do something else

My question is: How can I decide which product has been selected so as to
display its information on my next page? 
>From what I have seen the html:submit tag does not contain any attributes to
pass request parameters.

Thank U in advance,
Konstantina






--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: html:submit button

2002-02-21 Thread Konstantina Stamopoulou

Thank U for your reply and for the code details!
I used this approach to see which button was pressed and the 
tag  to pass the product id.

Thank U all for your help!
Konstantina

- Original Message -
From: "Maturo, Larry" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, February 21, 2002 5:30 PM
Subject: RE: html:submit button


> Hi Konstantina,
>
> Since you haven't supplied enough details, I'll assume that
> you have a table, and each row contains info on one product,
> plus two buttons, one for displaying info and one for do
> something with the product.
>
> In this case you then make each button look like an array, in
> your form bean, declare something like:
>
> private int editIndex = -1;
> private int infoIndex = -1;
> private String editString = "";
> private String infoString = "";
>
> public String getEditString(int index) {
> return editString;
> }
>
> public final void setEditString(int index, String editString){
> this.editString = editString;
> this.editIndex = index;
> }
>
>public int getEditIndex () {
> return editIndex;
>}
>
> public String getInfoString(int index) {
> return infoString;
> }
>
>public final void setInfoString(int index, String infoString){
> this.infoString = infoString;
> this.infoIndex = index;
>}
>
>public int getInfoIndex() {
>return infoIndex;
>}
>
> In your jsp, inside your iterate, you woud use:
>
> 
> 
>
> When submitted you can use getInfoString and getEditString
> to see which button was pressed (the pressed button will have
> a value other than "") and then use the appropriate get index
> to see which item was selected.
>
> -- Larry Maturo
>[EMAIL PROTECTED]
>
>
> -Original Message-
> From: Konstantina Stamopoulou [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 21, 2002 4:02 AM
> To: Struts Users Mailing List
> Subject: html:submit button
>
>
> Hello,
> I have a problem and I can't fingure out the solution to it. Here is my
> case:
>
> I have a list of products (PoductBean) on my .jsp and each one of it have
> two buttons (html:submit)  :
>
> Button1 --> Display Information for this product
> Button2 --> Use the information to do something else
>
> My question is: How can I decide which product has been selected so as to
> display its information on my next page?
> From what I have seen the html:submit tag does not contain any attributes
to
> pass request parameters.
>
> Thank U in advance,
> Konstantina
>
>
>
>
>
>
> --
> 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: html:submit tag question

2001-04-05 Thread Troy Hart

There is no support for this. I originally had a problem with this fact, but
when you think about it in terms of the fact that the action servlet is
using reflection to set properties automatically on your form beans, the
need to define your parameters names in a constants interface sorta goes
away. In reality it would be more problematic in this case to have to keep
your constants interface in sync with the properties of your form beans...if
that makes sense. The javadoc of your form beans give the person writing the
html the names of the properties automatically...

Troy


-Original Message-
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 2:08 PM
To: '[EMAIL PROTECTED]'
Subject: html:submit tag question




Hi all,

  Is it possible to convert the below HTML into a struts tag ? Thanks
for your information.

" >


  p.s All names are declared in a Constants file so that they can be
accessed in a uniform way across the application.


cheers,
Amar..



Re: html:submit tag question

2001-04-05 Thread Jim Crossley

I *think* this is the struts equivalent:


  


You may be able to get by without the property attribute, though.

"Nanduri, Amarnath" wrote:
> 
> Hi all,
> 
>   Is it possible to convert the below HTML into a struts tag ? Thanks
> for your information.
> 
> " >
> 
>   p.s All names are declared in a Constants file so that they can be
> accessed in a uniform way across the application.
> 
> cheers,
> Amar..



RE: html:submit tag question

2001-04-06 Thread Nanduri, Amarnath

thanks

-Original Message-
From: Jim Crossley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 4:18 PM
To: [EMAIL PROTECTED]
Subject: Re: html:submit tag question


I *think* this is the struts equivalent:


  


You may be able to get by without the property attribute, though.

"Nanduri, Amarnath" wrote:
> 
> Hi all,
> 
>   Is it possible to convert the below HTML into a struts tag ? Thanks
> for your information.
> 
> " >
> 
>   p.s All names are declared in a Constants file so that they can be
> accessed in a uniform way across the application.
> 
> cheers,
> Amar..



RE: html:submit and 2 buttons

2003-11-06 Thread Arik Levin ( Tikal )

You can just use JavaScript passing some parameters

You can also try this approach:
http://husted.com/struts/tips/003.html


-Original Message-
From: Frers Michael [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 05, 2003 6:54 PM
To: Struts Users Mailing List
Subject: html:submit and 2 buttons

Hello

just a little question about the taglib

i want to have one form with 2 buttons in it


one button should do "new"
the other "update"

how can i make my action class know which button was hit?

additionally i want that the buttons get there labels from a property file
that works as shown below but how can i now make my action class know which
button is hit?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: html:submit and 2 buttons

2003-11-06 Thread Philip Mark Donaghy
Your action can read the value attribute of your
submit tag. This is the label in your case.



Use the request.getParameter to find out which button
was clicked. Give each of your submit buttons a
different NAME. request.getParameter(NAME) will return
the label of the submit button clicked or null.

Phil

--- "Arik  Levin ( Tikal )"
<[EMAIL PROTECTED]> wrote:
> 
> You can just use JavaScript passing some parameters
> 
> You can also try this approach:
> http://husted.com/struts/tips/003.html
> 
> 
> -Original Message-
> From: Frers Michael [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, November 05, 2003 6:54 PM
> To: Struts Users Mailing List
> Subject: html:submit and 2 buttons
> 
> Hello
> 
> just a little question about the taglib
> 
> i want to have one form with 2 buttons in it
> 
> 
> one button should do "new"
> the other "update"
> 
> how can i make my action class know which button was
> hit?
> 
> additionally i want that the buttons get there
> labels from a property file
> that works as shown below but how can i now make my
> action class know which
> button is hit?
>  key="search.new"/>
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


=
Java Web Application Architect
mapimage.com - Java and GIS
struts1.1:tomcat4.1.27:linuxRH8

__
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: html:submit and 2 buttons

2003-11-06 Thread Greg Hess
I have often added form properties to represent flags for the different
button actions to process. My ActionForm would have two properties
"update" and "new":

setUpdate(boolean flag){}

boolean isUpdate()

For the submit buttons:



If I have to use an image for the submit button I generally will have a
hidden flag form field that I populate in the JavaScript onclick event
handler.

HTH,

Greg

> -Original Message-
> From: Philip Mark Donaghy [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 06, 2003 6:23 AM
> To: Struts Users Mailing List
> Subject: RE: html:submit and 2 buttons
> 
> Your action can read the value attribute of your
> submit tag. This is the label in your case.
> 
> 
> 
> Use the request.getParameter to find out which button
> was clicked. Give each of your submit buttons a
> different NAME. request.getParameter(NAME) will return
> the label of the submit button clicked or null.
> 
> Phil
> 
> --- "Arik  Levin ( Tikal )"
> <[EMAIL PROTECTED]> wrote:
> >
> > You can just use JavaScript passing some parameters
> >
> > You can also try this approach:
> > http://husted.com/struts/tips/003.html
> >
> >
> > -Original Message-
> > From: Frers Michael [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, November 05, 2003 6:54 PM
> > To: Struts Users Mailing List
> > Subject: html:submit and 2 buttons
> >
> > Hello
> >
> > just a little question about the taglib
> >
> > i want to have one form with 2 buttons in it
> >
> >
> > one button should do "new"
> > the other "update"
> >
> > how can i make my action class know which button was
> > hit?
> >
> > additionally i want that the buttons get there
> > labels from a property file
> > that works as shown below but how can i now make my
> > action class know which
> > button is hit?
> >  > key="search.new"/>
> >
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> 
> 
> =
> Java Web Application Architect
> mapimage.com - Java and GIS
> struts1.1:tomcat4.1.27:linuxRH8
> 
> __
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: html:submit with an onclick

2002-10-16 Thread Karr, David

Response at end.

> -Original Message-
> From: Wendy Smoak [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 16, 2002 10:39 AM
> To: 'Struts Users Mailing List'
> Subject: html:submit with an onclick
> 
> I need to set two form properties when a button is clicked.  
> The following
> works with just the setAction() call, but if I add the 
> setKeyToDelete(), it
> doesn't.  I don't know much about Javascript, though, so I 
> may have this all
> wrong.
> 
> The docs have [RTExpr] with the onclick attribute, so I was 
> hoping it would
> evaluate before calling the function.  But it doesn't even 
> compile as is.
> (Then again, I'm looking at the nightly build docs, but using 
> 1.1.  Has the
> RTExpr functionality been added recently?)
> 
>onclick="setAction('Delete Staff');
> setKeyToDelete('');"
>styleClass="deleteButton" titleKey="button.delete.staff" 
>value=" "/>

You can't nest tags in tag attributes.  You also can't nest quoted strings
with the same quote type.

In my view, you have two alternatives:

Ensure the "staffMember" is a scripting variable, and make the entire
"onclick" value be an rtexprvalue, concatenating the values you need (it has
to be the entire attribute value, not just a portion of it).

And the somewhat more radical position: Use the Struts-EL library.  Then,
this would look like this:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: html:submit with an onclick

2002-10-16 Thread Wendy Smoak

David wrote:
> And the somewhat more radical position: Use the Struts-EL library.  Then,
> this would look like this:
>  onclick="setAction('Delete
> Staff');setKeyToDelete('${staffMember}');"
> styleClass="deleteButton" titleKey="button.delete.staff"
> value=" "/>

This has to be the first time in my life I've done anything "radical". ;)
However, in for a penny, in for a pound... I've got the nightly build from
the 16th.  With some copying of .jar and .tld files, adding a <%@ taglib>
for the html-el tags and a copy-paste of what you suggested above... IT
WORKS!

Thanks, David, and everyone who's been holding my hand these past couple of
weeks.  This webapp is SO close to actually working, and that's exciting!  I
don't know if any of you is also the sole Java programmer in a
company/department as I am.  There's no one here to ask questions of, (or
celebrate with!) so I rely heavily on the -users lists for the various
things I'm using.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management




Re: html:submit problem need help

2002-09-03 Thread Dan Walker

I think this link:

http://husted.com/struts/tips/002.htm

addresses that issue.
-Dan

On Tuesday 03 September 2002 11:53, you wrote:
> Hi,
>
> I have 2 buttons on my jsp and i want to find out which button is pressed
> in my Action class, but i m not getting the submit parameter in request, my
> code is as below
>
> I am 2 buttons on my jsp as below
>
> 
>
> Login
>
> signout
>
> 
>
> my struts-config.xml is as below
>
>  type="org.apache.struts.validator.DynaValidatorForm">
>
> 
>
> 
>
>  input="/pages/test.jsp" name="test" >
>
> 
>
> 
>
> 
>
> and my Action class is
>
> Enumeration enm = request.getParameterNames();
> while(enm.hasMoreElements())
> {
>   System.out.println("paramters are " + enm.nextElement());
> }
> String submitVal = request.getParameter("submit");
> System.out.println("value of submit " + submitVal);
>
> if("Login".equals(submitVal))
> {
> return mapping.findForward("login");
> }
> else if("Signout".equals(submitVal))
> {
> return mapping.findForward("signout");
> }
> else
> {
> return mapping.findForward("login");
> }
>
> when i print the value of submitVal , it is null
>
> Ashish
>
>
>
>
> A$HI$H
>
>
> -
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: html:submit problem need help

2002-09-04 Thread Aamir Majeed

I think ur code will work if u just write different value of ur sumit button
means


 

and take value of parameter from request within ur Action class
means
if ("login".equalsIgnoreCase(request.getParameter("submit"))){
// login code
}
else if ("signout".equalsIgnoreCase(request.getParameter("submit"))){
//submit code
}
 Regards
Aamir
- Original Message -
From: "Dan Walker" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, September 03, 2002 10:01 PM
Subject: Re: html:submit problem need help


> I think this link:
>
> http://husted.com/struts/tips/002.htm
>
> addresses that issue.
> -Dan
>
> On Tuesday 03 September 2002 11:53, you wrote:
> > Hi,
> >
> > I have 2 buttons on my jsp and i want to find out which button is
pressed
> > in my Action class, but i m not getting the submit parameter in request,
my
> > code is as below
> >
> > I am 2 buttons on my jsp as below
> >
> > 
> >
> > Login
> >
> > signout
> >
> > 
> >
> > my struts-config.xml is as below
> >
> >  > type="org.apache.struts.validator.DynaValidatorForm">
> >
> > 
> >
> > 
> >
> >  > input="/pages/test.jsp" name="test" >
> >
> > 
> >
> > 
> >
> > 
> >
> > and my Action class is
> >
> > Enumeration enm = request.getParameterNames();
> > while(enm.hasMoreElements())
> > {
> >   System.out.println("paramters are " + enm.nextElement());
> > }
> > String submitVal = request.getParameter("submit");
> > System.out.println("value of submit " + submitVal);
> >
> > if("Login".equals(submitVal))
> > {
> > return mapping.findForward("login");
> > }
> > else if("Signout".equals(submitVal))
> > {
> > return mapping.findForward("signout");
> > }
> > else
> > {
> > return mapping.findForward("login");
> > }
> >
> > when i print the value of submitVal , it is null
> >
> > Ashish
> >
> >
> >
> >
> > A$HI$H
> >
> >
> > -
> > Do You Yahoo!?
> > Yahoo! Finance - Get real-time stock quotes
>
> --
> 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: html:submit and Image instead of button

2002-09-03 Thread Ravi Kora

Have a javascript function in the href tag like below.



 

The javascript function submitAct will have sth like below
function submitAct(index){
  if (index==0)  {...}
  document.forms[0].submit();
}   

Hope this helps. Bye
-Ravi







Thanks & Regards,
Ravi Kora
[EMAIL PROTECTED]
337-739-3434(M) 

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 03, 2002 11:50 AM
To: Struts Users Mailing List
Subject: html:submit and Image instead of button



Hi,

I have 4 buttons on an jsp page, but what if i have to use image instead
of buttons,

like Add

will have a button with Add Text, and then in my Action class i can find
out which button has been pressed, 

but what if i have to use Image instead of a button, like how can i find
out which image was clicked if i have 4 images on a jsp with
value="sumbit"





the above  are 2 tags with same one 

so how will i come to know which image was clicked, what is the best way
to do it

Ashish


A$HI$H


-
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: html:submit and Image instead of button

2002-09-03 Thread Ashish Kulkarni


hi 
But cant i do it in my action class instead in javascript,??
 
 Ravi Kora wrote:Have a javascript function in the href tag like below.





The javascript function submitAct will have sth like below
function submitAct(index){
if (index==0) {...}
document.forms[0].submit();
} 

Hope this helps. Bye
-Ravi







Thanks & Regards,
Ravi Kora
[EMAIL PROTECTED]
337-739-3434(M) 

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 03, 2002 11:50 AM
To: Struts Users Mailing List
Subject: html:submit and Image instead of button



Hi,

I have 4 buttons on an jsp page, but what if i have to use image instead
of buttons,

like Add

will have a button with Add Text, and then in my Action class i can find
out which button has been pressed, 

but what if i have to use Image instead of a button, like how can i find
out which image was clicked if i have 4 images on a jsp with
value="sumbit"

 [input] src="images/en/buttons/login_off.gif" width="75" height="24"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('login','','images/buttons/login_on.gif',1)" >

 [input] src="images/en/buttons/signoff_off.gif" width="75" height="24"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('signoff','','images/buttons/signoff_on.gif',1
)" >

the above are 2 tags with same one action="/pages/selectenv">

so how will i come to know which image was clicked, what is the best way
to do it

Ashish


A$HI$H


-
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes


--
To unsubscribe, e-mail: 
For additional commands, e-mail: 


A$HI$H


-
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes


RE: html:submit and Image instead of button

2002-09-03 Thread Ravi Kora

Have a property for that bean say
Private Sting act;
and in the jsp have a corresponding hidden tag like


In the javascript function set the act to whatever you want depending on
the index like
function submitAct(index){ 
if (index==0) { document.form.act.value="act1"; 
} 
document.forms[0].submit(); 
} 

Finally, in the Action class get the value of the property act for the
form. Hope this helps!
-R


Thanks & Regards,
Ravi Kora
[EMAIL PROTECTED]
337-739-3434(M) 

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 03, 2002 12:21 PM
To: Struts Users Mailing List
Subject: RE: html:submit and Image instead of button



hi 
But cant i do it in my action class instead in javascript,??
 
 Ravi Kora wrote:Have a javascript function in the href tag like below.





The javascript function submitAct will have sth like below function
submitAct(index){ if (index==0) {...} document.forms[0].submit(); } 

Hope this helps. Bye
-Ravi







Thanks & Regards,
Ravi Kora
[EMAIL PROTECTED]
337-739-3434(M) 

-Original Message-
From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, September 03, 2002 11:50 AM
To: Struts Users Mailing List
Subject: html:submit and Image instead of button



Hi,

I have 4 buttons on an jsp page, but what if i have to use image instead
of buttons,

like Add

will have a button with Add Text, and then in my Action class i can find
out which button has been pressed, 

but what if i have to use Image instead of a button, like how can i find
out which image was clicked if i have 4 images on a jsp with
value="sumbit"

 [input] src="images/en/buttons/login_off.gif" width="75" height="24"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('login','','images/buttons/login_on.gif',1)" >

 [input] src="images/en/buttons/signoff_off.gif" width="75" height="24"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('signoff','','images/buttons/signoff_on.gif',1
)" >

the above are 2 tags with same one action="/pages/selectenv">

so how will i come to know which image was clicked, what is the best way
to do it

Ashish


A$HI$H


-
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes


--
To unsubscribe, e-mail: 
For additional commands, e-mail: 


A$HI$H


-
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: html:submit and Image instead of button

2002-09-03 Thread Ted Husted

One trick is to get the ActionForm to do the work:

http://husted.com/struts/tips/001.html

-Ted.

Ashish Kulkarni wrote:

> hi 
> But cant i do it in my action class instead in javascript,??
>  
>  Ravi Kora wrote:Have a javascript function in the href tag like below.
> 
> 
> The javascript function submitAct will have sth like below
> function submitAct(index){
> if (index==0) {...}
> document.forms[0].submit();
> } 
> 
> Hope this helps. Bye
> -Ravi
> 
> 
> 
> Thanks & Regards,
> Ravi Kora
> [EMAIL PROTECTED]
> 337-739-3434(M) 
> 
> -Original Message-
> From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, September 03, 2002 11:50 AM
> To: Struts Users Mailing List
> Subject: html:submit and Image instead of button
> 
> 
> 
> Hi,
> 
> I have 4 buttons on an jsp page, but what if i have to use image instead
> of buttons,
> 
> like Add
> 
> will have a button with Add Text, and then in my Action class i can find
> out which button has been pressed, 
> 
> but what if i have to use Image instead of a button, like how can i find
> out which image was clicked if i have 4 images on a jsp with
> value="sumbit"
> 
>  [input] src="images/en/buttons/login_off.gif" width="75" height="24"
> onMouseOut="MM_swapImgRestore()"
> onMouseOver="MM_swapImage('login','','images/buttons/login_on.gif',1)" >
> 
>  [input] src="images/en/buttons/signoff_off.gif" width="75" height="24"
> onMouseOut="MM_swapImgRestore()"
> onMouseOver="MM_swapImage('signoff','','images/buttons/signoff_on.gif',1
> )" >
> 
> the above are 2 tags with same one action="/pages/selectenv">
> 
> so how will i come to know which image was clicked, what is the best way
> to do it
> 
> Ashish
> 
> 
> A$HI$H
> 
> 
> -
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> 
> 
> --
> To unsubscribe, e-mail: 
> For additional commands, e-mail: 
> 
> 
> A$HI$H
> 
> 
> -
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> 


-- 
Ted Husted, Husted dot Com, Fairport NY US
co-author, Java Web Development with Struts
Order it today:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: html:submit and html:button componant : value and text label

2003-11-24 Thread Paul McCulloch
This is an html issue, rather than a struts one. 

Read up on how  works for an in depth explanation.

Struts provides the LookupDispatchAction which is designed to deal with this
issue.

Paul

> -Original Message-
> From: Eric BELLARD [mailto:[EMAIL PROTECTED]
> Sent: 24 November 2003 11:21
> To: [EMAIL PROTECTED]
> Subject: html:submit and html:button componant : value and text label
> 
> 
> hi,
> 
> i'm dispatch action addicted developper and I go a
> recurent problem with html:button and html:submit
> componant.
> 
> With these componants it's impossible to separate
> their label and their submitted value.
> 
> I managed with some javascript like this to invoke the
> dispatch method i want :
> 
> // submit form
> function submitForm(form, parameter) {
>   
>   form.action = form.action + "?" + parameter;
>   form.submit();
> 
> }
> 
> // valid and submit a form
> function validAndSubmitForm(form, parameter) {
> 
>   if (window.confirm('Are tou sure you want to delete
> the selected samples?')) {
>   submitForm(form, parameter);
>   }
> }
> 
> So my question is why can't we separate the label and
> sumitted value of buttons in struts?
> 
> Sorry if it's a "déjà vu".
> 
> 
> 
> =
> Eric BELLARD
> [EMAIL PROTECTED]
> mobile: 0614952791
> 
> __
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: html:submit value not found in request, version 1.02 beta

2002-11-20 Thread Karr, David
I would guess it can't find the "button.view" property in your properties file.  If 
that was nonexistent, the value would be null.

(Note that there is no "1.02 beta" version.  There's versions 1.02 and 1.1b2 (and the 
nightly).)

> -Original Message-
> From: Linnea Ahlbeck [mailto:[EMAIL PROTECTED]]
> 
> Hi!
> 
> On my jsp pages I have the following code:
> 
> 
>
>   
> 
> 
> 
> (On my jsp page I only have one html:form tag)
> 
> In my SaveAction class I collect the submit value from the 
> request, like
> this:
> 
> String submit = request.getParameter("submit");
> 
> The submit value is null.
> 
> I'm using the Struts 1.02 beta version. Have anybody 
> experienced the same
> problem??

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: html:submit value not found in request, found a solution

2002-11-20 Thread Linnea Ahlbeck
Hi David!

Thanks for your tip. The "button.view" property in your properties file has
been found all the time but I'm not used to add the property attribute to
the html:submit tag. When I did that the request parameter was found (and
probably created to begin with) and therby able to reach from my action
class.

My solution:


   
  
   


Sorry for the version mix up, I'm using the  1.1b2 version.

Thanks again!

/Linnéa

-Original Message-
From: Karr, David [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 20, 2002 6:41 PM
To: Struts Users Mailing List
Subject: RE: html:submit value not found in request, version 1.02 beta


I would guess it can't find the "button.view" property in your properties
file.  If that was nonexistent, the value would be null.

(Note that there is no "1.02 beta" version.  There's versions 1.02 and 1.1b2
(and the nightly).)

> -Original Message-
> From: Linnea Ahlbeck [mailto:[EMAIL PROTECTED]]
>
> Hi!
>
> On my jsp pages I have the following code:
>
> 
>
>   
> 
> 
>
> (On my jsp page I only have one html:form tag)
>
> In my SaveAction class I collect the submit value from the
> request, like
> this:
>
> String submit = request.getParameter("submit");
>
> The submit value is null.
>
> I'm using the Struts 1.02 beta version. Have anybody
> experienced the same
> problem??

--
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]>