You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Patrick Davids <pa...@nubologic.com> on 2015/12/17 09:35:03 UTC

Question to DataTable and ReuseIfModelsEqualStrategy

Hi all,
I have a problem with an ComponentNotFoundExceptions when multiple 
ajax-request are fired with refreshing components and I fixed it using a 
ReuseIfModelsEqualStrategy in my refreshing DataTable.

But I'm not sure about the consequences using ReuseIfModelsEqualStrategy.

This is my case:
	Panel
		DataTable
			(rows with columns)
				Spinner with ajax-request refreshing the DataTable on change/spin


The Spinner has an AjaxChannel.QUEUE not too loose any data, when the 
user does multiple fast clicks.

Now the problem:
If the user is very fast with the mouse and uses the Spinner of the next 
row in the DataTable, while the previous Spinner is still working on its 
AjaxChannel.QUEUE and always refreshes the DataTable I run into 
ComponentNotFoundExceptions, when the first click of the next used 
Spinner is occuring.

Using ReuseIfModelsEqualStrategy for the DataTable, it is working, 
because the Items and componenents are reused.

I never used the ReuseIfModelsEqualStrategy before and while reading the 
javadoc, I am not sure about the equals() details and if I understood it 
really, really right.

Is it quite save to use the ReuseIfModelsEqualStrategy?
What are the pitfalls using it?

Thanx for any feedback and know-how!

kind regards
Patrick

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


Re: Question to DataTable and ReuseIfModelsEqualStrategy

Posted by Patrick Davids <pa...@nubologic.com>.
Hi Sven,

 > Why are you refreshing the whole table instead of a single row only?
At the end of the table is a ButtomToolBar calculating sums of all rows.
(the Spinner is for changing amounts / prices for an item in the rows)

How can I refresh a single row? This would help a bit (than, later, I 
could refresh the BottomToolBar by wickets event bus).

But I'm in a AbstractColumn...
@Override
public void populateItem(Item<ICellPopulator<T>> cellItem, String 
componentId, final IModel<T> rowModel) {
...
}
I don't have access to the row.

Patrick


Am 17.12.2015 um 10:40 schrieb Sven Meier:
> Hi,
>
>  >Is it quite save to use the ReuseIfModelsEqualStrategy?
>  >What are the pitfalls using it?
>
> as long as you follow the instructions in its JavaDoc I see no problem
> in using this strategy.
>
> Why are you refreshing the whole table instead of a single row only? If
> you did the latter, you won't get ComponentNotFoundExceptions either.
>
> Have fun
> Sven
>
>
>
> On 17.12.2015 09:35, Patrick Davids wrote:
>> Hi all,
>> I have a problem with an ComponentNotFoundExceptions when multiple
>> ajax-request are fired with refreshing components and I fixed it using
>> a ReuseIfModelsEqualStrategy in my refreshing DataTable.
>>
>> But I'm not sure about the consequences using ReuseIfModelsEqualStrategy.
>>
>> This is my case:
>>     Panel
>>         DataTable
>>             (rows with columns)
>>                 Spinner with ajax-request refreshing the DataTable on
>> change/spin
>>
>>
>> The Spinner has an AjaxChannel.QUEUE not too loose any data, when the
>> user does multiple fast clicks.
>>
>> Now the problem:
>> If the user is very fast with the mouse and uses the Spinner of the
>> next row in the DataTable, while the previous Spinner is still working
>> on its AjaxChannel.QUEUE and always refreshes the DataTable I run into
>> ComponentNotFoundExceptions, when the first click of the next used
>> Spinner is occuring.
>>
>> Using ReuseIfModelsEqualStrategy for the DataTable, it is working,
>> because the Items and componenents are reused.
>>
>> I never used the ReuseIfModelsEqualStrategy before and while reading
>> the javadoc, I am not sure about the equals() details and if I
>> understood it really, really right.
>>
>> Is it quite save to use the ReuseIfModelsEqualStrategy?
>> What are the pitfalls using it?
>>
>> Thanx for any feedback and know-how!
>>
>> kind regards
>> Patrick
>>
>> ---------------------------------------------------------------------
>> 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
>

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


Re: Question to DataTable and ReuseIfModelsEqualStrategy

Posted by Sven Meier <sv...@meiers.net>.
Hi,

 >Is it quite save to use the ReuseIfModelsEqualStrategy?
 >What are the pitfalls using it?

as long as you follow the instructions in its JavaDoc I see no problem 
in using this strategy.

Why are you refreshing the whole table instead of a single row only? If 
you did the latter, you won't get ComponentNotFoundExceptions either.

Have fun
Sven



On 17.12.2015 09:35, Patrick Davids wrote:
> Hi all,
> I have a problem with an ComponentNotFoundExceptions when multiple 
> ajax-request are fired with refreshing components and I fixed it using 
> a ReuseIfModelsEqualStrategy in my refreshing DataTable.
>
> But I'm not sure about the consequences using ReuseIfModelsEqualStrategy.
>
> This is my case:
>     Panel
>         DataTable
>             (rows with columns)
>                 Spinner with ajax-request refreshing the DataTable on 
> change/spin
>
>
> The Spinner has an AjaxChannel.QUEUE not too loose any data, when the 
> user does multiple fast clicks.
>
> Now the problem:
> If the user is very fast with the mouse and uses the Spinner of the 
> next row in the DataTable, while the previous Spinner is still working 
> on its AjaxChannel.QUEUE and always refreshes the DataTable I run into 
> ComponentNotFoundExceptions, when the first click of the next used 
> Spinner is occuring.
>
> Using ReuseIfModelsEqualStrategy for the DataTable, it is working, 
> because the Items and componenents are reused.
>
> I never used the ReuseIfModelsEqualStrategy before and while reading 
> the javadoc, I am not sure about the equals() details and if I 
> understood it really, really right.
>
> Is it quite save to use the ReuseIfModelsEqualStrategy?
> What are the pitfalls using it?
>
> Thanx for any feedback and know-how!
>
> kind regards
> Patrick
>
> ---------------------------------------------------------------------
> 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: Question to DataTable and ReuseIfModelsEqualStrategy

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
where pageLoadingFrame is just a custom blocking logic.

On Thu, Dec 17, 2015 at 10:02 AM, Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:

> Use a veil to block screen while AJAX is bussy.
>
>
> Wicket.Event.subscribe('/ajax/call/before', function(jqEvent, attributes,
> jqXHR, errorThrown, textStatus) {
>     pageLoadingFrame("show");
> });
>
> Wicket.Event.subscribe('/ajax/call/complete', function(jqEvent,
> attributes, jqXHR, errorThrown, textStatus) {
>     setTimeout(function(){
>         pageLoadingFrame("hide");
>     },500);
> });
>
> You can do that globaly as above...
>
> On Thu, Dec 17, 2015 at 9:35 AM, Patrick Davids <
> patrick.davids@nubologic.com> wrote:
>
>> Hi all,
>> I have a problem with an ComponentNotFoundExceptions when multiple
>> ajax-request are fired with refreshing components and I fixed it using a
>> ReuseIfModelsEqualStrategy in my refreshing DataTable.
>>
>> But I'm not sure about the consequences using ReuseIfModelsEqualStrategy.
>>
>> This is my case:
>>         Panel
>>                 DataTable
>>                         (rows with columns)
>>                                 Spinner with ajax-request refreshing the
>> DataTable on change/spin
>>
>>
>> The Spinner has an AjaxChannel.QUEUE not too loose any data, when the
>> user does multiple fast clicks.
>>
>> Now the problem:
>> If the user is very fast with the mouse and uses the Spinner of the next
>> row in the DataTable, while the previous Spinner is still working on its
>> AjaxChannel.QUEUE and always refreshes the DataTable I run into
>> ComponentNotFoundExceptions, when the first click of the next used Spinner
>> is occuring.
>>
>> Using ReuseIfModelsEqualStrategy for the DataTable, it is working,
>> because the Items and componenents are reused.
>>
>> I never used the ReuseIfModelsEqualStrategy before and while reading the
>> javadoc, I am not sure about the equals() details and if I understood it
>> really, really right.
>>
>> Is it quite save to use the ReuseIfModelsEqualStrategy?
>> What are the pitfalls using it?
>>
>> Thanx for any feedback and know-how!
>>
>> kind regards
>> Patrick
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>



-- 
Regards - Ernesto Reinaldo Barreiro

Re: Question to DataTable and ReuseIfModelsEqualStrategy

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Use a veil to block screen while AJAX is bussy.


Wicket.Event.subscribe('/ajax/call/before', function(jqEvent, attributes,
jqXHR, errorThrown, textStatus) {
    pageLoadingFrame("show");
});

Wicket.Event.subscribe('/ajax/call/complete', function(jqEvent, attributes,
jqXHR, errorThrown, textStatus) {
    setTimeout(function(){
        pageLoadingFrame("hide");
    },500);
});

You can do that globaly as above...

On Thu, Dec 17, 2015 at 9:35 AM, Patrick Davids <
patrick.davids@nubologic.com> wrote:

> Hi all,
> I have a problem with an ComponentNotFoundExceptions when multiple
> ajax-request are fired with refreshing components and I fixed it using a
> ReuseIfModelsEqualStrategy in my refreshing DataTable.
>
> But I'm not sure about the consequences using ReuseIfModelsEqualStrategy.
>
> This is my case:
>         Panel
>                 DataTable
>                         (rows with columns)
>                                 Spinner with ajax-request refreshing the
> DataTable on change/spin
>
>
> The Spinner has an AjaxChannel.QUEUE not too loose any data, when the user
> does multiple fast clicks.
>
> Now the problem:
> If the user is very fast with the mouse and uses the Spinner of the next
> row in the DataTable, while the previous Spinner is still working on its
> AjaxChannel.QUEUE and always refreshes the DataTable I run into
> ComponentNotFoundExceptions, when the first click of the next used Spinner
> is occuring.
>
> Using ReuseIfModelsEqualStrategy for the DataTable, it is working, because
> the Items and componenents are reused.
>
> I never used the ReuseIfModelsEqualStrategy before and while reading the
> javadoc, I am not sure about the equals() details and if I understood it
> really, really right.
>
> Is it quite save to use the ReuseIfModelsEqualStrategy?
> What are the pitfalls using it?
>
> Thanx for any feedback and know-how!
>
> kind regards
> Patrick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro