Re: Multiple AjaxLazyLoadingPanel's never load

2012-10-15 Thread Martin Grigorov
Hi,

On Fri, Oct 12, 2012 at 5:43 PM, Michael Zhavzharov mzhavzha...@alee.ru wrote:
 Hi, Martin! Thank You for your reply.

 I realized, that it is not an option for me to use ALLP. I need to load
 different data - Labels, Link and Image in one lazy panel, also I should be
 able to interact with other components in page, while ALLP loads it's
 content.

You can use Wicket IResource which is not locked like Page,

 I don't understand how to use IResource instead of Page. As I know IResource
 could carry an image, or css, and is not used like MarkupContainer. Am I
 wrong?


You are correct. With IResource you can deliver back only data (JSON,
byte[], XML, ...). So my suggestion was applicable in the case when
you want to load some data to show it. If you need to replace the
loading image with Wicket components then it is still possible but
again you'll need to acquire the page lock, i.e. you will face the
same problem.

Atmosphere/Native Web Sockets to push the data when ready

 It seems to me, that time has come to learn sockets.

This approach is the same as with IResource - you need the page lock
to be able to work with Components.



 Nevertheless, it is interesting to understand the problem with ALLP.
 I put sleep() into getLazyLoadComponent method and set different Models for
 returned Label. After starting the app I saw, that every ALLP changes first
 generated Label to it's own. It's looks like this:
 Label1 Label2
 Label3
 *  become   * become
 *
 * *
 *

 I think all the same that the matter is in markupId, but can't fix it.

Please create a quickstart app and I'll take a look.





 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Multiple-AjaxLazyLoadPanel-s-never-load-tp4652907p4652925.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Multiple AjaxLazyLoadingPanel's never load

2012-10-15 Thread Michael Zhavzharov
you'll need to acquire the page lock, i.e. you will face the same problem. 

i.e. there is no way to load components in page, showing loading indicator
and give user an opportunity to work with another elements on page? 

Thank you for your concern.
I don't know were to load app, that's why I loaded it to Google docs:
allpProject.zip on google
https://docs.google.com/open?id=0BwHokpA1QcAkdGk2QmdrQ0RhUzQ  





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Multiple-AjaxLazyLoadPanel-s-never-load-tp4652907p4652968.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Multiple AjaxLazyLoadingPanel's never load

2012-10-15 Thread Martin Grigorov
Hi,

On Mon, Oct 15, 2012 at 11:50 AM, Michael Zhavzharov
mzhavzha...@alee.ru wrote:
you'll need to acquire the page lock, i.e. you will face the same problem.

 i.e. there is no way to load components in page, showing loading indicator
 and give user an opportunity to work with another elements on page?

There is. You need to use different names for the ajax channels of the
Ajax behaviors.
See org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setChannel


 Thank you for your concern.
 I don't know were to load app, that's why I loaded it to Google docs:
 allpProject.zip on google
 https://docs.google.com/open?id=0BwHokpA1QcAkdGk2QmdrQ0RhUzQ

The solution is to remove id=ajaxPanel from the markup. Just leave
wicket:id there.






 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Multiple-AjaxLazyLoadPanel-s-never-load-tp4652907p4652968.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Multiple AjaxLazyLoadingPanel's never load

2012-10-15 Thread Martin Grigorov
On Mon, Oct 15, 2012 at 2:56 PM, Martin Grigorov mgrigo...@apache.org wrote:
 Hi,

 On Mon, Oct 15, 2012 at 11:50 AM, Michael Zhavzharov
 mzhavzha...@alee.ru wrote:
you'll need to acquire the page lock, i.e. you will face the same problem.

 i.e. there is no way to load components in page, showing loading indicator
 and give user an opportunity to work with another elements on page?

 There is. You need to use different names for the ajax channels of the
 Ajax behaviors.
 See org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setChannel

This will remove the synchronization at the client side but to improve
the blocking at the server side you will need to poll for the new
state as Ernesto suggested.



 Thank you for your concern.
 I don't know were to load app, that's why I loaded it to Google docs:
 allpProject.zip on google
 https://docs.google.com/open?id=0BwHokpA1QcAkdGk2QmdrQ0RhUzQ

 The solution is to remove id=ajaxPanel from the markup. Just leave
 wicket:id there.






 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Multiple-AjaxLazyLoadPanel-s-never-load-tp4652907p4652968.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Multiple AjaxLazyLoadingPanel's never load

2012-10-15 Thread Michael Zhavzharov
Thank You very much, Martin!

I am ashamed that I did not solve this problem by myself.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Multiple-AjaxLazyLoadPanel-s-never-load-tp4652907p4652975.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Multiple AjaxLazyLoadingPanel's never load

2012-10-12 Thread Martin Grigorov
Hi,

I'm not sure why it stops but I see another problem in it.
There is synchronization when using the page instance, i.e. the first
Ajax call will acquire the lock on the page and all other requests
will have to wait it to release it. So the ALLPs will load
sequentially.

How to solve this? It depends on the type of data you need to load.
You can use Wicket IResource which is not locked like Page, or
Atmosphere/Native Web Sockets to push the data when ready.

On Fri, Oct 12, 2012 at 10:24 AM, Michael Zhavzharov
mzhavzha...@alee.ru wrote:
 Hi, all!

 I have a problem with list of AjaxLazyLoadingPanels. Only the first panel
 loads, but others never. It's looks like this:
 http://apache-wicket.1842946.n4.nabble.com/file/n4652907/lazyloading.jpg

 I need to load N lazyPanels, and I trying to do next:

 *In Java:*

 List components = new ArrayList();
 for (int i = 0; i  6; i++) {
 components.add(i);
 }

 add(new ListView(list, components) {
 @Override
 protected void populateItem(ListItem item) {
 item.add(new AjaxLazyLoadPanel(ajaxPanel) {
 @Override
 public Component getLazyLoadComponent(String markupId) {
 return new Label(markupId, Simple Label);
 }
 });
 }
 });

 *In HTML:*
 div wicket:id=list
 div wicket:id=ajaxPanel id=ajaxPanel /div
 /div

 But this does not works.
 I tried to set every ALLP's markupId unique, but this led to the fact that
 even the first element-loaded stoped.

 Can somebody help me with this problem?

 Regards, Michael.



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Multiple-AjaxLazyLoadingPanel-s-never-load-tp4652907.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Multiple AjaxLazyLoadingPanel's never load

2012-10-12 Thread Michael Zhavzharov
Hi, Martin! Thank You for your reply.

I realized, that it is not an option for me to use ALLP. I need to load
different data - Labels, Link and Image in one lazy panel, also I should be
able to interact with other components in page, while ALLP loads it's
content.

You can use Wicket IResource which is not locked like Page,

I don't understand how to use IResource instead of Page. As I know IResource
could carry an image, or css, and is not used like MarkupContainer. Am I
wrong?

Atmosphere/Native Web Sockets to push the data when ready

It seems to me, that time has come to learn sockets.


Nevertheless, it is interesting to understand the problem with ALLP.
I put sleep() into getLazyLoadComponent method and set different Models for
returned Label. After starting the app I saw, that every ALLP changes first
generated Label to it's own. It's looks like this:
Label1 Label2   
   
Label3
*  become   * become   
*
* * 
  
*

I think all the same that the matter is in markupId, but can't fix it.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Multiple-AjaxLazyLoadPanel-s-never-load-tp4652907p4652925.html
Sent from the Users forum mailing list archive at Nabble.com.

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