This is fundamental to stateless, share nothing architectures. Each request needs all the information in order to satisfy the action. In your case you need p otherwise you cannot construct the form. There are geneally two options: - store P in the session - store P in a hiddenField and bind it's value explicitly if you need it before the onProcess event eg. during onInit: ClickUtils.bind(pField); pField.getValue();
regards Bob On Fri, Apr 29, 2011 at 11:08 AM, Haim Schindler <[email protected]> wrote: > Hello, > > I am not sure what is the right way to use forms. > Sometimes its a problem when the form has to be constructed again after > submit and before the callback is called. > > Example: > > in url I type: > > www.mysite.com/clickPage?p=100 > > then in the click page I create a form. > based on the url parameter "p=100" in the form creation I do: > ... > Integer calculatedNumber = dbService.loadData(p); > form.add(new HiddenField("calculatedNumber", calculatedNumber)); > ... > > I dont keep the "p" as a HIDDEN field in the form since I dont need it > anymore. all I care about now, is "calculatedNumber" > > the user clicked "SUBMIT" > > now, the calls should go to "onSubmit" > but before that, the form needs to be recreated, and it needs "p" to do so. > but "p" is not there anymore and then I get exception > > Am I missing something ? > > Thank you > Haim Schindler >
