Hi Tomas,

OK I don't think I read your original question correctly. I would recommend
that you read the following blog

http://click-framework.blogspot.com/2010/09/apache-click-220-explicit-binding.html

http://click-framework.blogspot.com/2010/09/apache-click-220-dynamic-form.html

regards Malcolm Edgar

On Mon, Oct 25, 2010 at 2:54 PM, Tomás P. Tapia <[email protected]> wrote:

> Malcolm,
>
> Thanks for your response and clarification.
>
> To be more precise: "we have problems setting default values for some
> dynamic fields".
>
> What is going on here is that we want to set default values on some fields,
> these fields has the characteristic of being created dynamically in the
> onInit method (i was cautious to use page.addControl in each of theses
> controls, in order to be recognized has such by ClickServlet).
>
> We set default values on these fields, but this default values were
> overwritten by the onProcess method besides this is not a form submission.
>  is that the expected behavior ?, if onProcess allways overrides default
> values, where are these useful ?
>
> Regards,
> Tomás Tapia Silva - Software Engineer
>
>
> ----- Mensaje original -----
> De: "Malcolm Edgar" <[email protected]>
> Para: "user" <[email protected]>
> Enviados: Lunes, 25 de Octubre 2010 17:41:40
> Asunto: Re: onProcess allways called and Overrides SetValue
>
> Hi,
>
>
> Form fields binding is performed in the onProcess() method, not in the
> onInit() method. The onInit() method is used primarily for post construction
> operations, and is provided for your use. Click doesn't do anything special
> in this phase.
>
>
> Most of the action happens in the onProcess() phase. For example a Form
> control will determine whether it is being targeted in a request, and if so
> it will process all its child controls. All the form fields will then have
> their onProcess() method called. Fields generally implement a pattern in
> their onProcess() method where they perform data binding, validation and
> dispatch an event to any listeners.
>
>
> After the onProcess phase has been completed, the ClickServlet will fire
> event's to any registered listeners, for example an Submit control "onClick"
> listener. You can think of these as closures, and in fact were inspired by
> Delphi's function pointers.
>
>
>
> regards Malcolm Edgar
>
>
> On Mon, Oct 25, 2010 at 11:11 AM, Tomás P. Tapia < [email protected] >
> wrote:
>
>
> Hi,
>
> I'm new to click, i don't know if it's ok but :
>
> ifi set the value to a control in the onInit() method, then onProcess()
> method overrides it without the form being submited. Until i understood the
> SetValue executed in onInit must be honored, moreover if there is no
> submission in course.
>
> I'm using click 2.2.
>
> Regards,
> Tomás Tapia Silva - Software Engineer
>
>
>
>

Reply via email to