You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by grazia <Gr...@gmail.com> on 2013/06/20 22:06:22 UTC

How to prevent a page from being marked as dirty ?

Is there an example of how to prevent that a page is marked as dirty ?
 how to use WebPage.dirty(isInitialization) ..





--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to prevent a page from being marked as dirty ?

Posted by grazia <Gr...@gmail.com>.
The problem seems kind of resolved by using
AjaxFormComponentUpdatingBehavior.
However for the timepicker.add(new
AjaxFormComponentUpdatingBehavior("onblur") does not work if the user is
selecting time using the slider ... Darn !!


On Fri, Jun 21, 2013 at 2:43 PM, grazia [via Apache Wicket] <
ml-node+s1842946n4659681h3@n4.nabble.com> wrote:

> LOL !
>
> That example was my starting point ... where did I get lost ?!
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636p4659681.html
>  To unsubscribe from How to prevent a page from being marked as dirty ?, click
> here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4659636&code=R3JhemlhLlJ1c3NvTGFzc25lckBnbWFpbC5jb218NDY1OTYzNnwyMjY4MDg1NDM=>
> .
> NAML<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636p4659692.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: How to prevent a page from being marked as dirty ?

Posted by grazia <Gr...@gmail.com>.
LOL !

That example was my starting point ... where did I get lost ?!



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636p4659681.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: How to prevent a page from being marked as dirty ?

Posted by Paul Bors <pa...@bors.ws>.
Before you kill yourself, did you take a look at the examples?
http://www.wicket-library.com/wicket-examples/ajax/tree/table/editable

~ Thank you,
  Paul Bors

-----Original Message-----
From: grazia [mailto:Grazia.RussoLassner@gmail.com] 
Sent: Friday, June 21, 2013 1:23 PM
To: users@wicket.apache.org
Subject: Re: How to prevent a page from being marked as dirty ?

Upon further analysis, the Page gets dirty when any of its components'
models are updated, it is doing what it is supposed to do. Can't eliminate
that
;-))

THere is something that gets out of synch with the ajax request. Below I
pasted teh code I used on a per row basis to update the tree. Anyone sees
something wrong ? I hope yes !

 saveButton.add(new AjaxFormSubmitBehavior("onclick") {

            @Override
            protected void onSubmit(final AjaxRequestTarget target) {
                final DefaultMutableTreeNode node =
((DefaultMutableTreeNode) inputModel.getTarget());
                final MyDto dto = (MyDto) node.getUserObject();
             
                schedulingManager.save(dto.getTrainingClass());  
     
                treeProvider.get()
                            .modelChanging();

                node.setUserObject(new MyDto(schedulingManager.get the
record you just saved... )));

                final DefaultTreeModel model =
                        (DefaultTreeModel) ((WicketTreeModel)
treeProvider.get()
                                                                         
.getModel()).getObject();
                model.nodeChanged(node);

                treeProvider.get()
                            .modelChanged();

                target.addChildren(treeProvider.get(), node.getClass());
                treeProvider.get()
                            .updateTree(target);
                
          

            }





--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-
marked-as-dirty-tp4659636p4659679.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to prevent a page from being marked as dirty ?

Posted by grazia <Gr...@gmail.com>.
Upon further analysis, the Page gets dirty when any of its components' models
are updated, it is doing what it is supposed to do. Can't eliminate that
;-))

THere is something that gets out of synch with the ajax request. Below I
pasted teh code I used on a per row basis to update the tree. Anyone sees
something wrong ? I hope yes !

 saveButton.add(new AjaxFormSubmitBehavior("onclick") {

            @Override
            protected void onSubmit(final AjaxRequestTarget target) {
                final DefaultMutableTreeNode node =
((DefaultMutableTreeNode) inputModel.getTarget());
                final MyDto dto = (MyDto) node.getUserObject();
             
                schedulingManager.save(dto.getTrainingClass());  
     
                treeProvider.get()
                            .modelChanging();

                node.setUserObject(new MyDto(schedulingManager.get the
record you just saved... )));

                final DefaultTreeModel model =
                        (DefaultTreeModel) ((WicketTreeModel)
treeProvider.get()
                                                                         
.getModel()).getObject();
                model.nodeChanged(node);

                treeProvider.get()
                            .modelChanged();

                target.addChildren(treeProvider.get(), node.getClass());
                treeProvider.get()
                            .updateTree(target);
                
          

            }





--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636p4659679.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to prevent a page from being marked as dirty ?

Posted by grazia <Gr...@gmail.com>.
No, freezing the page id does not remove the problem. 

I need to find a way either to stop the page reload or I have to do without
the ajax part ... the two seem in conflict ...



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636p4659668.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to prevent a page from being marked as dirty ?

Posted by grazia <Gr...@gmail.com>.
I should have explained before. 

The context is: I have a WebPage that contains a Form with a TreeTable.
Each row of the TreeTable has a cell with a TimePicker ( extends TextField
implements IWiQueryPlugin), and a submit button at the end of the row with
an AjaxFormSubmitBehavior to save the user choices and refresh the row that
has been changed.
Now, when the user selects a time in the TimePicker cell, and its model get
set, the Page gets marked as dirty and reloaded. If the page is reloaded
before the Ajax response is sent, then the Ajax response will not be able to
refresh the row that was edited. 

I am trying to setFreezePageId, where and how is the best way to use it ?
Maybe in the onBeforeRender of the Page ? Any other idea ?






--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636p4659667.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: How to prevent a page from being marked as dirty ?

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

This is internals detail.
Why do you need to deal with it ?


On Thu, Jun 20, 2013 at 10:06 PM, grazia <Gr...@gmail.com>wrote:

> Is there an example of how to prevent that a page is marked as dirty ?
>  how to use WebPage.dirty(isInitialization) ..
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-prevent-a-page-from-being-marked-as-dirty-tp4659636.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>