Closed GoogleCodeExporter closed 9 years ago
After some debugging, the bug is caused by line
http://code.google.com/p/prado3/source/browse/branches/3.1/framework/Web/Javascr
ipts/source/prado/controls/controls.js#214 :
$('PRADO_POSTBACK_TARGET').value = this.options.EventTarget;
While this is harmless the the DefaultButton is a TButton, it causes a problem
when the DefaultButton is a TActiveButton.
Simple postback parameters you expect on a normal page:
PRADO_POSTBACK_TARGET=testButtonPost&PRADO_POSTBACK_PARAMETER=undefined&txtDummy
=
Simple callback parameters you expect on a normal page:
PRADO_CALLBACK_TARGET=testButtonCall&PRADO_POSTBACK_TARGET=testButtonCall
Postback parameters from the testcase page:
PRADO_POSTBACK_TARGET=&PRADO_POSTBACK_PARAMETER=&txtDummy=&testButtonPost=Postba
ck
This works anyway, since the last parameter is intercepted in
TPage::processPostData() and set as FIELD_POSTBACK_TARGET
Callback parameters from the testcase page when hitting enter on the TTextBox:
PRADO_CALLBACK_TARGET=testButtonCall&PRADO_POSTBACK_TARGET=testButtonCall
Both targets are set
Postback parameters after the callback caused by DefaultButton handling (the
broken one):
PRADO_POSTBACK_TARGET=testButtonCall&PRADO_POSTBACK_PARAMETER=&txtDummy=&testBut
tonPost=Postback
As you can see, PRADO_POSTBACK_TARGET has not been reset, so
TPage::processPostData() won't pick up testButtonPost as the
FIELD_POSTBACK_TARGET; it will re-execute the previous callback instead.
The easier fix is just to comment out the offending line in controls.js.
I've tested a lot of testcase combinations, all of them works with this change;
i also tried adding a TRequiredFieldValidator and a TActiveCustomValidator to
ensure removing that line won't affect proper validation.
Another fix could be forcing PRADO_POSTBACK_TARGET for each postback, but
looking at the way Prado.Postback works it seems that it's not possible.
Original comment by ctrlal...@gmail.com
on 3 May 2011 at 8:39
Fixe in r2906
Original comment by ctrlal...@gmail.com
on 10 May 2011 at 8:23
Original issue reported on code.google.com by
ctrlal...@gmail.com
on 3 May 2011 at 2:49Attachments: