Re: ModalWindow
I'm also having problems with setting the size of a ModalWindow. It seems the only way I can affect the height of the window is by setting the initial height as px which is not an optimal solution because my users have different screen resolutions. Here's the code: infoModal.setCssClassName(ModalWindow.CSS_CLASS_GRAY); infoModal.setCookieName(null); infoModal.setResizable(false); infoModal.setInitialHeight(50); infoModal.setInitialWidth(50); infoModal.setHeightUnit("%"); infoModal.setWidthUnit("%"); infoModal.show(target); I've tried using setUserInitialHeight(true) and setUserInitialHeight(false), both have the same results. Now, using a screen resolution of 1680x1050 this window comes up as: The width, it would seem, is set to "50%" as you'd expect but the height is not. The dimensions of the window confirm this, 840x665 Using a resolution of 1024x768 the window comes up as: The dimensions this time are 512x733. Any help on this would be greatly appreciated. -- View this message in context: http://www.nabble.com/ModalWindow-tp17672576p25491333.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: Cancelling pending Ajax requests
Ideally, I would want to add a small wait period after each key stroke before the event is actually triggered and throttle the last event if another one comes in before the time period expires. Antti Mattila wrote: > > Problem: > I want to validate input as user types it, but validation takes a long > time > on the server. When validation result for the first input is returned, > user > might have caused several more input events to be validated. These > validation requests are pending execution on Wicket Ajax Channel. At this > point I'm only interested in validating the latest input, but before this > happens, all pending validation requests are processed. This is > unnecessary > and takes a lot of time so I want to cancel all the pending requests. > > Solution: > I did this by using named Channel and clearing all pending requests before > requesting the latest validation. I couldn't find a solution for this > problem, so I'm posting it here. Hopefully this might help someone else > and > please give me some feedback if this solution was not a good one. > > Thanks, > Antti Mattila > > Here's the code: > > public class ClearPendingAjaxRequests extends AjaxCallDecorator { > private final String clearPendingRequestsScript; > > public ClearPendingAjaxRequests(final String channel) { > clearPendingRequestsScript = "if (typeof > Wicket.channelManager.channels['" + channel + "'] != 'undefined') > Wicket.channelManager.channels['" + channel + "'].callbacks = new > Array();"; > } > > @Override > public CharSequence decorateScript(final CharSequence script) { > return clearPendingRequestsScript + script; > } > } > > public class UsersInputFieldOnChangeAjaxBehavior extends > AjaxFormComponentUpdatingBehavior { > public UsersInputFieldOnChangeAjaxBehavior() { > super("onkeyup"); > setThrottleDelay(Duration.milliseconds(500)); > } > > @Override > protected IAjaxCallDecorator getAjaxCallDecorator() { > return new ClearPendingAjaxRequests(getChannelName()); > } > > @Override > protected String getChannelName() { > return "ChannelForValidatingThisSpecificInput"; > } > > @Override > protected void onUpdate(final AjaxRequestTarget target) { > // Validate user's input, this takes a long time. > // Update UI. > } > } > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/Cancelling-pending-Ajax-requests-tp23523655p23813842.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: Cancelling pending Ajax requests
Does this solution actually work though? I tried it and I don't see any behaviour I wouldn't get from just the throttle delay. Is there something I need to change in this to use it? Possibly the channel names? Antti Mattila wrote: > > Problem: > I want to validate input as user types it, but validation takes a long > time > on the server. When validation result for the first input is returned, > user > might have caused several more input events to be validated. These > validation requests are pending execution on Wicket Ajax Channel. At this > point I'm only interested in validating the latest input, but before this > happens, all pending validation requests are processed. This is > unnecessary > and takes a lot of time so I want to cancel all the pending requests. > > Solution: > I did this by using named Channel and clearing all pending requests before > requesting the latest validation. I couldn't find a solution for this > problem, so I'm posting it here. Hopefully this might help someone else > and > please give me some feedback if this solution was not a good one. > > Thanks, > Antti Mattila > > Here's the code: > > public class ClearPendingAjaxRequests extends AjaxCallDecorator { > private final String clearPendingRequestsScript; > > public ClearPendingAjaxRequests(final String channel) { > clearPendingRequestsScript = "if (typeof > Wicket.channelManager.channels['" + channel + "'] != 'undefined') > Wicket.channelManager.channels['" + channel + "'].callbacks = new > Array();"; > } > > @Override > public CharSequence decorateScript(final CharSequence script) { > return clearPendingRequestsScript + script; > } > } > > public class UsersInputFieldOnChangeAjaxBehavior extends > AjaxFormComponentUpdatingBehavior { > public UsersInputFieldOnChangeAjaxBehavior() { > super("onkeyup"); > setThrottleDelay(Duration.milliseconds(500)); > } > > @Override > protected IAjaxCallDecorator getAjaxCallDecorator() { > return new ClearPendingAjaxRequests(getChannelName()); > } > > @Override > protected String getChannelName() { > return "ChannelForValidatingThisSpecificInput"; > } > > @Override > protected void onUpdate(final AjaxRequestTarget target) { > // Validate user's input, this takes a long time. > // Update UI. > } > } > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- View this message in context: http://www.nabble.com/Cancelling-pending-Ajax-requests-tp23523655p23810657.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: Wicket & IE7 Ajax problem
Terribly sorry about that... http://markmail.org/message/3llzlsmoa7jrbe32 here's a better link igor.vaynberg wrote: > > umm, the link you gave points to a thread about a problem with > wicket-velocity...? > > do you have the right link to the mailing list thread and the jira issue? > > -igor > > On Tue, Nov 11, 2008 at 7:22 AM, JohannesK <[EMAIL PROTECTED]> > wrote: >> >> Hello >> >> I am having the problem discussed here: >> http://www.mail-archive.com/users@wicket.apache.org/msg02284.html >> >> I see that in that thread and also in Jira several different solutions >> are >> suggested to the problem but I don't think any of them made it to Wicket >> 1.3.5? Do you have any plans on implementing a fix for this issue? I've >> tried adding the fix suggested by Lonnie there to wicket-ajax.js by hand >> but >> that for some reason stops Ajax working altogether in IE or Firefox... >> >> Any help on this issue would be greatly appreciated. >> -- >> View this message in context: >> http://www.nabble.com/Wicket---IE7-Ajax-problem-tp20441746p20441746.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/Wicket---IE7-Ajax-problem-tp20441746p20446675.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]
Wicket & IE7 Ajax problem
Hello I am having the problem discussed here: http://www.mail-archive.com/users@wicket.apache.org/msg02284.html I see that in that thread and also in Jira several different solutions are suggested to the problem but I don't think any of them made it to Wicket 1.3.5? Do you have any plans on implementing a fix for this issue? I've tried adding the fix suggested by Lonnie there to wicket-ajax.js by hand but that for some reason stops Ajax working altogether in IE or Firefox... Any help on this issue would be greatly appreciated. -- View this message in context: http://www.nabble.com/Wicket---IE7-Ajax-problem-tp20441746p20441746.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: A problem with paging - Page links not showing up
There should be a < span wicket:id="paging">< / span > there after the wicket:panel tag but it's only visible when i edit the post. JohannesK wrote: > > Hi > > I've tried searching for this problem but couldn't find anything useful. > My problem, in a nutshell, is that my PagingNavigation produces empty > blocks where the paging should go. Here's the Java, I'm doing this in the > constructor of a wicket Panel object: > > container = new WebMarkupContainer("bookDataView"); > DataView bookDataView = createDataView("bookDataRepeater"); > bookDataView.setItemsPerPage(5); > AjaxPagingNavigation ajaxPaging = new > AjaxPagingNavigation("paging",bookDataView); > ajaxPaging.setOutputMarkupId(true); > add(ajaxPaging); > container.add(bookDataView); > add(container); > > > On the HTML side: > > > > > > > > > cut out a bunch of here > > > > > > > > Now, I tested the dataview and it returns data just fine, well over 5 > items. View source shows this: > > > > > > > > The paging is just empty :s. Any idea what's going on here? > -- View this message in context: http://www.nabble.com/A-problem-with-paging---Page-links-not-showing-up-tp18275593p18275652.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]
A problem with paging - Page links not showing up
Hi I've tried searching for this problem but couldn't find anything useful. My problem, in a nutshell, is that my PagingNavigation produces empty blocks where the paging should go. Here's the Java, I'm doing this in the constructor of a wicket Panel object: container = new WebMarkupContainer("bookDataView"); DataView bookDataView = createDataView("bookDataRepeater"); bookDataView.setItemsPerPage(5); AjaxPagingNavigation ajaxPaging = new AjaxPagingNavigation("paging",bookDataView); ajaxPaging.setOutputMarkupId(true); add(ajaxPaging); container.add(bookDataView); add(container); On the HTML side: cut out a bunch of here Now, I tested the dataview and it returns data just fine, well over 5 items. View source shows this: The paging is just empty :s. Any idea what's going on here? -- View this message in context: http://www.nabble.com/A-problem-with-paging---Page-links-not-showing-up-tp18275593p18275593.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]
IOException from ModalWindow
Hi I'm using a ModalWindow for an user input -popup. The problem is that when i call AjaxRequestTarget.show(ModalWindow), i get an IOException from deep within jetty. Here's how it looks in the console: 13:33:56.139 WARN!! java.io.IOException: Tiedostonimen, hakemistonimen tai levynimen syntaksi ei kelpaa. TRANSLATION: The syntax of file, path or disk name is wrong. at java.io.WinNTFileSystem.canonicalize0(Native Method) at java.io.Win32FileSystem.canonicalize(Unknown Source) at java.io.File.getCanonicalPath(Unknown Source) at org.mortbay.util.FileResource.getAlias(FileResource.java:148) at org.mortbay.http.HttpContext.getResource(HttpContext.java:803) at org.mortbay.jetty.servlet.WebApplicationContext.getResource(WebApplicationContext.java:1246) at org.mortbay.jetty.servlet.ServletHandler.getResource(ServletHandler.java:711) at org.mortbay.jetty.servlet.ServletHandler.getResourceAsStream(ServletHandler.java:736) at org.mortbay.jetty.servlet.ServletHandler$Context.getResourceAsStream(ServletHandler.java:949) at org.apache.wicket.util.resource.WebExternalResourceStream.getInputStream(WebExternalResourceStream.java:98) at org.apache.wicket.request.target.resource.ResourceStreamRequestTarget.respond(ResourceStreamRequestTarget.java:131) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1097) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1166) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1245) at org.apache.wicket.RequestCycle.request(RequestCycle.java:489) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:319) at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:121) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:358) at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:342) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:111) at ordermanager.util.EntityManagerFilter.doFilterInternal(EntityManagerFilter.java:60) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567) at org.mortbay.http.HttpContext.handle(HttpContext.java:1807) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525) at org.mortbay.http.HttpContext.handle(HttpContext.java:1757) at org.mortbay.http.HttpServer.service(HttpServer.java:879) at org.mortbay.http.HttpConnection.service(HttpConnection.java:789) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:960) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:806) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:218) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:331) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:520) 13:33:56.143 WARN!! Alias request of 'file:/C:/workspace/ordermanager/:/0' for 'file:/C:/workspace/ordermanager/:/0' I'm assuming this has to do with the images the ModalWindow is using. Any ideas? -- View this message in context: http://www.nabble.com/IOException-from-ModalWindow-tf4757540.html#a13604927 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: Quick follow-up
Thanks for both replies. Oliver: setOutputMarkupPlaceholderTag() calls setOutputMarkupId(). Martijn: That explains a lot :) Oliver Lieven wrote: > > Hi, > > what about using products.setOutputMarkupId(true) ? > > regards, > Oliver > > > Martijn Dashorst wrote: >> >> Is the products a repeater (ListView, RepeatingView, DataView)? Then >> it doesn't have its own markup (see for instance >> http://cwiki.apache.org/WICKET/how-to-repaint-a-listview-via-ajax.html). >> >> Martijn >> >> On 10/23/07, JohannesK <[EMAIL PROTECTED]> wrote: >>> >>> I managed to solve that problem, but i still cannot get the markup id to >>> show >>> up in my div. >>> >>> These two calls: >>> products.setMarkupId("productlist"+item.getIndex()); >>> products.setOutputMarkupPlaceholderTag(true); >>> >>> don't seem to do anything. I can change the class of the div just fine >>> with >>> a SimpleAttributeModifier, but for the div id i can't get it to work. >>> -- >>> View this message in context: >>> http://www.nabble.com/Wicket-id-vs.-markup-id-%28wicket-1.3.0-beta4%29-tf4677248.html#a13364719 >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> >> -- >> Buy Wicket in Action: http://manning.com/dashorst >> Apache Wicket 1.3.0-beta4 is released >> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta4/ >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- View this message in context: http://www.nabble.com/Wicket-id-vs.-markup-id-%28wicket-1.3.0-beta4%29-tf4677248.html#a13379582 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Quick follow-up
I managed to solve that problem, but i still cannot get the markup id to show up in my div. These two calls: products.setMarkupId("productlist"+item.getIndex()); products.setOutputMarkupPlaceholderTag(true); don't seem to do anything. I can change the class of the div just fine with a SimpleAttributeModifier, but for the div id i can't get it to work. -- View this message in context: http://www.nabble.com/Wicket-id-vs.-markup-id-%28wicket-1.3.0-beta4%29-tf4677248.html#a13364719 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Wicket id vs. markup id (wicket-1.3.0-beta4)
Hi all I've been using Wicket for a while now and i love it to death. Today i encountered a perplexing problem which i haven't been able to get around. My goal is simply to create a link that shows/hides a div when clicked, and to create the id of that div dynamically. What i am doing now is this: JAVA: final ProductListView products = new ProductListView("items", order.getItems()); // Just a ListView basically products.setMarkupId("productlist"+item.getIndex()); // Set the markup id to hide/show the component products.setOutputMarkupPlaceholderTag(true); add(products); add(new AjaxFallbackLink("toggle"){ // Link to do the toggling.. calls a javascript function with the id to toggle it @Override public void onClick(AjaxRequestTarget arg0) {} }.add(new AttributeModifier("onClick", true, new Model("javascript:return toggleDiv("+("productlist"+item.getIndex())+");"; HTML: # Click me! ..some stuff here... So that should add the component with Wicket id "items" and the markup id "productlist0" (for example). When the page is rendered this error pops up: WicketMessage: Unable to find component with id 'items' in [MarkupContainer [Component id = panel, page = web.page.authenticated.IndexPage, path = 2:tabs:panel.DefaultPanel, isVisible = true, isVersioned = true]]. This means that you declared wicket:id=items in your markup, but that you either did not add the component to your page at all, or that the hierarchy does not match. Now to me, that looks like it's using the markup id i set as the wicked id of the component. Any ideas? -- View this message in context: http://www.nabble.com/Wicket-id-vs.-markup-id-%28wicket-1.3.0-beta4%29-tf4677248.html#a13363648 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]