Re: Preventing AJAX behavior to execute during page reload
Hi Sebastian, I’m confused: you say you have a stateful page but redirect in a stateless manner (to a new page instance). I think this is relatively easy to fix if you remain stateful, because (a) wicket guards against concurrent acces to a single page instance and (b) you can track in the page state if an action was executed or not. May I ask why you are not simply calling setResponsePage(getPage())? Met vriendelijke groet, Kind regards, Bas Gooren Op 6 maart 2020 bij 10:58:59, Sebastian Lichtenfels ( sebastian.lichtenf...@tomtec.de) schreef: Hi all, I have a problem with an AJAX behavior that I have on a stateful page. The behavior is triggered by the user by clicking a button (the button is outside my control). The behavior then does some backend action on the server and afterwards reloads the page (by calling RequestCycle.get().setResponsePage(page.getPageClass(), page.getPageParameters());, where page is the the current page). My problem now is that it can happen that the user clicks the button twice which results in the following sequence of calls: 1. First behavior is triggered on page version 1 2. Backend action is done 3. Server sends 302 to reload page 4. Second behavior is triggered (still for page version 1) 5. Backend is done for second behavior 6. Client cancels AJAX request for second behavior, because of the page redirect -> so no additional page reload here 7. Page render is triggered by the page reload My goal is to always reload the page if the backend action is triggered, because the page's state depends on the backend state. So either the second behavior should not be triggered at all or it should be correctly executed (meaning backend action AND page reload should be triggered). How can I achieve this? Best regards, Sebastian
Preventing AJAX behavior to execute during page reload
Hi all, I have a problem with an AJAX behavior that I have on a stateful page. The behavior is triggered by the user by clicking a button (the button is outside my control). The behavior then does some backend action on the server and afterwards reloads the page (by calling RequestCycle.get().setResponsePage(page.getPageClass(), page.getPageParameters());, where page is the the current page). My problem now is that it can happen that the user clicks the button twice which results in the following sequence of calls: 1. First behavior is triggered on page version 1 2. Backend action is done 3. Server sends 302 to reload page 4. Second behavior is triggered (still for page version 1) 5. Backend is done for second behavior 6. Client cancels AJAX request for second behavior, because of the page redirect -> so no additional page reload here 7. Page render is triggered by the page reload My goal is to always reload the page if the backend action is triggered, because the page's state depends on the backend state. So either the second behavior should not be triggered at all or it should be correctly executed (meaning backend action AND page reload should be triggered). How can I achieve this? Best regards, Sebastian
Re: onsubmit gets called after page reload
Hello, Yes, and it works well, so thank you so much. On Mon, Jul 4, 2016 at 5:36 PM, Sven Meier [via Apache Wicket] < ml-node+s1842946n467502...@n4.nabble.com> wrote: > The form is checking whether there are any errors before invoking your > #onSubmit() method. > > Have you tried overriding #onConfigure()? > > Regards > Sven > > -- > If you reply to this email, your message will be added to the discussion > below: > > http://apache-wicket.1842946.n4.nabble.com/onsubmit-gets-called-after-page-reload-tp4675020p4675028.html > To unsubscribe from onsubmit gets called after page reload, click here > <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code=4675020=c3VwZXJiaXNzaW1hQGdtYWlsLmNvbXw0Njc1MDIwfC01MzM2MjU4NzI=> > . > NAML > <http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer=instant_html%21nabble%3Aemail.naml=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onsubmit-gets-called-after-page-reload-tp4675020p4675030.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: onsubmit gets called after page reload
The form is checking whether there are any errors before invoking your #onSubmit() method. Have you tried overriding #onConfigure()? Regards Sven -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onsubmit-gets-called-after-page-reload-tp4675020p4675028.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: onsubmit gets called after page reload
Hello, Please check the image. Hope this is helpful. Thank you. On Mon, Jul 4, 2016 at 9:44 AM, Sven Meier [via Apache Wicket] < ml-node+s1842946n4675021...@n4.nabble.com> wrote: > Hi, > > I'm not sure which code is calling #isVisible() here, a stacktrace would > help to identify the caller. > > Nevertheless it's quite normal for #isVisible() to be called a number of > times. Thus it's a recommended practice to override #onConfigure() > instead: > > @Override > public void onConfigure() { > List docList = documentsModel.getObject(); > setVisible(docList != null && docList.size() > 0); > } > > Have fun > Sven > > > > On 03.07.2016 21:36, Iamuser wrote: > > > Hello, > > Please help me with the following situation: > > I'm using wicket 6. > > I have a page and a form. > > On this form I have an input, and when user hits Upload button, the list > > with the inputs should be updated. > > > > However, there is a strange behaviour: > > 1. when hitting the submit button, the onsubmit method is not > immediatelly > > called, but instead > > the isVisible() method is called on a repeated number of times, which > then > > calls Load() of the LoadableDetachableModel is called. > > 2. only after that the onSubmit() is finally called. > > > > But this behaviour, because of the isVisible() method being called > before > > onSubmit() does not display the new item to the list on the page. Only > after > > a new refresh of the page it is finally displayed. > > > > Here is the html and the java code: > > > > private class UploadForm extends Form { > > > > private static final long serialVersionUID = 1L; > > > > public UploadForm(String id, IModel docmodel) { > > super(id, docmodel); > > TextField fileDescription = new > > TextField("fileDescription", new > > PropertyModel(getModelObject(), "description")); > > add(fileDescription); > > > > final LoadableDetachableModel<ListDoc>> documentsModel = new > > LoadableDetachableModel<ListDoc>>() { > > > > private static final long serialVersionUID = 1L; > > > > @Override > > protected List load() { > > return SpringCtx.getAppDB(DocDao.class).selectByParentId(238); > > } > > }; > > > > final WebMarkupContainer documentsContainer = new > > WebMarkupContainer("documentsContainer"); > > documentsContainer.setOutputMarkupId(true); > > add(documentsContainer); > > > > documentsContainer.add(new ListView("documentList", documentsModel) > > { > > private static final long serialVersionUID = 1L; > > > > @Override > > protected void populateItem(ListItem item) { > > item.add(new Label("document", > > item.getModelObject().getDescription())); > > } > > @Override > > public boolean isVisible() { > > List docList = documentsModel.getObject(); > > return docList != null && docList.size() > 0; > > } > > }.setOutputMarkupId(true)); > > } > > > > @Override > > public void onSubmit() { > > logger.debug("this is onsubmit()"); > > > > Doc d = new Doc(); > > > > try { > > d.setFileName("test_fn"); > > d.setId(SpringCtx.getAppDB(DocDao.class).selectNextId()); > > d.setFileUrl("url"); > > d.setDescription(getModelObject().getDescription()); > > d.setParentId(238); > > > > SpringCtx.getAppDB(DocDao.class).insert(d); > > getModelObject().clear(); > > feedbackPanel.info(getString("upload.document.success")); > > } catch (Exception e) { > > logger.error("Error uploading user file", e); > > feedbackPanel.error(getString("upload.document.error") + " " + > > ExceptionUtils.getRootCauseMessage(e)); > > } > > } > > > > }; > > > > <http://apache-wicket.1842946.n4.nabble.com/file/n4675020/1.png> > > > > Please help me understand the issure. Thank you in advance. > > > > > > -- > > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/onsubmit-gets-called-after-page-reload-tp4675020.html > > Sent from the Users forum mailing list archive at Nabble.com. > > > > - > > To unsubscribe, e-mail: [hidden email] > <http:///user/SendEmail.jtp?type=node=4675021=0> > > For additional co
Re: onsubmit gets called after page reload
Hi, I'm not sure which code is calling #isVisible() here, a stacktrace would help to identify the caller. Nevertheless it's quite normal for #isVisible() to be called a number of times. Thus it's a recommended practice to override #onConfigure() instead: @Override public void onConfigure() { List docList = documentsModel.getObject(); setVisible(docList != null && docList.size() > 0); } Have fun Sven On 03.07.2016 21:36, Iamuser wrote: Hello, Please help me with the following situation: I'm using wicket 6. I have a page and a form. On this form I have an input, and when user hits Upload button, the list with the inputs should be updated. However, there is a strange behaviour: 1. when hitting the submit button, the onsubmit method is not immediatelly called, but instead the isVisible() method is called on a repeated number of times, which then calls Load() of the LoadableDetachableModel is called. 2. only after that the onSubmit() is finally called. But this behaviour, because of the isVisible() method being called before onSubmit() does not display the new item to the list on the page. Only after a new refresh of the page it is finally displayed. Here is the html and the java code: private class UploadForm extends Form { private static final long serialVersionUID = 1L; public UploadForm(String id, IModel docmodel) { super(id, docmodel); TextField fileDescription = new TextField("fileDescription", new PropertyModel(getModelObject(), "description")); add(fileDescription); final LoadableDetachableModel<ListDoc>> documentsModel = new LoadableDetachableModel<ListDoc>>() { private static final long serialVersionUID = 1L; @Override protected List load() { return SpringCtx.getAppDB(DocDao.class).selectByParentId(238); } }; final WebMarkupContainer documentsContainer = new WebMarkupContainer("documentsContainer"); documentsContainer.setOutputMarkupId(true); add(documentsContainer); documentsContainer.add(new ListView("documentList", documentsModel) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem item) { item.add(new Label("document", item.getModelObject().getDescription())); } @Override public boolean isVisible() { List docList = documentsModel.getObject(); return docList != null && docList.size() > 0; } }.setOutputMarkupId(true)); } @Override public void onSubmit() { logger.debug("this is onsubmit()"); Doc d = new Doc(); try { d.setFileName("test_fn"); d.setId(SpringCtx.getAppDB(DocDao.class).selectNextId()); d.setFileUrl("url"); d.setDescription(getModelObject().getDescription()); d.setParentId(238); SpringCtx.getAppDB(DocDao.class).insert(d); getModelObject().clear(); feedbackPanel.info(getString("upload.document.success")); } catch (Exception e) { logger.error("Error uploading user file", e); feedbackPanel.error(getString("upload.document.error") + " " + ExceptionUtils.getRootCauseMessage(e)); } } }; <http://apache-wicket.1842946.n4.nabble.com/file/n4675020/1.png> Please help me understand the issure. Thank you in advance. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onsubmit-gets-called-after-page-reload-tp4675020.html Sent from the Users forum mailing list archive at Nab
onsubmit gets called after page reload
Hello, Please help me with the following situation: I'm using wicket 6. I have a page and a form. On this form I have an input, and when user hits Upload button, the list with the inputs should be updated. However, there is a strange behaviour: 1. when hitting the submit button, the onsubmit method is not immediatelly called, but instead the isVisible() method is called on a repeated number of times, which then calls Load() of the LoadableDetachableModel is called. 2. only after that the onSubmit() is finally called. But this behaviour, because of the isVisible() method being called before onSubmit() does not display the new item to the list on the page. Only after a new refresh of the page it is finally displayed. Here is the html and the java code: private class UploadForm extends Form { private static final long serialVersionUID = 1L; public UploadForm(String id, IModel docmodel) { super(id, docmodel); TextField fileDescription = new TextField("fileDescription", new PropertyModel(getModelObject(), "description")); add(fileDescription); final LoadableDetachableModel<ListDoc>> documentsModel = new LoadableDetachableModel<ListDoc>>() { private static final long serialVersionUID = 1L; @Override protected List load() { return SpringCtx.getAppDB(DocDao.class).selectByParentId(238); } }; final WebMarkupContainer documentsContainer = new WebMarkupContainer("documentsContainer"); documentsContainer.setOutputMarkupId(true); add(documentsContainer); documentsContainer.add(new ListView("documentList", documentsModel) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem item) { item.add(new Label("document", item.getModelObject().getDescription())); } @Override public boolean isVisible() { List docList = documentsModel.getObject(); return docList != null && docList.size() > 0; } }.setOutputMarkupId(true)); } @Override public void onSubmit() { logger.debug("this is onsubmit()"); Doc d = new Doc(); try { d.setFileName("test_fn"); d.setId(SpringCtx.getAppDB(DocDao.class).selectNextId()); d.setFileUrl("url"); d.setDescription(getModelObject().getDescription()); d.setParentId(238); SpringCtx.getAppDB(DocDao.class).insert(d); getModelObject().clear(); feedbackPanel.info(getString("upload.document.success")); } catch (Exception e) { logger.error("Error uploading user file", e); feedbackPanel.error(getString("upload.document.error") + " " + ExceptionUtils.getRootCauseMessage(e)); } } }; <http://apache-wicket.1842946.n4.nabble.com/file/n4675020/1.png> Please help me understand the issure. Thank you in advance. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onsubmit-gets-called-after-page-reload-tp4675020.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: PageParameters refresh on page reload
Thanks for the response Martin, good to know this is fixed in v7 (and the workaround for v6). On 21/05/14 14:08, Martin Grigorov wrote: Hi, This is fixed in Wicket 7.x. We didn't apply the fix to 6.x because it is a behavior change. You can read the current parameters in #onConfigure() with getRequestCycle().getRequest().getRequestParameters() and override with them the page's parameters (page.getPageParameters()) Martin Grigorov Wicket Training and Consulting On Wed, May 21, 2014 at 9:41 PM, Edgar Merino donvo...@gmail.com wrote: Hello, I've got a problem that I've just noticed today: When an instance of a WebPage is created with some url parameters, the PageParameters object is never updated, that is, if I refresh the same webpage with different url parameters this won't be taken into account, instead the first params used to create the WebPage are used. Is there a way to have url parameters updated on each page request? Thanks in advance. - 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
PageParameters refresh on page reload
Hello, I've got a problem that I've just noticed today: When an instance of a WebPage is created with some url parameters, the PageParameters object is never updated, that is, if I refresh the same webpage with different url parameters this won't be taken into account, instead the first params used to create the WebPage are used. Is there a way to have url parameters updated on each page request? Thanks in advance. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: PageParameters refresh on page reload
Hi, This is fixed in Wicket 7.x. We didn't apply the fix to 6.x because it is a behavior change. You can read the current parameters in #onConfigure() with getRequestCycle().getRequest().getRequestParameters() and override with them the page's parameters (page.getPageParameters()) Martin Grigorov Wicket Training and Consulting On Wed, May 21, 2014 at 9:41 PM, Edgar Merino donvo...@gmail.com wrote: Hello, I've got a problem that I've just noticed today: When an instance of a WebPage is created with some url parameters, the PageParameters object is never updated, that is, if I refresh the same webpage with different url parameters this won't be taken into account, instead the first params used to create the WebPage are used. Is there a way to have url parameters updated on each page request? Thanks in advance. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Continuous page reload
Hello Martin, finally was able to find what is wrong: Everything starts working after replacing lines 122 and 123 in file: https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup getRootRequestMapperAsCompound().add(new NoVersionMapper(getHomePage())); getRootRequestMapperAsCompound().add(new NoVersionMapper(notinited, NotInitedPage.class)); with this one mountPage(notinited, NotInitedPage.class); So I guess my NoVersionMapper works as expected in 6.12.0 and does not work in 6.13.0 Is there ant workaround for this? Thanks in advance! On Wed, Jan 15, 2014 at 2:48 PM, Maxim Solodovnik solomax...@gmail.comwrote: Thanks, Will try to pin down the issue and will write back On Wed, Jan 15, 2014 at 2:31 PM, Martin Grigorov mgrigo...@apache.orgwrote: You can use git bisect if nothing else works. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 9:29 AM, Martin Grigorov mgrigo...@apache.org wrote: Here are the release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12325564 Please share when you have more information. We may need to release 6.13.1 if the problem is not easy to workaround. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 7:28 AM, Maxim Solodovnik solomax...@gmail.com wrote: Is there any docs describing what was changed in the behaviors etc. so I can go through our code and fix it? Thanks in advance :) On Tue, Jan 14, 2014 at 10:48 PM, Maxim Solodovnik solomax...@gmail.com wrote: I do have TimerBehavior, but the issue was reproducible after commenting it. I also have callback behaviors can try to comment it out page version is being removed from the URL using NoVersionMapper: (line 130) https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup On Tue, Jan 14, 2014 at 10:43 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Do you use Ajax timer behavior on that page ? And do you open the same page instance (same url, same pageId) in two tabs ? Martin Grigorov Wicket Training and Consulting On Tue, Jan 14, 2014 at 5:36 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello all, I just have updated to 6.13.0 (to get WICKET-5435https://issues.apache.org/jira/browse/WICKET-5435 ) Unfortunately application stop working :( We are using single page design but after update the whole page is get reloaded continuously Can someone please suggest the way to find the cause of such reloads? I have removed all the changes except for wicket and websockets library update. Thanks for any help -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax
Re: Continuous page reload
Please give a link to NoVersionMapper. Martin Grigorov Wicket Training and Consulting On Mon, Jan 27, 2014 at 7:19 PM, Maxim Solodovnik solomax...@gmail.comwrote: Hello Martin, finally was able to find what is wrong: Everything starts working after replacing lines 122 and 123 in file: https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup getRootRequestMapperAsCompound().add(new NoVersionMapper(getHomePage())); getRootRequestMapperAsCompound().add(new NoVersionMapper(notinited, NotInitedPage.class)); with this one mountPage(notinited, NotInitedPage.class); So I guess my NoVersionMapper works as expected in 6.12.0 and does not work in 6.13.0 Is there ant workaround for this? Thanks in advance! On Wed, Jan 15, 2014 at 2:48 PM, Maxim Solodovnik solomax...@gmail.com wrote: Thanks, Will try to pin down the issue and will write back On Wed, Jan 15, 2014 at 2:31 PM, Martin Grigorov mgrigo...@apache.org wrote: You can use git bisect if nothing else works. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 9:29 AM, Martin Grigorov mgrigo...@apache.org wrote: Here are the release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12325564 Please share when you have more information. We may need to release 6.13.1 if the problem is not easy to workaround. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 7:28 AM, Maxim Solodovnik solomax...@gmail.com wrote: Is there any docs describing what was changed in the behaviors etc. so I can go through our code and fix it? Thanks in advance :) On Tue, Jan 14, 2014 at 10:48 PM, Maxim Solodovnik solomax...@gmail.com wrote: I do have TimerBehavior, but the issue was reproducible after commenting it. I also have callback behaviors can try to comment it out page version is being removed from the URL using NoVersionMapper: (line 130) https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup On Tue, Jan 14, 2014 at 10:43 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Do you use Ajax timer behavior on that page ? And do you open the same page instance (same url, same pageId) in two tabs ? Martin Grigorov Wicket Training and Consulting On Tue, Jan 14, 2014 at 5:36 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello all, I just have updated to 6.13.0 (to get WICKET-5435https://issues.apache.org/jira/browse/WICKET-5435 ) Unfortunately application stop working :( We are using single page design but after update the whole page is get reloaded continuously Can someone please suggest the way to find the cause of such reloads? I have removed all the changes except for wicket and websockets library update. Thanks for any help -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax
Re: Continuous page reload
Ah, it is inner class. Easy :) I will check it soon. Martin Grigorov Wicket Training and Consulting On Mon, Jan 27, 2014 at 9:00 PM, Martin Grigorov mgrigo...@apache.orgwrote: Please give a link to NoVersionMapper. Martin Grigorov Wicket Training and Consulting On Mon, Jan 27, 2014 at 7:19 PM, Maxim Solodovnik solomax...@gmail.comwrote: Hello Martin, finally was able to find what is wrong: Everything starts working after replacing lines 122 and 123 in file: https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup getRootRequestMapperAsCompound().add(new NoVersionMapper(getHomePage())); getRootRequestMapperAsCompound().add(new NoVersionMapper(notinited, NotInitedPage.class)); with this one mountPage(notinited, NotInitedPage.class); So I guess my NoVersionMapper works as expected in 6.12.0 and does not work in 6.13.0 Is there ant workaround for this? Thanks in advance! On Wed, Jan 15, 2014 at 2:48 PM, Maxim Solodovnik solomax...@gmail.com wrote: Thanks, Will try to pin down the issue and will write back On Wed, Jan 15, 2014 at 2:31 PM, Martin Grigorov mgrigo...@apache.org wrote: You can use git bisect if nothing else works. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 9:29 AM, Martin Grigorov mgrigo...@apache.org wrote: Here are the release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12325564 Please share when you have more information. We may need to release 6.13.1 if the problem is not easy to workaround. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 7:28 AM, Maxim Solodovnik solomax...@gmail.com wrote: Is there any docs describing what was changed in the behaviors etc. so I can go through our code and fix it? Thanks in advance :) On Tue, Jan 14, 2014 at 10:48 PM, Maxim Solodovnik solomax...@gmail.com wrote: I do have TimerBehavior, but the issue was reproducible after commenting it. I also have callback behaviors can try to comment it out page version is being removed from the URL using NoVersionMapper: (line 130) https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup On Tue, Jan 14, 2014 at 10:43 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Do you use Ajax timer behavior on that page ? And do you open the same page instance (same url, same pageId) in two tabs ? Martin Grigorov Wicket Training and Consulting On Tue, Jan 14, 2014 at 5:36 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello all, I just have updated to 6.13.0 (to get WICKET-5435https://issues.apache.org/jira/browse/WICKET-5435 ) Unfortunately application stop working :( We are using single page design but after update the whole page is get reloaded continuously Can someone please suggest the way to find the cause of such reloads? I have removed all the changes except for wicket and websockets library update. Thanks for any help -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax
Re: Continuous page reload
I'd bet that https://issues.apache.org/jira/browse/WICKET-4997 caused the problem. Please try this: @Override public Url mapHandler(IRequestHandler requestHandler) { if (requestHandler instanceof ListenerInterfaceRequestHandler || requestHandler instanceof BookmarkableListenerInterfaceRequestHandler) { return null; } else { return super.mapHandler(requestHandler); } } Martin Grigorov Wicket Training and Consulting On Mon, Jan 27, 2014 at 9:01 PM, Martin Grigorov mgrigo...@apache.orgwrote: Ah, it is inner class. Easy :) I will check it soon. Martin Grigorov Wicket Training and Consulting On Mon, Jan 27, 2014 at 9:00 PM, Martin Grigorov mgrigo...@apache.orgwrote: Please give a link to NoVersionMapper. Martin Grigorov Wicket Training and Consulting On Mon, Jan 27, 2014 at 7:19 PM, Maxim Solodovnik solomax...@gmail.comwrote: Hello Martin, finally was able to find what is wrong: Everything starts working after replacing lines 122 and 123 in file: https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup getRootRequestMapperAsCompound().add(new NoVersionMapper(getHomePage())); getRootRequestMapperAsCompound().add(new NoVersionMapper(notinited, NotInitedPage.class)); with this one mountPage(notinited, NotInitedPage.class); So I guess my NoVersionMapper works as expected in 6.12.0 and does not work in 6.13.0 Is there ant workaround for this? Thanks in advance! On Wed, Jan 15, 2014 at 2:48 PM, Maxim Solodovnik solomax...@gmail.com wrote: Thanks, Will try to pin down the issue and will write back On Wed, Jan 15, 2014 at 2:31 PM, Martin Grigorov mgrigo...@apache.org wrote: You can use git bisect if nothing else works. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 9:29 AM, Martin Grigorov mgrigo...@apache.org wrote: Here are the release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12325564 Please share when you have more information. We may need to release 6.13.1 if the problem is not easy to workaround. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 7:28 AM, Maxim Solodovnik solomax...@gmail.com wrote: Is there any docs describing what was changed in the behaviors etc. so I can go through our code and fix it? Thanks in advance :) On Tue, Jan 14, 2014 at 10:48 PM, Maxim Solodovnik solomax...@gmail.com wrote: I do have TimerBehavior, but the issue was reproducible after commenting it. I also have callback behaviors can try to comment it out page version is being removed from the URL using NoVersionMapper: (line 130) https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup On Tue, Jan 14, 2014 at 10:43 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Do you use Ajax timer behavior on that page ? And do you open the same page instance (same url, same pageId) in two tabs ? Martin Grigorov Wicket Training and Consulting On Tue, Jan 14, 2014 at 5:36 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello all, I just have updated to 6.13.0 (to get WICKET-5435https://issues.apache.org/jira/browse/WICKET-5435 ) Unfortunately application stop working :( We are using single page design but after update the whole page is get reloaded continuously Can someone please suggest the way to find the cause of such reloads? I have removed all the changes except for wicket and websockets library update. Thanks for any help -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax
Re: Continuous page reload
Thanks a lot! Everything works as expected with the change you have proposed :) You saved me! On Tue, Jan 28, 2014 at 3:12 AM, Martin Grigorov mgrigo...@apache.orgwrote: I'd bet that https://issues.apache.org/jira/browse/WICKET-4997 caused the problem. Please try this: @Override public Url mapHandler(IRequestHandler requestHandler) { if (requestHandler instanceof ListenerInterfaceRequestHandler || requestHandler instanceof BookmarkableListenerInterfaceRequestHandler) { return null; } else { return super.mapHandler(requestHandler); } } Martin Grigorov Wicket Training and Consulting On Mon, Jan 27, 2014 at 9:01 PM, Martin Grigorov mgrigo...@apache.org wrote: Ah, it is inner class. Easy :) I will check it soon. Martin Grigorov Wicket Training and Consulting On Mon, Jan 27, 2014 at 9:00 PM, Martin Grigorov mgrigo...@apache.org wrote: Please give a link to NoVersionMapper. Martin Grigorov Wicket Training and Consulting On Mon, Jan 27, 2014 at 7:19 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello Martin, finally was able to find what is wrong: Everything starts working after replacing lines 122 and 123 in file: https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup getRootRequestMapperAsCompound().add(new NoVersionMapper(getHomePage())); getRootRequestMapperAsCompound().add(new NoVersionMapper(notinited, NotInitedPage.class)); with this one mountPage(notinited, NotInitedPage.class); So I guess my NoVersionMapper works as expected in 6.12.0 and does not work in 6.13.0 Is there ant workaround for this? Thanks in advance! On Wed, Jan 15, 2014 at 2:48 PM, Maxim Solodovnik solomax...@gmail.com wrote: Thanks, Will try to pin down the issue and will write back On Wed, Jan 15, 2014 at 2:31 PM, Martin Grigorov mgrigo...@apache.org wrote: You can use git bisect if nothing else works. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 9:29 AM, Martin Grigorov mgrigo...@apache.org wrote: Here are the release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12325564 Please share when you have more information. We may need to release 6.13.1 if the problem is not easy to workaround. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 7:28 AM, Maxim Solodovnik solomax...@gmail.com wrote: Is there any docs describing what was changed in the behaviors etc. so I can go through our code and fix it? Thanks in advance :) On Tue, Jan 14, 2014 at 10:48 PM, Maxim Solodovnik solomax...@gmail.com wrote: I do have TimerBehavior, but the issue was reproducible after commenting it. I also have callback behaviors can try to comment it out page version is being removed from the URL using NoVersionMapper: (line 130) https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup On Tue, Jan 14, 2014 at 10:43 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Do you use Ajax timer behavior on that page ? And do you open the same page instance (same url, same pageId) in two tabs ? Martin Grigorov Wicket Training and Consulting On Tue, Jan 14, 2014 at 5:36 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello all, I just have updated to 6.13.0 (to get WICKET-5435 https://issues.apache.org/jira/browse/WICKET-5435 ) Unfortunately application stop working :( We are using single page design but after update the whole page is get reloaded continuously Can someone please suggest the way to find the cause of such reloads? I have removed all the changes except for wicket and websockets library update. Thanks for any help -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax
Continuous page reload
Hello all, I just have updated to 6.13.0 (to get WICKET-5435https://issues.apache.org/jira/browse/WICKET-5435 ) Unfortunately application stop working :( We are using single page design but after update the whole page is get reloaded continuously Can someone please suggest the way to find the cause of such reloads? I have removed all the changes except for wicket and websockets library update. Thanks for any help -- WBR Maxim aka solomax
Re: Continuous page reload
Hi, Do you use Ajax timer behavior on that page ? And do you open the same page instance (same url, same pageId) in two tabs ? Martin Grigorov Wicket Training and Consulting On Tue, Jan 14, 2014 at 5:36 PM, Maxim Solodovnik solomax...@gmail.comwrote: Hello all, I just have updated to 6.13.0 (to get WICKET-5435https://issues.apache.org/jira/browse/WICKET-5435 ) Unfortunately application stop working :( We are using single page design but after update the whole page is get reloaded continuously Can someone please suggest the way to find the cause of such reloads? I have removed all the changes except for wicket and websockets library update. Thanks for any help -- WBR Maxim aka solomax
Re: Continuous page reload
I do have TimerBehavior, but the issue was reproducible after commenting it. I also have callback behaviors can try to comment it out page version is being removed from the URL using NoVersionMapper: (line 130) https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup On Tue, Jan 14, 2014 at 10:43 PM, Martin Grigorov mgrigo...@apache.orgwrote: Hi, Do you use Ajax timer behavior on that page ? And do you open the same page instance (same url, same pageId) in two tabs ? Martin Grigorov Wicket Training and Consulting On Tue, Jan 14, 2014 at 5:36 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello all, I just have updated to 6.13.0 (to get WICKET-5435https://issues.apache.org/jira/browse/WICKET-5435 ) Unfortunately application stop working :( We are using single page design but after update the whole page is get reloaded continuously Can someone please suggest the way to find the cause of such reloads? I have removed all the changes except for wicket and websockets library update. Thanks for any help -- WBR Maxim aka solomax -- WBR Maxim aka solomax
Re: Continuous page reload
Is there any docs describing what was changed in the behaviors etc. so I can go through our code and fix it? Thanks in advance :) On Tue, Jan 14, 2014 at 10:48 PM, Maxim Solodovnik solomax...@gmail.comwrote: I do have TimerBehavior, but the issue was reproducible after commenting it. I also have callback behaviors can try to comment it out page version is being removed from the URL using NoVersionMapper: (line 130) https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup On Tue, Jan 14, 2014 at 10:43 PM, Martin Grigorov mgrigo...@apache.orgwrote: Hi, Do you use Ajax timer behavior on that page ? And do you open the same page instance (same url, same pageId) in two tabs ? Martin Grigorov Wicket Training and Consulting On Tue, Jan 14, 2014 at 5:36 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello all, I just have updated to 6.13.0 (to get WICKET-5435https://issues.apache.org/jira/browse/WICKET-5435 ) Unfortunately application stop working :( We are using single page design but after update the whole page is get reloaded continuously Can someone please suggest the way to find the cause of such reloads? I have removed all the changes except for wicket and websockets library update. Thanks for any help -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax
Re: Continuous page reload
Here are the release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12325564 Please share when you have more information. We may need to release 6.13.1 if the problem is not easy to workaround. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 7:28 AM, Maxim Solodovnik solomax...@gmail.comwrote: Is there any docs describing what was changed in the behaviors etc. so I can go through our code and fix it? Thanks in advance :) On Tue, Jan 14, 2014 at 10:48 PM, Maxim Solodovnik solomax...@gmail.com wrote: I do have TimerBehavior, but the issue was reproducible after commenting it. I also have callback behaviors can try to comment it out page version is being removed from the URL using NoVersionMapper: (line 130) https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup On Tue, Jan 14, 2014 at 10:43 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Do you use Ajax timer behavior on that page ? And do you open the same page instance (same url, same pageId) in two tabs ? Martin Grigorov Wicket Training and Consulting On Tue, Jan 14, 2014 at 5:36 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello all, I just have updated to 6.13.0 (to get WICKET-5435https://issues.apache.org/jira/browse/WICKET-5435 ) Unfortunately application stop working :( We are using single page design but after update the whole page is get reloaded continuously Can someone please suggest the way to find the cause of such reloads? I have removed all the changes except for wicket and websockets library update. Thanks for any help -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax
Re: Continuous page reload
You can use git bisect if nothing else works. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 9:29 AM, Martin Grigorov mgrigo...@apache.orgwrote: Here are the release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12325564 Please share when you have more information. We may need to release 6.13.1 if the problem is not easy to workaround. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 7:28 AM, Maxim Solodovnik solomax...@gmail.comwrote: Is there any docs describing what was changed in the behaviors etc. so I can go through our code and fix it? Thanks in advance :) On Tue, Jan 14, 2014 at 10:48 PM, Maxim Solodovnik solomax...@gmail.com wrote: I do have TimerBehavior, but the issue was reproducible after commenting it. I also have callback behaviors can try to comment it out page version is being removed from the URL using NoVersionMapper: (line 130) https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup On Tue, Jan 14, 2014 at 10:43 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Do you use Ajax timer behavior on that page ? And do you open the same page instance (same url, same pageId) in two tabs ? Martin Grigorov Wicket Training and Consulting On Tue, Jan 14, 2014 at 5:36 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello all, I just have updated to 6.13.0 (to get WICKET-5435https://issues.apache.org/jira/browse/WICKET-5435 ) Unfortunately application stop working :( We are using single page design but after update the whole page is get reloaded continuously Can someone please suggest the way to find the cause of such reloads? I have removed all the changes except for wicket and websockets library update. Thanks for any help -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax
Re: Continuous page reload
Thanks, Will try to pin down the issue and will write back On Wed, Jan 15, 2014 at 2:31 PM, Martin Grigorov mgrigo...@apache.orgwrote: You can use git bisect if nothing else works. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 9:29 AM, Martin Grigorov mgrigo...@apache.org wrote: Here are the release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561version=12325564 Please share when you have more information. We may need to release 6.13.1 if the problem is not easy to workaround. Martin Grigorov Wicket Training and Consulting On Wed, Jan 15, 2014 at 7:28 AM, Maxim Solodovnik solomax...@gmail.com wrote: Is there any docs describing what was changed in the behaviors etc. so I can go through our code and fix it? Thanks in advance :) On Tue, Jan 14, 2014 at 10:48 PM, Maxim Solodovnik solomax...@gmail.com wrote: I do have TimerBehavior, but the issue was reproducible after commenting it. I also have callback behaviors can try to comment it out page version is being removed from the URL using NoVersionMapper: (line 130) https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/app/Application.java?view=markup On Tue, Jan 14, 2014 at 10:43 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Do you use Ajax timer behavior on that page ? And do you open the same page instance (same url, same pageId) in two tabs ? Martin Grigorov Wicket Training and Consulting On Tue, Jan 14, 2014 at 5:36 PM, Maxim Solodovnik solomax...@gmail.com wrote: Hello all, I just have updated to 6.13.0 (to get WICKET-5435https://issues.apache.org/jira/browse/WICKET-5435 ) Unfortunately application stop working :( We are using single page design but after update the whole page is get reloaded continuously Can someone please suggest the way to find the cause of such reloads? I have removed all the changes except for wicket and websockets library update. Thanks for any help -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax -- WBR Maxim aka solomax
Re: Problem with WiQuery Tab component after page reload
Hi, has no-one observed this yet? Shall I file an issue? Bye Stefan Stefan Renz wrote: Hi, I've observed the following behavior with WiQuery's Tabs-component: after reloading a page with a tabs component on it (or by navigating the browser history), one can't switch the active tab anymore -- the component always jumps back. The browser makes a new request. Apparently, Wicket loads a specific page version from the page store, which is stuck on the tab. Removing the version number from the URL works as expected. Did anyone also observe this behavior, or has anyone a suggestion to workaround or fix that? The least thing I could do is to come up with a quickstart for this, which is attached. We're talking about Wicket 6.6.0 and WiQuery 6.6.0 here, I've also tried with 6.5.0. Thanks, bye Stefan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Problem with WiQuery Tab component after page reload
Hi, I've observed the following behavior with WiQuery's Tabs-component: after reloading a page with a tabs component on it (or by navigating the browser history), one can't switch the active tab anymore -- the component always jumps back. The browser makes a new request. Apparently, Wicket loads a specific page version from the page store, which is stuck on the tab. Removing the version number from the URL works as expected. Did anyone also observe this behavior, or has anyone a suggestion to workaround or fix that? The least thing I could do is to come up with a quickstart for this, which is attached. We're talking about Wicket 6.6.0 and WiQuery 6.6.0 here, I've also tried with 6.5.0. Thanks, bye Stefan quickstart.tabeventstate.tar.gz Description: GNU Zip compressed data - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Problem with WiQuery Tab component after page reload
I forgot to mention that this happens with an ITabsAjaxEvent handler installed on the Tabs component... so is this a stateful/stateless thing? Bye Stefan Stefan Renz wrote: Hi, I've observed the following behavior with WiQuery's Tabs-component: after reloading a page with a tabs component on it (or by navigating the browser history), one can't switch the active tab anymore -- the component always jumps back. The browser makes a new request. Apparently, Wicket loads a specific page version from the page store, which is stuck on the tab. Removing the version number from the URL works as expected. Did anyone also observe this behavior, or has anyone a suggestion to workaround or fix that? The least thing I could do is to come up with a quickstart for this, which is attached. We're talking about Wicket 6.6.0 and WiQuery 6.6.0 here, I've also tried with 6.5.0. Thanks, bye Stefan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Problem with WiQuery Tab component after page reload
I forgot to mention that this happens with an ITabsAjaxEvent handler installed on the Tabs component... so is this a stateful/stateless thing? Bye Stefan Stefan Renz wrote: Hi, I've observed the following behavior with WiQuery's Tabs-component: after reloading a page with a tabs component on it (or by navigating the browser history), one can't switch the active tab anymore -- the component always jumps back. The browser makes a new request. Apparently, Wicket loads a specific page version from the page store, which is stuck on the tab. Removing the version number from the URL works as expected. Did anyone also observe this behavior, or has anyone a suggestion to workaround or fix that? The least thing I could do is to come up with a quickstart for this, which is attached. We're talking about Wicket 6.6.0 and WiQuery 6.6.0 here, I've also tried with 6.5.0. Thanks, bye Stefan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- im Auftrag der eFonds Solutions AG, +49-89-579494-3417 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 6: AjaxFormComponentUpdatingBehavior on dropdown leads to page reload
On Sat, March 09, 2013, Bernard wrote: I would try to debug the constructor of the page and/or override and debug life cycle methods of the page and then work up the call stack why they are executed. Thank you for your reply. Having slept a night over it I found the problem. Like a couple of times before, whenever it comes to request handling in a Wicket 1.5+ system, debugging mapRequest() in CompountRequestMapper is extremely helpful for understanding how your system works :) In my case one from a number of custom page mappers in my system (most of which derive from or wrap a MountedMapper) was the culprit. After doing some magic on the request, in mapRequest() it just returned a RenderPageRequestHandler instead of passing the request on to super.mapRequest(). I actually like the RequestMappers introduced in 1.5, but being so powerful they also exhibit plenty of ways to shoot yourself into the foot and produce rather bizarre effects.. Cheers, M'bert -- --- / http://herbert.the-little-red-haired-girl.org / - =+= In an organization, each person rises to the level of his own incompetency. -- The Peter Principle - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket 6: AjaxFormComponentUpdatingBehavior on dropdown leads to page reload
I've just spent several hours trying to debug a rather strange effect with a dropdown and a AjaxFormComponentUpdatingBehavior. I have a component which is used in several places of the system. It contains a dropdown to which a AjaxFormComponentUpdatingBehavior is added. Whenever the user selects a value, a label is displayed underneath. This component has been in use in different parts of the system for quite some time now. After having upgraded to Wicket 6.6, it does no longer work - on one particular page. While on all other pages it works just fine, on that particular page every time I change something, the page reloads (just as if I had attached an AjaxFormSubmitBehavior (which of course I had not, actually there is not a single one used within the whole project). When doing this reloading, my AjaxFormSubmitBehavior's handler is never invoked. I checked the requests the browser gets to see, and it seems like there isn't any difference. Just in case, here's roughly what I get on the pages where it works: Path: http://localhost:8080/editor/editorial-tools/rundschreiben?7-1.IBehaviorListener.1-page~body-stage-stage_content-wrapped_content-content-editor-form-object_editor-groups-0-group-attributes-7-item-value-choice-ajax~holder-drop~downrubrik=Rundschreiben Method: POST The next request is an icon for the stuff displayed later. On the bad page, the request does not look too much different (it's just a different page): Path: http://localhost:8080/foo/bar/nav/foobar-xxx?14-1.IBehaviorListener.1-page~body-stage-stage_content-wrapped_content-foo~content-choice-ajax~holder-drop~downaction=newvariant=foo-sub-page Method: POST Only after it, I get the original path, but a redirect: : Path: http://localhost:8080/foo/bar/nav/foobar-xxx?action=newvariant=foo-sub-page Method: GET Status Text: 302 (Moved Temporarily) Now this indicates that something's going wrong in the Java code rather than in Javascript. I tried to find the point where the multiplexing is done and from where the Ajax behaviours are invoked, but I did not find it. Now I feel really clueless. Is there a wellknown Gotcha which simply I don't know of? Maybe anybody had the same problem before? Or, at least, where should I step into the Wicket code in order to find out where it goes wrong? Any help appreciated! Cheers, M'bert -- --- / http://herbert.the-little-red-haired-girl.org / - =+= Dann freuen wir uns und gehen weiter und denken noch im Kuessegeben: Wie nah sind uns manche Tote, wie tot sind uns manche, die leben. -- Wolf Biermann - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 6: AjaxFormComponentUpdatingBehavior on dropdown leads to page reload
Hi, I would try to debug the constructor of the page and/or override and debug life cycle methods of the page and then work up the call stack why they are executed. As an example (not necessarily applicable in your case), one could find this way that the page had expired and Wicket just reconstructed it which could be surprising. See ListenerInterfaceRequestHandler#respond(). Regards Bernard On Fri, 8 Mar 2013 23:04:13 +0100, you wrote: I've just spent several hours trying to debug a rather strange effect with a dropdown and a AjaxFormComponentUpdatingBehavior. I have a component which is used in several places of the system. It contains a dropdown to which a AjaxFormComponentUpdatingBehavior is added. Whenever the user selects a value, a label is displayed underneath. This component has been in use in different parts of the system for quite some time now. After having upgraded to Wicket 6.6, it does no longer work - on one particular page. While on all other pages it works just fine, on that particular page every time I change something, the page reloads (just as if I had attached an AjaxFormSubmitBehavior (which of course I had not, actually there is not a single one used within the whole project). When doing this reloading, my AjaxFormSubmitBehavior's handler is never invoked. I checked the requests the browser gets to see, and it seems like there isn't any difference. Just in case, here's roughly what I get on the pages where it works: Path: http://localhost:8080/editor/editorial-tools/rundschreiben?7-1.IBehaviorListener.1-page~body-stage-stage_content-wrapped_content-content-editor-form-object_editor-groups-0-group-attributes-7-item-value-choice-ajax~holder-drop~downrubrik=Rundschreiben Method: POST The next request is an icon for the stuff displayed later. On the bad page, the request does not look too much different (it's just a different page): Path: http://localhost:8080/foo/bar/nav/foobar-xxx?14-1.IBehaviorListener.1-page~body-stage-stage_content-wrapped_content-foo~content-choice-ajax~holder-drop~downaction=newvariant=foo-sub-page Method: POST Only after it, I get the original path, but a redirect: : Path: http://localhost:8080/foo/bar/nav/foobar-xxx?action=newvariant=foo-sub-page Method: GET Status Text: 302 (Moved Temporarily) Now this indicates that something's going wrong in the Java code rather than in Javascript. I tried to find the point where the multiplexing is done and from where the Ajax behaviours are invoked, but I did not find it. Now I feel really clueless. Is there a wellknown Gotcha which simply I don't know of? Maybe anybody had the same problem before? Or, at least, where should I step into the Wicket code in order to find out where it goes wrong? Any help appreciated! Cheers, M'bert - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
rawInput, page reload and error messages
Hi! I have the following situation (Wicket 1.5.5): - a Form with a TextFieldString with some Validator - you input invalid data and submit - error message, fine. - (invalid) rawInput is shown in the TextField, fine. - now I do a page reload, invalid rawInput still in the TextField, but no error message shown What I'd like to achieve is that upon a page reload the (invalid) rawInput is shown in the TextField, but the error message also needs to be shown again. How can this be done? I already tried to trigger validation manually by calling formComponent.validate(), but this calls AbstractTextComponent.convertInput(), which tries to pull the input data from the request (and there is no data because of page reload, so validation won't fail …). Cheers, -Tom - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: rawInput, page reload and error messages
You might want to subclass Form to retain additional state. It could save the validation errors and put them back onto components in onBeforeRender, clearing them when validation is eventually successful. This could probably also be accomplished with a Behavior. On Wed, Apr 11, 2012 at 7:19 AM, Thomas Götz t...@decoded.de wrote: Hi! I have the following situation (Wicket 1.5.5): - a Form with a TextFieldString with some Validator - you input invalid data and submit - error message, fine. - (invalid) rawInput is shown in the TextField, fine. - now I do a page reload, invalid rawInput still in the TextField, but no error message shown What I'd like to achieve is that upon a page reload the (invalid) rawInput is shown in the TextField, but the error message also needs to be shown again. How can this be done? I already tried to trigger validation manually by calling formComponent.validate(), but this calls AbstractTextComponent.convertInput(), which tries to pull the input data from the request (and there is no data because of page reload, so validation won't fail …). Cheers, -Tom - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
change or replace css file on page reload
Hi all i was wondering how could i change a css file on every page reload i thought of using header contribution in onBeforeRender() , but it seams to add the new the new css file what i need is to replace a certain css on every render of a certain page actually i can dynamically generate the css file using velocity or freemarker ,but the question is how to replace the old css with the new one thanks Joe
Re: change or replace css file on page reload
see IHeaderContributor -igor On Tue, May 4, 2010 at 4:50 PM, Joe Fawzy joewic...@gmail.com wrote: Hi all i was wondering how could i change a css file on every page reload i thought of using header contribution in onBeforeRender() , but it seams to add the new the new css file what i need is to replace a certain css on every render of a certain page actually i can dynamically generate the css file using velocity or freemarker ,but the question is how to replace the old css with the new one thanks Joe - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Page reload after submit action
Hello Vinnet. Thank you. Upgrading to Wicket 1.4.7 fixed the problem. Cheers, Manfred vineet semwal wrote: Hi, It appears you are on 1.4.6,upgrade to 1.4.7 and see if the problem disappears. On Sun, Mar 14, 2010 at 5:15 AM, Bergmann Manfred m...@software-by-mabe.comwrote: Hi there. I have the following problem with reloading the same page that is currently loaded. I'm working on a blog application. Normally the URL in the browser for a specific blog entry is like this: http://host/blog/id/someblogid where /blog is mounted as bookmarkable in Application to Blog WebPage subclass which has a constructor with PageParameters which accepts id=someblogid which then is translated to /blog/id/someblogid by Wicket. Now there is an add comment panel on the page that, when a user submits it, should load the Blog page for the same someblogid. In onSubmit I tried with: setResponsePage(Blog.class, new PageParameters(id=+someblogid) which ends up that a page with this URL is loaded /blog/id/blog/id/someblogid which of course doesn't work. Reloading the same page using setResponsePage(getWebPage) doesn't work either. I'm probably missing the obvious but I'd appreciate if someone could help me here. Manfred - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- regards, Vineet Semwal -- View this message in context: http://old.nabble.com/Page-reload-after-submit-action-tp27891746p27894271.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
Page reload after submit action
Hi there. I have the following problem with reloading the same page that is currently loaded. I'm working on a blog application. Normally the URL in the browser for a specific blog entry is like this: http://host/blog/id/someblogid where /blog is mounted as bookmarkable in Application to Blog WebPage subclass which has a constructor with PageParameters which accepts id=someblogid which then is translated to /blog/id/someblogid by Wicket. Now there is an add comment panel on the page that, when a user submits it, should load the Blog page for the same someblogid. In onSubmit I tried with: setResponsePage(Blog.class, new PageParameters(id=+someblogid) which ends up that a page with this URL is loaded /blog/id/blog/id/someblogid which of course doesn't work. Reloading the same page using setResponsePage(getWebPage) doesn't work either. I'm probably missing the obvious but I'd appreciate if someone could help me here. Manfred - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Page reload after submit action
Hi, It appears you are on 1.4.6,upgrade to 1.4.7 and see if the problem disappears. On Sun, Mar 14, 2010 at 5:15 AM, Bergmann Manfred m...@software-by-mabe.comwrote: Hi there. I have the following problem with reloading the same page that is currently loaded. I'm working on a blog application. Normally the URL in the browser for a specific blog entry is like this: http://host/blog/id/someblogid where /blog is mounted as bookmarkable in Application to Blog WebPage subclass which has a constructor with PageParameters which accepts id=someblogid which then is translated to /blog/id/someblogid by Wicket. Now there is an add comment panel on the page that, when a user submits it, should load the Blog page for the same someblogid. In onSubmit I tried with: setResponsePage(Blog.class, new PageParameters(id=+someblogid) which ends up that a page with this URL is loaded /blog/id/blog/id/someblogid which of course doesn't work. Reloading the same page using setResponsePage(getWebPage) doesn't work either. I'm probably missing the obvious but I'd appreciate if someone could help me here. Manfred - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- regards, Vineet Semwal
Re: Force page reload/re-render
if(userSetWasChanged){ target.appendJavascript(window.location.reload()); or setResponsePage(getPage()); or setResponsePage(getPage().getClass()); } On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen pieter.claas...@gmail.comwrote: I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
RE: Getting the Choose Option on page reload
Thank you for the responses. theDropdownComponent.nullValid=Choose one worked. Regards, Vinay Karmarkar -Original Message- From: Wilhelmsen Tor Iver [mailto:toriv...@arrive.no] Sent: Monday, November 09, 2009 6:37 PM To: users@wicket.apache.org Subject: Re: Getting the Choose Option on page reload I have 2 drop-downs and a search button my page. When the page is loaded for the first time, the first option in both the drop-downs is Choose Option. Now if I select some value and click Search, the page is rendered again and the Choose Option is gone forever. But I want it back. How do I go this? It is a consequence of disabling null values; you need to tell the dropdown to accept null values which is what Choose Option represents: theDropdownComponent.setNullValid(true); You will also want to override the display value property in the .properties file: theDropdownComponent.null_valid=Not set - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Force page reload/re-render
Hi Pedro, I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. setResponsePage(getPage().getClass()) only works for stateless pages and on most of my pages, I pass params via the constructor. The javascript option will be a last resort, but it seems to be not the most elegant solution. Rgds, On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos pedros...@gmail.com wrote: if(userSetWasChanged){ target.appendJavascript(window.location.reload()); or setResponsePage(getPage()); or setResponsePage(getPage().getClass()); } On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen pieter.claas...@gmail.com wrote: I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Force page reload/re-render
Isn't AJAX refresh an option to consider here? For instance, defining some contexts which need to be re-rendered (e.g. marking them with an interface) and them having and IVisitor that collects all those contexts and add them to the AjaxRequestTarget? Best, Ernesto On Tue, Nov 10, 2009 at 8:19 AM, pieter claassen pieter.claas...@gmail.comwrote: I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Force page reload/re-render
Both of the suggestions I think requires me to modify the logic of the controls (either to keep track of which ones need to be updated or by placing the rendering logic in onBeforeRender()). I think this is a lot of work for something relative straight forward and also any changes to permission structures and I have to modify controls. Is there no way that I can mark a page obtained via getPage() as requiring re-rendering? I tried getPage().dirty() before the setResponsePage() but that didn't do anything. Thanks for the feedback though. P On Tue, Nov 10, 2009 at 1:10 PM, Pedro Santos pedros...@gmail.com wrote: I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. Where do you implement your control ( update logic )? Consider do it overriding Component.onBeforeRender method On Tue, Nov 10, 2009 at 10:03 AM, pieter claassen pieter.claas...@gmail.com wrote: Hi Pedro, I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. setResponsePage(getPage().getClass()) only works for stateless pages and on most of my pages, I pass params via the constructor. The javascript option will be a last resort, but it seems to be not the most elegant solution. Rgds, On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos pedros...@gmail.com wrote: if(userSetWasChanged){ target.appendJavascript(window.location.reload()); or setResponsePage(getPage()); or setResponsePage(getPage().getClass()); } On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen pieter.claas...@gmail.com wrote: I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Force page reload/re-render
Hi Ernesto, To recap, I have a control panel visible on each and every page and in that control panel, you can select the appropriate role you want to use. Based on that role some menu items will be visible or not (example below is correct). I am sure this problem has been solved before :-0 as this is a very normal usecase for context sensitive navigation. It seems that there is no way to force the page to re-render using getPage()? Thanks for the feedback so far. I keep on coming up against this issue and have not found a reasonable solution to the problem. The javascript option seems to be best so far. Pieter On Tue, Nov 10, 2009 at 1:41 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Even if you re-render your page components that are not dynamic will not change their state: unless you create a new instance of the page, I guess. By this I mean. class MyPanel { public MyPanel(id) { PanelB panelB = new Panel(B); panelB.setVisible(getSomeCondition()); } } Even if condition getSomeCondition() change, and you re-render MyPanel, or the whole page, panelB will still be not visible. So, if you want something to be dynamic you have to program it to be dynamic. Best, Ernesto On Tue, Nov 10, 2009 at 1:20 PM, pieter claassen pieter.claas...@gmail.com wrote: Both of the suggestions I think requires me to modify the logic of the controls (either to keep track of which ones need to be updated or by placing the rendering logic in onBeforeRender()). I think this is a lot of work for something relative straight forward and also any changes to permission structures and I have to modify controls. Is there no way that I can mark a page obtained via getPage() as requiring re-rendering? I tried getPage().dirty() before the setResponsePage() but that didn't do anything. Thanks for the feedback though. P On Tue, Nov 10, 2009 at 1:10 PM, Pedro Santos pedros...@gmail.com wrote: I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. Where do you implement your control ( update logic )? Consider do it overriding Component.onBeforeRender method On Tue, Nov 10, 2009 at 10:03 AM, pieter claassen pieter.claas...@gmail.com wrote: Hi Pedro, I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. setResponsePage(getPage().getClass()) only works for stateless pages and on most of my pages, I pass params via the constructor. The javascript option will be a last resort, but it seems to be not the most elegant solution. Rgds, On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos pedros...@gmail.com wrote: if(userSetWasChanged){ target.appendJavascript(window.location.reload()); or setResponsePage(getPage()); or setResponsePage(getPage().getClass()); } On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen pieter.claas...@gmail.com wrote: I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com -- Pieter Claassen musmato.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Force page reload/re-render
Hi Pieter Due to the Java-Nature of Wicket, things done in the constructor are only executed once for this instance. Since F5 only re-renders the instance, the expression setVisible(whatever()) is only executed once. The most dynamic implementation would be to override isVisible() for every component that changes its visibility dynamically or if that would lead to lots of code duplication, you could write a behaviour doing exactly that and add it to every component (or container) as needed. isVisible() is evaluated during each and every rendering phase, meaning upon every F5 reload as well. This is the way we do it for dynamic content. Matt pieter claassen wrote: Hi Ernesto, To recap, I have a control panel visible on each and every page and in that control panel, you can select the appropriate role you want to use. Based on that role some menu items will be visible or not (example below is correct). I am sure this problem has been solved before :-0 as this is a very normal usecase for context sensitive navigation. It seems that there is no way to force the page to re-render using getPage()? Thanks for the feedback so far. I keep on coming up against this issue and have not found a reasonable solution to the problem. The javascript option seems to be best so far. Pieter On Tue, Nov 10, 2009 at 1:41 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Even if you re-render your page components that are not dynamic will not change their state: unless you create a new instance of the page, I guess. By this I mean. class MyPanel { public MyPanel(id) { PanelB panelB = new Panel(B); panelB.setVisible(getSomeCondition()); } } Even if condition getSomeCondition() change, and you re-render MyPanel, or the whole page, panelB will still be not visible. So, if you want something to be dynamic you have to program it to be dynamic. Best, Ernesto On Tue, Nov 10, 2009 at 1:20 PM, pieter claassen pieter.claas...@gmail.com wrote: Both of the suggestions I think requires me to modify the logic of the controls (either to keep track of which ones need to be updated or by placing the rendering logic in onBeforeRender()). I think this is a lot of work for something relative straight forward and also any changes to permission structures and I have to modify controls. Is there no way that I can mark a page obtained via getPage() as requiring re-rendering? I tried getPage().dirty() before the setResponsePage() but that didn't do anything. Thanks for the feedback though. P On Tue, Nov 10, 2009 at 1:10 PM, Pedro Santos pedros...@gmail.com wrote: I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. Where do you implement your control ( update logic )? Consider do it overriding Component.onBeforeRender method On Tue, Nov 10, 2009 at 10:03 AM, pieter claassen pieter.claas...@gmail.com wrote: Hi Pedro, I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. setResponsePage(getPage().getClass()) only works for stateless pages and on most of my pages, I pass params via the constructor. The javascript option will be a last resort, but it seems to be not the most elegant solution. Rgds, On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos pedros...@gmail.com wrote: if(userSetWasChanged){ target.appendJavascript(window.location.reload()); or setResponsePage(getPage()); or setResponsePage(getPage().getClass()); } On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen pieter.claas...@gmail.com wrote: I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter smime.p7s Description: S/MIME Cryptographic Signature
Re: Force page reload/re-render
The page will be re-rendered... Implement your menu item componentes isVisible method to return true due your context Enviado de meu iPhone Em 10/11/2009, às 11:39, pieter claassen pieter.claas...@gmail.com escreveu: Hi Ernesto, To recap, I have a control panel visible on each and every page and in that control panel, you can select the appropriate role you want to use. Based on that role some menu items will be visible or not (example below is correct). I am sure this problem has been solved before :-0 as this is a very normal usecase for context sensitive navigation. It seems that there is no way to force the page to re-render using getPage()? Thanks for the feedback so far. I keep on coming up against this issue and have not found a reasonable solution to the problem. The javascript option seems to be best so far. Pieter On Tue, Nov 10, 2009 at 1:41 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Even if you re-render your page components that are not dynamic will not change their state: unless you create a new instance of the page, I guess. By this I mean. class MyPanel { public MyPanel(id) { PanelB panelB = new Panel(B); panelB.setVisible(getSomeCondition()); } } Even if condition getSomeCondition() change, and you re-render MyPanel, or the whole page, panelB will still be not visible. So, if you want something to be dynamic you have to program it to be dynamic. Best, Ernesto On Tue, Nov 10, 2009 at 1:20 PM, pieter claassen pieter.claas...@gmail.com wrote: Both of the suggestions I think requires me to modify the logic of the controls (either to keep track of which ones need to be updated or by placing the rendering logic in onBeforeRender()). I think this is a lot of work for something relative straight forward and also any changes to permission structures and I have to modify controls. Is there no way that I can mark a page obtained via getPage() as requiring re-rendering? I tried getPage().dirty() before the setResponsePage() but that didn't do anything. Thanks for the feedback though. P On Tue, Nov 10, 2009 at 1:10 PM, Pedro Santos pedros...@gmail.com wrote: I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. Where do you implement your control ( update logic )? Consider do it overriding Component.onBeforeRender method On Tue, Nov 10, 2009 at 10:03 AM, pieter claassen pieter.claas...@gmail.com wrote: Hi Pedro, I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. setResponsePage(getPage().getClass()) only works for stateless pages and on most of my pages, I pass params via the constructor. The javascript option will be a last resort, but it seems to be not the most elegant solution. Rgds, On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos pedros...@gmail.com wrote: if(userSetWasChanged){ target.appendJavascript(window.location.reload()); or setResponsePage(getPage()); or setResponsePage(getPage().getClass()); } On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen pieter.claas...@gmail.com wrote: I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter --- --- --- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com -- Pieter Claassen musmato.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: Force page reload/re-render
Hi Pieter, Components that have .setVisible(false) will never be evaluated again automatically. You need to call .setVisible(true) on all that apply. One way would be control visibility in the base panel by overriding onBeforeRender() to handle all the cases in one place. e.g. class ControlPanel extends Panel { protected void onBeforeRender () { Role role = getModelObject(); caseOnePanel.setVisible(false); caseTwoPanel.setVisible (false); if (role instanceof CaseOne) { caseOnePanel.setVisible (true); } else if (role instanceof CaseTwo) { caseTwoPanel.setVisible (true); } } } Or you could override .isVisible() in your sub panels to control when they are visible. I like the on before render way myself because there is no performance penalty if the visibility logic is complex (Component.isVisible() is called alot during the rendering phase). Regards, Mike To recap, I have a control panel visible on each and every page and in that control panel, you can select the appropriate role you want to use. Based on that role some menu items will be visible or not (example below is correct). I am sure this problem has been solved before :-0 as this is a very normal usecase for context sensitive navigation. It seems that there is no way to force the page to re-render using getPage()? Thanks for the feedback so far. I keep on coming up against this issue and have not found a reasonable solution to the problem. The javascript option seems to be best so far. Pieter On Tue, Nov 10, 2009 at 1:41 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Even if you re-render your page components that are not dynamic will not change their state: unless you create a new instance of the page, I guess. By this I mean. class MyPanel { public MyPanel(id) { PanelB panelB = new Panel(B); panelB.setVisible(getSomeCondition()); } } Even if condition getSomeCondition() change, and you re-render MyPanel, or the whole page, panelB will still be not visible. So, if you want something to be dynamic you have to program it to be dynamic. Best, Ernesto On Tue, Nov 10, 2009 at 1:20 PM, pieter claassen pieter.claas...@gmail.com wrote: Both of the suggestions I think requires me to modify the logic of the controls (either to keep track of which ones need to be updated or by placing the rendering logic in onBeforeRender()). I think this is a lot of work for something relative straight forward and also any changes to permission structures and I have to modify controls. Is there no way that I can mark a page obtained via getPage() as requiring re-rendering? I tried getPage().dirty() before the setResponsePage() but that didn't do anything. Thanks for the feedback though. P On Tue, Nov 10, 2009 at 1:10 PM, Pedro Santos pedros...@gmail.com wrote: I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. Where do you implement your control ( update logic )? Consider do it overriding Component.onBeforeRender method On Tue, Nov 10, 2009 at 10:03 AM, pieter claassen pieter.claas...@gmail.com wrote: Hi Pedro, I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. setResponsePage(getPage().getClass()) only works for stateless pages and on most of my pages, I pass params via the constructor. The javascript option will be a last resort, but it seems to be not the most elegant solution. Rgds, On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos pedros...@gmail.com wrote: if(userSetWasChanged){ target.appendJavascript(window.location.reload()); or setResponsePage(getPage()); or setResponsePage(getPage().getClass()); } On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen pieter.claas...@gmail.com wrote: I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com -- Pedro Henrique Oliveira dos Santos -- Pieter Claassen musmato.com
Re: Force page reload/re-render
Thanks for all the feedback. onBeforeRender() works like a charm. Pieter On Tue, Nov 10, 2009 at 2:51 PM, Michael O'Cleirigh michael.ocleir...@rivulet.ca wrote: Hi Pieter, Components that have .setVisible(false) will never be evaluated again automatically. You need to call .setVisible(true) on all that apply. One way would be control visibility in the base panel by overriding onBeforeRender() to handle all the cases in one place. e.g. class ControlPanel extends Panel { protected void onBeforeRender () { Role role = getModelObject(); caseOnePanel.setVisible(false); caseTwoPanel.setVisible (false); if (role instanceof CaseOne) { caseOnePanel.setVisible (true); } else if (role instanceof CaseTwo) { caseTwoPanel.setVisible (true); } } } Or you could override .isVisible() in your sub panels to control when they are visible. I like the on before render way myself because there is no performance penalty if the visibility logic is complex (Component.isVisible() is called alot during the rendering phase). Regards, Mike To recap, I have a control panel visible on each and every page and in that control panel, you can select the appropriate role you want to use. Based on that role some menu items will be visible or not (example below is correct). I am sure this problem has been solved before :-0 as this is a very normal usecase for context sensitive navigation. It seems that there is no way to force the page to re-render using getPage()? Thanks for the feedback so far. I keep on coming up against this issue and have not found a reasonable solution to the problem. The javascript option seems to be best so far. Pieter On Tue, Nov 10, 2009 at 1:41 PM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Even if you re-render your page components that are not dynamic will not change their state: unless you create a new instance of the page, I guess. By this I mean. class MyPanel { public MyPanel(id) { PanelB panelB = new Panel(B); panelB.setVisible(getSomeCondition()); } } Even if condition getSomeCondition() change, and you re-render MyPanel, or the whole page, panelB will still be not visible. So, if you want something to be dynamic you have to program it to be dynamic. Best, Ernesto On Tue, Nov 10, 2009 at 1:20 PM, pieter claassen pieter.claas...@gmail.com wrote: Both of the suggestions I think requires me to modify the logic of the controls (either to keep track of which ones need to be updated or by placing the rendering logic in onBeforeRender()). I think this is a lot of work for something relative straight forward and also any changes to permission structures and I have to modify controls. Is there no way that I can mark a page obtained via getPage() as requiring re-rendering? I tried getPage().dirty() before the setResponsePage() but that didn't do anything. Thanks for the feedback though. P On Tue, Nov 10, 2009 at 1:10 PM, Pedro Santos pedros...@gmail.com wrote: I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. Where do you implement your control ( update logic )? Consider do it overriding Component.onBeforeRender method On Tue, Nov 10, 2009 at 10:03 AM, pieter claassen pieter.claas...@gmail.com wrote: Hi Pedro, I tried setResponsePage(getPage()) but the problem is it does not re-render controls on the page. setResponsePage(getPage().getClass()) only works for stateless pages and on most of my pages, I pass params via the constructor. The javascript option will be a last resort, but it seems to be not the most elegant solution. Rgds, On Tue, Nov 10, 2009 at 11:45 AM, Pedro Santos pedros...@gmail.com wrote: if(userSetWasChanged){ target.appendJavascript(window.location.reload()); or setResponsePage(getPage()); or setResponsePage(getPage().getClass()); } On Tue, Nov 10, 2009 at 5:19 AM, pieter claassen pieter.claas...@gmail.com wrote: I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --
Re: Getting the Choose Option on page reload
I have 2 drop-downs and a search button my page. When the page is loaded for the first time, the first option in both the drop-downs is Choose Option. Now if I select some value and click Search, the page is rendered again and the Choose Option is gone forever. But I want it back. How do I go this? It is a consequence of disabling null values; you need to tell the dropdown to accept null values which is what Choose Option represents: theDropdownComponent.setNullValid(true); You will also want to override the display value property in the .properties file: theDropdownComponent.null_valid=Not set - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Force page reload/re-render
I have a link on a panel that is included in many pages. When the user clicks on the link, I change something in the user settings that will affect what gets displayed on the page. However, for that to work, I need to reload the page after the user clicked on the link as by default the other components that now need to be checked for conditional visibility don't re-render (why not?). setResponsePage() requires me to pass into the panel a target page and this becomes complex when you have a mix of statefull and stateless pages as targets (and it just doesn't feel right). I am sure there must be an easier way to just re-render a page? Any tips? Thanks, pieter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Getting the Choose Option on page reload
Hi, I have 2 drop-downs and a search button my page. When the page is loaded for the first time, the first option in both the drop-downs is Choose Option. Now if I select some value and click Search, the page is rendered again and the Choose Option is gone forever. But I want it back. How do I go this? Thanks. Regards, Vinay Karmarkar Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
Re: Getting the Choose Option on page reload
you can set the dropdown model object to a value which you will read it from pageparams, and you will set the pageparams in onsubmit, on first page load you will not be able to retrieve from pageparams so in this case set the modelobject to default value. -- regards, Vineet Semwal On Fri, Nov 6, 2009 at 2:57 PM, vinay.karmar...@wipro.com wrote: Hi, I have 2 drop-downs and a search button my page. When the page is loaded for the first time, the first option in both the drop-downs is Choose Option. Now if I select some value and click Search, the page is rendered again and the Choose Option is gone forever. But I want it back. How do I go this? Thanks. Regards, Vinay Karmarkar Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
Re: force page reload
as it is kind of a workflow and i had all the pages already prepared by passing imodels along into constructors, i didn't want to have a bookmarkablepage (whatever you pick: panels/pages/variations, you need this one to call the page executing the code). but this was the simpler solution, pass an id to the non wicket server through http post, get it back and initialize the a detachablemodel again with the id and the dao. so i changed a bit my code to fit this no-arg constructor page, which is responsible of checking the http post params. imo it is a good idea to use variations. a panel could have also been, of course, but i wanted to avoid boilerplate for just a thank you. i finally redirected to the next page. in any case, this is such a small case that the approach is not so important here. thanks all! francisco On Tue, Oct 7, 2008 at 1:36 AM, Jeremy Thomerson [EMAIL PROTECTED] wrote: I'd wholeheartedly agree with the panel solution. Either one would work, but I think the panel is really good. -- Jeremy Thomerson http://www.wickettraining.com On Mon, Oct 6, 2008 at 9:53 PM, John Krasnay [EMAIL PROTECTED] wrote: On Mon, Oct 06, 2008 at 07:36:03PM -0200, francisco treacy wrote: thanks for your help, serkan. cool, this works. as a workaround nevertheless: -i wouldn't want my app to check every single request the existence of a parameter which i am going to use in only *one* page anyway -what if i have this param passed to another page that doesn't expect it? this could easily introduce new bugs isn't there another easy way to force reloading / not caching a page? why isn't setHeaders having any effect? should be straightforward - what am i missing here? thanks again anyone for some pointers! francisco It seems to me a bit strange to use markup variant for this. You could have your callback page forward to the correct page like this: public CallbackPage(PageParameters params) { if (params.getString(DATA).equals(good)) { setResponsePage(PaymentGoodPage.class); } else { setResponsePage(TryAgainPage.class); } } Alternatively, you could instantiate an appropriate panel in your page: public CallbackPage(PageParameters params) { if (params.getString(DATA).equals(good)) { add(new PaymentGoodPanel(responsePanel)); } else { add(new TryAgainPanel(responsePanel)); } } jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: force page reload
Just throwing this out there: http://wicketstuff.org/wicket13doc/org/apache/wicket/Page.html#setStatelessHint(boolean) Perhaps that may work. Ryan Gravener http://twitter.com/ryangravener On Tue, Oct 7, 2008 at 12:02 PM, francisco treacy [EMAIL PROTECTED] wrote: as it is kind of a workflow and i had all the pages already prepared by passing imodels along into constructors, i didn't want to have a bookmarkablepage (whatever you pick: panels/pages/variations, you need this one to call the page executing the code). but this was the simpler solution, pass an id to the non wicket server through http post, get it back and initialize the a detachablemodel again with the id and the dao. so i changed a bit my code to fit this no-arg constructor page, which is responsible of checking the http post params. imo it is a good idea to use variations. a panel could have also been, of course, but i wanted to avoid boilerplate for just a thank you. i finally redirected to the next page. in any case, this is such a small case that the approach is not so important here. thanks all! francisco On Tue, Oct 7, 2008 at 1:36 AM, Jeremy Thomerson [EMAIL PROTECTED] wrote: I'd wholeheartedly agree with the panel solution. Either one would work, but I think the panel is really good. -- Jeremy Thomerson http://www.wickettraining.com On Mon, Oct 6, 2008 at 9:53 PM, John Krasnay [EMAIL PROTECTED] wrote: On Mon, Oct 06, 2008 at 07:36:03PM -0200, francisco treacy wrote: thanks for your help, serkan. cool, this works. as a workaround nevertheless: -i wouldn't want my app to check every single request the existence of a parameter which i am going to use in only *one* page anyway -what if i have this param passed to another page that doesn't expect it? this could easily introduce new bugs isn't there another easy way to force reloading / not caching a page? why isn't setHeaders having any effect? should be straightforward - what am i missing here? thanks again anyone for some pointers! francisco It seems to me a bit strange to use markup variant for this. You could have your callback page forward to the correct page like this: public CallbackPage(PageParameters params) { if (params.getString(DATA).equals(good)) { setResponsePage(PaymentGoodPage.class); } else { setResponsePage(TryAgainPage.class); } } Alternatively, you could instantiate an appropriate panel in your page: public CallbackPage(PageParameters params) { if (params.getString(DATA).equals(good)) { add(new PaymentGoodPanel(responsePanel)); } else { add(new TryAgainPanel(responsePanel)); } } jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: force page reload
yes... the page must be bookmarkable - so i need it anyway. another question that pops out with your suggestion: when called, are bookmarkable pages always instantiated? under any circumstance? just to make sure that calling http://localhost:8080/myapp/bookmarkable will always trigger the code. sorry if this is obvious, i just never paid attention :) francisco On Tue, Oct 7, 2008 at 2:07 PM, Ryan Gravener [EMAIL PROTECTED] wrote: Just throwing this out there: http://wicketstuff.org/wicket13doc/org/apache/wicket/Page.html#setStatelessHint(boolean) Perhaps that may work. Ryan Gravener http://twitter.com/ryangravener On Tue, Oct 7, 2008 at 12:02 PM, francisco treacy [EMAIL PROTECTED] wrote: as it is kind of a workflow and i had all the pages already prepared by passing imodels along into constructors, i didn't want to have a bookmarkablepage (whatever you pick: panels/pages/variations, you need this one to call the page executing the code). but this was the simpler solution, pass an id to the non wicket server through http post, get it back and initialize the a detachablemodel again with the id and the dao. so i changed a bit my code to fit this no-arg constructor page, which is responsible of checking the http post params. imo it is a good idea to use variations. a panel could have also been, of course, but i wanted to avoid boilerplate for just a thank you. i finally redirected to the next page. in any case, this is such a small case that the approach is not so important here. thanks all! francisco On Tue, Oct 7, 2008 at 1:36 AM, Jeremy Thomerson [EMAIL PROTECTED] wrote: I'd wholeheartedly agree with the panel solution. Either one would work, but I think the panel is really good. -- Jeremy Thomerson http://www.wickettraining.com On Mon, Oct 6, 2008 at 9:53 PM, John Krasnay [EMAIL PROTECTED] wrote: On Mon, Oct 06, 2008 at 07:36:03PM -0200, francisco treacy wrote: thanks for your help, serkan. cool, this works. as a workaround nevertheless: -i wouldn't want my app to check every single request the existence of a parameter which i am going to use in only *one* page anyway -what if i have this param passed to another page that doesn't expect it? this could easily introduce new bugs isn't there another easy way to force reloading / not caching a page? why isn't setHeaders having any effect? should be straightforward - what am i missing here? thanks again anyone for some pointers! francisco It seems to me a bit strange to use markup variant for this. You could have your callback page forward to the correct page like this: public CallbackPage(PageParameters params) { if (params.getString(DATA).equals(good)) { setResponsePage(PaymentGoodPage.class); } else { setResponsePage(TryAgainPage.class); } } Alternatively, you could instantiate an appropriate panel in your page: public CallbackPage(PageParameters params) { if (params.getString(DATA).equals(good)) { add(new PaymentGoodPanel(responsePanel)); } else { add(new TryAgainPanel(responsePanel)); } } jk - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
force page reload
hi, i'm integrating a wicket application with an online payment system provided by a bank. i have a wicket stateful page (ie shows visa / mastercard icons) which links to the bank app's payment page. depending on the transaction, the bank sends us back a result code in an encrypted http url parameter, appended to the url of our wicket page. String encrypted = getWebRequestCycle().getWebRequest().getHttpServletRequest().getParameter(DATA); according to the bank's response, i decide whether to show a please pay or a thank you page with wicket variations. the only problem i am having here is: the wicket page is cached, so no matter what the result is, it will show the last seen version in the pagemap - that is, it won't re-execute the page's java code. i tried overriding headers protected void setHeaders(WebResponse response) { response.setHeader(Pragma, no-cache); response.setDateHeader(Expires,0); response.setHeader(Cache-Control, no-cache, max-age=0, must-revalidate, no-store); } but none of these http headers are seen in the html output whatsoever. i also tried implementing IMarkupCacheKeyProvider and returning null. with no success so far. what should i do to execute the page's code, no matter when it is called? thanks, francisco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: force page reload
If I understood you correctly, I've done something like this to show a different page depending on a url parameter. You should override the newRequestCycleProcessor() method of your application class, and return a different request target from the resolve method. Here I return a bookmarkablepagerequesttarget which creates a new home page if a certain parameter exists in the request: @Override protected IRequestCycleProcessor newRequestCycleProcessor() { return new WebRequestCycleProcessor() { @Override public IRequestTarget resolve(RequestCycle cycle, RequestParameters params) { if (null != params.getParameters().get(ContentSearchPage.PARAM_SEARCH_KEY)) { return new BookmarkablePageRequestTarget(ContentSearchPage.class); } return super.resolve(cycle, params); } }; } -Original Message- From: francisco treacy [mailto:[EMAIL PROTECTED] Sent: Mon 10/6/2008 10:07 PM To: users@wicket.apache.org Subject: force page reload hi, i'm integrating a wicket application with an online payment system provided by a bank. i have a wicket stateful page (ie shows visa / mastercard icons) which links to the bank app's payment page. depending on the transaction, the bank sends us back a result code in an encrypted http url parameter, appended to the url of our wicket page. String encrypted = getWebRequestCycle().getWebRequest().getHttpServletRequest().getParameter(DATA); according to the bank's response, i decide whether to show a please pay or a thank you page with wicket variations. the only problem i am having here is: the wicket page is cached, so no matter what the result is, it will show the last seen version in the pagemap - that is, it won't re-execute the page's java code. i tried overriding headers protected void setHeaders(WebResponse response) { response.setHeader(Pragma, no-cache); response.setDateHeader(Expires,0); response.setHeader(Cache-Control, no-cache, max-age=0, must-revalidate, no-store); } but none of these http headers are seen in the html output whatsoever. i also tried implementing IMarkupCacheKeyProvider and returning null. with no success so far. what should i do to execute the page's code, no matter when it is called? thanks, francisco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: force page reload
On Mon, Oct 06, 2008 at 07:36:03PM -0200, francisco treacy wrote: thanks for your help, serkan. cool, this works. as a workaround nevertheless: -i wouldn't want my app to check every single request the existence of a parameter which i am going to use in only *one* page anyway -what if i have this param passed to another page that doesn't expect it? this could easily introduce new bugs isn't there another easy way to force reloading / not caching a page? why isn't setHeaders having any effect? should be straightforward - what am i missing here? thanks again anyone for some pointers! francisco It seems to me a bit strange to use markup variant for this. You could have your callback page forward to the correct page like this: public CallbackPage(PageParameters params) { if (params.getString(DATA).equals(good)) { setResponsePage(PaymentGoodPage.class); } else { setResponsePage(TryAgainPage.class); } } Alternatively, you could instantiate an appropriate panel in your page: public CallbackPage(PageParameters params) { if (params.getString(DATA).equals(good)) { add(new PaymentGoodPanel(responsePanel)); } else { add(new TryAgainPanel(responsePanel)); } } jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: force page reload
I'd wholeheartedly agree with the panel solution. Either one would work, but I think the panel is really good. -- Jeremy Thomerson http://www.wickettraining.com On Mon, Oct 6, 2008 at 9:53 PM, John Krasnay [EMAIL PROTECTED] wrote: On Mon, Oct 06, 2008 at 07:36:03PM -0200, francisco treacy wrote: thanks for your help, serkan. cool, this works. as a workaround nevertheless: -i wouldn't want my app to check every single request the existence of a parameter which i am going to use in only *one* page anyway -what if i have this param passed to another page that doesn't expect it? this could easily introduce new bugs isn't there another easy way to force reloading / not caching a page? why isn't setHeaders having any effect? should be straightforward - what am i missing here? thanks again anyone for some pointers! francisco It seems to me a bit strange to use markup variant for this. You could have your callback page forward to the correct page like this: public CallbackPage(PageParameters params) { if (params.getString(DATA).equals(good)) { setResponsePage(PaymentGoodPage.class); } else { setResponsePage(TryAgainPage.class); } } Alternatively, you could instantiate an appropriate panel in your page: public CallbackPage(PageParameters params) { if (params.getString(DATA).equals(good)) { add(new PaymentGoodPanel(responsePanel)); } else { add(new TryAgainPanel(responsePanel)); } } jk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: page reload
Even though version 1.3.3 has been released 1.3.2 is fine. Theoretically only this is required: @Override public final void onClick() { BaseGroup group = (BaseGroup) getModelObject(); groupManager.deleteGroup(group.getId()); } But it might be possible the model of the listview is loaded before you delete the item, in that case the listview won't show the current state until the model is detached. could you try the following: @Override public final void onClick() { BaseGroup group = (BaseGroup) getModelObject(); groupManager.deleteGroup(group.getId()); listview.removeAll(); listview.getModel().detach(); } Maurice On Mon, Apr 14, 2008 at 3:28 PM, Milan Křápek [EMAIL PROTECTED] wrote: I am using the normal Link. My ListView Model takes data from LoadableDetachableModel. I think if the web page should refresh each time the Link is clicked, than the LoadableDetachableModel::load() method should be called but this does not happen. Is it possible that I am using to old wicket version. I am using wicket 1.3.2. If the version is right, please just take the fact that for some reason the refresh of web page did not proceed. Is there any way how to reload the page manualy in the onClick event of normal Link object? As I write in previos mails I try call @Override public final void onClick() { BaseGroup group = (BaseGroup) getModelObject(); groupManager.deleteGroup(group.getId()); getPage().modelChanged(); setResponsePage(getPage()); setRedirect(true); } but this does not work too. Any idea how to make it different way? hierarchy of my page is Page ListView ListItem Link remove And I need to reload whole page or at least the ListView. Thanks for any advice Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: page reload
Hi, I am still stack on this problem. It seems that page refresh does not help. I try to add javascript command window.refresh and window.reload but this does not wokr too. Only thing that helps is new call of this page constructor. (I add some refrsh link, that generates the new page) This seems that I have bad written page constructor. That on the refresh the model is not updated. Here are some snippets of y code: public class Page extends MainTemplate // maintemplate is some base page that gives common look { // Inject spring bean for group management @SpringBean(name=baseGroupManager) private DtabaseManager databaseManager; public Page() { // Create navigation border // this creates something like navomatic example on wicket NavigationTable navigationBorder = new NavigationTable(navigationBorder); // Add items to page body // model is created by calling function that receive some data from database navigationBorder.add(new MyList(myList, databaseManager.loadAndGetGroups())); / // Add navigation border add(navigationBorder); // Add Add modal window final ModalWindow addWindow; navigationBorder.add(addWindow = new ModalWindow(addWindow)); addWindow.setContent(new GroupManagementAddPanel(addWindow.getContentId(), addWindow)); addWindow.setTitle(Add Group.); addWindow.setCookieName(addWindow); addWindow.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() { @Override public boolean onCloseButtonClicked(AjaxRequestTarget target) { return true; } }); addWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { @Override public void onClose(AjaxRequestTarget target) { getPage().modelChanged(); setResponsePage(target.getPage()); setRedirect(true); } }); navigationBorder.add(new AjaxLink(add) { @Override public void onClick(AjaxRequestTarget target) { addWindow.show(target); } }); } } Please do anybody see something wrong. Let me know. I do not know why the model navigationBorder.add(new MyList(myList, databaseManager.loadAndGetGroups())); is not reloaded. The constructor of MyList class just call super(id, list); Thanks for your advice Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: page reload
In navigationBorder.add(new MyList(myList, databaseManager.loadAndGetGroups())); databaseManager.loadAndGetGroups() should return a reloading model like LoadableDetachableModel which in the load method always goes to the database I assume that right now it simply returns a list or a non reloading model. Maurice On Mon, Apr 14, 2008 at 8:08 AM, Milan Křápek [EMAIL PROTECTED] wrote: Hi, I am still stack on this problem. It seems that page refresh does not help. I try to add javascript command window.refresh and window.reload but this does not wokr too. Only thing that helps is new call of this page constructor. (I add some refrsh link, that generates the new page) This seems that I have bad written page constructor. That on the refresh the model is not updated. Here are some snippets of y code: public class Page extends MainTemplate // maintemplate is some base page that gives common look { // Inject spring bean for group management @SpringBean(name=baseGroupManager) private DtabaseManager databaseManager; public Page() { // Create navigation border // this creates something like navomatic example on wicket NavigationTable navigationBorder = new NavigationTable(navigationBorder); // Add items to page body // model is created by calling function that receive some data from database navigationBorder.add(new MyList(myList, databaseManager.loadAndGetGroups())); / // Add navigation border add(navigationBorder); // Add Add modal window final ModalWindow addWindow; navigationBorder.add(addWindow = new ModalWindow(addWindow)); addWindow.setContent(new GroupManagementAddPanel(addWindow.getContentId(), addWindow)); addWindow.setTitle(Add Group.); addWindow.setCookieName(addWindow); addWindow.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() { @Override public boolean onCloseButtonClicked(AjaxRequestTarget target) { return true; } }); addWindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { @Override public void onClose(AjaxRequestTarget target) { getPage().modelChanged(); setResponsePage(target.getPage()); setRedirect(true); } }); navigationBorder.add(new AjaxLink(add) { @Override public void onClick(AjaxRequestTarget target) { addWindow.show(target); } }); } } Please do anybody see something wrong. Let me know. I do not know why the model navigationBorder.add(new MyList(myList, databaseManager.loadAndGetGroups())); is not reloaded. The constructor of MyList class just call super(id, list); Thanks for your advice Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: page reload
Thanks a lot, with the LoadableDetachableModel I am now able to show the changes when I edit the item. But some problems still remain. To delete items I have just link, that on the onClick event removes the selected item. So I need to reload the page after this remove too. I try to do it by adding @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(onclick, window.refresh();); } to that Link. This works, but the window.refresh() commnad is called before the action in the onClick method. Is it posible to do the refresh after the action in onClick method?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: page reload
Are you using an ajaxlink or a regular link? if(ajax) try wrapping your list in a WebMarkupContainer and add that to the ajaxtarget. else this should already work, the entire page is automatically refreshed after the onclick exits. Maurice On Mon, Apr 14, 2008 at 12:38 PM, Milan Křápek [EMAIL PROTECTED] wrote: Thanks a lot, with the LoadableDetachableModel I am now able to show the changes when I edit the item. But some problems still remain. To delete items I have just link, that on the onClick event removes the selected item. So I need to reload the page after this remove too. I try to do it by adding @Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put(onclick, window.refresh();); } to that Link. This works, but the window.refresh() commnad is called before the action in the onClick method. Is it posible to do the refresh after the action in onClick method?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
page reload
Hi, probably I need a very simple thing but I cannot find the solution. On my page I have table that represents some objects in database. I have there button for adding new item to database. This button opens new modal window with form for filling thenew object. After I submit this form, new object is created in database and modal window is closed. What I need is to reload the page to get new model from database. But I do not know how. I suppose that there must be something in onClose() method in setWindowClosedCallback. Please how can I reload the page? Thanks for any advice. Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: page reload
Thanks for quick response. But I am not sure, that this what I want. I think it will need a little bit more description. As I said I have table where I listed some objects from database. I have there link which creates new modal window. But I do not give any model to this modal window. In this modal window there is a form which I fill and with the filled parameters I create a new object that I store to database. Than I close the modal window. So in the modal window object I have not any model (ListView or DataTable) that can be refreshed. So I need to refresh the whole parent page. On wiki I found some example: modalWindow.setWindowClosedCallback(new WindowClosedCallback(){ private static final long serialVersionUID = 1L; @Override public void onClose(AjaxRequestTarget target){ target.addComponent(parentPage); } }); But I dont know how to create the parentPage object and what is the type of it. I tried to create new page just something like parentPage = new Mypage(); but of course this does not work. Than I try this target.addComponent(new WebMarkupContainer(myPage, new Model(new MyPage(; this does not wokrs too. Please any other idea how to reload the WHOLE page. Best regards Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: page reload
Set a WindowClosedCallback on the modalwindow and use that to add the table to the ajaxtarget. Note that most listviews,datatables, etc require that you wrap them in a WebMarkupContainer or Panel before you can refresh them via ajax. Of course i assume that the model of the table goes to the database and not some in memory list. Maurice On Fri, Apr 11, 2008 at 12:14 PM, Milan Křápek [EMAIL PROTECTED] wrote: Hi, probably I need a very simple thing but I cannot find the solution. On my page I have table that represents some objects in database. I have there button for adding new item to database. This button opens new modal window with form for filling thenew object. After I submit this form, new object is created in database and modal window is closed. What I need is to reload the page to get new model from database. But I do not know how. I suppose that there must be something in onClose() method in setWindowClosedCallback. Please how can I reload the page? Thanks for any advice. Milan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: page reload
setResponsePage(getPage()) or setResponsePage(getPage()) On 4/11/08, Martijn Dashorst [EMAIL PROTECTED] wrote: setResponsePage(this) will send a redirect to the current page Martijn On 4/11/08, Milan Křápek [EMAIL PROTECTED] wrote: Thanks for quick response. But I am not sure, that this what I want. I think it will need a little bit more description. As I said I have table where I listed some objects from database. I have there link which creates new modal window. But I do not give any model to this modal window. In this modal window there is a form which I fill and with the filled parameters I create a new object that I store to database. Than I close the modal window. So in the modal window object I have not any model (ListView or DataTable) that can be refreshed. So I need to refresh the whole parent page. On wiki I found some example: modalWindow.setWindowClosedCallback(new WindowClosedCallback(){ private static final long serialVersionUID = 1L; @Override public void onClose(AjaxRequestTarget target){ target.addComponent(parentPage); } }); But I dont know how to create the parentPage object and what is the type of it. I tried to create new page just something like parentPage = new Mypage(); but of course this does not work. Than I try this target.addComponent(new WebMarkupContainer(myPage, new Model(new MyPage(; this does not wokrs too. Please any other idea how to reload the WHOLE page. Best regards Milan - 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.2 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2 -- Buy Wicket in Action: http://manning.com/dashorst Apache Wicket 1.3.2 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2
Re: page reload
setResponsePage(this) will send a redirect to the current page Martijn On 4/11/08, Milan Křápek [EMAIL PROTECTED] wrote: Thanks for quick response. But I am not sure, that this what I want. I think it will need a little bit more description. As I said I have table where I listed some objects from database. I have there link which creates new modal window. But I do not give any model to this modal window. In this modal window there is a form which I fill and with the filled parameters I create a new object that I store to database. Than I close the modal window. So in the modal window object I have not any model (ListView or DataTable) that can be refreshed. So I need to refresh the whole parent page. On wiki I found some example: modalWindow.setWindowClosedCallback(new WindowClosedCallback(){ private static final long serialVersionUID = 1L; @Override public void onClose(AjaxRequestTarget target){ target.addComponent(parentPage); } }); But I dont know how to create the parentPage object and what is the type of it. I tried to create new page just something like parentPage = new Mypage(); but of course this does not work. Than I try this target.addComponent(new WebMarkupContainer(myPage, new Model(new MyPage(; this does not wokrs too. Please any other idea how to reload the WHOLE page. Best regards Milan - 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.2 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2
Page reload after file upload
Hi, I have one form with multiple fields where I can edit a object. I want to attach a document or image (of class Document) to the form/object using a second upload form. This works fine if I first execute the upload, then edit other fields and finally submit the form. The problem occurs if I upload/attach a file subsequent to editing the fields. The upload form reloads the page and the changes in the form are gone. How can I avoid this? How can I catch the changes made before upload? Can nested forms solve this? Thanks in advance, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Page reload after file upload
[EMAIL PROTECTED] wrote: a fancy solution would be to upload the file by means of an ajax request - then the values would stay the same as the page doesn't perform a full reload, that ain't as easy as it sounds, take a look a this: http://www.nabble.com/Submitting-an-ajaxform-with-multipart-form-d ata-to15734375.html#a15734375 Thanks for your quick reply. Have you tried the multi file upload component? Does that work? Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page reload after file upload
a fancy solution would be to upload the file by means of an ajax request - then the values would stay the same as the page doesn't perform a full reload, that ain't as easy as it sounds, take a look a this: http://www.nabble.com/Submitting-an-ajaxform-with-multipart-form-data-to15734375.html#a15734375 regards, Michael Kai Mütz wrote: Hi, I have one form with multiple fields where I can edit a object. I want to attach a document or image (of class Document) to the form/object using a second upload form. This works fine if I first execute the upload, then edit other fields and finally submit the form. The problem occurs if I upload/attach a file subsequent to editing the fields. The upload form reloads the page and the changes in the form are gone. How can I avoid this? How can I catch the changes made before upload? Can nested forms solve this? Thanks in advance, Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Page-reload-after-file-upload-tp15869570p15869948.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: Page reload after file upload
unfortunately i haven't had the time to try it so far. but i'd be interested if it works too ;-) regards, Michael Kai Mütz wrote: [EMAIL PROTECTED] wrote: a fancy solution would be to upload the file by means of an ajax request - then the values would stay the same as the page doesn't perform a full reload, that ain't as easy as it sounds, take a look a this: http://www.nabble.com/Submitting-an-ajaxform-with-multipart-form-d ata-to15734375.html#a15734375 Thanks for your quick reply. Have you tried the multi file upload component? Does that work? Kai - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Page-reload-after-file-upload-tp15869570p15870416.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: Page reload after file upload
you need to use the same form for both upload and other fields. that is just how html works. -igor On Thu, Mar 6, 2008 at 1:30 AM, Kai Mütz [EMAIL PROTECTED] wrote: Hi, I have one form with multiple fields where I can edit a object. I want to attach a document or image (of class Document) to the form/object using a second upload form. This works fine if I first execute the upload, then edit other fields and finally submit the form. The problem occurs if I upload/attach a file subsequent to editing the fields. The upload form reloads the page and the changes in the form are gone. How can I avoid this? How can I catch the changes made before upload? Can nested forms solve this? Thanks in advance, Kai - 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]
DDC and page reload
Hello, I have a little problem with drop down choices. I have one on my page. It stores some currencies. In the same page, I've got a Flash module, who needs the actual currency to work. I pass it using the usual flashvars. But when I change a currency on the DDC (ie from USD to EUR), the actual page is refreshed (or seems to), but the currency passed in the flashvars is the old one (USD) although all of my models are properly updated. So I think wicket hasn't recomputed some markup... Can I force him to fully reload (recreate) the current page when a onSelectionChange event is fired? Thanks! ;) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DDC and page reload
how are you listening to the change of the DDC? If through ajax then you have to set the response page again to get a real refresh of everything (or just refresh th flash markup part) if through normal submit (onSelection) then the page is completely refreshed anyway maybe you cache at some place to much johan On Jan 30, 2008 1:54 PM, Sébastien Piller [EMAIL PROTECTED] wrote: Hello, I have a little problem with drop down choices. I have one on my page. It stores some currencies. In the same page, I've got a Flash module, who needs the actual currency to work. I pass it using the usual flashvars. But when I change a currency on the DDC (ie from USD to EUR), the actual page is refreshed (or seems to), but the currency passed in the flashvars is the old one (USD) although all of my models are properly updated. So I think wicket hasn't recomputed some markup... Can I force him to fully reload (recreate) the current page when a onSelectionChange event is fired? Thanks! ;) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DDC and page reload
I have a little problem with drop down choices. I have one on my page. It stores some currencies. In the same page, I've got a Flash module, who needs the actual currency to work. I pass it using the usual flashvars. But when I change a currency on the DDC (ie from USD to EUR), the actual page is refreshed (or seems to), but the currency passed in the flashvars is the old one (USD) although all of my models are properly updated. So I think wicket hasn't recomputed some markup... Can I force him to fully reload (recreate) the current page when a onSelectionChange event is fired? I think it would be easier to help you if you supplied some code :) -- Edvin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DDC and page reload
I found a patch (very ugly but works). On the onSelectionChange, I wrote this: if (MyAbstractPage.this instanceof MyPageWithTheRefreshIssue) { setResponsePage(new MyPageWithTheRefreshIssue()); } But I wonder: is this a normal behavior? I guessed I need not to refresh it manually, need I? Thanks! ;) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DDC and page reload
swf.setValue(flashvars, somevar= + somevalue+ currency= + curr); ^ that should instead take an IModel so that it renders a fresh value on each new request instead of always rendering the value you passed in at page construction. in fact, it should take the same model instance as is use by the ddc. -igor On Jan 30, 2008 5:10 AM, Sébastien Piller [EMAIL PROTECTED] wrote: Yes, no problem, but it's really trivial... My Flash object is added here (I use the ShockWaveComponent, little modified, from the wiki): ShockWaveComponent swf = new ShockWaveComponent(swf, ShirtDesignerV2.swf, 770, 480); swf.setValue(quality, high); swf.setValue(bgcolor, #869ca7); swf.setValue(id, editor); swf.setValue(name, editor); ... String curr = getCurrentCurrency(); swf.setValue(flashvars, somevar= + somevalue+ currency= + curr); swf.setValue(allowScriptAccess, sameDomain); swf.setValue(type, application/x-shockwave-flash); add(swf); And here I change the currency with the DDC: DropDownChoice currencies = new DropDownChoice(currencies, new PropertyModel(this, currentCurrency), Arrays.asList(new String[] { CHF, EUR, USD })) { @Override protected boolean wantOnSelectionChangedNotifications() { return true; } @Override protected void onSelectionChanged(Object newSelection) { //System.out.println(SETTED: + newSelection); setCurrency(newSelection + ); } }; add(currencies); There is nothing special here But when the onSelectionChanged is fired, the flashvars doesn't change Thanks ;) Edvin Syse a écrit : I think it would be easier to help you if you supplied some code :) -- Edvin - 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]
Uploading files without page reload
Hi all, I have problem with uploading files. My uploading file form is placed in modal window and after submitting comunicate appears that modal window will be closed. What I want is situation when after submitting modal window is still visible. The best solution would be not reloading page but i read somewhere that it is impossible to upload file via ajax. I tried to do something with PageParameters but to show modal window AjaxRequstTarget. Pls help. -- View this message in context: http://www.nabble.com/Uploading-files-without-page-reload-tf4241610.html#a12069395 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: Uploading files without page reload
legol wrote: Hi all, I have problem with uploading files. My uploading file form is placed in modal window and after submitting comunicate appears that modal window will be closed. What I want is situation when after submitting modal window is still visible. The best solution would be not reloading page but i read somewhere that it is impossible to upload file via ajax. I tried to do something with PageParameters but to show modal window AjaxRequstTarget. Pls help. The only way to do this, I think, is to embed your file upload inside an iframe. That way, you're doing a proper page submit. Regards, Al -- Alastair Maw Wicket-biased blog at http://herebebeasties.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Uploading files without page reload
I've done that having the upload form specifying an hidden iframe as target and - above all - having the following code in the Form#onSubmit() method // Tell Wicket we're going to do the redirect ourselves. getRequestCycle().setRedirect(false); // Make sure no output for the current cycle is ever sent. getRequestCycle().setRequestTarget( EmptyRequestTarget.getInstance()); Paolo On 8/9/07, Al Maw [EMAIL PROTECTED] wrote: legol wrote: Hi all, I have problem with uploading files. My uploading file form is placed in modal window and after submitting comunicate appears that modal window will be closed. What I want is situation when after submitting modal window is still visible. The best solution would be not reloading page but i read somewhere that it is impossible to upload file via ajax. I tried to do something with PageParameters but to show modal window AjaxRequstTarget. Pls help. The only way to do this, I think, is to embed your file upload inside an iframe. That way, you're doing a proper page submit. Regards, Al -- Alastair Maw Wicket-biased blog at http://herebebeasties.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]