Can i disable the button from the code( is it a good practice)?
Can somebody help me out? <html:form action="startVerification.do" styleId ="AccVina" method="post"> <html:hidden property="apprCode" value="1"/> <html:submit styleId="btnVina" property="action" onklick="return DisabDlr()" > Accept Data</html:submit> </html:form>
But each button HAS a value of its own. It gets submitted as a parameter like all the other fields from the form. This is how LookupDispatchAction works. OR if you aren't using DispatchActions you can still tell from your Action class which button was clicked. With your current code, the below line will give you the text displayed in the button (ie "Approve Deal"): String buttonClicked = (String)request.getParameter("action");
A good workman is known by his tools.
posted 15 years ago
I am trying to use LookUpDispatchAction . I have a button , which when clicked doesn't execute the appropriate methos.
The javadoc for LookupDispatchAction is pretty good.
Here's what is wrong. Your buttons needs to get their text from your ApplicationResources.properties file. Most of the other needed changes are in bold. If any of this is not clear to you, the javadoc should be of good use.
ApplicationResources: button.accept = Accept Data button.approve = Approve Deal
The code does get executed by the looks of it. What happens, though is that the page gets submitted in addition to the button becoming disabled. When the new page returns, the button is no longer disabled because it is a brand new page.