Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

html:submit setter not being called

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Has anybody ever run into setter problems when you create a form which doesn't extend ActionForm directly?

I have XYZForm which extends CommonForm, which extends ButtonsForm which extends ActionForm (whew!)

In XYZForm, I have a boolean assignFormButton and the following setter:

public void setAssignFormButton(final String button) {
this.assignFormButton = buttonStringToBoolean(button);
}

(buttonStringToBoolean just takes the string and returns a boolean if not null)

In my JSP, I have:
<html:submit property="assignFormButton" styleId="assignProjectSubmitLink" tabindex="5>ASSIGN</html:submit>

assignFormButon=ASSIGN is indeed in the URL..however, it is never been called in the form.

However, I have other form elements in the JSP and XYZForm which ARE being set properly.

Ideas?

Stephanie
 
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While this is an intriguing use of html:submit, I don't believe the auto-population feature of Struts extends to the submit property.

As such, my Actions are littered with

if( request.getParameter( "some.submit.button" ) != null ) {
//handle this type of request
}
 
Steph DeGuire
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, not to get into too much details of our design, but common buttons (ex: save, cancel, reset, return) are in a class of their own called ButtonsForm. Each of our ActionForms extend this form.

The setters work perfectly for the buttons inside the ButtonsForm but don't for the ones that are in classes that extend it.

Quite frustrating.
 
reply
    Bookmark Topic Watch Topic
  • New Topic