svn beyond 1.4
Hey *, is any code available yet for stuff that is past 1.4? So far the only thing I've found is Matej's ajax rewrite in http://svn.apache.org/repos/asf/wicket/sandbox/knopp/experimental/. Since some issues targeted at 1.5-M1 in jira have received patches, I was wondering what these patches where build against and if there is any 1.5 code in some svn repo? Thanks in advance, Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Refreshing DataView with new dataset
Hi all, Apologies if this has been answered elsewhere - I could not find a relevant thread. I have a Panel containing a form, with a textfield and button, and a WebMarkupContainer containing a dataview. The provider for the dataview sources data from a database based on the string entered in the textfield on form (empty initially so all records returned). On the AjaxButton's onSubmit() event, I set the provider reference to a new data provider with the search value retrieved from the textfield and add the WMC to the Ajax target. I am logging messages and see that the new provider gets created when the button is clicked and the records returned are what's expected. The dataview, however, still continues showing data from old data set. I setOutputMarkupId(true) on the WMC. Any suggestions on what I might be doing incorrectly/improperly? Any help will be greatly appreciated. Cheers! -- View this message in context: http://www.nabble.com/Refreshing-DataView-with-new-dataset-tp21650528p21650528.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: Refreshing DataView with new dataset
cbchhaya schrieb: Hi all, Apologies if this has been answered elsewhere - I could not find a relevant thread. I have a Panel containing a form, with a textfield and button, and a WebMarkupContainer containing a dataview. The provider for the dataview sources data from a database based on the string entered in the textfield on form (empty initially so all records returned). On the AjaxButton's onSubmit() event, I set the provider reference to a new data provider with the search value retrieved from the textfield and add the WMC to the Ajax target. I am logging messages and see that the new provider gets created when the button is clicked and the records returned are what's expected. The dataview, however, still continues showing data from old data set. I setOutputMarkupId(true) on the WMC. Any suggestions on what I might be doing incorrectly/improperly? Any help will be greatly appreciated. Cheers! Did you add the component (dataview) to the AjaxRequestTarget in the end of submit? Provide some code please. Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Refreshing DataView with new dataset
Hi, Thanks for your response. Here's some code, if this helps. For the WMC: WMC wmc = new WMC(data); wmc.setOutputMarkupId(true); add(wmc); On the form: form.add(new AjaxButton(searchBtn){ @Override protected void onSubmit(AjaxRequestTarget target, Form form) { dataProvider = new DomainDataProvider(user, searchField.getModelObjectAsString()); target.addComponent(wmc); target.focusComponent(searchField); } }); add(form); The panel that contains this form also contains a reference to the data provider (dataProvider above) declared as: IDataProvider dataProvider = MyDataProvider(user, ); //Initially the search criterion is empty The DataView is defined as follow: DataView dataView = new DataView(dataView, dataProvider){ @Override protected void populateItem(Item item) { //Do something here }; dataView.setItemsPerPage(BASE_PAGE_SIZE); dataView.setOutputMarkupId(true); wmc.add(dataView); If order matters, I declare the provider first, followed by data view followed by form. Thanks once again. Cheers!! Newgro wrote: cbchhaya schrieb: Hi all, Apologies if this has been answered elsewhere - I could not find a relevant thread. I have a Panel containing a form, with a textfield and button, and a WebMarkupContainer containing a dataview. The provider for the dataview sources data from a database based on the string entered in the textfield on form (empty initially so all records returned). On the AjaxButton's onSubmit() event, I set the provider reference to a new data provider with the search value retrieved from the textfield and add the WMC to the Ajax target. I am logging messages and see that the new provider gets created when the button is clicked and the records returned are what's expected. The dataview, however, still continues showing data from old data set. I setOutputMarkupId(true) on the WMC. Any suggestions on what I might be doing incorrectly/improperly? Any help will be greatly appreciated. Cheers! Did you add the component (dataview) to the AjaxRequestTarget in the end of submit? Provide some code please. Cheers Per - 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/Refreshing-DataView-with-new-dataset-tp21650528p21650771.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: Refreshing DataView with new dataset
Please read MyDataProvider as DomainDataProvider cbchhaya wrote: Hi, Thanks for your response. Here's some code, if this helps. For the WMC: WMC wmc = new WMC(data); wmc.setOutputMarkupId(true); add(wmc); On the form: form.add(new AjaxButton(searchBtn){ @Override protected void onSubmit(AjaxRequestTarget target, Form form) { dataProvider = new DomainDataProvider(user, searchField.getModelObjectAsString()); target.addComponent(wmc); target.focusComponent(searchField); } }); add(form); The panel that contains this form also contains a reference to the data provider (dataProvider above) declared as: IDataProvider dataProvider = MyDataProvider(user, ); //Initially the search criterion is empty The DataView is defined as follow: DataView dataView = new DataView(dataView, dataProvider){ @Override protected void populateItem(Item item) { //Do something here }; dataView.setItemsPerPage(BASE_PAGE_SIZE); dataView.setOutputMarkupId(true); wmc.add(dataView); If order matters, I declare the provider first, followed by data view followed by form. Thanks once again. Cheers!! Newgro wrote: cbchhaya schrieb: Hi all, Apologies if this has been answered elsewhere - I could not find a relevant thread. I have a Panel containing a form, with a textfield and button, and a WebMarkupContainer containing a dataview. The provider for the dataview sources data from a database based on the string entered in the textfield on form (empty initially so all records returned). On the AjaxButton's onSubmit() event, I set the provider reference to a new data provider with the search value retrieved from the textfield and add the WMC to the Ajax target. I am logging messages and see that the new provider gets created when the button is clicked and the records returned are what's expected. The dataview, however, still continues showing data from old data set. I setOutputMarkupId(true) on the WMC. Any suggestions on what I might be doing incorrectly/improperly? Any help will be greatly appreciated. Cheers! Did you add the component (dataview) to the AjaxRequestTarget in the end of submit? Provide some code please. Cheers Per - 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/Refreshing-DataView-with-new-dataset-tp21650528p21650779.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: Refreshing DataView with new dataset
I don't see the complete process, but if i'm not completely wrong you is creating the DataProvider instance twice. Once in constructor and once in the AjaxButton.onSubmit method. But you is not assign this new instance to the dataview. Hit me if i'm wrong. Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Getting an error when trying to install via Maven
Hey, I created a Wicket skeleton project via Maven. When trying to install the project, I got this error: java.lang.ClassCastException: wicket.Initializer cannot be cast to org.apache.wicket.IInitializer at org.apache.wicket.Application.addInitializer(Application.java:755) at org.apache.wicket.Application.load(Application.java:829) at org.apache.wicket.Application.initializeComponents(Application.java:608) at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:575) at org.apache.wicket.protocol.http.MockWebApplication.init(MockWebApplication.java:157) at org.apache.wicket.util.tester.BaseWicketTester.init(BaseWicketTester.java:204) at org.apache.wicket.util.tester.WicketTester.init(WicketTester.java:308) at org.apache.wicket.util.tester.WicketTester.init(WicketTester.java:291) at com.eldorado.TestHomePage.setUp(TestHomePage.java:15) at junit.framework.TestCase.runBare(TestCase.java:125) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:62) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:155) at org.apache.maven.surefire.Surefire.run(Surefire.java:177) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) ... Removed 18 stack frames Please note, that I didn't code anything at all, I just tried to test the basic skeleton. Is this error intentional or something is going wrong? Thanks. -- View this message in context: http://www.nabble.com/Getting-an-error-when-trying-to-install-via-Maven-tp21651202p21651202.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: Observation and page (map) eviction
But how is a view to know if its model (object) has changed in the pull model? One way that I see this working is if views extract all state that they need to do the rendering into a separate object. This object is then recalculated from the model that is used by the view on each request. Is this what you're suggesting? Of course one should not go about (de)serializing listeners carelessly. I was a bit simplistic in describing what I want there, sorry 'bout that. What I'm doing at the moment (with the listener leak) is that the listeners that actually get registered with the object are stored in the session. When they're called (asynchronously), they store events in a queue. Then, when a request comes in, this queue is emptied by the page that is being rendered; the events are processed by the in-page listeners. This mechanism does depend on the use of sticky sessions, as it has to be possible for an external service to invoke the (session) listeners. The problem is now how to manage the listeners in the session. They only need to be present for the current pages in pagemaps, i.e. those pages that are shown and that will generate a request every now and then using an ajax-timer. Other pages in the pagemap will be redrawn completely when they need to respond to a request, so there is no need for observation for them. Just realised that I can detect pagemap eviction by simply enumerating the pagemaps when the session is detached. It seems to me that for wicket to support comet/bayeux, there will have to be a solution for the kind of problems I'm running into here. I don't think pushing the problem to the application developer (as I think you are suggesting) is acceptable in the long run. Cheers, Frank From: Johan Compagner [mailto:jcompag...@gmail.com] Sent: 24 January 2009 19:58 I think having references to or from pages is a bad idea in wicket. We serialize pages so if pages would have listeners then the are also serialized. If others reference pages then after serialization/deserialization they point to the wrong instance. Way better is pure pull support. Components know where thet get its data from and they pull it on render and/or on a visitor that checks all components if they are changed. (and if changes add them to ajax request target) On 24/01/2009, igor.vaynb...@gmail.com igor.vaynb...@gmail.com wrote: Use weakreferences to hold onto pages instead. -igor On 1/24/09, Frank van Lankvelt f.vanlankv...@onehippo.com wrote: I'm trying to get a page to observe a business object that can send events. The changes don't warrant a full page refresh, so I want to update only those parts of the page that have changed as a result of the events. I've seen wicketstuff-push, where a similar kind of observation is present in the Application. From what I could see, the chat example has the drawback that there is no *unregistering* of listeners when pages are disposed of, so there is a memory leak. (all pages will be kept in memory, being referenced directly by the service in the application) There doesn't seem to be any support for cleaning up pages, e.g. in the form of listeners that an application could register with the session store. An alternative seems to be to implement my own PageMap, but I'm reluctant to do that as there will be a lot of copy/paste involved and the existing PageMap implementations rely on the fact that they're in the same package as Session. A different alternative is to store all the listeners in a registry and use a separate thread to remove any listeners that are associated with pages that are no longer stored. Is there a better way? Thanks, Frank f.vanlankv...@onehippo.com www.onehippo.com Amsterdam Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466 San Francisco Hippo USA Inc. 101 H Street, suite Q Petaluma CA 94952-5100 +1-877-41-HIPPO - 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 f.vanlankv...@onehippo.com www.onehippo.com Amsterdam Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466 San Francisco Hippo USA Inc. 101 H Street, suite Q Petaluma CA 94952-5100 +1-877-41-HIPPO - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional
Re: Refreshing DataView with new dataset
Hi, That's right. How do I replace the dataProvider? It doesn't have an ID so I can't use replaceWith... Any suggestions? Thanks! Newgro wrote: I don't see the complete process, but if i'm not completely wrong you is creating the DataProvider instance twice. Once in constructor and once in the AjaxButton.onSubmit method. But you is not assign this new instance to the dataview. Hit me if i'm wrong. Cheers Per - 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/Refreshing-DataView-with-new-dataset-tp21650528p21652628.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: Refreshing DataView with new dataset
Or should I replace the dataview itself (this would be very inefficient)? In the data provider, in the constructor I call out into the DAO and retrieve results that are collected in a transient list. Iterations occurs over this list (the dataset is small so holding the list in memory isn't a problem). Therefore, without updating the dataProvider reference with a new provider instance (whereby the search string gets passed into the constructor), the search never occurs. Even when I instantiate a new provider, the search occurs but I still see the old results in the dataview. The complete process is: 1. Create WMC - set output markup ID to true 2. Create feedback panel and add it to WMC 3. Create dataview passing in empty search criterion and add it to WMC 4. Create form and in the button's onSubmit() method, instantiate a new data provider and add WMC to AJAX target. Add form to underlying panel. Hope this helps. cbchhaya wrote: Hi, That's right. How do I replace the dataProvider? It doesn't have an ID so I can't use replaceWith... Any suggestions? Thanks! Newgro wrote: I don't see the complete process, but if i'm not completely wrong you is creating the DataProvider instance twice. Once in constructor and once in the AjaxButton.onSubmit method. But you is not assign this new instance to the dataview. Hit me if i'm wrong. Cheers Per - 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/Refreshing-DataView-with-new-dataset-tp21650528p21653387.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: Refreshing DataView with new dataset
I think I may have resolved the issue although I still feel it's a bit hacky. On the data provider implementation, I set a searchString property every time a new search is entered and then clear out the cached list and reload new data (slight optimization - don't refresh is string is same as old one). And from within the onClick() method on the form, I call dataProvider.setSearchString(get model value). Although this works, is this the right way of doing things? I haven't worked with Wicket long enough to understand the memory profile when using such data sets but can I optimize this any? Thanks again! cbchhaya wrote: Hi, That's right. How do I replace the dataProvider? It doesn't have an ID so I can't use replaceWith... Any suggestions? Thanks! Newgro wrote: I don't see the complete process, but if i'm not completely wrong you is creating the DataProvider instance twice. Once in constructor and once in the AjaxButton.onSubmit method. But you is not assign this new instance to the dataview. Hit me if i'm wrong. Cheers Per - 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/Refreshing-DataView-with-new-dataset-tp21650528p21654195.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: svn beyond 1.4
no, even what matej has is still a prototype. when we release 1.4.2 we will branch it off and trunk will become 1.5. -igor On Sat, Jan 24, 2009 at 7:26 PM, Martin Voigt voig...@googlemail.com wrote: Hey *, is any code available yet for stuff that is past 1.4? So far the only thing I've found is Matej's ajax rewrite in http://svn.apache.org/repos/asf/wicket/sandbox/knopp/experimental/. Since some issues targeted at 1.5-M1 in jira have received patches, I was wondering what these patches where build against and if there is any 1.5 code in some svn repo? Thanks in advance, Martin - 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
Popup new Window after Wizard:onFinish()
Guys, I’m writing a Wizard using DynamicWizardModel such that each step is of DynamicWizardStep kind. Question number 1: I would like to popup a success message to the user (better a new popup window, a small one) after the last step, i.e. overriding the onFinish() Wizard event and then show the Window. But How?? ModalWindow() for example, needs AjaxRequestTarget and submitting the Wizard results in submitting the whole form. I have no an AjaxRequestTarget to hook into. Any idea how can I achieve that? Question number 2: If I fail during the last Wizard step (e.g. after applyState() and call to error(…)) I expect that onFinish() will not be called at all since the form encounter an error and the Wizard indeed stays in its last step giving the user a chance to fix its data. What do I miss here? Thanks a LOT for any input. -- View this message in context: http://www.nabble.com/Popup-new-Window-after-Wizard%3AonFinish%28%29-tp21655026p21655026.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
Access last page
Hi, can i easily access the page from which another page is called? I would like to share the navigational infos of one page with the next page. That should be achieved by pulling the NaviModel of the last page (if present). If i debug i can see that there is a pagemap - (SecondLevel) which is containing the appropriate page. But i can not find any access to this attribute. Is there a way? Thanks Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Embedding html from an external application
Hi Farhan, Yes, indeed. After so many years Wicket can still surprise me. Anyway, the problems you have with this are identical as you would have with the c:import tag. What you want is not simply feasible. It would be wise to consider alternatives. For example moving the JSPs into the same context as the Wicket application, using an iframe (session problem does not go away), or getting rid of the JSPs altogether. Regards, Erik. mfs wrote: Eric, Thanks for the follow-up. Actually i just came across the http://wicket.sourceforge.net/apidocs/wicket/markup/html/include/Include.html Include component in Wicket which i believe does the same as you suggested to implement...i.e. opens up a new http-connection to the server/url from where the contents are to be embedded...Isn't it ? Secondly since this would mean a separate request would be opened for contents to be included, and hence wouldn't be carrying the request parameters, cookies etc. Which i would have to figure out a way to pass-on/embed manually. Farhan. -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ -- View this message in context: http://www.nabble.com/Embedding-html-from-an-external-application-tp21593700p21655839.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
Panel in List, remove extra div
I have a page on which I want to show products. Because I want to also want to show products on otherpages in the same way, I've made a ProductPanel. I'm also using ListView to show multiple ProductPanels on each page. I'm using a panel in a list, but this gives an extra div. I don't see how I can remove this extra div. See my code below and the generated html output. As you can see, every single item in the list, gives this html: div wicket:id=products and div wicket:id=product. I would like to have only 1 div instead of two. What is the Wicket way to solve this? ProductsPage.html = div wicket:id=products div wicket:id=product/div /div ProductsPage.java = public class ProductsPage extends BasePage { public ModelsPage() { ListProduct products = dao.getProducts(); add(new ListView(products, products) { @Override protected void populateItem(ListItem item) { Product product = (Product) item.getModelObject(); item.add(new ProductPanel(product, product)); } }); } } ProductPanel.html = wicket:panel /wicket:panel ProductPanel.java = public class ProductPanel extends Panel { public ProductPanel(String id, Product product) { super(id); add(new Label(name, product.getName())); add(new Label(description, product.getDescription())); add(new Label(price, product.getPrice())); } } Generated HTML Output = div wicket:id=products div wicket:id=product wicket:panel /wicket:panel /div /div div wicket:id=products div wicket:id=product wicket:panel b bb 2 /wicket:panel /div /div div wicket:id=products div wicket:id=product wicket:panel c c 3 /wicket:panel /div /div -- View this message in context: http://www.nabble.com/Panel-in-List%2C-remove-extra-div-tp21656188p21656188.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: Panel in List, remove extra div
wicket:container wicket:id=products div wicket:id=product/div /wicket:container -igor On Sun, Jan 25, 2009 at 12:19 PM, Prag pragprog...@gmail.com wrote: I have a page on which I want to show products. Because I want to also want to show products on otherpages in the same way, I've made a ProductPanel. I'm also using ListView to show multiple ProductPanels on each page. I'm using a panel in a list, but this gives an extra div. I don't see how I can remove this extra div. See my code below and the generated html output. As you can see, every single item in the list, gives this html: div wicket:id=products and div wicket:id=product. I would like to have only 1 div instead of two. What is the Wicket way to solve this? ProductsPage.html = div wicket:id=products div wicket:id=product/div /div ProductsPage.java = public class ProductsPage extends BasePage { public ModelsPage() { ListProduct products = dao.getProducts(); add(new ListView(products, products) { @Override protected void populateItem(ListItem item) { Product product = (Product) item.getModelObject(); item.add(new ProductPanel(product, product)); } }); } } ProductPanel.html = wicket:panel /wicket:panel ProductPanel.java = public class ProductPanel extends Panel { public ProductPanel(String id, Product product) { super(id); add(new Label(name, product.getName())); add(new Label(description, product.getDescription())); add(new Label(price, product.getPrice())); } } Generated HTML Output = div wicket:id=products div wicket:id=product wicket:panel /wicket:panel /div /div div wicket:id=products div wicket:id=product wicket:panel b bb 2 /wicket:panel /div /div div wicket:id=products div wicket:id=product wicket:panel c c 3 /wicket:panel /div /div -- View this message in context: http://www.nabble.com/Panel-in-List%2C-remove-extra-div-tp21656188p21656188.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: Panel in List, remove extra div
Perfect, thanks! igor.vaynberg wrote: wicket:container wicket:id=products div wicket:id=product/div /wicket:container -igor -- View this message in context: http://www.nabble.com/Panel-in-List%2C-remove-extra-div-tp21656188p21656303.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: Access last page
You should hold that info yourself Not the page itself but just the id and the version number (and pagemap) Then through session.get(x,y,z) you can get the page On 25/01/2009, Per Newgro per.new...@gmx.ch wrote: Hi, can i easily access the page from which another page is called? I would like to share the navigational infos of one page with the next page. That should be achieved by pulling the NaviModel of the last page (if present). If i debug i can see that there is a pagemap - (SecondLevel) which is containing the appropriate page. But i can not find any access to this attribute. Is there a way? Thanks Per - 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: Observation and page (map) eviction
What we doe is pretty simple Just remeber the last rendered value of a component. Then you can compare this to something and you know if it is changed ore not. On 25/01/2009, Frank van Lankvelt f.vanlankv...@onehippo.com wrote: But how is a view to know if its model (object) has changed in the pull model? One way that I see this working is if views extract all state that they need to do the rendering into a separate object. This object is then recalculated from the model that is used by the view on each request. Is this what you're suggesting? Of course one should not go about (de)serializing listeners carelessly. I was a bit simplistic in describing what I want there, sorry 'bout that. What I'm doing at the moment (with the listener leak) is that the listeners that actually get registered with the object are stored in the session. When they're called (asynchronously), they store events in a queue. Then, when a request comes in, this queue is emptied by the page that is being rendered; the events are processed by the in-page listeners. This mechanism does depend on the use of sticky sessions, as it has to be possible for an external service to invoke the (session) listeners. The problem is now how to manage the listeners in the session. They only need to be present for the current pages in pagemaps, i.e. those pages that are shown and that will generate a request every now and then using an ajax-timer. Other pages in the pagemap will be redrawn completely when they need to respond to a request, so there is no need for observation for them. Just realised that I can detect pagemap eviction by simply enumerating the pagemaps when the session is detached. It seems to me that for wicket to support comet/bayeux, there will have to be a solution for the kind of problems I'm running into here. I don't think pushing the problem to the application developer (as I think you are suggesting) is acceptable in the long run. Cheers, Frank From: Johan Compagner [mailto:jcompag...@gmail.com] Sent: 24 January 2009 19:58 I think having references to or from pages is a bad idea in wicket. We serialize pages so if pages would have listeners then the are also serialized. If others reference pages then after serialization/deserialization they point to the wrong instance. Way better is pure pull support. Components know where thet get its data from and they pull it on render and/or on a visitor that checks all components if they are changed. (and if changes add them to ajax request target) On 24/01/2009, igor.vaynb...@gmail.com igor.vaynb...@gmail.com wrote: Use weakreferences to hold onto pages instead. -igor On 1/24/09, Frank van Lankvelt f.vanlankv...@onehippo.com wrote: I'm trying to get a page to observe a business object that can send events. The changes don't warrant a full page refresh, so I want to update only those parts of the page that have changed as a result of the events. I've seen wicketstuff-push, where a similar kind of observation is present in the Application. From what I could see, the chat example has the drawback that there is no *unregistering* of listeners when pages are disposed of, so there is a memory leak. (all pages will be kept in memory, being referenced directly by the service in the application) There doesn't seem to be any support for cleaning up pages, e.g. in the form of listeners that an application could register with the session store. An alternative seems to be to implement my own PageMap, but I'm reluctant to do that as there will be a lot of copy/paste involved and the existing PageMap implementations rely on the fact that they're in the same package as Session. A different alternative is to store all the listeners in a registry and use a separate thread to remove any listeners that are associated with pages that are no longer stored. Is there a better way? Thanks, Frank f.vanlankv...@onehippo.com www.onehippo.com Amsterdam Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466 San Francisco Hippo USA Inc. 101 H Street, suite Q Petaluma CA 94952-5100 +1-877-41-HIPPO - 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 f.vanlankv...@onehippo.com www.onehippo.com Amsterdam Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466 San Francisco Hippo USA Inc.
Re: Observation and page (map) eviction
Maybe if you want listeners then only the session listen to those? And pages/components when they render pull the changes out of the session? On 25/01/2009, Frank van Lankvelt f.vanlankv...@onehippo.com wrote: But how is a view to know if its model (object) has changed in the pull model? One way that I see this working is if views extract all state that they need to do the rendering into a separate object. This object is then recalculated from the model that is used by the view on each request. Is this what you're suggesting? Of course one should not go about (de)serializing listeners carelessly. I was a bit simplistic in describing what I want there, sorry 'bout that. What I'm doing at the moment (with the listener leak) is that the listeners that actually get registered with the object are stored in the session. When they're called (asynchronously), they store events in a queue. Then, when a request comes in, this queue is emptied by the page that is being rendered; the events are processed by the in-page listeners. This mechanism does depend on the use of sticky sessions, as it has to be possible for an external service to invoke the (session) listeners. The problem is now how to manage the listeners in the session. They only need to be present for the current pages in pagemaps, i.e. those pages that are shown and that will generate a request every now and then using an ajax-timer. Other pages in the pagemap will be redrawn completely when they need to respond to a request, so there is no need for observation for them. Just realised that I can detect pagemap eviction by simply enumerating the pagemaps when the session is detached. It seems to me that for wicket to support comet/bayeux, there will have to be a solution for the kind of problems I'm running into here. I don't think pushing the problem to the application developer (as I think you are suggesting) is acceptable in the long run. Cheers, Frank From: Johan Compagner [mailto:jcompag...@gmail.com] Sent: 24 January 2009 19:58 I think having references to or from pages is a bad idea in wicket. We serialize pages so if pages would have listeners then the are also serialized. If others reference pages then after serialization/deserialization they point to the wrong instance. Way better is pure pull support. Components know where thet get its data from and they pull it on render and/or on a visitor that checks all components if they are changed. (and if changes add them to ajax request target) On 24/01/2009, igor.vaynb...@gmail.com igor.vaynb...@gmail.com wrote: Use weakreferences to hold onto pages instead. -igor On 1/24/09, Frank van Lankvelt f.vanlankv...@onehippo.com wrote: I'm trying to get a page to observe a business object that can send events. The changes don't warrant a full page refresh, so I want to update only those parts of the page that have changed as a result of the events. I've seen wicketstuff-push, where a similar kind of observation is present in the Application. From what I could see, the chat example has the drawback that there is no *unregistering* of listeners when pages are disposed of, so there is a memory leak. (all pages will be kept in memory, being referenced directly by the service in the application) There doesn't seem to be any support for cleaning up pages, e.g. in the form of listeners that an application could register with the session store. An alternative seems to be to implement my own PageMap, but I'm reluctant to do that as there will be a lot of copy/paste involved and the existing PageMap implementations rely on the fact that they're in the same package as Session. A different alternative is to store all the listeners in a registry and use a separate thread to remove any listeners that are associated with pages that are no longer stored. Is there a better way? Thanks, Frank f.vanlankv...@onehippo.com www.onehippo.com Amsterdam Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466 San Francisco Hippo USA Inc. 101 H Street, suite Q Petaluma CA 94952-5100 +1-877-41-HIPPO - 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 f.vanlankv...@onehippo.com www.onehippo.com Amsterdam Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466 San Francisco Hippo USA Inc. 101 H Street,
Re: Performance question
I guess wicket should dump the page serialized size in development mode. So that users see them when developing. On 21/01/2009, Michael O'Cleirigh michael.ocleir...@rivulet.ca wrote: Hello, A big delay in refreshing can be a sign that your pages are serializing your domain object graph as part of the page serialization process. In my case it turned out that my AJAX autocompleting search page was serializing a 50MB in memory index on each update. I would investigate using Detatchable models or for example storing the data in spring beans injectable using the @SpringBean annotation since in that case only the spring proxy is serialized not the contained domain objects. You could also put a breakpoint within the wicket page serialization process to try and see how big the serialized page is. Mike Did you ever determine the cause? I am having a similar problem, it is not acceptable. Ritesh Trivedi wrote: Hi, I have created first couple of pages of my wicket application but have some performance concerns. The pages (even the refresh alone takes 6-7 secs on Dual Core 2.2GHz Pentium with 4GB of RAM). DB is located on the remote host, but has caching at the application server - so thats not adding to the latency for the refresh. Here is the requestlogger information for the home page refresh couple of times Can someone point me to the direction on going about finding out what is taking this long other than (and may be simpler than) running a profiler on the application - atleast initially. My application is running in deployment mode and is running in tomcat. = ! before getting top nav menuitems 1208209856242 ! after getting top nav menuitems 1208209860972 time taken 4730 2008-04-14 14:51:07,677 (http-0.0.0.0-8080-Processor12) [ RequestLogger.jav a:320:INFO ] time=11567,event=BookmarkablePage[com.neobits.web.pages.Index],resp onse=BookmarkablePage[com.neobits.web.pages.Index],sessionid=729B1C0D58665D15518 044E5C8A63088.jvm1,sessionsize=1177,sessionstart=Mon Apr 14 14:38:51 PDT 2008,re quests=4,totaltime=28472,activerequests=3,maxmem=532M,total=266M,used=56M ! before getting top nav menuitems 1208209878458 ! after getting top nav menuitems 1208209878696 time taken 238 2008-04-14 14:51:25,266 (http-0.0.0.0-8080-Processor4) [ RequestLogger.java :320:INFO ] time=6888,event=BookmarkablePage[com.neobits.web.pages.Index],respon se=BookmarkablePage[com.neobits.web.pages.Index],sessionid=729B1C0D58665D1551804 4E5C8A63088.jvm1,sessionsize=1177,sessionstart=Mon Apr 14 14:38:51 PDT 2008,requ ests=5,totaltime=35360,activerequests=3,maxmem=532M,total=266M,used=55M ! before getting top nav menuitems 1208209893292 ! after getting top nav menuitems 1208209893526 time taken 234 2008-04-14 14:51:40,514 (http-0.0.0.0-8080-Processor6) [ RequestLogger.java :320:INFO ] time=7309,event=BookmarkablePage[com.neobits.web.pages.Index],respon se=BookmarkablePage[com.neobits.web.pages.Index],sessionid=729B1C0D58665D1551804 4E5C8A63088.jvm1,sessionsize=1177,sessionstart=Mon Apr 14 14:38:51 PDT 2008,requ ests=6,totaltime=42669,activerequests=4,maxmem=532M,total=266M,used=46M - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
InlineFrame: IPageLink object looses reference to page after deserialiations
Hi, I'm trying to use the InlineFrame component. I create an IPageLink object to it. The object holds a reference to a page. By placing breakpoints, I can see that the IPageLink object is created once. InlineFrame#onLinkClicked is called twice. On the first time, the page reference is fine. The second time the IPageLink is of a different object and the page reference it is null. My guess is that the second time is after deserialization of the page. But why is the reference null? I'm working in an osgi environment with pax-wicket. Thank you, Ittay -- -- Ittay - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org