• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

html:submit setter not being called  RSS feed

 
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
 
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!