[Seaside] Form extended with ajax and callbacks

Norbert Hartl norbert at hartl.name
Fri Dec 2 17:36:13 UTC 2011

Am 02.12.2011 um 18:25 schrieb Paul DeBruicker:

> On 11-12-02 09:21 AM, Norbert Hartl wrote:
>> Ok, I've found the problem. As it is all the same form I submit it twice. Once for the transfer of the select value and the second time when using the submit button. The select callback is triggered a second time and the magritte component gets resetted and that is the reason I can't see the value. I'm not sure what is the best solution to it. Is it possible to submit only a subset of the form fields? Otherwise I need to detect this case somehow.
>> Norbert
> Could you just make a generic textInput that stores into an inst var in the component whatever value you want in the class the select chooses, then do the instance creation and set the value once the form is submitted?

That wouldn't work. I need only one text input because the selected class is the simplest one of all possible. For every other case there will be multiple form elements that form a new instance. So the delegating component needs to be agnostic of the selected instance. As it is a select I just switch cases and there is no need to reset the child component unless the selection has changed. This way it works quite ok.



More information about the seaside mailing list