Catching arrays in page parameters
Hi, Do you know how to catch this kind of URL parameters ? linksOrder?listItem[]=1&listItem[]=2&listItem[]=3 When I try : String[] linkIds = parameters.getStringArray("listItem"); No value in my array When I try : String[] linkIds = parameters.getStringArray("listItem[]"); Only the first value is available :( For your information, this kind of URL is used by JQuery (sortable serialization) Thanks, Stéphane - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Page load after an action
Thanks Pedro, it's ok now ;-) I use LoadableDetachableModel to avoid the call to detach() method. It does not seem that is the right way. Somebody can explain me why ? Stéphane Pedro Santos a écrit : by calling getDefaultModel inside onClick, you get an reference to the link component model. You need to detach the model on your list view. You has an reference to it on your variable "news". So: news.getDefaultModel().detach() If you need, you can change that variable modifiers or turn it an instance variable for have acess to it inside your onClick implementation. On Tue, Jan 26, 2010 at 2:01 PM, Stéphane Jeanjean < stephane.jeanj...@softeam.com> wrote: The behaviour is the same with the following code :( public void onClick() { // TODO : check the refresh issue getNewsDao().delete(item.getModelObject()); ourLogger.debug("News deleted"); getDefaultModel().detach(); } Pedro Santos a écrit : missing line: call detach method just after delete your item. On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos wrote: Call news.getDefaultModel().detach(), and look for more info about detachable models. http://cwiki.apache.org/WICKET/detachable-models.html On Tue, Jan 26, 2010 at 1:35 PM, Stéphane Jeanjean < stephane.jeanj...@softeam.com> wrote: Hi, I don't use Hibernate. My persistence layer uses JDBC. What is strange when I click the delete link, it's the logs order : Loading all news News deleted So it seems that the deletion is done after the data reload :( Stéphane Riyad Kalla a écrit : Stephane, I'll let someone smarter than me address the wicket issue of removing the item from the ListView and seeing if that helps -- but is there a chance you are using Hibernate and the Level 2 ehcache plugin or any 2nd-level caching with your persistence code? I ask because I've seen code like this "I don't see my changes until the 2nd refresh!" a lot with folks using 2nd level caches and not seeing immediate persistence of those changes. On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean < stephane.jeanj...@softeam.com> wrote: Please find my code just below : public class NewsListPage { protected static transient NewsDao myNewsDao; public NewsListPage() { PageableListView news = new PageableListView("list", new NewsModel(), 15){ @Override protected void populateItem(final ListItem item) { ourLogger.debug("Getting item value "+item.getModelObject().getTitle()); News news = item.getModelObject(); item.add(new Label("date", new Model(news.getDate(; Link l = new Link("edit"){ @Override public void onClick() { setResponsePage(new NewsPage(item.getModelObject())); } }; item.add(l); l.add(new Label("title", news.getTitle())); item.add(new Link("delete", new Model()){ @Override public void onClick() { // TODO : check the refresh issue getNewsDao().delete(item.getModelObject()); ourLogger.debug("News deleted"); } }); } }; add(news); add(new OrPagingNavigator("navigator", news)); add(new BookmarkablePageLink("add", NewsPage.class)); } /** * Model for the news List to load the news from the db each time * */ public class NewsModel extends LoadableDetachableModel> { @Override protected List load() { ourLogger.debug("Loading all news"); return new NewsDao().load(); } } } Jeremy Thomerson a écrit : You're probably not using models correctly - specifically for your list view. You could post some code, but make sure that you're reloading the data for the list view after the onClick is called and the item is deleted. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean < stephane.jeanj...@softeam.com> wrote: Hello, My page displays a list of items, for each of them, an icon is available to delete it. The action is managed in a Link.onClick() method. When I click on the link, the page is refreshed but the item is always in my list, I have to do refresh again manually the page to have a list wihtout this item. In the logs, it seems that the deletion in the onClick() method is called after the load of the page :( Someb
Re: Page load after an action
The behaviour is the same with the following code :( public void onClick() { // TODO : check the refresh issue getNewsDao().delete(item.getModelObject()); ourLogger.debug("News deleted"); getDefaultModel().detach(); } Pedro Santos a écrit : missing line: call detach method just after delete your item. On Tue, Jan 26, 2010 at 1:41 PM, Pedro Santos wrote: Call news.getDefaultModel().detach(), and look for more info about detachable models. http://cwiki.apache.org/WICKET/detachable-models.html On Tue, Jan 26, 2010 at 1:35 PM, Stéphane Jeanjean < stephane.jeanj...@softeam.com> wrote: Hi, I don't use Hibernate. My persistence layer uses JDBC. What is strange when I click the delete link, it's the logs order : Loading all news News deleted So it seems that the deletion is done after the data reload :( Stéphane Riyad Kalla a écrit : Stephane, I'll let someone smarter than me address the wicket issue of removing the item from the ListView and seeing if that helps -- but is there a chance you are using Hibernate and the Level 2 ehcache plugin or any 2nd-level caching with your persistence code? I ask because I've seen code like this "I don't see my changes until the 2nd refresh!" a lot with folks using 2nd level caches and not seeing immediate persistence of those changes. On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean < stephane.jeanj...@softeam.com> wrote: Please find my code just below : public class NewsListPage { protected static transient NewsDao myNewsDao; public NewsListPage() { PageableListView news = new PageableListView("list", new NewsModel(), 15){ @Override protected void populateItem(final ListItem item) { ourLogger.debug("Getting item value "+item.getModelObject().getTitle()); News news = item.getModelObject(); item.add(new Label("date", new Model(news.getDate(; Link l = new Link("edit"){ @Override public void onClick() { setResponsePage(new NewsPage(item.getModelObject())); } }; item.add(l); l.add(new Label("title", news.getTitle())); item.add(new Link("delete", new Model()){ @Override public void onClick() { // TODO : check the refresh issue getNewsDao().delete(item.getModelObject()); ourLogger.debug("News deleted"); } }); } }; add(news); add(new OrPagingNavigator("navigator", news)); add(new BookmarkablePageLink("add", NewsPage.class)); } /** * Model for the news List to load the news from the db each time * */ public class NewsModel extends LoadableDetachableModel> { @Override protected List load() { ourLogger.debug("Loading all news"); return new NewsDao().load(); } } } Jeremy Thomerson a écrit : You're probably not using models correctly - specifically for your list view. You could post some code, but make sure that you're reloading the data for the list view after the onClick is called and the item is deleted. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean < stephane.jeanj...@softeam.com> wrote: Hello, My page displays a list of items, for each of them, an icon is available to delete it. The action is managed in a Link.onClick() method. When I click on the link, the page is refreshed but the item is always in my list, I have to do refresh again manually the page to have a list wihtout this item. In the logs, it seems that the deletion in the onClick() method is called after the load of the page :( Somebody has an idea to avoid this manual refresh ? Thanks, Stéphane - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h..
Re: Page load after an action
Hi, I don't use Hibernate. My persistence layer uses JDBC. What is strange when I click the delete link, it's the logs order : Loading all news News deleted So it seems that the deletion is done after the data reload :( Stéphane Riyad Kalla a écrit : Stephane, I'll let someone smarter than me address the wicket issue of removing the item from the ListView and seeing if that helps -- but is there a chance you are using Hibernate and the Level 2 ehcache plugin or any 2nd-level caching with your persistence code? I ask because I've seen code like this "I don't see my changes until the 2nd refresh!" a lot with folks using 2nd level caches and not seeing immediate persistence of those changes. On Tue, Jan 26, 2010 at 7:57 AM, Stéphane Jeanjean < stephane.jeanj...@softeam.com> wrote: Please find my code just below : public class NewsListPage { protected static transient NewsDao myNewsDao; public NewsListPage() { PageableListView news = new PageableListView("list", new NewsModel(), 15){ @Override protected void populateItem(final ListItem item) { ourLogger.debug("Getting item value "+item.getModelObject().getTitle()); News news = item.getModelObject(); item.add(new Label("date", new Model(news.getDate(; Link l = new Link("edit"){ @Override public void onClick() { setResponsePage(new NewsPage(item.getModelObject())); } }; item.add(l); l.add(new Label("title", news.getTitle())); item.add(new Link("delete", new Model()){ @Override public void onClick() { // TODO : check the refresh issue getNewsDao().delete(item.getModelObject()); ourLogger.debug("News deleted"); } }); } }; add(news); add(new OrPagingNavigator("navigator", news)); add(new BookmarkablePageLink("add", NewsPage.class)); } /** * Model for the news List to load the news from the db each time * */ public class NewsModel extends LoadableDetachableModel> { @Override protected List load() { ourLogger.debug("Loading all news"); return new NewsDao().load(); } } } Jeremy Thomerson a écrit : You're probably not using models correctly - specifically for your list view. You could post some code, but make sure that you're reloading the data for the list view after the onClick is called and the item is deleted. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean < stephane.jeanj...@softeam.com> wrote: Hello, My page displays a list of items, for each of them, an icon is available to delete it. The action is managed in a Link.onClick() method. When I click on the link, the page is refreshed but the item is always in my list, I have to do refresh again manually the page to have a list wihtout this item. In the logs, it seems that the deletion in the onClick() method is called after the load of the page :( Somebody has an idea to avoid this manual refresh ? Thanks, Stéphane - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Page load after an action
Please find my code just below : public class NewsListPage { protected static transient NewsDao myNewsDao; public NewsListPage() { PageableListView news = new PageableListView("list", new NewsModel(), 15){ @Override protected void populateItem(final ListItem item) { ourLogger.debug("Getting item value "+item.getModelObject().getTitle()); News news = item.getModelObject(); item.add(new Label("date", new Model(news.getDate(; Link l = new Link("edit"){ @Override public void onClick() { setResponsePage(new NewsPage(item.getModelObject())); } }; item.add(l); l.add(new Label("title", news.getTitle())); item.add(new Link("delete", new Model()){ @Override public void onClick() { // TODO : check the refresh issue getNewsDao().delete(item.getModelObject()); ourLogger.debug("News deleted"); } }); } }; add(news); add(new OrPagingNavigator("navigator", news)); add(new BookmarkablePageLink("add", NewsPage.class)); } /** * Model for the news List to load the news from the db each time * */ public class NewsModel extends LoadableDetachableModel> { @Override protected List load() { ourLogger.debug("Loading all news"); return new NewsDao().load(); } } } Jeremy Thomerson a écrit : You're probably not using models correctly - specifically for your list view. You could post some code, but make sure that you're reloading the data for the list view after the onClick is called and the item is deleted. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Jan 26, 2010 at 8:37 AM, Stéphane Jeanjean < stephane.jeanj...@softeam.com> wrote: Hello, My page displays a list of items, for each of them, an icon is available to delete it. The action is managed in a Link.onClick() method. When I click on the link, the page is refreshed but the item is always in my list, I have to do refresh again manually the page to have a list wihtout this item. In the logs, it seems that the deletion in the onClick() method is called after the load of the page :( Somebody has an idea to avoid this manual refresh ? Thanks, Stéphane - 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
Page load after an action
Hello, My page displays a list of items, for each of them, an icon is available to delete it. The action is managed in a Link.onClick() method. When I click on the link, the page is refreshed but the item is always in my list, I have to do refresh again manually the page to have a list wihtout this item. In the logs, it seems that the deletion in the onClick() method is called after the load of the page :( Somebody has an idea to avoid this manual refresh ? Thanks, Stéphane - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE : Redirections and Reverse-Proxy
For sure, I'm using reverse proxy and cookie rewriting, but before reverse proxying the hostname is not the right. I think it comes from the Jetty implementation for the sendRedirect() method. > -Message d'origine- > De : nino martinez wael [mailto:nino.martinez.w...@gmail.com] > Envoyé : lundi 28 septembre 2009 20:49 > À : users@wicket.apache.org > Objet : Re: Redirections and Reverse-Proxy > > > Hi > > I havent had that many troubles using Apache Http and wicket. > As long as you remember to forward and reverse proxy + cookie > rewrite.. > > Something like this: > http://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html > > > > -- Forwarded message -- > From: Stéphane Jeanjean > Date: 2009/9/28 > Subject: Re: Redirections and Reverse-Proxy > To: users@wicket.apache.org > > > > I'm not sure it's a related to wicket. I think it's related to the > respones.sendRedirect() implementation and how the string put > in the location header is build. I don't know if it's > standard or if it's a Jetty implementation. I have to found > out this implementation to understand where the host in > location header comes from. Or perhaps I could "override" the > sendRedirect method() as described here : > http://knowledgefolders.com/akc/servlet/DisplayServlet?url=Dis > playNoteMPURL&reportId=1711&ownerUserId=satya > > > Stéphane Jeanjean a écrit : > > > > I don't know, that's a part of my question. Nothing about RPhost is > > configured in my BEhost. > > > > Igor Vaynberg a écrit : > > > >> how does wicket know about RPhost when it issues the 302? > >> > >> -igor > >> > >> On Mon, Sep 28, 2009 at 2:10 AM, Stéphane Jeanjean > >> wrote: > >> > >> > >>> Hello, > >>> > >>> I'm using Wicket in a backend which is behind a reverse-proxy. I > >>> understand that Wicket does some redirections even if it's not's > >>> explicity requested by my code. (perhaps, here, it > depends of some > >>> strategies, but I > >>> don't know them) > >>> > >>> When a redirection is sent by the back-end the hostname > used is the > >>> reverse proxy host instead of the back-end host. I would > like to use > >>> the back-end host in this response to be able to translate the > >>> back-end host to front-end > >>> host in the reverse-proxy. > >>> What I can see in the reponse : > >>> BackEnd -> 302:http://RPhost/myApp/mypage --> ReverseProxy -> > >>> 302:http://RPhost/myApp/mypage -> Browser > >>> What I would like : > >>> BackEnd -> 302:http://BEhost/myApp/mypage --> ReverseProxy -> > >>> 302:https://RPhost/myApp/mypage -> Browser > >>> > >>> I'm using Jetty for my server and mod_proxy in ligthtpd for the > >>> reverse proxy. > >>> > >>> Any idea ? > >>> > >>> Thanks, > >>> > >>> Stéphane > >>> > >>> > >>> > >>> > > >>> - > >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >>> For additional commands, e-mail: users-h...@wicket.apache.org > >>> > >>> > >>> > >>> > >> > >> > - > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> For additional commands, e-mail: users-h...@wicket.apache.org > >> > >> > >> > >> > >> > >> > > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > > > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Redirections and Reverse-Proxy
I'm not sure it's a related to wicket. I think it's related to the respones.sendRedirect() implementation and how the string put in the location header is build. I don't know if it's standard or if it's a Jetty implementation. I have to found out this implementation to understand where the host in location header comes from. Or perhaps I could "override" the sendRedirect method() as described here : http://knowledgefolders.com/akc/servlet/DisplayServlet?url=DisplayNoteMPURL&reportId=1711&ownerUserId=satya Stéphane Jeanjean a écrit : I don't know, that's a part of my question. Nothing about RPhost is configured in my BEhost. Igor Vaynberg a écrit : how does wicket know about RPhost when it issues the 302? -igor On Mon, Sep 28, 2009 at 2:10 AM, Stéphane Jeanjean wrote: Hello, I'm using Wicket in a backend which is behind a reverse-proxy. I understand that Wicket does some redirections even if it's not's explicity requested by my code. (perhaps, here, it depends of some strategies, but I don't know them) When a redirection is sent by the back-end the hostname used is the reverse proxy host instead of the back-end host. I would like to use the back-end host in this response to be able to translate the back-end host to front-end host in the reverse-proxy. What I can see in the reponse : BackEnd -> 302:http://RPhost/myApp/mypage --> ReverseProxy -> 302:http://RPhost/myApp/mypage -> Browser What I would like : BackEnd -> 302:http://BEhost/myApp/mypage --> ReverseProxy -> 302:https://RPhost/myApp/mypage -> Browser I'm using Jetty for my server and mod_proxy in ligthtpd for the reverse proxy. Any idea ? Thanks, Stéphane - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Redirections and Reverse-Proxy
I don't know, that's a part of my question. Nothing about RPhost is configured in my BEhost. Igor Vaynberg a écrit : how does wicket know about RPhost when it issues the 302? -igor On Mon, Sep 28, 2009 at 2:10 AM, Stéphane Jeanjean wrote: Hello, I'm using Wicket in a backend which is behind a reverse-proxy. I understand that Wicket does some redirections even if it's not's explicity requested by my code. (perhaps, here, it depends of some strategies, but I don't know them) When a redirection is sent by the back-end the hostname used is the reverse proxy host instead of the back-end host. I would like to use the back-end host in this response to be able to translate the back-end host to front-end host in the reverse-proxy. What I can see in the reponse : BackEnd -> 302:http://RPhost/myApp/mypage --> ReverseProxy -> 302:http://RPhost/myApp/mypage -> Browser What I would like : BackEnd -> 302:http://BEhost/myApp/mypage --> ReverseProxy -> 302:https://RPhost/myApp/mypage -> Browser I'm using Jetty for my server and mod_proxy in ligthtpd for the reverse proxy. Any idea ? Thanks, Stéphane - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Redirections and Reverse-Proxy
Hello, I'm using Wicket in a backend which is behind a reverse-proxy. I understand that Wicket does some redirections even if it's not's explicity requested by my code. (perhaps, here, it depends of some strategies, but I don't know them) When a redirection is sent by the back-end the hostname used is the reverse proxy host instead of the back-end host. I would like to use the back-end host in this response to be able to translate the back-end host to front-end host in the reverse-proxy. What I can see in the reponse : BackEnd -> 302:http://RPhost/myApp/mypage --> ReverseProxy -> 302:http://RPhost/myApp/mypage -> Browser What I would like : BackEnd -> 302:http://BEhost/myApp/mypage --> ReverseProxy -> 302:https://RPhost/myApp/mypage -> Browser I'm using Jetty for my server and mod_proxy in ligthtpd for the reverse proxy. Any idea ? Thanks, Stéphane - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org