Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:submit setter not being called

 
Steph DeGuire
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
Ray Stojonic
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic