Error with link in DataTable together with AjaxEventBehavior(onclick)
Hi, I have a DataTable. In this DataTable I want to be able to click on the rows in the table to make some stuff happen (by Ajax), for example highlighting the current row. To implement this I am overriding the newRow method in DataTable and adding an AjaxEventBehavior(onclick) to each row item. This works well, but when I add a Link to another page in one of the columns, I get a problem. When clicking the link I still trigger an onclick ajax event for clicking the row. But since the link takes me to another page, this ajax request will fail beacuse the page it belongs to is no longer available. Is there a way to prevent the onclick event from happening when I click on my link? Or is there a better way of doing this? Thanks! Daniel -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Error-with-link-in-DataTable-together-with-AjaxEventBehavior-onclick-tp4611096.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
Inmethod datagrid and Twitter bootstrap
Hi, I've been playing around a bit with the Twitter bootstrap css framework and think it looks really nice. Now, it would be very nice if it was possible to make the inmethod datagrid (which I use a lot) get the look and feel of the twitter bootstrap table. I'm thinking of making the inmethod datagrid look something like this: http://datatables.net/media/blog/bootstrap/ This means that I would also like to use the paging look and feel from twitter botostrap. I know there is a setTheme() method on the DataGrid component, but before I start digging too deep into that, it would be nice to hear from someone more involved with the inmethod DatGrid project if they think that what I'm trying to do is at all possible to achieve. Or maybe someone has already done it? Any thought on this would be very appreciated. Thanks for reading! /Daniel -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Inmethod-datagrid-and-Twitter-bootstrap-tp4480711p4480711.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: Borders and inheritance in wicket 1.5
Igor Vaynberg-2 wrote: extending panel A means that your components go into panel A not into one of its children. Yep. That's why I used setTransparentResolver on the sectionBorder in 1.4 to make things work. Igor Vaynberg-2 wrote: you can provide a special addChild() method, or provide addChildren(WebMarkupContainer) callback that you call from A's onInitialize() or let your panel A implement IComponentResolver and try to locate children itself (this is not good for code that depends on the actual hierarchy to function). -igor My scenario is that all panels that extend panel A should get the same appearance, which is provided by the border component in panel A. The idea was that users of Panel B should not have to be aware of any special methods, they should just use add to add components as usual. So if I can avoid it I would rather not add any special methods. I guess my solution will be to replace the border in panel A with the actual html of the border. It will work even if I lose the reusability I had with keeping design in the border component. If I understand things correctly, it is not possible to have a wicket:child/ element which is not a direct child to the base panel, without providing some extra methods (or implement IComponentResolver). I'm not saying this is a bad thing, just trying to understand how things work now. Thank you for your time! On Tue, Nov 1, 2011 at 3:15 PM, bjolletz lt;daniel.akerlund@gt; wrote: Hi, I have the following setup: *A border:* *Panel A* (sectionBorder refers to my border component above) *Panel B* (extends Panel A) When I add the someLabel component to Panel B, the component hierarchy will be wrong since the someLabel component will be added to the base panel (Panel A), but in the markup it is really located under the sectionBorder. In Wicket 1.4 I could solve this by using setTransparentResolver(true) on the border. In Wicket 1.5 however, setTransparentResolver seems to have been removed. Does this mean that the setup in my example is no longer possible, or is there another way to do it? I have read the section about borders in the migration guide, but I still dont really see how this one could be solved without setTransparentResolver. Any ideas? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Borders-and-inheritance-in-wicket-1-5-tp3965704p3965704.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscribe@.apache For additional commands, e-mail: users-help@.apache - To unsubscribe, e-mail: users-unsubscribe@.apache For additional commands, e-mail: users-help@.apache -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Borders-and-inheritance-in-wicket-1-5-tp3965704p3980989.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: Borders and inheritance in wicket 1.5
If panel A was the only place where the border was used, that would surely be true. But I also use the border in other components where I want the same appearance but dont want to extend from panel A. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Borders-and-inheritance-in-wicket-1-5-tp3965704p3981920.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: Borders and inheritance in wicket 1.5
Oh, that would probably solve my scenario! I think add() actually was final in 1.4, but as you say that seems to have changed in 1.5. I wasn't aware of that change so did not think that was an option... Thanks you very much for your help and quick replies, much appreciated! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Borders-and-inheritance-in-wicket-1-5-tp3965704p3982218.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
Borders and inheritance in wicket 1.5
Hi, I have the following setup: *A border:* *Panel A* (sectionBorder refers to my border component above) *Panel B* (extends Panel A) When I add the someLabel component to Panel B, the component hierarchy will be wrong since the someLabel component will be added to the base panel (Panel A), but in the markup it is really located under the sectionBorder. In Wicket 1.4 I could solve this by using setTransparentResolver(true) on the border. In Wicket 1.5 however, setTransparentResolver seems to have been removed. Does this mean that the setup in my example is no longer possible, or is there another way to do it? I have read the section about borders in the migration guide, but I still dont really see how this one could be solved without setTransparentResolver. Any ideas? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Borders-and-inheritance-in-wicket-1-5-tp3965704p3965704.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: Wrong path for resources on redirected login page
Hi! I saw that you made a commit to trunk to fix the WICKET-4138 issue, so I tried running my project with the snapshot version of wicket-core, and now it seems to work as it should! Good job and a big thank you! I guess you dont need me to create a quickstart now? Also, I didn't realize that the page is actually not rendered the second time, after the redirect. Thanks for explaining. Cheers and good night! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wrong-path-for-resources-on-redirected-login-page-tp3920038p3962137.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: Wrong path for resources on redirected login page
Hi! After som more hours of debugging I finally think I'm starting to understand what is happening here. The short version is that I think that this might indeed be an example of the forward problem in the case you pointed to above. Here is what I think is happening: * I point my browser to /App/StartPage * Tomcat *forwards* the request to /LoginPage, just as it's supposed to do according to my web.xml. Wicket is not involved in this forwarding. * Wicket renders the LoginPage * Here comes the confusing part... In WebPageRenderer, line 233, Wicket creates a new URL stored in a variable called targetUrl2. This URL will have an URL parameter, like LoginPage?123. This URL is then compared to the old URL (LoginPage) (Line 244). The URLs are not equal which results in Wicket (for some reason which is not immediately apparent to me) sending a redirect (Line 266) to the new URL stored in targetUrl2. * This will eventually result in Wicket calling the Tomcat sendRedirect method with argument LoginPage?123. To me it seems strange that Wicket first renders all of LoginPage, and then decides to redirect to the same page and render everything again. Seems like unnecessary work to me, but there may of course be much I dont see here. As far as I understand, the redirect to LoginPage?123 might have something to do with the page not being stateless, but it seems strange that all pages should have to be rendered twice (with a redirect) just because they are not stateless. As I said I guess this could be an example of this issue, though I'm not 100% sure: https://issues.apache.org/jira/browse/WICKET-4138 If that is the case, do you know when this issue will be fixed? Thank you! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wrong-path-for-resources-on-redirected-login-page-tp3920038p3953772.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: Wrong path for resources on redirected login page
I also thought that Tomcat should take care of the redirect configured in web.xml by itself, but that does not seem to be the case. To me it seems like Tomcat does create its own redirect response, but that Tomcat still calls its filter chain, which will invoke my WicketFilter which leads to wicket also constructing a redirect, which I would guess takes precedence over the one created by Tomcat. Using the debug tool in Google Chrome and FireBug in Firefox, I can affirm that the redirect really is a 302 redirect. Martin Grigorov-4 wrote: This looks wrong. It should be ../LoginPage instead. But I'm not sure that Wicket creates this redirect location. From the description in your first mail I think the web container (Tomcat) should care about the redirect. I.e. hitting an Url that requires authentication Tomcat will not deliver it to WicketFilter at all but will do the redirect to the 'form-login-page'. I'm not sure how exactly the web container does this though... If it is redirect 302 then all should be fine, but if it is RequestDispatcher.forward() then Wicket will be confused indeed. See https://issues.apache.org/jira/browse/WICKET-4138 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wrong-path-for-resources-on-redirected-login-page-tp3920038p3932467.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: Wrong path for resources on redirected login page
I just realized something that should maybe have been obvious to me at once... I'm not at home and able to test this atm, but I'm quite sure that my WicketFilter is positioned before my security-constraint in my web.xml. I didn't think security-constraint was treated as a filter, so I didn't think the placement of that section mattered. But if the order matters, I guess that would explain why WicketFilter is invoked even when I expected Tomcat to make a redirect. If this is the cause of my problem I feel stupid... :) However, the same web.xml did work in wicket 1.4.18, probably due to lucky circumstances... -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wrong-path-for-resources-on-redirected-login-page-tp3920038p3932608.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: Wrong path for resources on redirected login page
Hi. I didn't get things to work with 1.5.2, seems to be the same behavior there. I've done some additional research and debugging... As far as I understand, my problem boils down to this: * Wicket creates a redirect from my StartPage (mounted as App/StartPage) to my LoginPage (mounted as LoginPage). * In the end of this redirect, wicket calls the sendRedirect(String location) method of the Response class of my web container, which in my case is org.apache.catalina.connector.Response (JBoss/Tomcat). As the location parameter, wicket sends LoginPage. * Looking into the source code of org.apache.catalina.connector.Response, I can see that Tomcat treats this as a relative URL. Since the last URL visited was App/StartPage, tomcat renders the redirect URL to be App/LoginPage. * My browser receives the redirect and asks for the page App/LoginPage. Although this URL is wrong, wicket somehow seems to work out that LoginPage is the page to access, but no resources are loaded bacause of wrong URLs. I've tried mounting my LoginPage like: mountPage(/LoginPage, LoginPage.class); But that attempt was futile, since it seems like wicket strips the / in the beginning of a mount URL. The question now is whether this is a wicket or a tomcat issue (or both, or none :) ). As far as I can see, if wicket called the org.apache.catalina.connector.Response with sendRedirect(/LoginPage), things would work out. But there may well be many things I dont understand here... Bottom line... * Is my scenario meant to work? * Are my conclusions correct? * If so, should I create a JIRA case on this issue? Thanks for reading and your time! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wrong-path-for-resources-on-redirected-login-page-tp3920038p3931337.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: Wrong path for resources on redirected login page
Thanks Gilberto! I'll try that. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wrong-path-for-resources-on-redirected-login-page-tp3920038p3925757.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: Wrong path for resources on redirected login page
Thank you for your quick replies! I have been trying to set up a quickstart with wicket version 1.5.2 to test things out, but it seems like its not totally trivial to set up security constraints in web.xml using jetty. I tried to add the following to my web.xml: security-constraint web-resource-collection web-resource-nameAll resources/web-resource-name descriptionProtects all resources/description url-pattern/App/*/url-pattern /web-resource-collection auth-constraint role-nameUSER/role-name /auth-constraint /security-constraint security-role role-nameUSER/role-name /security-role login-config auth-methodBASIC/auth-method realm-nameApp Realm/realm-name form-login-config form-login-page/LoginPage/form-login-page form-error-page/LoginErrorPage/form-error-page /form-login-config /login-config But that resulted in an error message from jetty: java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@494b6bed in org.eclipse.jetty.security.ConstraintSecurityHandler@769aba32#STARTING Seems like you have to add something called LoginService to jetty to make security stuff work. Maybe this is obvious to everyone but I'm not familiar with jetty at all. Anyway, if anyone knows what to do I would be very thankful for a pointer in the right direction. Thanks for reading! /Daniel -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wrong-path-for-resources-on-redirected-login-page-tp3920038p3923720.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
Wrong path for resources on redirected login page
Hi, I have the following setup: Two pages mounted like follows: mountPage(App/StartPage, StartPage.class); mountPage(LoginPage, LoginPage.class); In my web.xml, I have added a security constraint to the /App/ path and set up the form-login-page to be /LoginPage. This means that when I go to the address App/StartPage, tomcat redirects me to /LoginPage, which is working fine. However, none of my resources are loaded. The reason seems to be that wicket still believes that my base URL is /App/, when it should actually be /. The URL shown in the browser address field is /App/LoginPage?0. Resources on my LoginPage are loaded with PackageResourceReference, like: add(new Image(logo, new PackageResourceReference(LoginPage.class, images/logo.png))); Other resource, like css, are loaded like: response.renderCSSReference(new CssResourceReference(LoginPage.class, style.css)); This approach was working fine in 1.4.18. Right now I'm using 1.5.1. I know that both the resource handling and URL rendering have been changed in wicket 1.5, but I haven't been able to figure out what (if anything) I'm supposed to change to make this work again. Does anyone have any ideas? Or is there a better way to set up things? I've been looking at this case, it feels similar to my problem but if it was the same it should have been fixed in 1.5.1: https://issues.apache.org/jira/browse/WICKET-4030 I hope this is understandable. Thank you for any input on this! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wrong-path-for-resources-on-redirected-login-page-tp3920038p3920038.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: Wrong path for resources on redirected login page
Addition to my post above: I noticed that the browser URL seems to be the same in both 1.4.18 and 1.5.1: /App/LoginPage But, in 1.4.18 the resource links looked something like this: ../resources/se.app.LoginPage/images/logo.png while in 1.5.1 it looks lke this: wicket/resource/se.app.LoginPage/images/logo-ver-1319057388417.png So, no ../ in 1.5.1 which I guess is what's causing my problems. In 1.4.18 it seems that wicket automagically solved the resource path issue. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wrong-path-for-resources-on-redirected-login-page-tp3920038p3920126.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: component .... not found on page for a Link colun in the Datatable after self refresh using the AjaxSelfUpdatingTimerBehavior
Thanks, that seems to do the trick... Fernando: Returning null does not work since the resolve method requires a not null return value. But if the AjaxLink trick works, it seems I wont be needing to modify the resolve method anyway... -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/component-not-found-on-page-for-a-Link-colun-in-the-Datatable-after-self-refresh-using-the-AjaxSelfUr-tp1892913p2327012.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: component .... not found on page for a Link colun in the Datatable after self refresh using the AjaxSelfUpdatingTimerBehavior
Hi, My conclusion is that this is not really a wicket error, since we're clicking a link which no longer exists after the Ajax update. My solution to this has been to catch these exceptions in my WebRequestCycleProcessor, like this: @Override public IRequestTarget resolve(RequestCycle requestCycle, RequestParameters requestParameters) { try { return super.resolve(requestCycle, requestParameters); } catch (InvalidUrlException e) { if (requestCycle.getRequest().getURL().contains(ILinkListener)) { return new PageRequestTarget(requestCycle.getRequest().getPage()); } throw e; } } What happens is that if I get this exception and the request URL contains ILinkListener, I just return the page which the user is already at. For the user it will seem like nothing happens, which at least is better than that they get an exception. This is not a pretty solution, but the best I could think of. If someone knows of a better or more general soultion to this problem I would be happy to know. /Daniel -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/component-not-found-on-page-for-a-Link-colun-in-the-Datatable-after-self-refresh-using-the-AjaxSelfUr-tp1892913p2276328.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: component .... not found on page for a Link colun in the Datatable after self refresh using the AjaxSelfUpdatingTimerBehavior
Hi, Did you find a solution for this? I'm using wicket 1.4.8 and get almost the same error. Like you I have a customized column with a Link component in a datagrid. I have an ajax search field which updates the data (and the links) in the data grid when changing the search input. Sometimes if I click the link very quickly after I have changed the search value,, I get the same exception as you: org.apache.wicket.WicketRuntimeException: component panel:searchAndShowPanel:form:dataGrid:form:bodyContainer:body:row:31:item:addLink:addRecipientLink not found on page se.diamo.paysol.web.pages.invoicerecipientdir.pages.pagerorecipientdirectory.invoicerecipientdirectoryforcustomerpage.admin.AdminInvoiceRecipientDirectoryForCustomerPage[id = 27], listener interface = [RequestListenerInterface name=ILinkListener, method=public abstract void org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144) But, if I wait one or two seconds before clicking, I never get this error. It seems like this has to do with the re-rendering of the page after the ajax request. At the moment the link is clicked, the link listener is not present on the server side. The question is if this should be considered a bug in Wicket or if this is by design. I'm thankful for any input on this. Apollo Apollo11 wrote: Hi all, I create a customized column with a Link component with an Icon, which it will popup a new page for editding after click on it, for the Wicket Datatable. *public* IconLinkPanel( *final* Item item, *final* String componentId, * final* IModel model) {*{* *final* Link link = *new* Link(iconLink) { @Override *public* *void* onClick() { PageParameters params = *new* PageParameters(); params.put(object, theModel.getObject()); EditorPopupPage page = *new *EditorPopupPage(params ) ; setRedirect(*true*); setResponsePage(page); }; link.setPopupSettings(getPopupSettings()); Image img = *new* Image(image, getImageResourceReference()); *if* (getAltString() != *null* !getAltString().trim().isEmpty()) { img.add(*new* SimpleAttributeModifier(alt, getAltString())); } *if* (getTitleString() != *null* !getTitleString().trim().isEmpty()) { img.add(*new* SimpleAttributeModifier(title, getTitleString())); } link.add(img); add(link); } the Datatable itself I added AjaxSelfUpdatingTimerBehavior to refresh the table every 5 seconds. I've encountered a Intermittent internal server error whick when clicking on the link. the log shows Caused by: org.apache.wicket.WicketRuntimeException: component homePage:panel:table:rows:32:cells:14:cell:link not found on page com.apollo.fo.web.HomePage[id = 0], listener interface = [RequestListenerInterface name=ILinkListener, method=public abstract void org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:426) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:471) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144) I believe this issue is related to the datatable refreshing every 5 seconds. Is everyone have the same issue? If so, any solution for this? Your feedback are appreciated! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/component-not-found-on-page-for-a-Link-colun-in-the-Datatable-after-self-refresh-using-the-AjaxSelfUr-tp1892913p2229885.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
Dynamic wizard content
Hi! I am trying to build a wizard but have a problem with dynamic content. My problem breaks down to this: * Assume a wizard with two steps, A and B. * The content of step B depends on the user input from step A. In my particular case I want to have a gridview in step B and the data in it depends on what is submitted in step A. * As far as I understand, all steps are constructed at the same time. How, then, can I make the content of step B dynamic? In my particular case, I create a GridView in step B, which as far as I can see will be rendered at the same time as the wizard is created, and at this time I dont know which data the gridview should contain. Any help appreciated! /Daniel -- View this message in context: http://www.nabble.com/Dynamic-wizard-content-tp21432585p21432585.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: SV: Dynamic wizard content
Thanks for the reply, that seems lika a good approach! /Daniel * As far as I understand, all steps are constructed at the same time. How, then, can I make the content of step B dynamic? No it's rendered at render time; what you want to do is use a model which step A configures; e.g. a LoadableDetachableModel which receives properties from step A and then will load the actual data when asked to by the view. -- View this message in context: http://www.nabble.com/Dynamic-wizard-content-tp21432585p21439706.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: Browser file download complete callback
Probably you're right, I've just begun using Wicket and am not very into the inner workings of everything. Thanks for the suggestion about decorating inputstream, should have thought of it myself. /Daniel igor.vaynberg wrote: another problem with close is that you would have to internally keep a reference to the inputstream(), and what if getinputstream() was called more then once because for example you are generating a xls, a csv, and a png all at once...then your close() has to keep track of multiple references? -igor On Tue, Nov 4, 2008 at 9:22 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: the problem is that we would have to pass around the inputstream and iresourcestream unless we put the burden on you to make getreinputstream() return the same inputstream for the same request... you can pretty easily create a decorator for inputstream and intercept close(), its not perfect but it will work for right now while we figure out what to do with iresourcestream#close -igor On Tue, Nov 4, 2008 at 1:35 AM, bjolletz [EMAIL PROTECTED] wrote: Thanks for the reply! So you're suggesting that the close() method of the IResourceStream should be removed? Isn't there a point in having the close() method? In my case, by overriding the close() method, it would be possible to be notified when a download is complete. Don't know how else I would accomplish that (any suggestions?). Wouldn't it be a better idea to implement a close() method with default close behaviour in the abstract classes implementing the IResourceStream interface? That way, by extending one of these abstract resource stream classes, you dont have to mind about the close() method if you dont want to. /Daniel igor.vaynberg wrote: hmm, seems like a bug. it looks like we now close the input stream directly instead of using close() which allows users not to have to keep a reference to the stream. #close() can probably be removed. please open a jira issue. -igor On Mon, Nov 3, 2008 at 3:28 AM, bjolletz [EMAIL PROTECTED] wrote: Hi! I would like to have a download link through which a user can download some bytearray from my database. So far no problem, I accomplish this by creating a new WebResource and implementing the getResourceStream method. My problem is that I would like to be notified when the user is finished downloading so that I can mark the downloaded item as downloaded in my database. I'm using an AbstractResourceStream and I thought I would be able to do this by overriding the close() method. However, the close method of the AbstractResourceStream never seems to be called. The implementation of the getResourceStream() method of my WebResource object: public IResourceStream getResourceStream() { return new AbstractResourceStream() { ByteArrayInputStream bais; public InputStream getInputStream() throws ResourceStreamNotFoundException { bais = getByteArrayInputStreamFromDB(); return bais; } public void close() throws IOException { bais.close(); markByteArrayAsDownloadedInDB(); } }; } Why is it that the close() method is never called? Is there a better/other way to do it? Is it at all possible to get a callback when a user is finished downloading the bytearray? Thanks in advance! /Daniel -- View this message in context: http://www.nabble.com/Browser-file-download-complete-callback-tp20300290p20300290.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/Browser-file-download-complete-callback-tp20300290p20318122.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/Browser-file-download-complete-callback-tp20300290p20342791.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: Browser file download complete callback
Thanks for the reply! So you're suggesting that the close() method of the IResourceStream should be removed? Isn't there a point in having the close() method? In my case, by overriding the close() method, it would be possible to be notified when a download is complete. Don't know how else I would accomplish that (any suggestions?). Wouldn't it be a better idea to implement a close() method with default close behaviour in the abstract classes implementing the IResourceStream interface? That way, by extending one of these abstract resource stream classes, you dont have to mind about the close() method if you dont want to. /Daniel igor.vaynberg wrote: hmm, seems like a bug. it looks like we now close the input stream directly instead of using close() which allows users not to have to keep a reference to the stream. #close() can probably be removed. please open a jira issue. -igor On Mon, Nov 3, 2008 at 3:28 AM, bjolletz [EMAIL PROTECTED] wrote: Hi! I would like to have a download link through which a user can download some bytearray from my database. So far no problem, I accomplish this by creating a new WebResource and implementing the getResourceStream method. My problem is that I would like to be notified when the user is finished downloading so that I can mark the downloaded item as downloaded in my database. I'm using an AbstractResourceStream and I thought I would be able to do this by overriding the close() method. However, the close method of the AbstractResourceStream never seems to be called. The implementation of the getResourceStream() method of my WebResource object: public IResourceStream getResourceStream() { return new AbstractResourceStream() { ByteArrayInputStream bais; public InputStream getInputStream() throws ResourceStreamNotFoundException { bais = getByteArrayInputStreamFromDB(); return bais; } public void close() throws IOException { bais.close(); markByteArrayAsDownloadedInDB(); } }; } Why is it that the close() method is never called? Is there a better/other way to do it? Is it at all possible to get a callback when a user is finished downloading the bytearray? Thanks in advance! /Daniel -- View this message in context: http://www.nabble.com/Browser-file-download-complete-callback-tp20300290p20300290.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/Browser-file-download-complete-callback-tp20300290p20318122.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]
Browser file download complete callback
Hi! I would like to have a download link through which a user can download some bytearray from my database. So far no problem, I accomplish this by creating a new WebResource and implementing the getResourceStream method. My problem is that I would like to be notified when the user is finished downloading so that I can mark the downloaded item as downloaded in my database. I'm using an AbstractResourceStream and I thought I would be able to do this by overriding the close() method. However, the close method of the AbstractResourceStream never seems to be called. The implementation of the getResourceStream() method of my WebResource object: public IResourceStream getResourceStream() { return new AbstractResourceStream() { ByteArrayInputStream bais; public InputStream getInputStream() throws ResourceStreamNotFoundException { bais = getByteArrayInputStreamFromDB(); return bais; } public void close() throws IOException { bais.close(); markByteArrayAsDownloadedInDB(); } }; } Why is it that the close() method is never called? Is there a better/other way to do it? Is it at all possible to get a callback when a user is finished downloading the bytearray? Thanks in advance! /Daniel -- View this message in context: http://www.nabble.com/Browser-file-download-complete-callback-tp20300290p20300290.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]
Change row appearance in a DataGrid
Hi! I've just started learning Wicket and like it very much so far. I've found the very nice DataGrid component, for which I have a question: Is it possible to alter the appearance of a row in the grid in some custom way? What I want to do is that depending on my row data, I want all text in certain rows to be printed with bold text-weight. In other words, I want to add a class attribute to some of the rows, for which I can provide a style sheet. Is this possible in some way? Thanks in advance! /Daniel -- View this message in context: http://www.nabble.com/Change-row-appearance-in-a-DataGrid-tp20207345p20207345.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: Change row appearance in a DataGrid
Thanks for the very quick reply! I may be stupid but DataGrid doesn't seem to have a newRowItem() method to override. I did some googling and found that you can do just this for DataGridView, but I'm using DataGrid, which does not extend from AbstractGridView (which has the newRowItem method), but from AbstractGrid. Am I missing something obvious here? /Daniel jwcarman wrote: Override newRowItem() and decorate it however you want (using AttributeAppender behavior perhaps). On Tue, Oct 28, 2008 at 9:37 AM, bjolletz [EMAIL PROTECTED] wrote: Hi! I've just started learning Wicket and like it very much so far. I've found the very nice DataGrid component, for which I have a question: Is it possible to alter the appearance of a row in the grid in some custom way? What I want to do is that depending on my row data, I want all text in certain rows to be printed with bold text-weight. In other words, I want to add a class attribute to some of the rows, for which I can provide a style sheet. Is this possible in some way? Thanks in advance! /Daniel -- View this message in context: http://www.nabble.com/Change-row-appearance-in-a-DataGrid-tp20207345p20207345.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/Change-row-appearance-in-a-DataGrid-tp20207345p20207809.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]