Marc Portier wrote:



Vasyl Stashuk wrote:


Consider following example. Our form has repeat widget with some item list and additional fields for adding items (i.e. item name and submit button).
User wants to add new item. She enters name and presses the button. Form become redisplayed and new item appear in the list. If user press 'Refresh'
button on the browser for some reason, a new request for item addition will be sent. I wan't to avoid it. For this purpose, i want to handle business logic
of adding new user to the list in separate HTTP request, than rendering form view.



Vasyl,


I'm not completely sure about this

I did try hitting refresh on the woody form2 sample after adding a row to the repeater and the problem is not showing there, so maybe your problem can be solved by more closely following the pattern offered there?

regards,
-marc=

<snip />


Can I store continuation id in session?




I would strongly advise against doing that.


-marc=

The difference between my code and form2 sample is the fact how model managed. If I get it right in form2 it is stored as continuation attribute. Hitting refresh won't change continuation and also won't change model.


I change the model by calling some services, i.e:
       model.allList = manager.getAll();

       form.load(model);
       form.showForm("view");
       form.save(model);

       if (form.submitId == "delete") {
           var row = form.getWidget().getSubmitWidget().getParent();
           var selected = row.getWidget("id").getValue();

           manager.delete(selected);
       } else if (form.submitId == "add") {
           manager.add(model.prop2, model.prop1);
       }

manager is the reference to business delegate that will call service-layer which is responsible for data management.

Can i work with flowscript in this way?

thank you for the help,
vasyas


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to