This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi all I am working with a html form that has to have several submit values in order to determine the action that is to be taken. The problem that I am encountering is that when I get into my action class for that page I am using the property and value portions of the submit tag to determine the right action. This would be fine if I could still specify the text that is displayed on the screen, which unfortunately is being taken from the value portion of the submit. I can see this is a horrible thing to have, as any change to the presentation would also mean a required change in the code. The only solution I have come up with to this point is to give each submit button a different property and then check which one is not null. I am fairly certain there are better solutions, and I am not even sure if what I have proposed will work.
Try using LookupDispatchAction, and use the ApplicationResources file for the value of your submit buttons. By doing this, you can change the way your submit buttons are displayed without changing the logic in your Action class.
For more information on how to use LookupDispatchAction, seethis link.
Thanks for the link. I was looking at that and didn't understand it and continued to work until I had something that at least made sure I could do what I wanted. I think that is going to fall into the beautification process that will happen in the very near future. There are other components that I want to ensure will at least work before I come back to making it work perfectly. I hope you don't mind if I bring this topic back up in the future.
thanks again for the link, it's nice to know that I was looking at something that was on the right track (even if I didn't use it off the hop ).
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com