Re: how to include jsp into wicket htmls
Can you give a example of include jsp with g.apache.wicket.markup.html.include.Include -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-include-jsp-into-wicket-htmls-tp4650615p4650617.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: How can wicket Page form model be accessed from child panel
you are right that the LoginUserModel gets null. Now can you please suggest how and where should I reload the LoginUserModel? If in the panel, I try to call this.scmodel.getObject() in the validate() method I still get the old LoginUser Object. When the control goes back to page form submit, the LoginUser newUser = getModelObject(); returns the updated object. Please suggest how can I get the updated object in panel? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-wicket-Page-form-model-be-accessed-from-child-panel-tp4650608p4650618.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: Wicket and Versioning
Hi, Thanks a lot, however, doing that for every page seems to be though. Isn't there a standard way in wicket for doing this? I cannot believe such a base case not be covered besides workarounds.. I mean, linking through a Bookmarkable link to my stateful page creates a new version on each click without any changes doesn't make any sense for most applications I think... please, anyone to turn this off? Why does setVersioned have no effect either?? Thanks a bunch!! Alex Am 18.07.2012 um 16:38 schrieb Andrea Del Bene: Hi, you could try with the following solution: - Mount a stateless page on your desired path (let's say /home) - This page should do nothing but redirect user to your stateful page, but instead of creating a new instance of it each time, it will save into session your stateful page to use it for the next requests. Its constructor should look like this: Page page = null; if(Session.get().getAttribute(page) == null){ Session.get().bind(); page = new YourPage(); Session.get().setAttribute(page, page); }else{ page =(Page) Session.get().getAttribute(page); } setResponsePage(page); Inside YourPage you should anyway call serVersioned(false). One more thing -- I don't see any use in versioning in my case: My base page is stateful though that means each and every link I use will lead to a new version number polluting the user's browser history with all the same link even though there has NOTHING changed on the page!? Please, there has to be a way to turn that off.. I was trying to return a PageManager that returns supportsVersioning = false still no effect.. NOTE: I do not want to only get this out of the url but I want to get RID of this feature as it pollutes the session by storing a serialized version of all but the same page... thanks!! Alex Am 18.07.2012 um 14:08 schrieb Josh Kamau: Now create something like this public class CleanUrlMapper extends MountedMapper { public CleanUrlMapper(String mountPath, Class? extends IRequestablePage pageClass) { super(mountPath, pageClass, new PageParametersEncoder()); } @Override protected void encodePageComponentInfo(Url url, PageComponentInfo info) { // do nothing so that component info does not get rendered in url } @Override public Url mapHandler(IRequestHandler requestHandler) { if (requestHandler instanceof ListenerInterfaceRequestHandler) { return null; } else { return super.mapHandler(requestHandler); } } } and then mount your pages like this mount(new CleanUrlMapper(/home, HomePage.class)); Atleast thats what i do to achieve something like what you want. Josh. On Wed, Jul 18, 2012 at 2:53 PM, Alexander Adam, Emia Systems a...@emiasys.com wrote: Hi! I am pretty much lost with Wicket 1.5.7 and versioning. What happens is this: I've deactivated versioning by setting serVersioned(false) in my page's constructor. However, still the page id gets increment each time I call the exact same url in my browser i.e. home/?0, home/?1, home/?2, etc. I simply don't want this behavior, I want to have a stateful page with *exactly* one state at a given time for a given user, not more. How can I do that? I want page refreshes to destroy anything ajax might have created and the such still, I want to be stateful to properly use forms, clickable links etc.. please advise, I'm almost giving up :( thank you!! Alex - 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: How to Logout
Hi Paul Thanks, I was able to fix this using your idea, even though I couldn't do this in the link itself since this URL is called from a lot of places. Thanks again Matt On 18.07.2012 19:06, Paul Bors wrote: There is no need to throw a RestartResponseAtInterceptPageException. Simply redirect the user to the log-in page: // Logout Link logout = new Link(logout) { @Override public void onClick() { Session.session().invalidateNow(); setResponsePage(LoginPage.class); } }; ~ Thank you, Paul Bors -Original Message- From: Sébastien Gautrin [mailto:sgaut...@telemetris.com] Sent: Wednesday, July 18, 2012 12:43 PM To: users@wicket.apache.org Subject: Re: How to Logout Hi, The LogoutPage in the application I work on is quite simple: - first we invalidate the session with session.invalidateNow() like you do - second we throw a RestartResponseAtInterceptPageException with the Page we want the user to go to after the logout process (actually we use it with the class of the Page we want, but you can pass it an instance of a Page). Hope this will help. Original Message Subject: How to Logout From: Matthias Keller matthias.kel...@ergon.ch To: users@wicket.apache.org Date: 2012-07-18 Hi I'm trying to implement a simple logout mechanism with the need of complete session termination. For this I created a LogoutPage and mounted it using mountPage(/logout, LogoutPage.class); Now this page contains multiple components and a link to change langugage etc, therefore it is stateful. But when I perform a session.invalidate(Now)() in the page's constructor, the user gets redirected to /logout?0 with a new session ID. Probably though the page was stored in the previous session so it doesn't exist with the new one, then he gets redirected back to /logout, back to /logout?0 and so on. What do I have to do to implement this simple logout page? Thanks Matt - 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 -- matthias.kel...@ergon.ch +41 44 268 83 98 Ergon Informatik AG, Kleinstrasse 15, CH-8008 Zürich http://www.ergon.ch __ e r g o nsmart people - smart software smime.p7s Description: S/MIME Cryptographic Signature
re-direct after pop-up notification
Hi all, I wan't to display a pop-up message and after that (after the user pressed on he OK button inside the pop-up notification) i wan't to re-direct him to a new page. i tried to do the following: (from NewPage1) try { runMe( form ); target.appendJavascript(alert('submitted successfully')); //after the user press 'OK' -- display NewPage2 setResponsePage(NewPage2.class); //re-direct to NewPage2 } but he won't show me the submitted successfully message, he re-direct me straight to NewPage2. any ideas?? Thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/re-direct-after-pop-up-notification-tp4650621.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: How can wicket Page form model be accessed from child panel
On 19/07/2012 3:26 AM, jam.ntk wrote: you are right that the LoginUserModel gets null. Now can you please suggest how and where should I reload the LoginUserModel? From my previous email: You need to reload it in the LoadableDetachableModel.load() method. If in the panel, I try to call this.scmodel.getObject() in the validate() method I still get the old LoginUser Object. When the control goes back to page form submit, the LoginUser newUser = getModelObject(); returns the updated object. In the form processing process, the models are only updated after successful validation. You need to use FormComponent#getConvertedInput to get the input for validation. See the javadoc for Form for more info. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How can wicket Page form model be accessed from child panel
ok, I need to check the form attribute value in the vaildate() method of panel. If thats the case then i guess i cannot get the updated model in the validate method. So the workaround for me is to use getters of components (TextField, DropDownChoice etc) from webpage in the panel validate method. However as per you suggested I see blank value for #getConvertedInput() to these components. Sorry if these are basic questions, but i am learning wicket. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-wicket-Page-form-model-be-accessed-from-child-panel-tp4650608p4650625.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: How can wicket Page form model be accessed from child panel
Why do you have a validate() method in your panel if it isn't part of the form? When you get to the form's onSubmit() method, all the models used in the form components have already been updated. This occurs after all the validators of the form and its components are executed. Therefore, if you use the same model in the form and in the panel, the panel will also see the new model object set by the form component *but only after all form validation occurs*. http://stackoverflow.com/a/4641827/1030527 has a good writeup of the form processing flow. On 19/07/2012 9:31 AM, jam.ntk wrote: ok, I need to check the form attribute value in the vaildate() method of panel. If thats the case then i guess i cannot get the updated model in the validate method. So the workaround for me is to use getters of components (TextField, DropDownChoice etc) from webpage in the panel validate method. However as per you suggested I see blank value for #getConvertedInput() to these components. Sorry if these are basic questions, but i am learning wicket. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-wicket-Page-form-model-be-accessed-from-child-panel-tp4650608p4650625.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket Layout Design
Hi, I am new to Wicket. I'm working on a multi province web application. The goal is to use the same web application for all provinces. CSS and some business logic will differ for each province. I want to know the best ways to instantiate my layout components in my base page. (Using markup inheritance for page composition) * Each layout component could be subclassed. public class BasePage extends WebPage { public BasePage() { // Want to know the best way to instanciate // HeaderXXX or HeaderYYY for example base on the province. add(new Header()); add(new SideBar()); add(new Footer()); } } My BasePage is in a common maven module. Each province subclassed pages and components are in a different maven module. I read that using factories to instanciate components was not a good idea (http://blog.comsysto.com/2011/05/09/apache-wicket-best-practices-2/) Do you have a better approach to accomplish this? Thanks a lot and sorry for my english David -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Layout-Design-tp4650630.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
PagingNavigator with additionnal pageParameters
Hi all, I would like to add a pagingNavigator , with a custom additional parameters , then the generated links will contain these parameters. Is it possible ? and how to do that. If not , how to deal with that. I m using wicket 1.4.16 , and I can't upgrade right now. Thank you , A.M. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PagingNavigator-with-additionnal-pageParameters-tp4650631.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: How can wicket Page form model be accessed from child panel
I have two fields on the webpage which needs be validated for not being blank if user has selected few checkboxes which are part of the panel. So I thought of to have a validate method in the panel. Are you suggesting that instead of validating in the panel I validate in the form submit of webpage? Please suggest -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-wicket-Page-form-model-be-accessed-from-child-panel-tp4650608p4650632.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
E-mail validation link
Good evening, I'm currently trying to send a validation e-mail when a user creates an account. I'd link to provide a link in order to confirm the subscription. Is there any recommended way to do that? In particular, I don't know how to write the href of the Link in my e-mail. Any help will be much appreciated. Regards, Pierre Goupil -- Le bonheur n'est pas une destination, mais une façon de voyager. Papa d'une petite Lou-Ann depuis le 30 juin.
Re: E-mail validation link
I do something like this : 1. Create a confirmation page that takes a confirmation code as a page parameter 2. Mount a page to a url that looks like http://domain.com/confirmation?code=somesupersecretcode 3. When a user registers, i generate the code and put it somewhere in the database 4. I then send him the link as in (2) above but with user specific code 5. When the user tries to login, i extract the code and check if its valid. Am sure there could be other more clever techniques Will be watching this thread. Josh. On Thu, Jul 19, 2012 at 9:45 PM, Pierre Goupil goupilpie...@gmail.comwrote: Good evening, I'm currently trying to send a validation e-mail when a user creates an account. I'd link to provide a link in order to confirm the subscription. Is there any recommended way to do that? In particular, I don't know how to write the href of the Link in my e-mail. Any help will be much appreciated. Regards, Pierre Goupil -- Le bonheur n'est pas une destination, mais une façon de voyager. Papa d'une petite Lou-Ann depuis le 30 juin.
[1.5] [6.0] dynamically named CSS, JS images resources
Good evening, I'd like to contribute CSSs JSs to my head for which names I don't know. More precisely, I'd like to be able to download a .zip, unzip it and contribute its CSS JS content to the head, plus being able to display the images of the zip thanks to the links in the CSS. Regarding the downloading and unzipping steps, it's easy. But for the header contributions, I can't figure out how to do that since : 1) I don't know the names of the CSS JS files before download 2) the CSS files link to the images using their regular names, but Wicket appends characters of its own to their names. What I'm trying to achieve is to be able to switch (at run-time) my app's theme by downloading a new one on a themes website, like http://www.freecsstemplates.org/ I use Wicket 1.5.7 but a solution for Wicket 6.0 is OK as well. Any help will be much appreciated. Regards, Pierre Goupil -- Le bonheur n'est pas une destination, mais une façon de voyager. Papa d'une petite Lou-Ann depuis le 30 juin.
Re: E-mail validation link
Thanks Josh! :-) We'll be watching together to see if anyone has other cool solutions! Regards, Pierre On Thu, Jul 19, 2012 at 8:55 PM, Josh Kamau joshnet2...@gmail.com wrote: I do something like this : 1. Create a confirmation page that takes a confirmation code as a page parameter 2. Mount a page to a url that looks like http://domain.com/confirmation?code=somesupersecretcode 3. When a user registers, i generate the code and put it somewhere in the database 4. I then send him the link as in (2) above but with user specific code 5. When the user tries to login, i extract the code and check if its valid. Am sure there could be other more clever techniques Will be watching this thread. Josh. On Thu, Jul 19, 2012 at 9:45 PM, Pierre Goupil goupilpie...@gmail.com wrote: Good evening, I'm currently trying to send a validation e-mail when a user creates an account. I'd link to provide a link in order to confirm the subscription. Is there any recommended way to do that? In particular, I don't know how to write the href of the Link in my e-mail. Any help will be much appreciated. Regards, Pierre Goupil -- Le bonheur n'est pas une destination, mais une façon de voyager. Papa d'une petite Lou-Ann depuis le 30 juin. -- Le bonheur n'est pas une destination, mais une façon de voyager. Papa d'une petite Lou-Ann depuis le 30 juin.
Re: E-mail validation link
Hello, I've implemented this in the same way as Josh does. My code for register participant for our conference[1] is open source. You can view it here[2] in particular: https://bitbucket.org/margielm/confitura/src/06588ec117c8/src/main/java/jelatyna/pages/confitura/registration/form/RegistrationForm.java https://bitbucket.org/margielm/confitura/src/06588ec117c8/src/main/java/jelatyna/pages/confitura/registration/Registration.java [1] www.confitura.pl [2] https://bitbucket.org/margielm/confitura -- Pozdrawiam/Best regards Michał Margiel http://www.confitura.pl (dawniej Javarsovia) http://www.linkedin.com/in/MichalMargiel http://www.margiel.eu
RE: [1.5] [6.0] dynamically named CSS, JS images resources
Have you tried turning the link tag into a dynamic WebMarkupContainer and then switching its href attribute's value via an AttributeModifier? HTML: html wicket:id=htmlTag head link wicket:id=cssHeadLink rel=stylesheet type=text/css href=css/default-styles.css /head body wicket:child/ /body /html Java: public BasePage() { htmlTag = new TransparentWebMarkupContainer(htmlTag); htmlTag.add( new AttributeModifier(lang, new ModelString(getUserLocale().getLanguage())) ); add(htmlTag); cssHeadLink = new WebMarkupContainer(cssHeadLink); cssHeadLink.add( new AttributeModifier(href, new ModelString(getSkinStyleSheet())) ); htmlTag.add(cssHeadLink); } Then have getSkinStyleSheet() return the name of the CSS file or use any other kind of IModel. Notice the above example also shows the use of the TransparentWebMarkupContainer used to change the HTML document's language in a similar manner only it will not be part of the component path for pages that extend BasePage. Here, getUserLocale() returns the Locale of the logged-in user whose ID is stored the Session. ~ Thank you, Paul Bors | Software Engineer | Knoa Software | 5 Union Square West, New York , NY 10003 | O: 212-807-9608 | www.knoa.com -Original Message- From: Pierre Goupil [mailto:goupilpie...@gmail.com] Sent: Thursday, July 19, 2012 2:57 PM To: users@wicket.apache.org Subject: [1.5] [6.0] dynamically named CSS, JS images resources Good evening, I'd like to contribute CSSs JSs to my head for which names I don't know. More precisely, I'd like to be able to download a .zip, unzip it and contribute its CSS JS content to the head, plus being able to display the images of the zip thanks to the links in the CSS. Regarding the downloading and unzipping steps, it's easy. But for the header contributions, I can't figure out how to do that since : 1) I don't know the names of the CSS JS files before download 2) the CSS files link to the images using their regular names, but Wicket appends characters of its own to their names. What I'm trying to achieve is to be able to switch (at run-time) my app's theme by downloading a new one on a themes website, like http://www.freecsstemplates.org/ I use Wicket 1.5.7 but a solution for Wicket 6.0 is OK as well. Any help will be much appreciated. Regards, Pierre Goupil -- Le bonheur n'est pas une destination, mais une façon de voyager. Papa d'une petite Lou-Ann depuis le 30 juin.
Re: E-mail validation link
It looks nice, Michal! I'm browsing it and I'll come back here if I have any questions, if it doesn't bother you. Thanks all! Regards, Pierre On Thu, Jul 19, 2012 at 9:10 PM, Michal Margiel michal.marg...@gmail.comwrote: Hello, I've implemented this in the same way as Josh does. My code for register participant for our conference[1] is open source. You can view it here[2] in particular: https://bitbucket.org/margielm/confitura/src/06588ec117c8/src/main/java/jelatyna/pages/confitura/registration/form/RegistrationForm.java https://bitbucket.org/margielm/confitura/src/06588ec117c8/src/main/java/jelatyna/pages/confitura/registration/Registration.java [1] www.confitura.pl [2] https://bitbucket.org/margielm/confitura -- Pozdrawiam/Best regards Michał Margiel http://www.confitura.pl (dawniej Javarsovia) http://www.linkedin.com/in/MichalMargiel http://www.margiel.eu -- Le bonheur n'est pas une destination, mais une façon de voyager. Papa d'une petite Lou-Ann depuis le 30 juin.
Re: E-mail validation link
2012/7/19 Pierre Goupil goupilpie...@gmail.com It looks nice, Michal! I'm browsing it and I'll come back here if I have any questions, if it doesn't bother you. No problemo! we are here to help each other. So bug me as much as you want ;) btw. I was doing this for the first time. So if anyone has better, or at least different, idea - I am eager to hear it! -- Pozdrawiam/Best regards Michał Margiel http://www.confitura.pl (dawniej Javarsovia) http://www.linkedin.com/in/MichalMargiel http://www.margiel.eu
Re: How can wicket Page form model be accessed from child panel
Ah now I'm starting to understand. The Wicket way as I understand it is to validate in the form submit and its components. Your validator however will need a reference to the current value of those checkboxes. I'm guessing the checkboxes are not part of the form in your case, otherwise this is very easy (just access the form component of the form). If they are not part of the form, you should share a model between each checkbox and the form validator to control the activation of the validation. On 19/07/2012 2:12 PM, jam.ntk wrote: I have two fields on the webpage which needs be validated for not being blank if user has selected few checkboxes which are part of the panel. So I thought of to have a validate method in the panel. Are you suggesting that instead of validating in the panel I validate in the form submit of webpage? Please suggest -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-wicket-Page-form-model-be-accessed-from-child-panel-tp4650608p4650632.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Class that extends AjaxTabbedPanel does not remember selected panel on page refresh
Hi, I have a class that extends AjaxTabbedPanel, it displays a busy indicator while the ajax call is running (see code below). This all works fine during these ajax calls; so a busy indicator is displayed and the tab that has been selected is displayed correctly in the view. However, if the page is refreshed the first tab in the group of tabs is shown as being selected and the app forgets which tab was previously selected. To me it seems like the initial page state for the tabs has been preserved and used again on refreshing the page (a bit like it's a static model). I can't figure out though what needs to be done to fix. public class IndicatingAjaxTabbedPanel extends AjaxTabbedPanel { private static final long serialVersionUID = 1L; public IndicatingAjaxTabbedPanel(String id, ListITab tabs) { super(id, tabs); } @SuppressWarnings(unchecked) @Override protected WebMarkupContainer newLink(String linkId, final int index) { return new IndicatingAjaxFallbackLink(linkId) { private static final long serialVersionUID = 1L; @Override public void onClick(AjaxRequestTarget target) { setSelectedTab(index); if (target != null) { target.add(IndicatingAjaxTabbedPanel.this); } onAjaxUpdate(target); } }; } } Cheers. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Class-that-extends-AjaxTabbedPanel-does-not-remember-selected-panel-on-page-refresh-tp4650642.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