Sigh. Still no closer to figuring it out!

Did find a problem in my code to output all the parameters of a request,
fixed it, but it didnt help me pin down the problem. :-(

Ive resorted to adding code to the effect of:
form.setHeaderTransformation( request.getParameter("headerTransformation" );
to my action, which allows me to continue working for now, but I would
really like to know what the actual problem is.

-----Original Message-----
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 13:23
To: Struts Users Mailing List
Subject: Arrgh!!! my property has been cursed and my bean doesnt like
the field on my farm , uhh form I mean


Or to be a little bit more specific...

Old Mc Andrew had a form
and on that form he had a field
with the name "headerTransformation"
but naughty Mr Struts simply would NOT call the method
setHeaderTransformation in his ActionForm
even though it had not been a problem yesterday!

No matter what Andrew looked at everything still seemed fine but it just
didnt work!
He tried changing the field from a checkbox to a boring old text field
He tried dumping the request parameters to see if anything was dodgy there
- maybe multiple values were being submitted for that property?
but no - it all checked out ok, no matter where he looked.
Poor Andrew was getting VERY alarmed.

Then he had a clever idea!
He changed the name of the field on his html form to "headerTransformationx"
,
he also added a second setter named setHeaderTransformationx to his
actionform and then tried again.
Amazing! This time it worked!
Mr Struts went right ahead and called the setHeaderTransformationx method.
Andrew couldnt believe his eyes.

Just to test he renamed the field back to "headerTransformation"
and sure enough nasty Mr Struts gave it the cold shoulder again.

Now Andrew is very confused. He hasnt the slightest clue why a parameter
named
"headerTransformation" is completely ignored by Mr Struts, while a parameter
named "headerTransformationx" is welcomed with open arms!

Well boys and girls, perhaps you can help poor Andrew with his problem?
Can anyone give him a reason why silly Mr Struts has a bad attitude towards
his fieldnames?


<details>
Ive looked at the request parameters (dumping them from processPopulate() in
the request processor just before the form is populated.
headerTransformation=xxx is in there alright, and its not multiple values.
So it fine there,
but the setter in the actionForm is not getting called.

The code in my actionform is:

public void setHeaderTransformationx(String value)
{
  System.out.println("Setting headerTransformationx to " + value);
  _headerTransformation = value;
}

public void setHeaderTransformation(String value)
{
  System.out.println("Setting headerTransformation to " + value);
  _headerTransformation = value;
}

public String getHeaderTransformation()
{
  return _headerTransformation;
}

I also set _headerTransformation to null in the reset() method (it used to
be a checkbox before I started trying to diagnose the problem).

And my html form has a field with the code:

<input type="text" name="headerTransformationx"
onchange="submitWithMethod('update');"/>
(or
<input type="text" name="headerTransformation"
onchange="submitWithMethod('update');"/>
depending on which of the two setters Im testing)

When I use the headerTransformationx name it works, but headerTransformation
does not.

I have several other fields on the form that are specified in an almost
identical manner , the only difference being their name, and they all work
sweet.

Very confused :-(
</detail>


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to