Re: Ajax busy indicator getting stuck
Created WICKET-4257 with quickstart. 2011/11/19 Igor Vaynberg igor.vaynb...@gmail.com: that might work. -igor On Fri, Nov 18, 2011 at 1:45 PM, Nazaret Kazarian nazaret.kazar...@gmail.com wrote: Yep, I will create a quickstart and create a jira. If it turns out to be a bug, until it gets solved, I am thinking of showing / hiding the busy indicator using js pre/post call handlers. And maybe also use the following code as a condition in post call handler to hide the indicator: wicketAjaxBusy: function() { for (var c in Wicket.channelManager.channels) { if (Wicket.channelManager.channels[c].busy) { return true; } } return false; } Do you think that's a good idea? 2011/11/18 Igor Vaynberg igor.vaynb...@gmail.com: quickstart, jira? -igor On Fri, Nov 18, 2011 at 1:20 PM, Nazaret Kazarian nazaret.kazar...@gmail.com wrote: That sounds reasonable. According to the scenario I described above, the indicator will always get stuck if you use channel type Drop and issue an ajax request on a busy channel. 2011/11/18 coincoinfou olivierandr...@gmail.com: Same problem with IndicatingAjaxLink when I switch to AjaxChannel.Type.DROP -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-busy-indicator-getting-stuck-tp4082837p4083026.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 - 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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Ajax busy indicator getting stuck
Hi, I have added a global ajax indicator to all my pages by having all pages (through a TemplatePage superclass) implement the IAjaxIndicatorAware interface. Generally it works, but I have noticed that it is quite easy to get the ajax indicator stuck spinning indefinitely, by issuing many ajax calls quickly the one after the other. For example if I press an ajax button multiple times quickly the busy indicator gets stuck. It seems as if the Wicket.show(hide)Incrementally js functions lose count of ajax requests and the busy indicator is never actually hidden. Has anyone encountered this problem? Thanks a lot Naz - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ajax busy indicator getting stuck
I have also noticed that with 1.5.3... I normally block the page with div to prevent this but for links on a modal window it happens to me (because blocking div is behind modal). Regards, Ernesto On Fri, Nov 18, 2011 at 11:53 AM, Nazaret Kazarian nazaret.kazar...@gmail.com wrote: Hi, I have added a global ajax indicator to all my pages by having all pages (through a TemplatePage superclass) implement the IAjaxIndicatorAware interface. Generally it works, but I have noticed that it is quite easy to get the ajax indicator stuck spinning indefinitely, by issuing many ajax calls quickly the one after the other. For example if I press an ajax button multiple times quickly the busy indicator gets stuck. It seems as if the Wicket.show(hide)Incrementally js functions lose count of ajax requests and the busy indicator is never actually hidden. Has anyone encountered this problem? Thanks a lot Naz - 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: Ajax busy indicator getting stuck
On Fri, Nov 18, 2011 at 12:59 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: I have also noticed that with 1.5.3... I normally block the page with div to prevent this but for links on a modal window it happens to me (because blocking div is behind modal). And you didn't experience this with 1.5.2 ? Maybe https://issues.apache.org/jira/browse/WICKET-4071 is involved ? Regards, Ernesto On Fri, Nov 18, 2011 at 11:53 AM, Nazaret Kazarian nazaret.kazar...@gmail.com wrote: Hi, I have added a global ajax indicator to all my pages by having all pages (through a TemplatePage superclass) implement the IAjaxIndicatorAware interface. Generally it works, but I have noticed that it is quite easy to get the ajax indicator stuck spinning indefinitely, by issuing many ajax calls quickly the one after the other. For example if I press an ajax button multiple times quickly the busy indicator gets stuck. It seems as if the Wicket.show(hide)Incrementally js functions lose count of ajax requests and the busy indicator is never actually hidden. Has anyone encountered this problem? Thanks a lot Naz - 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 -- 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: Ajax busy indicator getting stuck
Martin, Before switching to 1.5.3 I was working with 1.5.x trunk and I think it was the same there... but I can´t say that assertion is 100% true. As said in my case this happens to me on a modal window because my indicator panel blocks the UI and that blocking div is behind the modal. It should not be very difficult to produce a quick-start for this issue (I guess). Best regards, Ernesto On Fri, Nov 18, 2011 at 12:02 PM, Martin Grigorov mgrigo...@apache.org wrote: On Fri, Nov 18, 2011 at 12:59 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: I have also noticed that with 1.5.3... I normally block the page with div to prevent this but for links on a modal window it happens to me (because blocking div is behind modal). And you didn't experience this with 1.5.2 ? Maybe https://issues.apache.org/jira/browse/WICKET-4071 is involved ? Regards, Ernesto On Fri, Nov 18, 2011 at 11:53 AM, Nazaret Kazarian nazaret.kazar...@gmail.com wrote: Hi, I have added a global ajax indicator to all my pages by having all pages (through a TemplatePage superclass) implement the IAjaxIndicatorAware interface. Generally it works, but I have noticed that it is quite easy to get the ajax indicator stuck spinning indefinitely, by issuing many ajax calls quickly the one after the other. For example if I press an ajax button multiple times quickly the busy indicator gets stuck. It seems as if the Wicket.show(hide)Incrementally js functions lose count of ajax requests and the busy indicator is never actually hidden. Has anyone encountered this problem? Thanks a lot Naz - 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 -- 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ajax busy indicator getting stuck
I'm sorry I forgot to mention that I am using version 1.4.19 With a little reverse engineering I noticed that maybe one of the cases this happens is this: an ajax button is pressed, showIncrementally is executed, but the actual ajax request is postponed because its channel is busy. When the time comes to actually execute the request, the request is stopped because of precondition check, and thus hideIncrementally is never called. This loses the count. A fix might be to call hideIncrementally when the ajax request precondition is not met. As to why the precondition is not met, I am guessing it's because the previous ajax request did DOM replacement in a way that the precondition of the queued request is no longer met. 2011/11/18 Ernesto Reinaldo Barreiro reier...@gmail.com: Martin, Before switching to 1.5.3 I was working with 1.5.x trunk and I think it was the same there... but I can´t say that assertion is 100% true. As said in my case this happens to me on a modal window because my indicator panel blocks the UI and that blocking div is behind the modal. It should not be very difficult to produce a quick-start for this issue (I guess). Best regards, Ernesto On Fri, Nov 18, 2011 at 12:02 PM, Martin Grigorov mgrigo...@apache.org wrote: On Fri, Nov 18, 2011 at 12:59 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: I have also noticed that with 1.5.3... I normally block the page with div to prevent this but for links on a modal window it happens to me (because blocking div is behind modal). And you didn't experience this with 1.5.2 ? Maybe https://issues.apache.org/jira/browse/WICKET-4071 is involved ? Regards, Ernesto On Fri, Nov 18, 2011 at 11:53 AM, Nazaret Kazarian nazaret.kazar...@gmail.com wrote: Hi, I have added a global ajax indicator to all my pages by having all pages (through a TemplatePage superclass) implement the IAjaxIndicatorAware interface. Generally it works, but I have noticed that it is quite easy to get the ajax indicator stuck spinning indefinitely, by issuing many ajax calls quickly the one after the other. For example if I press an ajax button multiple times quickly the busy indicator gets stuck. It seems as if the Wicket.show(hide)Incrementally js functions lose count of ajax requests and the busy indicator is never actually hidden. Has anyone encountered this problem? Thanks a lot Naz - 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 -- 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 - 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: Ajax busy indicator getting stuck
Martin, WICKET-4071 is not involved as I am not using AjaxIndicatorAppender in any way. 2011/11/18 Nazaret Kazarian nazaret.kazar...@gmail.com: I'm sorry I forgot to mention that I am using version 1.4.19 With a little reverse engineering I noticed that maybe one of the cases this happens is this: an ajax button is pressed, showIncrementally is executed, but the actual ajax request is postponed because its channel is busy. When the time comes to actually execute the request, the request is stopped because of precondition check, and thus hideIncrementally is never called. This loses the count. A fix might be to call hideIncrementally when the ajax request precondition is not met. As to why the precondition is not met, I am guessing it's because the previous ajax request did DOM replacement in a way that the precondition of the queued request is no longer met. 2011/11/18 Ernesto Reinaldo Barreiro reier...@gmail.com: Martin, Before switching to 1.5.3 I was working with 1.5.x trunk and I think it was the same there... but I can´t say that assertion is 100% true. As said in my case this happens to me on a modal window because my indicator panel blocks the UI and that blocking div is behind the modal. It should not be very difficult to produce a quick-start for this issue (I guess). Best regards, Ernesto On Fri, Nov 18, 2011 at 12:02 PM, Martin Grigorov mgrigo...@apache.org wrote: On Fri, Nov 18, 2011 at 12:59 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: I have also noticed that with 1.5.3... I normally block the page with div to prevent this but for links on a modal window it happens to me (because blocking div is behind modal). And you didn't experience this with 1.5.2 ? Maybe https://issues.apache.org/jira/browse/WICKET-4071 is involved ? Regards, Ernesto On Fri, Nov 18, 2011 at 11:53 AM, Nazaret Kazarian nazaret.kazar...@gmail.com wrote: Hi, I have added a global ajax indicator to all my pages by having all pages (through a TemplatePage superclass) implement the IAjaxIndicatorAware interface. Generally it works, but I have noticed that it is quite easy to get the ajax indicator stuck spinning indefinitely, by issuing many ajax calls quickly the one after the other. For example if I press an ajax button multiple times quickly the busy indicator gets stuck. It seems as if the Wicket.show(hide)Incrementally js functions lose count of ajax requests and the busy indicator is never actually hidden. Has anyone encountered this problem? Thanks a lot Naz - 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 -- 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 - 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: Ajax busy indicator getting stuck
Same problem with IndicatingAjaxLink when I switch to AjaxChannel.Type.DROP -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-busy-indicator-getting-stuck-tp4082837p4083026.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: Ajax busy indicator getting stuck
That sounds reasonable. According to the scenario I described above, the indicator will always get stuck if you use channel type Drop and issue an ajax request on a busy channel. 2011/11/18 coincoinfou olivierandr...@gmail.com: Same problem with IndicatingAjaxLink when I switch to AjaxChannel.Type.DROP -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-busy-indicator-getting-stuck-tp4082837p4083026.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ajax busy indicator getting stuck
quickstart, jira? -igor On Fri, Nov 18, 2011 at 1:20 PM, Nazaret Kazarian nazaret.kazar...@gmail.com wrote: That sounds reasonable. According to the scenario I described above, the indicator will always get stuck if you use channel type Drop and issue an ajax request on a busy channel. 2011/11/18 coincoinfou olivierandr...@gmail.com: Same problem with IndicatingAjaxLink when I switch to AjaxChannel.Type.DROP -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-busy-indicator-getting-stuck-tp4082837p4083026.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 - 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: Ajax busy indicator getting stuck
Yep, I will create a quickstart and create a jira. If it turns out to be a bug, until it gets solved, I am thinking of showing / hiding the busy indicator using js pre/post call handlers. And maybe also use the following code as a condition in post call handler to hide the indicator: wicketAjaxBusy: function() { for (var c in Wicket.channelManager.channels) { if (Wicket.channelManager.channels[c].busy) { return true; } } return false; } Do you think that's a good idea? 2011/11/18 Igor Vaynberg igor.vaynb...@gmail.com: quickstart, jira? -igor On Fri, Nov 18, 2011 at 1:20 PM, Nazaret Kazarian nazaret.kazar...@gmail.com wrote: That sounds reasonable. According to the scenario I described above, the indicator will always get stuck if you use channel type Drop and issue an ajax request on a busy channel. 2011/11/18 coincoinfou olivierandr...@gmail.com: Same problem with IndicatingAjaxLink when I switch to AjaxChannel.Type.DROP -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-busy-indicator-getting-stuck-tp4082837p4083026.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 - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Ajax busy indicator getting stuck
that might work. -igor On Fri, Nov 18, 2011 at 1:45 PM, Nazaret Kazarian nazaret.kazar...@gmail.com wrote: Yep, I will create a quickstart and create a jira. If it turns out to be a bug, until it gets solved, I am thinking of showing / hiding the busy indicator using js pre/post call handlers. And maybe also use the following code as a condition in post call handler to hide the indicator: wicketAjaxBusy: function() { for (var c in Wicket.channelManager.channels) { if (Wicket.channelManager.channels[c].busy) { return true; } } return false; } Do you think that's a good idea? 2011/11/18 Igor Vaynberg igor.vaynb...@gmail.com: quickstart, jira? -igor On Fri, Nov 18, 2011 at 1:20 PM, Nazaret Kazarian nazaret.kazar...@gmail.com wrote: That sounds reasonable. According to the scenario I described above, the indicator will always get stuck if you use channel type Drop and issue an ajax request on a busy channel. 2011/11/18 coincoinfou olivierandr...@gmail.com: Same problem with IndicatingAjaxLink when I switch to AjaxChannel.Type.DROP -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-busy-indicator-getting-stuck-tp4082837p4083026.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 - 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 - 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: ajax busy indicator for AjaxFallbackDefaultDataTable
What I did for the paginator and sortable columns was to create 2 subclases. For the OrderByBorder I get the indicator on the column to the right, which does not look good. I still don't know how to fix that. These are the two classes: abstract class IndicatingAjaxFallbackOrderByBorder extends AjaxFallbackOrderByBorder implements IAjaxIndicatorAware { private static final long serialVersionUID = 1L; private final AjaxIndicatorAppender indicatorAppender = new AjaxIndicatorAppender(); public IndicatingAjaxFallbackOrderByBorder(String id, String property, ISortStateLocator stateLocator) { super(id, property, stateLocator); add(indicatorAppender); } @Override public String getAjaxIndicatorMarkupId() { return indicatorAppender.getMarkupId(); } } class IndicatingAjaxPagingNavigator extends AjaxPagingNavigator implements IAjaxIndicatorAware { private static final long serialVersionUID = 1L; private final AjaxIndicatorAppender indicatorAppender = new AjaxIndicatorAppender(); public IndicatingAjaxPagingNavigator(String id, IPageable pageable) { super(id, pageable); add(indicatorAppender); } @Override public String getAjaxIndicatorMarkupId() { return indicatorAppender.getMarkupId(); } } fachhoch wrote: AjaxFallbackDefaultDataTable has several components inside AjaxNavigationToolbar AjaxFallbackHeadersToolbar I want to display ajax busy indicator when ever user clicks on pagination or any column which is sortable 'adding IndicatorAppender to AjaxLink or AjaxButton works but it is not working for AjaxFallbackDefaultDataTable please help me -- View this message in context: http://www.nabble.com/ajax-busy-indicator-for-AjaxFallbackDefaultDataTable-tp22630549p22776603.html Sent from the Wicket - User 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
ajax busy indicator
is there any ajax busy indicator which blocks the entire page some thing like nexus repository manager does . -- View this message in context: http://www.nabble.com/ajax-busy-indicator-tp22529825p22529825.html Sent from the Wicket - User 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: ajax busy indicator
see mask component in wicketstuff-minis -igor On Sun, Mar 15, 2009 at 4:47 PM, miro miroconn...@yahoo.com wrote: is there any ajax busy indicator which blocks the entire page some thing like nexus repository manager does . -- View this message in context: http://www.nabble.com/ajax-busy-indicator-tp22529825p22529825.html Sent from the Wicket - User 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ajax busy indicator never stops in IE
The problem is in wicket-ajax.js file. In 1.4-rc1 it is line #1448: if (typeof(id) == string id.length 0) { Change it to: if ((typeof(id) == String || typeof(id) == string) id.length 0) { and it all works. Cheers! miro wrote: My page has IndicatingAjaxLinkWhen user clicks on this link the busy indicator never stops , it works fine in firefox here some html tbody wicket:id=auditInfoContainer style=width:100%;height:556;overflow:auto; wicket:container wicket:id=auditInfos tr wicket:id=auditInfo height=10 td /td td /td td /td td /td td /td td /td td /td td /td td /td /tr /wicket:container /tbody auditInfo is the link . I am using wicket 1.3.5 -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20665553.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax busy indicator never stops in IE
, but it is not easy to understand it. I will compare it with firefox generated logs... igor.vaynberg wrote: why dont you check *why* it is not hiding. ajax console should give you a clue. -igor On Fri, Nov 14, 2008 at 6:43 AM, miro [EMAIL PROTECTED] wrote: did nobody faced this problem whats the solution for this ? miro wrote: My page has IndicatingAjaxLinkWhen user clicks on this link the busy indicator never stops , it works fine in firefox here some html tbody wicket:id=auditInfoContainer style=width:100%;height:556;overflow:auto; wicket:container wicket:id=auditInfos tr wicket:id=auditInfo height=10 td /td td /td td /td td /td td /td td /td td /td td /td td /td /tr /wicket:container /tbody auditInfo is the link . I am using wicket 1.3.5 -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20501752.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20577814.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax busy indicator never stops in IE
I compared the ajax console difference for IE and firefox the main difference is IE complains about object error IE console INFO: Response parsed. Now invoking steps... ERROR: [object Error] (several of these) INFO: Response processed successfully. INFO: Invoking post-call handler(s)... INFO: last focus id was not set Firefox console INFO: Response parsed. Now invoking steps... INFO: Response processed successfully. INFO: Invoking post-call handler(s)... INFO: last focus id was not set please help me understand whjat might cause ERROR: [object Error] in IE and not in firefox ? Xhelas wrote: Thank you for the clue on the clue! There are indeed some likely usefull information (with errors on IE7) in the ajax console, but it is not easy to understand it. I will compare it with firefox generated logs... igor.vaynberg wrote: why dont you check *why* it is not hiding. ajax console should give you a clue. -igor On Fri, Nov 14, 2008 at 6:43 AM, miro [EMAIL PROTECTED] wrote: did nobody faced this problem whats the solution for this ? miro wrote: My page has IndicatingAjaxLinkWhen user clicks on this link the busy indicator never stops , it works fine in firefox here some html tbody wicket:id=auditInfoContainer style=width:100%;height:556;overflow:auto; wicket:container wicket:id=auditInfos tr wicket:id=auditInfo height=10 td /td td /td td /td td /td td /td td /td td /td td /td td /td /tr /wicket:container /tbody auditInfo is the link . I am using wicket 1.3.5 -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20501752.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20559665.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax busy indicator never stops in IE
/tbody auditInfo is the link . I am using wicket 1.3.5 -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20501752.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20567404.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax busy indicator never stops in IE
on this link the busy indicator never stops , it works fine in firefox here some html tbody wicket:id=auditInfoContainer style=width:100%;height:556;overflow:auto; wicket:container wicket:id=auditInfos tr wicket:id=auditInfo height=10 td /td td /td td /td td /td td /td td /td td /td td /td td /td /tr /wicket:container /tbody auditInfo is the link . I am using wicket 1.3.5 -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20501752.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20567987.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax busy indicator never stops in IE
/td /tr /wicket:container /tbody auditInfo is the link . I am using wicket 1.3.5 -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20501752.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax busy indicator never stops in IE
All the same for me with 1.4-rc1. miro wrote: My page has IndicatingAjaxLinkWhen user clicks on this link the busy indicator never stops , it works fine in firefox here some html tbody wicket:id=auditInfoContainer style=width:100%;height:556;overflow:auto; wicket:container wicket:id=auditInfos tr wicket:id=auditInfo height=10 td /td td /td td /td td /td td /td td /td td /td td /td td /td /tr /wicket:container /tbody auditInfo is the link . I am using wicket 1.3.5 -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20496470.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax busy indicator never stops in IE
did nobody faced this problem whats the solution for this ? miro wrote: My page has IndicatingAjaxLinkWhen user clicks on this link the busy indicator never stops , it works fine in firefox here some html tbody wicket:id=auditInfoContainer style=width:100%;height:556;overflow:auto; wicket:container wicket:id=auditInfos tr wicket:id=auditInfo height=10 td /td td /td td /td td /td td /td td /td td /td td /td td /td /tr /wicket:container /tbody auditInfo is the link . I am using wicket 1.3.5 -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20501752.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax busy indicator never stops in IE
why dont you check *why* it is not hiding. ajax console should give you a clue. -igor On Fri, Nov 14, 2008 at 6:43 AM, miro [EMAIL PROTECTED] wrote: did nobody faced this problem whats the solution for this ? miro wrote: My page has IndicatingAjaxLinkWhen user clicks on this link the busy indicator never stops , it works fine in firefox here some html tbody wicket:id=auditInfoContainer style=width:100%;height:556;overflow:auto; wicket:container wicket:id=auditInfos tr wicket:id=auditInfo height=10 td /td td /td td /td td /td td /td td /td td /td td /td td /td /tr /wicket:container /tbody auditInfo is the link . I am using wicket 1.3.5 -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20501752.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax busy indicator never stops in IE
Thank you for the clue on the clue! There are indeed some likely usefull information (with errors on IE7) in the ajax console, but it is not easy to understand it. I will compare it with firefox generated logs... igor.vaynberg wrote: why dont you check *why* it is not hiding. ajax console should give you a clue. -igor On Fri, Nov 14, 2008 at 6:43 AM, miro [EMAIL PROTECTED] wrote: did nobody faced this problem whats the solution for this ? miro wrote: My page has IndicatingAjaxLinkWhen user clicks on this link the busy indicator never stops , it works fine in firefox here some html tbody wicket:id=auditInfoContainer style=width:100%;height:556;overflow:auto; wicket:container wicket:id=auditInfos tr wicket:id=auditInfo height=10 td /td td /td td /td td /td td /td td /td td /td td /td td /td /tr /wicket:container /tbody auditInfo is the link . I am using wicket 1.3.5 -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20501752.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20506809.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ajax busy indicator never stops in IE
My page has IndicatingAjaxLinkWhen user clicks on this link the busy indicator never stops , it works fine in firefox here some html tbody wicket:id=auditInfoContainer style=width:100%;height:556;overflow:auto; wicket:container wicket:id=auditInfos tr wicket:id=auditInfo height=10 td /td td /td td /td td /td td /td td /td td /td td /td td /td /tr /wicket:container /tbody auditInfo is the link . I am using wicket 1.3.5 -- View this message in context: http://www.nabble.com/ajax-busy-indicator-never-stops-in-IE-tp20485948p20485948.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax Busy Indicator
And wait a minute, is the container in fact the indicator? Yes! @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src,urlFor(AbstractDefaultAjaxBehavior.INDICATOR)); } This part I didn't understand. The html has just img src=# border=0 wicket:id=ajaxIndicator/ and that command will replace the src - Wicket's default indicator image. Wicket id is a different thing than the markup id. Probably you need to override getMarkupId() to return that id. Ok. This is probably where I have messed up. Say I have img src=# border=0 wicket:id=ajaxIndicatorImage/ in my HTML and an AjaxIndicatorContainer extends WebMarkupContainer for it as previously. Now, how do I set up the markup-id if it is not the same as wicket-id :) ? Anyone has done this exact same thing before in a similar manner and coud post code? ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax Busy Indicator
This seems like tweaking... nope, that's what CSS is for, you wouldn't want to change your markup just to put something as tiny as an ajaxindicator some pixels to the left would you? (just an example) Martin Makundi wrote: You can use CSS to control the positon of the busy indicating image. To place it right from the button use This seems like tweaking... IAjaxIndicatorAware simply takes the html id of the element you want to show/hide; it can be placed anywhere in html... This is more of what I am looking for, but with IAjaxIndicatorAware I havent succeeded in making the indicator appear. I posted earlier the code I have, but it didn't do the job. I will repeat it here if someone can see immediately what is wrong in it: public class Login extends WebPage { // ... default constructor contents: final Form loginForm = new Form(LOGIN_FORM, new Model()); final AjaxIndicatorContainer indicatorContainer = new AjaxIndicatorContainer(); indicatorContainer.setOutputMarkupId(true); loginForm.add(indicatorContainer); final SubmitLink loginButton = new SubmitLink(LOGIN_BUTTON, new Model()) { /** * @see org.apache.wicket.markup.html.form.SubmitLink#onSubmit() */ @Override public void onSubmit() { super.onSubmit(); Thread.sleep(5000); // Simulate form processing } }; abstract class AjaxFormSubmitIndicator extends AjaxFormSubmitBehavior implements IAjaxIndicatorAware { /** * Constructor for TODO * */ public AjaxFormSubmitIndicator() { super(onchange); // I have tried onchange and onclick } } loginButton.add(new AjaxFormSubmitIndicator() { @Override protected void onError(AjaxRequestTarget arg0) { // TODO Auto-generated method stub } @Override protected void onSubmit(AjaxRequestTarget arg0) { loginButton.onSubmit(); } public String getAjaxIndicatorMarkupId() { return indicatorContainer.getMarkupId(); } }); loginForm.add(loginButton); // ... etc.. add(new FeedbackPanel(feedback)); add(loginForm); } public class AjaxIndicatorContainer extends WebMarkupContainer { /** * */ private static final long serialVersionUID = 5573778050703849297L; /** * */ public static final String INDICATOR_MARKUP_ID = ajaxIndicator; /** * Constructor for TODO */ public AjaxIndicatorContainer() { super(INDICATOR_MARKUP_ID); } /** * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src,urlFor(AbstractDefaultAjaxBehavior.INDICATOR)); } body wicket:extend h1Login/h1 Feedback messages will be here. form wicket:id=loginForm table border=0 cellspacing=0 cellpadding=2 align=center trtd NOWRAP width=80 align=right Username: /td tdinput type=text wicket:id=userId/td/tr trtd NOWRAP align=right Password: /tdtdinput type=password wicket:id=password/td/tr trtd align=right # /tdtd NOWRAP input type=submit value=Sign in wicket:id=loginButton /td/tr /table /form /wicket:extend /body - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Ajax-Busy-Indicator-tp15153150p15177222.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax Busy Indicator
This seems like tweaking... nope, that's what CSS is for, you wouldn't want to change your markup just to put something as tiny as an ajaxindicator some pixels to the left would you? (just an example) What I do not want is the indicator to take up extra space from where it does not belong (i.e., either immediate left or right side of the button). Say, I want the following layout: element Aelement BindicatorIconelement Cnew row/block element DajaxSubmitButtonelement Eelement F With css I cannot position the IndicatorAppender like that. It will only appear on either left or right side of the ajaxSubmitButton. What I want is to a) independently position the indicatorIcon and b) independently position the submitButton and c) activate the indicatorIcon with the submitbutton. ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Feedback Panel and Ajax Busy Indicator
Hi! I got the Ajax busy indicator working with the code below, but I have run into a new problem: the feedbackpanel does not display the feedbacks anymore. Does anyone know what I managed to do wrong eventually? And more importantly, how to fix the feedback panel? ** Martin 2008/1/30, Martin Makundi [EMAIL PROTECTED]: Hi! Tnx Igor, I finally got it working after quite some wrestling.. I understood I must extend the AjaxButton? I shall play around with it some more in order to more fully understand it. However, in case someone else needs it too, my complete code and markup is available below for ajax busy indicator for form submit button. /** * This class TODO */ public class IndicatorLogin extends WebPage { private static final long serialVersionUID = 1L; /** * Constructor for TODO */ @SuppressWarnings(serial) public IndicatorLogin() { final Form loginForm = new Form(loginForm, new Model()); final AjaxIndicatorContainer indicatorContainer = new AjaxIndicatorContainer(loginForm); { TextField userIdField = new TextField(userId, new Model()); userIdField.setRequired(true); loginForm.add(userIdField); } { PasswordTextField passwdField = new PasswordTextField(password, new Model()); passwdField.setResetPassword(false); loginForm.add(passwdField); } { final AjaxButton loginButton = new MyAjaxButton(loginButton, loginForm) { @Override protected void onSubmit(AjaxRequestTarget arg0, Form arg1) { simulateLoginTransaction(); } public String getAjaxIndicatorMarkupId() { return indicatorContainer.getMarkupId(); } }; loginForm.add(loginButton); } add(new FeedbackPanel(feedback)); add(loginForm); } /** * This method TODO */ synchronized void simulateLoginTransaction() { System.out.println(Transaction begin.); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println(Transaction complete.); } } /** * This class TODO */ @SuppressWarnings(serial) class AjaxIndicatorContainer extends WebMarkupContainer { /** * Constructor for TODO * @param form */ public AjaxIndicatorContainer(Form form) { super(ajaxIndicator); // wicket:id setOutputMarkupId(true); setMarkupId(ajaxIndicatorId); // markup:id form.add(this); } /** * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src,urlFor(AbstractDefaultAjaxBehavior.INDICATOR)); } } abstract class MyAjaxButton extends AjaxButton implements IAjaxIndicatorAware { /** * Constructor for TODO * * @param id * @param form */ public MyAjaxButton(String id, Form form) { super(id, form); } }; html xmlns:wicket=http://wicket.sourceforge.net; head titleLogin form/title /head body h1Login/h1 span wicket:id=feedbackFeedback messages will be here./span form wicket:id=loginForm table border=0 cellspacing=0 cellpadding=2 align=center trtd NOWRAP width=80 align=right Username: /td tdinput type=text wicket:id=userId/td/tr trtd NOWRAP align=right Password: /tdtdinput type=password wicket:id=password/td/tr trtd align=right img src=# border=0 style=display:none wicket:id=ajaxIndicator//tdtd NOWRAP input type=submit value=Sign in wicket:id=loginButton /td/tr /table /form /body /html ** Martin 2008/1/30, Igor Vaynberg [EMAIL PROTECTED]: img src=# border=0 wicket:id=ajaxIndicatorImage id=ajaxIndicatorImage/ should get you started :) the only caveat is if that image component for some reason has setoutputmarkupid(true) set on it, in which case the id attr you put into markup will be overwritten, to make this thing work dynamically you would final Image image=new Image(ajxIndicatorImage, ...); image.setOutputMarkupId(true); image.setMarkupId('whatever-you-want-but-make-sure-its-unique'); pass that markup id to your iajaxindicatorware component alternatively you can wire up the two components so the use wicket's automatically generated markup id which is available via component.getmarkupid() but the caveat is that it is only available during render -igor class abstract mycomponent implements iajaxindicatoraware { }; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax Busy Indicator
Hi! Tnx Igor, I finally got it working after quite some wrestling.. I understood I must extend the AjaxButton? I shall play around with it some more in order to more fully understand it. However, in case someone else needs it too, my complete code and markup is available below for ajax busy indicator for form submit button. /** * This class TODO */ public class IndicatorLogin extends WebPage { private static final long serialVersionUID = 1L; /** * Constructor for TODO */ @SuppressWarnings(serial) public IndicatorLogin() { final Form loginForm = new Form(loginForm, new Model()); final AjaxIndicatorContainer indicatorContainer = new AjaxIndicatorContainer(loginForm); { TextField userIdField = new TextField(userId, new Model()); userIdField.setRequired(true); loginForm.add(userIdField); } { PasswordTextField passwdField = new PasswordTextField(password, new Model()); passwdField.setResetPassword(false); loginForm.add(passwdField); } { final AjaxButton loginButton = new MyAjaxButton(loginButton, loginForm) { @Override protected void onSubmit(AjaxRequestTarget arg0, Form arg1) { simulateLoginTransaction(); } public String getAjaxIndicatorMarkupId() { return indicatorContainer.getMarkupId(); } }; loginForm.add(loginButton); } add(new FeedbackPanel(feedback)); add(loginForm); } /** * This method TODO */ synchronized void simulateLoginTransaction() { System.out.println(Transaction begin.); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println(Transaction complete.); } } /** * This class TODO */ @SuppressWarnings(serial) class AjaxIndicatorContainer extends WebMarkupContainer { /** * Constructor for TODO * @param form */ public AjaxIndicatorContainer(Form form) { super(ajaxIndicator); // wicket:id setOutputMarkupId(true); setMarkupId(ajaxIndicatorId); // markup:id form.add(this); } /** * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src,urlFor(AbstractDefaultAjaxBehavior.INDICATOR)); } } abstract class MyAjaxButton extends AjaxButton implements IAjaxIndicatorAware { /** * Constructor for TODO * * @param id * @param form */ public MyAjaxButton(String id, Form form) { super(id, form); } }; html xmlns:wicket=http://wicket.sourceforge.net; head titleLogin form/title /head body h1Login/h1 span wicket:id=feedbackFeedback messages will be here./span form wicket:id=loginForm table border=0 cellspacing=0 cellpadding=2 align=center trtd NOWRAP width=80 align=right Username: /td tdinput type=text wicket:id=userId/td/tr trtd NOWRAP align=right Password: /tdtdinput type=password wicket:id=password/td/tr trtd align=right img src=# border=0 style=display:none wicket:id=ajaxIndicator//tdtd NOWRAP input type=submit value=Sign in wicket:id=loginButton /td/tr /table /form /body /html ** Martin 2008/1/30, Igor Vaynberg [EMAIL PROTECTED]: img src=# border=0 wicket:id=ajaxIndicatorImage id=ajaxIndicatorImage/ should get you started :) the only caveat is if that image component for some reason has setoutputmarkupid(true) set on it, in which case the id attr you put into markup will be overwritten, to make this thing work dynamically you would final Image image=new Image(ajxIndicatorImage, ...); image.setOutputMarkupId(true); image.setMarkupId('whatever-you-want-but-make-sure-its-unique'); pass that markup id to your iajaxindicatorware component alternatively you can wire up the two components so the use wicket's automatically generated markup id which is available via component.getmarkupid() but the caveat is that it is only available during render -igor class abstract mycomponent implements iajaxindicatoraware { }; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax Busy Indicator
no, you dont need to extend an ajaxbutton, IAjaxIndicatorAware works on any component that has any kind of ajax behavior added to it -igor On Jan 30, 2008 1:34 PM, Martin Makundi [EMAIL PROTECTED] wrote: Hi! Tnx Igor, I finally got it working after quite some wrestling.. I understood I must extend the AjaxButton? I shall play around with it some more in order to more fully understand it. However, in case someone else needs it too, my complete code and markup is available below for ajax busy indicator for form submit button. /** * This class TODO */ public class IndicatorLogin extends WebPage { private static final long serialVersionUID = 1L; /** * Constructor for TODO */ @SuppressWarnings(serial) public IndicatorLogin() { final Form loginForm = new Form(loginForm, new Model()); final AjaxIndicatorContainer indicatorContainer = new AjaxIndicatorContainer(loginForm); { TextField userIdField = new TextField(userId, new Model()); userIdField.setRequired(true); loginForm.add(userIdField); } { PasswordTextField passwdField = new PasswordTextField(password, new Model()); passwdField.setResetPassword(false); loginForm.add(passwdField); } { final AjaxButton loginButton = new MyAjaxButton(loginButton, loginForm) { @Override protected void onSubmit(AjaxRequestTarget arg0, Form arg1) { simulateLoginTransaction(); } public String getAjaxIndicatorMarkupId() { return indicatorContainer.getMarkupId(); } }; loginForm.add(loginButton); } add(new FeedbackPanel(feedback)); add(loginForm); } /** * This method TODO */ synchronized void simulateLoginTransaction() { System.out.println(Transaction begin.); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println(Transaction complete.); } } /** * This class TODO */ @SuppressWarnings(serial) class AjaxIndicatorContainer extends WebMarkupContainer { /** * Constructor for TODO * @param form */ public AjaxIndicatorContainer(Form form) { super(ajaxIndicator); // wicket:id setOutputMarkupId(true); setMarkupId(ajaxIndicatorId); // markup:id form.add(this); } /** * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src,urlFor(AbstractDefaultAjaxBehavior.INDICATOR)); } } abstract class MyAjaxButton extends AjaxButton implements IAjaxIndicatorAware { /** * Constructor for TODO * * @param id * @param form */ public MyAjaxButton(String id, Form form) { super(id, form); } }; html xmlns:wicket=http://wicket.sourceforge.net; head titleLogin form/title /head body h1Login/h1 span wicket:id=feedbackFeedback messages will be here./span form wicket:id=loginForm table border=0 cellspacing=0 cellpadding=2 align=center trtd NOWRAP width=80 align=right Username: /td tdinput type=text wicket:id=userId/td/tr trtd NOWRAP align=right Password: /tdtdinput type=password wicket:id=password/td/tr trtd align=right img src=# border=0 style=display:none wicket:id=ajaxIndicator//tdtd NOWRAP input type=submit value=Sign in wicket:id=loginButton /td/tr /table /form /body /html ** Martin 2008/1/30, Igor Vaynberg [EMAIL PROTECTED]: img src=# border=0 wicket:id=ajaxIndicatorImage id=ajaxIndicatorImage/ should get you started :) the only caveat is if that image component for some reason has setoutputmarkupid(true) set on it, in which case the id attr you put into markup will be overwritten, to make this thing work dynamically you would final Image image=new Image(ajxIndicatorImage, ...); image.setOutputMarkupId(true); image.setMarkupId('whatever-you-want-but-make-sure-its-unique'); pass that markup id to your iajaxindicatorware component alternatively you can wire up the two components so the use wicket's automatically generated markup id which is available via component.getmarkupid() but the caveat is that it is only available during render -igor class abstract mycomponent implements iajaxindicatoraware { }; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Feedback Panel and Ajax Busy Indicator
On Wed, 30 Jan 2008, Martin Makundi wrote: I got the Ajax busy indicator working with the code below, but I have run into a new problem: the feedbackpanel does not display the feedbacks anymore. Does anyone know what I managed to do wrong eventually? And more importantly, how to fix the feedback panel? ... final AjaxButton loginButton = new MyAjaxButton(loginButton, loginForm) { @Override protected void onSubmit(AjaxRequestTarget arg0, Form arg1) { simulateLoginTransaction(); } In onSubmit, also call target.addComponent(IndicatorLogin.this.get(feedback)); and please rename arg0 to target :) It's a good idea to attach Wicket sources to your IDE (e.g. mvn -DdownloadSources=true eclipse:eclipse) because then this tends to happen automatically. add(new FeedbackPanel(feedback)); Change this to add(new FeedbackPanel(feedback).setOutputPlaceHolderTag(true)); add(loginForm); } /** * This method TODO */ ...and it would be a good idea to cleanup code formatting and remove these comments... synchronized void simulateLoginTransaction() { System.out.println(Transaction begin.); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } ...and fix the exception handling, throw new RuntimeException(e); Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax Busy Indicator
no, you dont need to extend an ajaxbutton, IAjaxIndicatorAware works on any component that has any kind of ajax behavior added to it This means? I tried using AjaxButton and adding an AjaxFormSubmitBehavior implements IAjaxIndicatorAware but that never received the submit event. I also tried a SubmitLink button with the same behavior, but it did not work. Finally, extending AjaxButton and implementing IAjaxIndicatorAware received the event, but lost the feedback functionality. I am still a bit clueless with this new frame ;) So how whould you have done it exactly right? t. Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Feedback Panel and Ajax Busy Indicator
and please rename arg0 to target :) It's a good idea to attach Wicket sources to your IDE (e.g. mvn -DdownloadSources=true eclipse:eclipse) because then this tends to happen automatically. I have been thinking of attaching the sources... I found some example of adding all sources of all packages in the repository. Is there a way to limit this to e.g., specific packages? This way I can lazy-load the sources whenever needed. And does it require some additional setup from Eclipse (e.g., pom.xml/project properties) or will it automatically find the existing sources from maven repository? add(new FeedbackPanel(feedback)); Change this to add(new FeedbackPanel(feedback).setOutputPlaceHolderTag(true)); I will try these and comment. /** * This method TODO */ ...and it would be a good idea to cleanup code formatting and remove these comments... I prefer to comment all non-private members and the template gives me a TODO... try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } ...and fix the exception handling, throw new RuntimeException(e); Relax, it's just mock-up-code, but yes, I completely agree with you on this ;) ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax Busy Indicator
if ajaxbutton works for you thats great. i was simply trying to explain that iajaxindicatoraware is decoupled from ajaxbutton - it will work on any component to which you add an ajax behavior. -igor On Jan 30, 2008 9:04 PM, Martin Makundi [EMAIL PROTECTED] wrote: no, you dont need to extend an ajaxbutton, IAjaxIndicatorAware works on any component that has any kind of ajax behavior added to it This means? I tried using AjaxButton and adding an AjaxFormSubmitBehavior implements IAjaxIndicatorAware but that never received the submit event. I also tried a SubmitLink button with the same behavior, but it did not work. Finally, extending AjaxButton and implementing IAjaxIndicatorAware received the event, but lost the feedback functionality. I am still a bit clueless with this new frame ;) So how whould you have done it exactly right? t. Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax Busy Indicator
Take a look at IndicatingAjaxButton in the extensions-project and adapt it for your form. If you don't mind taking the default indicator, you can use WicketAjaxIndicatorAppender just like in the mentioned class Martin Makundi wrote: Hi! Can anyone help? I am having difficulties showing a bysy indicator besides the submit button, while the form is being submitted and processed. I have only found pieces of varying examples and I have tried to put them work together, but it just does not seem want to show the indicator. Here is my code: public class Login extends WebPage { // ... default constructor contents: final Form loginForm = new Form(LOGIN_FORM, new Model()); final AjaxIndicatorContainer indicatorContainer = new AjaxIndicatorContainer(); indicatorContainer.setOutputMarkupId(true); loginForm.add(indicatorContainer); final SubmitLink loginButton = new SubmitLink(LOGIN_BUTTON, new Model()) { /** * @see org.apache.wicket.markup.html.form.SubmitLink#onSubmit() */ @Override public void onSubmit() { super.onSubmit(); Thread.sleep(5000); // Simulate form processing } }; abstract class AjaxFormSubmitIndicator extends AjaxFormSubmitBehavior implements IAjaxIndicatorAware { /** * Constructor for TODO * */ public AjaxFormSubmitIndicator() { super(onchange); // I have tried onchange and onclick } } loginButton.add(new AjaxFormSubmitIndicator() { @Override protected void onError(AjaxRequestTarget arg0) { // TODO Auto-generated method stub } @Override protected void onSubmit(AjaxRequestTarget arg0) { loginButton.onSubmit(); } public String getAjaxIndicatorMarkupId() { return indicatorContainer.getMarkupId(); } }); loginForm.add(loginButton); // ... etc.. add(new FeedbackPanel(feedback)); add(loginForm); } public class AjaxIndicatorContainer extends WebMarkupContainer { /** * */ private static final long serialVersionUID = 5573778050703849297L; /** * */ public static final String INDICATOR_MARKUP_ID = ajaxIndicator; /** * Constructor for TODO */ public AjaxIndicatorContainer() { super(INDICATOR_MARKUP_ID); } /** * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src,urlFor(AbstractDefaultAjaxBehavior.INDICATOR)); } body wicket:extend h1Login/h1 Feedback messages will be here. form wicket:id=loginForm table border=0 cellspacing=0 cellpadding=2 align=center trtd NOWRAP width=80 align=right Username: /td tdinput type=text wicket:id=userId/td/tr trtd NOWRAP align=right Password: /tdtdinput type=password wicket:id=password/td/tr trtd align=right # /tdtd NOWRAP input type=submit value=Sign in wicket:id=loginButton /td/tr /table /form /wicket:extend /body ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Ajax-Busy-Indicator-tp15153150p15160382.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax Busy Indicator
Hi! I can get the default behaviour to work. However, I do not want the ajax indicator icon to be appended after the button. Instead, I want to simply mark it elsewhere in my html file to position it suitably. I have not found a way to separate the button from the icon in the markup. I am new to Wicket, so I haven't got my mind wrapped around this the right way yet. To put it in swing, I would set the icon visible on default render. Then I would set it visible for the duration of the processing and set it invisible again after that. At least this is what it should look like, but I cannot seem to get the pieces together nicely. Anybody can help? Anyone have boilerplate code for the same problem? ** Martin 2008/1/29, Michael Sparer [EMAIL PROTECTED]: Take a look at IndicatingAjaxButton in the extensions-project and adapt it for your form. If you don't mind taking the default indicator, you can use WicketAjaxIndicatorAppender just like in the mentioned class Martin Makundi wrote: Hi! Can anyone help? I am having difficulties showing a bysy indicator besides the submit button, while the form is being submitted and processed. I have only found pieces of varying examples and I have tried to put them work together, but it just does not seem want to show the indicator. Here is my code: public class Login extends WebPage { // ... default constructor contents: final Form loginForm = new Form(LOGIN_FORM, new Model()); final AjaxIndicatorContainer indicatorContainer = new AjaxIndicatorContainer(); indicatorContainer.setOutputMarkupId(true); loginForm.add(indicatorContainer); final SubmitLink loginButton = new SubmitLink(LOGIN_BUTTON, new Model()) { /** * @see org.apache.wicket.markup.html.form.SubmitLink#onSubmit() */ @Override public void onSubmit() { super.onSubmit(); Thread.sleep(5000); // Simulate form processing } }; abstract class AjaxFormSubmitIndicator extends AjaxFormSubmitBehavior implements IAjaxIndicatorAware { /** * Constructor for TODO * */ public AjaxFormSubmitIndicator() { super(onchange); // I have tried onchange and onclick } } loginButton.add(new AjaxFormSubmitIndicator() { @Override protected void onError(AjaxRequestTarget arg0) { // TODO Auto-generated method stub } @Override protected void onSubmit(AjaxRequestTarget arg0) { loginButton.onSubmit(); } public String getAjaxIndicatorMarkupId() { return indicatorContainer.getMarkupId(); } }); loginForm.add(loginButton); // ... etc.. add(new FeedbackPanel(feedback)); add(loginForm); } public class AjaxIndicatorContainer extends WebMarkupContainer { /** * */ private static final long serialVersionUID = 5573778050703849297L; /** * */ public static final String INDICATOR_MARKUP_ID = ajaxIndicator; /** * Constructor for TODO */ public AjaxIndicatorContainer() { super(INDICATOR_MARKUP_ID); } /** * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src,urlFor(AbstractDefaultAjaxBehavior.INDICATOR)); } body wicket:extend h1Login/h1 Feedback messages will be here. form wicket:id=loginForm table border=0 cellspacing=0 cellpadding=2 align=center trtd NOWRAP width=80 align=right Username: /td tdinput type=text wicket:id=userId/td/tr trtd NOWRAP align=right Password: /tdtdinput type=password wicket:id=password/td/tr trtd align=right # /tdtd NOWRAP input type=submit value=Sign in wicket:id=loginButton /td/tr /table /form /wicket:extend /body ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Ajax-Busy-Indicator-tp15153150p15160382.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax Busy Indicator
IAjaxIndicatorAware simply takes the html id of the element you want to show/hide; it can be placed anywhere in html... alternatively there are clientside javascript callbacks you can hook into to create gmail-like busy indicator, see wicket-ajax.js -igor On Jan 29, 2008 11:11 AM, Martin Makundi [EMAIL PROTECTED] wrote: Hi! I can get the default behaviour to work. However, I do not want the ajax indicator icon to be appended after the button. Instead, I want to simply mark it elsewhere in my html file to position it suitably. I have not found a way to separate the button from the icon in the markup. I am new to Wicket, so I haven't got my mind wrapped around this the right way yet. To put it in swing, I would set the icon visible on default render. Then I would set it visible for the duration of the processing and set it invisible again after that. At least this is what it should look like, but I cannot seem to get the pieces together nicely. Anybody can help? Anyone have boilerplate code for the same problem? ** Martin 2008/1/29, Michael Sparer [EMAIL PROTECTED]: Take a look at IndicatingAjaxButton in the extensions-project and adapt it for your form. If you don't mind taking the default indicator, you can use WicketAjaxIndicatorAppender just like in the mentioned class Martin Makundi wrote: Hi! Can anyone help? I am having difficulties showing a bysy indicator besides the submit button, while the form is being submitted and processed. I have only found pieces of varying examples and I have tried to put them work together, but it just does not seem want to show the indicator. Here is my code: public class Login extends WebPage { // ... default constructor contents: final Form loginForm = new Form(LOGIN_FORM, new Model()); final AjaxIndicatorContainer indicatorContainer = new AjaxIndicatorContainer(); indicatorContainer.setOutputMarkupId(true); loginForm.add(indicatorContainer); final SubmitLink loginButton = new SubmitLink(LOGIN_BUTTON, new Model()) { /** * @see org.apache.wicket.markup.html.form.SubmitLink#onSubmit() */ @Override public void onSubmit() { super.onSubmit(); Thread.sleep(5000); // Simulate form processing } }; abstract class AjaxFormSubmitIndicator extends AjaxFormSubmitBehavior implements IAjaxIndicatorAware { /** * Constructor for TODO * */ public AjaxFormSubmitIndicator() { super(onchange); // I have tried onchange and onclick } } loginButton.add(new AjaxFormSubmitIndicator() { @Override protected void onError(AjaxRequestTarget arg0) { // TODO Auto-generated method stub } @Override protected void onSubmit(AjaxRequestTarget arg0) { loginButton.onSubmit(); } public String getAjaxIndicatorMarkupId() { return indicatorContainer.getMarkupId(); } }); loginForm.add(loginButton); // ... etc.. add(new FeedbackPanel(feedback)); add(loginForm); } public class AjaxIndicatorContainer extends WebMarkupContainer { /** * */ private static final long serialVersionUID = 5573778050703849297L; /** * */ public static final String INDICATOR_MARKUP_ID = ajaxIndicator; /** * Constructor for TODO */ public AjaxIndicatorContainer() { super(INDICATOR_MARKUP_ID); } /** * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src,urlFor(AbstractDefaultAjaxBehavior.INDICATOR)); } body wicket:extend h1Login/h1 Feedback messages will be here. form wicket:id=loginForm table border=0 cellspacing=0 cellpadding=2 align=center trtd NOWRAP width=80 align=right Username: /td tdinput type=text wicket:id=userId/td/tr trtd NOWRAP align=right Password: /tdtdinput type=password wicket:id=password/td/tr trtd align=right # /tdtd NOWRAP input type=submit value=Sign in wicket:id=loginButton /td/tr /table /form /wicket:extend /body ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Ajax-Busy-Indicator-tp15153150p15160382.html Sent from the Wicket - User mailing list archive at Nabble.com
RE: Ajax Busy Indicator
You can use CSS to control the positon of the busy indicating image. To place it right from the button use span.wicket-ajax-indicator img { margin:0; padding:0; padding-left: 2px; display: inline; white-space: nowrap; } Use other css code for other positioning. Stefan -Ursprüngliche Nachricht- Von: Martin Makundi [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 29. Januar 2008 20:12 An: users@wicket.apache.org Betreff: Re: Ajax Busy Indicator Hi! I can get the default behaviour to work. However, I do not want the ajax indicator icon to be appended after the button. Instead, I want to simply mark it elsewhere in my html file to position it suitably. I have not found a way to separate the button from the icon in the markup. I am new to Wicket, so I haven't got my mind wrapped around this the right way yet. To put it in swing, I would set the icon visible on default render. Then I would set it visible for the duration of the processing and set it invisible again after that. At least this is what it should look like, but I cannot seem to get the pieces together nicely. Anybody can help? Anyone have boilerplate code for the same problem? ** Martin 2008/1/29, Michael Sparer [EMAIL PROTECTED]: Take a look at IndicatingAjaxButton in the extensions-project and adapt it for your form. If you don't mind taking the default indicator, you can use WicketAjaxIndicatorAppender just like in the mentioned class Martin Makundi wrote: Hi! Can anyone help? I am having difficulties showing a bysy indicator besides the submit button, while the form is being submitted and processed. I have only found pieces of varying examples and I have tried to put them work together, but it just does not seem want to show the indicator. Here is my code: public class Login extends WebPage { // ... default constructor contents: final Form loginForm = new Form(LOGIN_FORM, new Model()); final AjaxIndicatorContainer indicatorContainer = new AjaxIndicatorContainer(); indicatorContainer.setOutputMarkupId(true); loginForm.add(indicatorContainer); final SubmitLink loginButton = new SubmitLink(LOGIN_BUTTON, new Model()) { /** * @see org.apache.wicket.markup.html.form.SubmitLink#onSubmit() */ @Override public void onSubmit() { super.onSubmit(); Thread.sleep(5000); // Simulate form processing } }; abstract class AjaxFormSubmitIndicator extends AjaxFormSubmitBehavior implements IAjaxIndicatorAware { /** * Constructor for TODO * */ public AjaxFormSubmitIndicator() { super(onchange); // I have tried onchange and onclick } } loginButton.add(new AjaxFormSubmitIndicator() { @Override protected void onError(AjaxRequestTarget arg0) { // TODO Auto-generated method stub } @Override protected void onSubmit(AjaxRequestTarget arg0) { loginButton.onSubmit(); } public String getAjaxIndicatorMarkupId() { return indicatorContainer.getMarkupId(); } }); loginForm.add(loginButton); // ... etc.. add(new FeedbackPanel(feedback)); add(loginForm); } public class AjaxIndicatorContainer extends WebMarkupContainer { /** * */ private static final long serialVersionUID = 5573778050703849297L; /** * */ public static final String INDICATOR_MARKUP_ID = ajaxIndicator; /** * Constructor for TODO */ public AjaxIndicatorContainer() { super(INDICATOR_MARKUP_ID); } /** * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src,urlFor(AbstractDefaultAjaxBehavior.INDICATOR)); } body wicket:extend h1Login/h1 Feedback messages will be here. form wicket:id=loginForm table border=0 cellspacing=0 cellpadding=2 align=center trtd NOWRAP width=80 align=right Username: /td tdinput type=text wicket:id=userId/td/tr trtd NOWRAP align=right Password: /tdtdinput type=password wicket:id=password/td/tr trtd align=right # /tdtd NOWRAP input type=submit value=Sign in wicket:id=loginButton /td/tr /table /form /wicket:extend /body ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Ajax-Busy-Indicator
Re: Ajax Busy Indicator
You can use CSS to control the positon of the busy indicating image. To place it right from the button use This seems like tweaking... IAjaxIndicatorAware simply takes the html id of the element you want to show/hide; it can be placed anywhere in html... This is more of what I am looking for, but with IAjaxIndicatorAware I havent succeeded in making the indicator appear. I posted earlier the code I have, but it didn't do the job. I will repeat it here if someone can see immediately what is wrong in it: public class Login extends WebPage { // ... default constructor contents: final Form loginForm = new Form(LOGIN_FORM, new Model()); final AjaxIndicatorContainer indicatorContainer = new AjaxIndicatorContainer(); indicatorContainer.setOutputMarkupId(true); loginForm.add(indicatorContainer); final SubmitLink loginButton = new SubmitLink(LOGIN_BUTTON, new Model()) { /** * @see org.apache.wicket.markup.html.form.SubmitLink#onSubmit() */ @Override public void onSubmit() { super.onSubmit(); Thread.sleep(5000); // Simulate form processing } }; abstract class AjaxFormSubmitIndicator extends AjaxFormSubmitBehavior implements IAjaxIndicatorAware { /** * Constructor for TODO * */ public AjaxFormSubmitIndicator() { super(onchange); // I have tried onchange and onclick } } loginButton.add(new AjaxFormSubmitIndicator() { @Override protected void onError(AjaxRequestTarget arg0) { // TODO Auto-generated method stub } @Override protected void onSubmit(AjaxRequestTarget arg0) { loginButton.onSubmit(); } public String getAjaxIndicatorMarkupId() { return indicatorContainer.getMarkupId(); } }); loginForm.add(loginButton); // ... etc.. add(new FeedbackPanel(feedback)); add(loginForm); } public class AjaxIndicatorContainer extends WebMarkupContainer { /** * */ private static final long serialVersionUID = 5573778050703849297L; /** * */ public static final String INDICATOR_MARKUP_ID = ajaxIndicator; /** * Constructor for TODO */ public AjaxIndicatorContainer() { super(INDICATOR_MARKUP_ID); } /** * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src,urlFor(AbstractDefaultAjaxBehavior.INDICATOR)); } body wicket:extend h1Login/h1 span wicket:id=feedbackFeedback messages will be here./span form wicket:id=loginForm table border=0 cellspacing=0 cellpadding=2 align=center trtd NOWRAP width=80 align=right Username: /td tdinput type=text wicket:id=userId/td/tr trtd NOWRAP align=right Password: /tdtdinput type=password wicket:id=password/td/tr trtd align=rightimg src=# border=0 wicket:id=ajaxIndicator style=display:none//tdtd NOWRAP input type=submit value=Sign in wicket:id=loginButton /td/tr /table /form /wicket:extend /body - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ajax Busy Indicator
On Wed, 30 Jan 2008, Martin Makundi wrote: public class Login extends WebPage { // ... default constructor contents: final Form loginForm = new Form(LOGIN_FORM, new Model()); final AjaxIndicatorContainer indicatorContainer = new AjaxIndicatorContainer(); indicatorContainer.setOutputMarkupId(true); loginForm.add(indicatorContainer); Maybe you won't need the container around the indicator if you say setOutputMarkupPlaceHolderTag(true) to the indicator itself. public String getAjaxIndicatorMarkupId() { return indicatorContainer.getMarkupId(); } I have used hardocoded HTML ids here, that way you can easily control the layout of the indicator in CSS. public class AjaxIndicatorContainer extends WebMarkupContainer { ... */ public static final String INDICATOR_MARKUP_ID = ajaxIndicator; ... */ public AjaxIndicatorContainer() { super(INDICATOR_MARKUP_ID); } Wicket id is a different thing than the markup id. Probably you need to override getMarkupId() to return that id. And wait a minute, is the container in fact the indicator? Then you definitely need to output the placeholder container for it, otherwise ajax has no way of making it visible as it does not appear in the HTML. You should be able to see this as an error in the ajax debug console (available when running with -Dwicket.configuration=development ). @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src,urlFor(AbstractDefaultAjaxBehavior.INDICATOR)); } This part I didn't understand. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Ajax Busy Indicator
Hi! Can anyone help? I am having difficulties showing a bysy indicator besides the submit button, while the form is being submitted and processed. I have only found pieces of varying examples and I have tried to put them work together, but it just does not seem want to show the indicator. Here is my code: public class Login extends WebPage { // ... default constructor contents: final Form loginForm = new Form(LOGIN_FORM, new Model()); final AjaxIndicatorContainer indicatorContainer = new AjaxIndicatorContainer(); indicatorContainer.setOutputMarkupId(true); loginForm.add(indicatorContainer); final SubmitLink loginButton = new SubmitLink(LOGIN_BUTTON, new Model()) { /** * @see org.apache.wicket.markup.html.form.SubmitLink#onSubmit() */ @Override public void onSubmit() { super.onSubmit(); Thread.sleep(5000); // Simulate form processing } }; abstract class AjaxFormSubmitIndicator extends AjaxFormSubmitBehavior implements IAjaxIndicatorAware { /** * Constructor for TODO * */ public AjaxFormSubmitIndicator() { super(onchange); // I have tried onchange and onclick } } loginButton.add(new AjaxFormSubmitIndicator() { @Override protected void onError(AjaxRequestTarget arg0) { // TODO Auto-generated method stub } @Override protected void onSubmit(AjaxRequestTarget arg0) { loginButton.onSubmit(); } public String getAjaxIndicatorMarkupId() { return indicatorContainer.getMarkupId(); } }); loginForm.add(loginButton); // ... etc.. add(new FeedbackPanel(feedback)); add(loginForm); } public class AjaxIndicatorContainer extends WebMarkupContainer { /** * */ private static final long serialVersionUID = 5573778050703849297L; /** * */ public static final String INDICATOR_MARKUP_ID = ajaxIndicator; /** * Constructor for TODO */ public AjaxIndicatorContainer() { super(INDICATOR_MARKUP_ID); } /** * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag) */ @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(src,urlFor(AbstractDefaultAjaxBehavior.INDICATOR)); } body wicket:extend h1Login/h1 span wicket:id=feedbackFeedback messages will be here./span form wicket:id=loginForm table border=0 cellspacing=0 cellpadding=2 align=center trtd NOWRAP width=80 align=right Username: /td tdinput type=text wicket:id=userId/td/tr trtd NOWRAP align=right Password: /tdtdinput type=password wicket:id=password/td/tr trtd align=rightimg src=# border=0 wicket:id=ajaxIndicator style=display:none//tdtd NOWRAP input type=submit value=Sign in wicket:id=loginButton /td/tr /table /form /wicket:extend /body ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]