Re: AjaxSelfUpdatingBehaviour detaches my DataTable

2018-11-22 Thread sven
 
 
Hi,  
 

 
If your queries are so expensive you can just keep its results as a member in 
your component. Make a new query each time a filter changes, and let your 
dataProvider just iterate over the cached list.
 

 
Note that your Data gets serialized with your page though.
 

 
Sven
 
 
 

 
 
 
 
 
>  
> On 19.11.2018 at 12:00,wrote:
>  
>  
>  Hi Sven, Sorry, I did not notice your answer so far. Okay. Let's try to see 
> things from different angle :) Yes I use spring. I tried to reduce the number 
> of unnecessary queries. To achieve this I try to catch if my table filtered 
> or a new item added or a dropdownchoice changed and so on. It works more or 
> less but there is no method to catch an ajax table refresh for example 
> (Catching it in detach() method is bad practice you made me sure) Here is a 
> simple DataProvider I use. The question is that which point should I reload 
> data using customBo? At size() or Iterator ? What is the best practice for 
> this ? -- Sent from: 
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html 
> - To 
> unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional 
> commands, e-mail: users-h...@wicket.apache.org 
>  
 

Re: AjaxSelfUpdatingBehaviour detaches my DataTable

2018-11-19 Thread Sandor Feher
Hi Sven,

Sorry, I did not notice your answer so far.
Okay. Let's try to  see things from different angle :)

Yes I use spring. I tried to reduce the number of unnecessary queries. To
achieve this I try to catch if my table filtered or a new item added or a
dropdownchoice changed and so on.

It works more or less but there is no method to catch an ajax table refresh
for example (Catching it in detach() method is bad practice you made me
sure)

Here is a simple DataProvider I use.  The question is that which point
should I reload data using customBo?

At size() or Iterator ?  What is the best practice for this ?







--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



Re: AjaxSelfUpdatingBehaviour detaches my DataTable

2018-11-14 Thread Sven Meier

Hi Sandor,

why doesn't your myDAO 'detach'(=clear) its cache automatically whenever 
a new item is added?


Wicket might call #detach() in a lot of circumstances, thus this has to 
be a very quick operation.


It's better to avoid tying your caching to your UI layer. If you're 
using Spring, you can add caching to your service via annotations quite 
easily:


https://docs.spring.io/spring/docs/4.0.x/spring-framework-reference/html/cache.html

Have fun
Sven


Am 14.11.18 um 22:38 schrieb Sandor Feher:

Hi,

Sorry for the confusing.
Let me explain it more.
Let's suppose a simple CRUD page with a single DataTable and it's
dataprovider.
I need to refresh my datatable after a new item added.

So far I did it like this:

mw = new ModalWindow("modal");
mw.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
 private static final long serialVersionUID = 1L;

 @Override
 public void onClose(AjaxRequestTarget target) {
 dataTable.detachModels();
 target.add(wm_bottom);
 }
 });

In my dataprovider I reloaded data when datatable (and dataprovider) got
detached.

 @Override
 public void detach() {
   myDAO.refreshData();
 }

and every other cases when datatable filtered or cleared and so one.
And at this point AjaxSelfupdatingBehaviour comes in the picture. I can't
rely on ondetach method anymore because it's fired in every second not just
when it needed.

I hope I need a different approach to refresh my data but I did not figure
it out so far.

Regards,  Sandor

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



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



Re: AjaxSelfUpdatingBehaviour detaches my DataTable

2018-11-14 Thread Sandor Feher
Hi,

Sorry for the confusing.
Let me explain it more.
Let's suppose a simple CRUD page with a single DataTable and it's
dataprovider.
I need to refresh my datatable after a new item added.

So far I did it like this:

mw = new ModalWindow("modal");
mw.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
private static final long serialVersionUID = 1L;

@Override
public void onClose(AjaxRequestTarget target) {
dataTable.detachModels();
target.add(wm_bottom);
}
});

In my dataprovider I reloaded data when datatable (and dataprovider) got
detached.

@Override
public void detach() {
  myDAO.refreshData();
}

and every other cases when datatable filtered or cleared and so one.
And at this point AjaxSelfupdatingBehaviour comes in the picture. I can't
rely on ondetach method anymore because it's fired in every second not just
when it needed.

I hope I need a different approach to refresh my data but I did not figure
it out so far.

Regards,  Sandor 

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



Re: AjaxSelfUpdatingBehaviour detaches my DataTable

2018-11-14 Thread Bas Gooren
Hi Sandor,

Can you explain more clearly (step by step, request by request) what is
happening and what you expect to happen?

Most dataproviders (e.g. ones backed by a database model) reload their
underlying data on every request, so reloading should be easy (simply add
the datatable to the ajax request or reload the entire page).
What kind of data provider are you using?

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 12 november 2018 bij 14:19:09, Sandor Feher (sfe...@bluesystem.hu)
schreef:

Hi,

I feel a little bit dump but I can't fix it.

At the moment it looks like if I want my DataTable get reloaded then I must
call explicitly a public method in my DataProvider.

So far I simply called detachModel() on my DataTable and in detach method I
reloaded list using my DAO.
Because of AwareAjaxSelfUpdatingBehaviour (which is in my HeaderPanel which
is included by BasePage and every page classes extend the BasePage) all
pages get detached in every second.

TIA, Sandor

-- 
Sent from:
http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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


Re: AjaxSelfUpdatingBehaviour detaches my DataTable

2018-11-12 Thread Sandor Feher
Hi,

I feel a little bit dump but I can't fix it. 

At the moment it looks like if I want my DataTable get reloaded then I must
call explicitly a public method in my DataProvider. 

So far I simply called detachModel() on my DataTable and in detach method I
reloaded list using my DAO.
Because of AwareAjaxSelfUpdatingBehaviour (which is in my HeaderPanel which
is included by BasePage and every page classes extend the BasePage) all
pages get detached in every second.

TIA, Sandor

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



Re: AjaxSelfUpdatingBehaviour detaches my DataTable

2018-10-30 Thread Sandor Feher
Hi Sven,

Ok, thanks.

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



Re: AjaxSelfUpdatingBehaviour detaches my DataTable

2018-10-29 Thread Sven Meier

Hi,

AjaxRequestHandler detaches the whole page, so not only the updated 
components.


Have fun
Sven


Am 29.10.18 um 16:54 schrieb Sandor Feher:

Hi,


I succesfuly implemented my session expiration solution described in my
recent post:
http://apache-wicket.1842946.n4.nabble.com/Handling-session-timeout-properly-td4675541.html
and I use the same behavior for refreshing my NotificationPanel too.

My only problem/observation that AjaxSelfUpdatingBehaviour detaches my
DataTable/DataProvider too although it has nothing to do with them. (It
detaches at every 10 second when my Notification panel get refreshed).

I'm just wondering if it is the expected behaviour or I missed something.

I created a quickstart for demonstrating the situation.
Sorry for the mess, I did not have too much time to prettify but I hope you
will get the root point.

https://github.com/sfeher/selfupdatingbehavoiurquickstart

TIA, Sandor

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



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



AjaxSelfUpdatingBehaviour detaches my DataTable

2018-10-29 Thread Sandor Feher
Hi,


I succesfuly implemented my session expiration solution described in my
recent post:
http://apache-wicket.1842946.n4.nabble.com/Handling-session-timeout-properly-td4675541.html
and I use the same behavior for refreshing my NotificationPanel too.

My only problem/observation that AjaxSelfUpdatingBehaviour detaches my
DataTable/DataProvider too although it has nothing to do with them. (It
detaches at every 10 second when my Notification panel get refreshed).

I'm just wondering if it is the expected behaviour or I missed something.

I created a quickstart for demonstrating the situation.
Sorry for the mess, I did not have too much time to prettify but I hope you
will get the root point.

https://github.com/sfeher/selfupdatingbehavoiurquickstart

TIA, Sandor

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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