File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes passing parameters with LookupDispatchAction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "passing parameters with LookupDispatchAction" Watch "passing parameters with LookupDispatchAction" New topic
Author

passing parameters with LookupDispatchAction

Ben Hagadorn
Greenhorn

Joined: Mar 28, 2006
Posts: 25
I need to know if there is a way to pass a dynamic parameter from a JSP page to a LookupDispatchAction without using JavaScript. Here is what I'm doing:

I have a JSP page with editable fields; say customer info for example: name, phone, etc. I also have a list of associated orders at the bottom of the screen. I�d like to be able to click on one of these orders and do the following:

1)Save the data on the form (so I need to use a SUBMIT and not just a LINK)
2)Forward the user to another screen based upon the ID of the order they just selected.

One of the constraints that I have is that I cannot use JavaScript because it�s possible that an end-user would have it disabled. This means I can�t add any code in the onClick event for the �order� link that would set a hidden field on the form before submitting it.

Is there a way to do this?

Thanks for the help!
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Can you even submit the form from a link without using JavaScript? It seems like you would have to have a bunch of submit buttons on the page, which would probably look pretty ugly.

The "no JavaScript" rule sounds nice in theory, but it is almost impossible to write a decent web based application without using JavaScript.

- Brent
Ben Hagadorn
Greenhorn

Joined: Mar 28, 2006
Posts: 25
Brent,

I created a class in my CSS file that looks like a regular link, not a button. I then use that class when I create the page and the "links" look fine:

.NinePlain_fake_link {
FONT-WEIGHT: 300;
FONT-SIZE: 8pt;
COLOR: black;
BACKGROUND-COLOR: white;
FONT-FAMILY: Arial, Helvetica, Verdana;
TEXT-DECORATION: underline;
border-color: white;
border-style: solid;
border-width: 0;
cursor: hand;}



<input type="submit" value="INFO" class="NinePlain_fake_link" />
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Ben:

Thanks for the info. I did not know that you could change the looks of a "button". Sorry I cannot help you with your question.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing parameters with LookupDispatchAction