Hi Tomas, On 26/10/2010 08:54, Tomás P. Tapia wrote: > 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). Any reason you are you adding fields to the Page, and not the form? By adding Fields to the Page, you are telling Click to process them every request, whether it is a GET or a POST. Forms on the other hand only process their children on submissions so should give the behavior you are after. Further, fields outside Forms aren't very useful as their values won't be posted to the server.
> 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 ? I have been thinking that Field onProcess behavior should check if there is a matching request parameter before setting it's value (which is the behavior you are seeing as well). If there is no incoming value, the Field shouldn't be processed or validated. Kind regards Bob
