struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Van Wart <>
Subject Re: Question about Lookup dispatch action
Date Fri, 18 Aug 2006 21:47:35 GMT
mosho wrote:
> Hi Scott,
> It doesn't seem to work.
> My submit buttons look like this:
> <html:submit property="navigation" value="Previous" styleClass="button" >
>               <bean:message key="button.previous"/>
> </html:submit>&nbsp;&nbsp;&nbsp;
> Now, if I have a link, how can I set the property navigation for it.
> "  onClickSubmit()  pic.gif   "

Well first you should probably get rid of 'value="Previous"', since you 
should be (and are) setting the button text using <bean:message.../>.

I didn't consider you were using regular buttons as well.  In this case, 
the hidden field is going to be sent, and might muck up 
LookupDispatchAction when the user clicks a regular button.  So what you 
might need to do is something like this:

  <input type="hidden" id="hiddenNavigation" name="navigation" value="" 

I can't guarantee having the "disabled" there will work, but it should 
prevent the web browser from sending an extra (blank) "navigation" 
property and possibly causing the bean helpers to discard the REAL 
"navigation" value (when a button is clicked).  Then in your JSP:

  <c:set var="submitText">
    <bean:message key="button.submit" />

  <script type="text/javascript">

    function onClickSubmit() {
      var hiddenField = document.getElementById( "hiddenNavigation" );
      hiddenField.disabled = false;
      hiddenField.value = "${submitText}";


Have fun,

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

View raw message