Re: http://wicketinaction.com/ broken?
The site is broken for few weeks now. Martijn is aware of the problem. It is Wordpress related. On Sat, Jul 20, 2013 at 5:47 AM, Jeremy Thomerson wrote: > I can confirm pages other than the homepage are broken. Martijn is away on > vacation right now, so it may be a few days before he gets it back up. > > > > > On Fri, Jul 19, 2013 at 5:16 PM, Daniel Watrous >wrote: > > > This looks like a wordpress issue. Look for a problem with the .htaccess > > file. > > > > It should include something like this: > > > > > > RewriteEngine On > > RewriteBase /wordpress/ > > RewriteCond %{REQUEST_FILENAME} !-f > > RewriteCond %{REQUEST_FILENAME} !-d > > RewriteRule . /wordpress/index.php [L] > > > > > > Daniel > > > > > > On Fri, Jul 19, 2013 at 2:42 PM, Gabriel Landon wrote: > > > > > The home page dos work : > > > > > > wget http://wicketinaction.com/ > > > --2013-07-19 10:40:45-- http://wicketinaction.com/ > > > Résolution de wicketinaction.com... 94.124.120.40 > > > Connexion vers wicketinaction.com|94.124.120.40|:80...connecté. > > > requête HTTP transmise, en attente de la réponse...*200 OK* > > > > > > But not the other pages : > > > wget > > http://wicketinaction.com/2013/02/replace-components-with-animation/ > > > --2013-07-19 10:41:45-- > > > http://wicketinaction.com/2013/02/replace-components-with-animation/ > > > Résolution de wicketinaction.com... 94.124.120.40 > > > Connexion vers wicketinaction.com|94.124.120.40|:80...connecté. > > > requête HTTP transmise, en attente de la réponse...*404 Not Found* > > > 2013-07-19 10:41:46 ERREUR 404: Not Found. > > > > > > > > > > > > > > > > > > > > > > > > -- > > > View this message in context: > > > > > > http://apache-wicket.1842946.n4.nabble.com/http-wicketinaction-com-broken-tp4660379p4660385.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 > > > > > > > > > > > > -- > Jeremy Thomerson > http://wickettraining.com >
Re: Mutliple forms - single login popup
Validation could determine if the user is logged in or not. But how would the login form know which form to continue submitting after a successful login? On Friday, July 19, 2013 at 5:12 AM, Stefan Renz wrote: > Hi Jeff, > > could you use an AjaxSubmitLink and treat unauthenticated users as a > validation failure so that you end up in #onError() of your link? That way, > you can keep the submission login in Form#onSubmit()... > > Bye > Stefan > > Jeff Schneller wrote: > > Easy enough to implement when 1 form with submit button on page. Much more > > difficult when there are N forms with a submit button on a page. Each modal > > would need to have a different onSubmit() behavior so that the correct form > > is processed after the authentication occurs. > > > > > > > > On Sunday, July 14, 2013 at 11:38 PM, Paul Borș wrote: > > > > > So what's stopping you from doing so again? > > > > > > You simply keep the same conditions, if not logged you show the modal > > > pop-up with the authentication form. User clicks submit on the login form > > > and inside the onSubmit() of the form/button you run your authentication > > > and if it passes you post the data, if not you give an error. > > > > > > ~ Thank you, > > > Paul Bors > > > > > > On Jul 14, 2013, at 10:07 AM, Jeff Schneller > > (mailto:j...@mootus.com)> wrote: > > > > > > > Paul - > > > > > > > > That is how I am doing it. But I want the buttons to always appear even > > > > if not logged in. Then when clicked a modal is shown to login through a > > > > form and then the button action is finally executed. > > > > > > > > On Sunday, July 14, 2013 at 1:15 AM, Paul Bors wrote: > > > > > Keep a flag in your customized Session for when the user is logged > > > > > in. I keep the ID of the user record from the db so that if I need > > > > > the user POJO I can lazy load it later (say to e-mail the user or to > > > > > show the user's name under the My Profile page etc). > > > > > > > > > > If that is null, then show your pop-up, if valid then show your > > > > > button. > > > > > > > > > > ~ Thank you, > > > > > Paul Bors > > > > > > > > > > -Original Message- > > > > > From: Jeff Schneller [mailto:j...@mootus.com] > > > > > Sent: Sunday, July 14, 2013 12:13 AM > > > > > To: users@wicket.apache.org (mailto:users@wicket.apache.org) > > > > > Subject: Mutliple forms - single login popup > > > > > > > > > > Using 1.5.x. > > > > > > > > > > I have multiple forms (minimum of 2 but could be any number) on my > > > > > page being put on the page as a ListView. Each form has its own model > > > > > and 2 buttons within it that perform some action on its model. > > > > > Similar to the facebook newsfeed where each news article has its own > > > > > like and comment button. I have a login form on the page being shown > > > > > as a jquery modal window. > > > > > > > > > > My requirement is that the user must be logged in before either > > > > > button click is processed. I have code that works but only for one > > > > > form. > > > > > > > > > > I want the button click to perform the business logic when user is > > > > > logged in and if not logged in - show a modal login form, after > > > > > successful login then perform the business logic. > > > > > > > > > > What is the best/easiest way to do this? > > > > > > > > > > Jeff Schneller > > > > > Co-Founder/CTO, Mootus (http://www.mootus.com) j...@mootus.com > > > > > (mailto:a...@mootus.com) > > > > > M: 1-617-851-0200 > > > > > Skype: jeff.schneller > > > > > > > > > > LinkedIn (http://www.linkedin.com/in/jeffschneller) | Twitter > > > > > (https://twitter.com/Mootusco) | Website (http://www.mootus.com/) > > > > > > > > > > > > > > > > > > > > - > > > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > > > > (mailto:users-unsubscr...@wicket.apache.org) > > > > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > (mailto:users-h...@wicket.apache.org) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > - > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > > (mailto:users-unsubscr...@wicket.apache.org) > > > For additional commands, e-mail: users-h...@wicket.apache.org > > > (mailto:users-h...@wicket.apache.org) > > > > > > > > > > > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > (mailto:users-unsubscr...@wicket.apache.org) > For additional commands, e-mail: users-h...@wicket.apache.org > (mailto:users-h...@wicket.apache.org) > >
Re: Multiple F5 refreshes create multiple threads
Hi! Not knowing what 1.3 does, but 1.4 locks pagemap in org.apache.wicket.Session. ** Martin 2013/7/18 Mateusz Mieszkowski : > Hi, > > I'm having a problem with quite old version of Wicket (1.3.6) and I'm > wondering if this still exists in the latest version as we're getting ready > for upgrading. > The thing is that if the page opened in browser uses SortableDataProvider, > iterator method is executed. So far so good... > But each time user do F5, page refresh creates new http thread and every one > of them is trying to process iterator method. > Since this is the same user/session, I think it is safe to say that only one > thread(that is doing the refresh) is necessary and more refreshes should kill > http threads that are working to get the same info. > > The problem in my system was, that one user's F5 blocked and it caused > hundreds of refresh and started hundreds of http thread. I imagine that in > worse case scenario it could use up whole thread pool and system would be > useless for some time. > > I've checked changelogs and jira issues but haven't found anything similar. > Could you please let me know if there is a way to avoid such situation? > > Kind regards, > Mateusz Mieszkowski - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Multiple F5 refreshes create multiple threads
Hi, I'm having a problem with quite old version of Wicket (1.3.6) and I'm wondering if this still exists in the latest version as we're getting ready for upgrading. The thing is that if the page opened in browser uses SortableDataProvider, iterator method is executed. So far so good... But each time user do F5, page refresh creates new http thread and every one of them is trying to process iterator method. Since this is the same user/session, I think it is safe to say that only one thread(that is doing the refresh) is necessary and more refreshes should kill http threads that are working to get the same info. The problem in my system was, that one user's F5 blocked and it caused hundreds of refresh and started hundreds of http thread. I imagine that in worse case scenario it could use up whole thread pool and system would be useless for some time. I've checked changelogs and jira issues but haven't found anything similar. Could you please let me know if there is a way to avoid such situation? Kind regards, Mateusz Mieszkowski
Adding checkbox column to DefaultDataTable
This works just fine to add checkboxes to a ListView: final CheckGroup group = new CheckGroup("group", new ArrayList()); Form form = new Form("form") { @Override protected void onSubmit() { info("selected person(s): " + group.getDefaultModelObjectAsString()); } }; add(form); form.add(group); group.add(new CheckGroupSelector("groupselector")); ListView listView = new ListView("persons", getModel()) { /** * @see * org.apache.wicket.markup.html.list.ListView#populateItem(org.apache.wicket.markup.html.list.ListItem) */ @Override protected void populateItem(ListItem item) { item.add(new Check("checkbox", item.getModel())); item.add(new Label("name", new PropertyModel(item.getDefaultModel(), "name"))); } }; listView.setReuseItems(true); group.add(listView); However, similar code to add a checkbox column to a DefaultDataTable fails. final CheckGroup group = new CheckGroup("group", new ArrayList()); Form form = new Form("form2") { @Override protected void onSubmit() { info("selected person(s): " + group.getDefaultModelObjectAsString()); } }; List columns = new ArrayList(); columns.add(new CheckboxColumn("id")); columns.add(new PsPropertyColumn("Name", "name") { @Override public void populateItem(Item cellItem, String componentId, IModel rowModel) { super.populateItem(cellItem, componentId, rowModel); } }); final DataProvider dataProvider = new DataProvider(getModel()); add(form); form.add(group); group.add(new CheckGroupSelector("groupselector")); DefaultDataTable table = new DefaultDataTable("dataTable", columns, dataProvider, 5) { }; group.add(table); The checkboxes appear, but selecting on actually selects the column rather than the individual item. This causes multiple problems, such as getDefaultModelObjectAsString() returns the column and the CheckGroupSelector, thinking the column is selected and the same column is used for all checkboxes, selects all boxes on post back. Any advice? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Adding-checkbox-column-to-DefaultDataTable-tp4660374.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: http://wicketinaction.com/ broken?
I can confirm pages other than the homepage are broken. Martijn is away on vacation right now, so it may be a few days before he gets it back up. On Fri, Jul 19, 2013 at 5:16 PM, Daniel Watrous wrote: > This looks like a wordpress issue. Look for a problem with the .htaccess > file. > > It should include something like this: > > > RewriteEngine On > RewriteBase /wordpress/ > RewriteCond %{REQUEST_FILENAME} !-f > RewriteCond %{REQUEST_FILENAME} !-d > RewriteRule . /wordpress/index.php [L] > > > Daniel > > > On Fri, Jul 19, 2013 at 2:42 PM, Gabriel Landon wrote: > > > The home page dos work : > > > > wget http://wicketinaction.com/ > > --2013-07-19 10:40:45-- http://wicketinaction.com/ > > Résolution de wicketinaction.com... 94.124.120.40 > > Connexion vers wicketinaction.com|94.124.120.40|:80...connecté. > > requête HTTP transmise, en attente de la réponse...*200 OK* > > > > But not the other pages : > > wget > http://wicketinaction.com/2013/02/replace-components-with-animation/ > > --2013-07-19 10:41:45-- > > http://wicketinaction.com/2013/02/replace-components-with-animation/ > > Résolution de wicketinaction.com... 94.124.120.40 > > Connexion vers wicketinaction.com|94.124.120.40|:80...connecté. > > requête HTTP transmise, en attente de la réponse...*404 Not Found* > > 2013-07-19 10:41:46 ERREUR 404: Not Found. > > > > > > > > > > > > > > > > -- > > View this message in context: > > > http://apache-wicket.1842946.n4.nabble.com/http-wicketinaction-com-broken-tp4660379p4660385.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 > > > > > -- Jeremy Thomerson http://wickettraining.com
Re: http://wicketinaction.com/ broken?
This looks like a wordpress issue. Look for a problem with the .htaccess file. It should include something like this: RewriteEngine On RewriteBase /wordpress/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L] Daniel On Fri, Jul 19, 2013 at 2:42 PM, Gabriel Landon wrote: > The home page dos work : > > wget http://wicketinaction.com/ > --2013-07-19 10:40:45-- http://wicketinaction.com/ > Résolution de wicketinaction.com... 94.124.120.40 > Connexion vers wicketinaction.com|94.124.120.40|:80...connecté. > requête HTTP transmise, en attente de la réponse...*200 OK* > > But not the other pages : > wget http://wicketinaction.com/2013/02/replace-components-with-animation/ > --2013-07-19 10:41:45-- > http://wicketinaction.com/2013/02/replace-components-with-animation/ > Résolution de wicketinaction.com... 94.124.120.40 > Connexion vers wicketinaction.com|94.124.120.40|:80...connecté. > requête HTTP transmise, en attente de la réponse...*404 Not Found* > 2013-07-19 10:41:46 ERREUR 404: Not Found. > > > > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/http-wicketinaction-com-broken-tp4660379p4660385.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: http://wicketinaction.com/ broken?
The home page dos work : wget http://wicketinaction.com/ --2013-07-19 10:40:45-- http://wicketinaction.com/ Résolution de wicketinaction.com... 94.124.120.40 Connexion vers wicketinaction.com|94.124.120.40|:80...connecté. requête HTTP transmise, en attente de la réponse...*200 OK* But not the other pages : wget http://wicketinaction.com/2013/02/replace-components-with-animation/ --2013-07-19 10:41:45-- http://wicketinaction.com/2013/02/replace-components-with-animation/ Résolution de wicketinaction.com... 94.124.120.40 Connexion vers wicketinaction.com|94.124.120.40|:80...connecté. requête HTTP transmise, en attente de la réponse...*404 Not Found* 2013-07-19 10:41:46 ERREUR 404: Not Found. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/http-wicketinaction-com-broken-tp4660379p4660385.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: http://wicketinaction.com/ broken?
Huh. Maybe some kind of dynamic DNS. ~$ wget http://wicketinaction.com/book/ --2013-07-19 13:35:29-- http://wicketinaction.com/book/ Resolving wicketinaction.com (wicketinaction.com)... 94.124.120.40 Connecting to wicketinaction.com (wicketinaction.com)|94.124.120.40|:80... connected. HTTP request sent, awaiting response... 404 Not Found 2013-07-19 13:35:29 ERROR 404: Not Found. On Fri, Jul 19, 2013 at 1:26 PM, Igor Vaynberg wrote: > works for me > > > On Fri, Jul 19, 2013 at 1:19 PM, Dan Retzlaff wrote: > > > Busted for me. > > > > > > On Fri, Jul 19, 2013 at 12:54 PM, William Speirs > > wrote: > > > > > Worked for me... try again? > > > > > > Bill- > > > > > > > > > On Fri, Jul 19, 2013 at 2:52 PM, Gabriel Landon > wrote: > > > > > > > Hi, > > > > > > > > The website wicketinaction.com seems to be down, only the home page > is > > > > working. > > > > All the other pages return a 404. > > > > > > > > Where can I find a working version of the website? > > > > > > > > Regards, > > > > Gabriel. > > > > > > > > > > > > > > > > > > > > -- > > > > View this message in context: > > > > > > > > > > http://apache-wicket.1842946.n4.nabble.com/http-wicketinaction-com-broken-tp4660379.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: Append elements in ajax request
Hi Sven, Yeah I saw that possibility but the problem is that the messages are animated when first displayed. I don't want the animation to trigger again when repainting the panel. I believe Dan's solution will fill all my needs and I'm implementing it now. Regards, Bertrand On 19/07/2013 2:36 PM, Sven Meier wrote: Hi Bertrand, use a custom ApplicationSettings#feedbackMessageCleanupFilter that keeps your special messages even if they were rendered already. Sven On 07/19/2013 06:07 PM, Bertrand Guay-Paquet wrote: Hi Dan, You can render into a hidden div, then use some JavaScript to move them into view. Something like this which uses jQuery. response.render(OnDomReadyHeaderItem.forScript("$('#hiddenfeedback div').appendTo($('#visiblefeedback'));")); Great idea! Thanks! That behavior doesn't seem exactly right though. If a form is AJAX-submitted twice with the same error, do you really want to show the error twice? The feedback panel I'm referring to is used for session messages like "Your email address was saved". They don't indicate errors with forms; I have other fenced feedback panels that do that and I want them to only show the most recent messages like you explained. Some pages which display the session messages also have ajax buttons that do minor actions and I don't want those ajax requests to clear the catch-all feedback panel. Thanks again! Bertrand - 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: http://wicketinaction.com/ broken?
works for me On Fri, Jul 19, 2013 at 1:19 PM, Dan Retzlaff wrote: > Busted for me. > > > On Fri, Jul 19, 2013 at 12:54 PM, William Speirs > wrote: > > > Worked for me... try again? > > > > Bill- > > > > > > On Fri, Jul 19, 2013 at 2:52 PM, Gabriel Landon wrote: > > > > > Hi, > > > > > > The website wicketinaction.com seems to be down, only the home page is > > > working. > > > All the other pages return a 404. > > > > > > Where can I find a working version of the website? > > > > > > Regards, > > > Gabriel. > > > > > > > > > > > > > > > -- > > > View this message in context: > > > > > > http://apache-wicket.1842946.n4.nabble.com/http-wicketinaction-com-broken-tp4660379.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: Grouping tags in a ListView without a parent tag
Hi Victor Also, wicket:container is designed for for purpose Best regards, Sebastien. On Fri, Jul 19, 2013 at 7:42 PM, Dan Retzlaff wrote: > If you associate your ListView with a that wraps your two > elements, you can call item.setRenderBodyOnly(true) to suppress the > from the markup. The two inner s will remain. > > > On Fri, Jul 19, 2013 at 10:34 AM, Victor Dolirio Ferreira Barbosa < > victor...@gmail.com> wrote: > > > Hello Everybody, > > > > I got stuck in a situation that I could not resolve in a "graceful way" > > yet. > > > > I have in my HTML a menu built with and tags and it use a > > "separator" concept. Like this: > > > > > > > > Admin > > > > > > Help > > > > > > What I want is to iterate a menu list in Java code with a Repeater but > > grouping 2 li tags in a way that it outputs the tag with its separator > > sibling. > > > > Its not possible to group them with another tag like a span or div, cause > > HTML don't render it. > > > > I naively tried to group them with a but it not > worked. > > > > What is the better way to do this? > > > > -- > > []s, > > Victor Dolirio > > http://victordolirio.com > > >
Re: http://wicketinaction.com/ broken?
Busted for me. On Fri, Jul 19, 2013 at 12:54 PM, William Speirs wrote: > Worked for me... try again? > > Bill- > > > On Fri, Jul 19, 2013 at 2:52 PM, Gabriel Landon wrote: > > > Hi, > > > > The website wicketinaction.com seems to be down, only the home page is > > working. > > All the other pages return a 404. > > > > Where can I find a working version of the website? > > > > Regards, > > Gabriel. > > > > > > > > > > -- > > View this message in context: > > > http://apache-wicket.1842946.n4.nabble.com/http-wicketinaction-com-broken-tp4660379.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: http://wicketinaction.com/ broken?
Worked for me... try again? Bill- On Fri, Jul 19, 2013 at 2:52 PM, Gabriel Landon wrote: > Hi, > > The website wicketinaction.com seems to be down, only the home page is > working. > All the other pages return a 404. > > Where can I find a working version of the website? > > Regards, > Gabriel. > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/http-wicketinaction-com-broken-tp4660379.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: Grouping tags in a ListView without a parent tag
If you associate your ListView with a that wraps your two elements, you can call item.setRenderBodyOnly(true) to suppress the from the markup. The two inner s will remain. On Fri, Jul 19, 2013 at 10:34 AM, Victor Dolirio Ferreira Barbosa < victor...@gmail.com> wrote: > Hello Everybody, > > I got stuck in a situation that I could not resolve in a "graceful way" > yet. > > I have in my HTML a menu built with and tags and it use a > "separator" concept. Like this: > > > > Admin > > > Help > > > What I want is to iterate a menu list in Java code with a Repeater but > grouping 2 li tags in a way that it outputs the tag with its separator > sibling. > > Its not possible to group them with another tag like a span or div, cause > HTML don't render it. > > I naively tried to group them with a but it not worked. > > What is the better way to do this? > > -- > []s, > Victor Dolirio > http://victordolirio.com >
http://wicketinaction.com/ broken?
Hi, The website wicketinaction.com seems to be down, only the home page is working. All the other pages return a 404. Where can I find a working version of the website? Regards, Gabriel. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/http-wicketinaction-com-broken-tp4660379.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: Append elements in ajax request
Hi Bertrand, use a custom ApplicationSettings#feedbackMessageCleanupFilter that keeps your special messages even if they were rendered already. Sven On 07/19/2013 06:07 PM, Bertrand Guay-Paquet wrote: Hi Dan, You can render into a hidden div, then use some JavaScript to move them into view. Something like this which uses jQuery. response.render(OnDomReadyHeaderItem.forScript("$('#hiddenfeedback div').appendTo($('#visiblefeedback'));")); Great idea! Thanks! That behavior doesn't seem exactly right though. If a form is AJAX-submitted twice with the same error, do you really want to show the error twice? The feedback panel I'm referring to is used for session messages like "Your email address was saved". They don't indicate errors with forms; I have other fenced feedback panels that do that and I want them to only show the most recent messages like you explained. Some pages which display the session messages also have ajax buttons that do minor actions and I don't want those ajax requests to clear the catch-all feedback panel. Thanks again! Bertrand - 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
Grouping tags in a ListView without a parent tag
Hello Everybody, I got stuck in a situation that I could not resolve in a "graceful way" yet. I have in my HTML a menu built with and tags and it use a "separator" concept. Like this: Admin Help What I want is to iterate a menu list in Java code with a Repeater but grouping 2 li tags in a way that it outputs the tag with its separator sibling. Its not possible to group them with another tag like a span or div, cause HTML don't render it. I naively tried to group them with a but it not worked. What is the better way to do this? -- []s, Victor Dolirio http://victordolirio.com
RE: Form questions
For stateless pages it would create a new one each time (add the DebugBar to your pages and see if your page is stateless or not and also see what the model is per component). For when Wicket serializes your page, you don't want a PropertyModel alone, you want a detachable model (see section 9.6 of the Wicket Free Guide or go over chapter 9 again "Wicket models and forms"). You need to wrap a Detachable model inside a Property model like so: add(new TextField("url", new PropertyModel(new LoadableDetachableModel(cnavUrl), "URL")) .setRequired(true) .add(new UrlValidator())); Is best to use a CompoundPropertyModel for the entire form and get to your POJO that feeds the entire form (or panel) via a detachable model. The LoadableDetachableModel is desined to only serialize the record ID for which you can later retrieve the entire object from your persistence layer. ~ Thank you, Paul Bors -Original Message- From: Daniel Watrous [mailto:dwmaill...@gmail.com] Sent: Friday, July 19, 2013 11:24 AM To: users@wicket.apache.org Subject: Re: Form questions Paul, Thanks. I get that and understand how the Model happens. As you can see, the instance of the model object is created in the constructor. So the first question I had is whether a new instance is created for every request or if there's one instance that's serialized. I suspect it's the second, knowing how Wicket treats sessions. In that case, I need some way on a per request basis to load the model from the database. The other question I had is how to create a link that sends the ID to the page that renders the form. I need to create a link to that page, include an ID value with the request and then access that ID within the form for my query to load that object from the DB. Daniel On Thu, Jul 18, 2013 at 5:14 PM, Paul Bors wrote: > Okay let's pre-populate this field: > > add(new TextField("url", new PropertyModel(cnavUrl, "URL")) > .setRequired(true) > .add(new UrlValidator())); > > Its mode is a new PropertyModel(cnavUrl, "URL"), which is the "CnavUrl > cnavUrl = new MorphiaCnavUrl();". > So it's the cnavUrl.getUrl() value. > > What do you get when you call new MorphiaCnavUrl().getUrl()? > That's what should appear in the TextField when you first load the > page (normally read form the DB). > > ~ Thank you, > Paul Bors > > -Original Message- > From: Daniel Watrous [mailto:dwmaill...@gmail.com] > Sent: Thursday, July 18, 2013 6:03 PM > To: users@wicket.apache.org > Subject: Re: Form questions > > I've made a lot of progress and been through chapters 9 and 10 of > Wicket Free Guide, but I'm still stumped on point #2, pre-populating the form. > Here's what I have right now: > > public class CnavForm extends Form { > > @Inject private CnavUrlDAO cnavUrlDAO; > > public CnavForm(String id) { > super(id); > CnavUrl cnavUrl = new MorphiaCnavUrl(); > setModel(new Model((Serializable) cnavUrl)); > > add(new TextField("url", new PropertyModel(cnavUrl, "URL")) > .setRequired(true) > .add(new UrlValidator())); > add(new HiddenField("objectid", new PropertyModel(cnavUrl, > "id"))); > > add(new Button("publish") { > @Override > public void onSubmit() { > CnavUrl cnavUrl = (CnavUrl) CnavForm.this.getModelObject(); > // check for existing record to know if this is a > create or update > if (((MorphiaCnavUrlModel)cnavUrl).getId() == null) { > // create > cnavUrlDAO.save(cnavUrl); > } else { > // update > cnavUrlDAO.save(cnavUrl); > } > } > }); > } > } > > I need to know how to do two things. > 1) how to link to the page that displays the form, and pass it the ID > for the record I want to edit > 2) load the object from the database and have it replace the model I > create in the constructor > > Obviously I can make a database call and get the object. Is the > constructor called every time the page is requested, so that I could > check for an ID and either create the model or load it from the > database? If so, then I just need help with #1. > > Thanks, > Daniel > > > On Wed, Jul 17, 2013 at 10:19 AM, Daniel Watrous > wrote: > > > I think I'm getting it now. The Form needs to be embedded in a panel > > for the type of inclusion that I'm interested in. > > > > I created a CnavFormPanel.java and changed CnavForm.html to > > CnavFormPanel.html. I left CnavForm.java alone. > > > > In CnavModify.java I removed this > > > > Form form = new CnavForm("cnavFormArea"); > > add(form); > > > > And added this > > > > add(new CnavFormPanel("cnavFormArea")); > > > > That works. Thanks for your help. > > > > Daniel > > > > > > On Wed, Jul 17, 2013 at 10:07 AM, Daniel Wat
Re: Append elements in ajax request
Hi Dan, You can render into a hidden div, then use some JavaScript to move them into view. Something like this which uses jQuery. response.render(OnDomReadyHeaderItem.forScript("$('#hiddenfeedback div').appendTo($('#visiblefeedback'));")); Great idea! Thanks! That behavior doesn't seem exactly right though. If a form is AJAX-submitted twice with the same error, do you really want to show the error twice? The feedback panel I'm referring to is used for session messages like "Your email address was saved". They don't indicate errors with forms; I have other fenced feedback panels that do that and I want them to only show the most recent messages like you explained. Some pages which display the session messages also have ajax buttons that do minor actions and I don't want those ajax requests to clear the catch-all feedback panel. Thanks again! Bertrand - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Append elements in ajax request
Hi Bertrand, You can render into a hidden div, then use some JavaScript to move them into view. Something like this which uses jQuery. response.render(OnDomReadyHeaderItem.forScript("$('#hiddenfeedback div').appendTo($('#visiblefeedback'));")); That behavior doesn't seem exactly right though. If a form is AJAX-submitted twice with the same error, do you really want to show the error twice? We just allow user-initiated AJAX requests to re-render/clear the feedback panel. Generally the user is either re-submitting a form, or navigating/panel-swapping away. In either case the old feedback isn't relevant anymore. In the few places where we have AJAX polling, e.g. through AjaxSelfUpdatingTimerBehavior, we set a RequestCycle-scoped flag in onTimer() or whatever to indicate that the request wasn't user-initiated. This suppresses the feedback panel from being rendered. It's not pretty, but it's what we do. :) Fortunately this polling stuff is going away as we move to Wicket-Atmosphere. Dan On Fri, Jul 19, 2013 at 7:25 AM, Bertrand Guay-Paquet < ber...@step.polymtl.ca> wrote: > Hello, > > I have a catch-all feedback panel which displays feedback messages at the > top of my web pages. It slides-in the message boxes and adds a "close" link > to each one. > > It also has an event handler which makes sure it redraws itself each time > Wicket handles an ajax request: > > @Override > public void onEvent(IEvent a_event) { > // This makes sure the panel always adds itself to the ajax > response > if (a_event.getPayload() instanceof AjaxRequestTarget) { > ((AjaxRequestTarget) a_event.getPayload()).add(**this); > } > } > > This way, I don't have to add it explicitly to the request target each > time a component adds a session message. > > After each request, the default behavior is to clear all rendered feedback > messages from the session. My problem is that each time an ajax request is > made, the currently displayed feedback message list is replaced by a new > one. This removes any unclosed messages still present from the DOM. > > How can I tell Wicket ajax to append DOM elements to a parent instead of > re-rendering the parent and its children? Is there another solution? > > Not clearing the messages from the session and displaying them again is > not an option because the fade-in animation would be repeated. > > Regards, > Bertrand > > --**--**- > To unsubscribe, e-mail: > users-unsubscribe@wicket.**apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Form questions
Paul, Thanks. I get that and understand how the Model happens. As you can see, the instance of the model object is created in the constructor. So the first question I had is whether a new instance is created for every request or if there's one instance that's serialized. I suspect it's the second, knowing how Wicket treats sessions. In that case, I need some way on a per request basis to load the model from the database. The other question I had is how to create a link that sends the ID to the page that renders the form. I need to create a link to that page, include an ID value with the request and then access that ID within the form for my query to load that object from the DB. Daniel On Thu, Jul 18, 2013 at 5:14 PM, Paul Bors wrote: > Okay let's pre-populate this field: > > add(new TextField("url", new PropertyModel(cnavUrl, "URL")) > .setRequired(true) > .add(new UrlValidator())); > > Its mode is a new PropertyModel(cnavUrl, "URL"), which is the "CnavUrl > cnavUrl = new MorphiaCnavUrl();". > So it's the cnavUrl.getUrl() value. > > What do you get when you call new MorphiaCnavUrl().getUrl()? > That's what should appear in the TextField when you first load the page > (normally read form the DB). > > ~ Thank you, > Paul Bors > > -Original Message- > From: Daniel Watrous [mailto:dwmaill...@gmail.com] > Sent: Thursday, July 18, 2013 6:03 PM > To: users@wicket.apache.org > Subject: Re: Form questions > > I've made a lot of progress and been through chapters 9 and 10 of Wicket > Free Guide, but I'm still stumped on point #2, pre-populating the form. > Here's what I have right now: > > public class CnavForm extends Form { > > @Inject private CnavUrlDAO cnavUrlDAO; > > public CnavForm(String id) { > super(id); > CnavUrl cnavUrl = new MorphiaCnavUrl(); > setModel(new Model((Serializable) cnavUrl)); > > add(new TextField("url", new PropertyModel(cnavUrl, "URL")) > .setRequired(true) > .add(new UrlValidator())); > add(new HiddenField("objectid", new PropertyModel(cnavUrl, "id"))); > > add(new Button("publish") { > @Override > public void onSubmit() { > CnavUrl cnavUrl = (CnavUrl) CnavForm.this.getModelObject(); > // check for existing record to know if this is a create or > update > if (((MorphiaCnavUrlModel)cnavUrl).getId() == null) { > // create > cnavUrlDAO.save(cnavUrl); > } else { > // update > cnavUrlDAO.save(cnavUrl); > } > } > }); > } > } > > I need to know how to do two things. > 1) how to link to the page that displays the form, and pass it the ID for > the record I want to edit > 2) load the object from the database and have it replace the model I create > in the constructor > > Obviously I can make a database call and get the object. Is the constructor > called every time the page is requested, so that I could check for an ID > and > either create the model or load it from the database? If so, then I just > need help with #1. > > Thanks, > Daniel > > > On Wed, Jul 17, 2013 at 10:19 AM, Daniel Watrous > wrote: > > > I think I'm getting it now. The Form needs to be embedded in a panel > > for the type of inclusion that I'm interested in. > > > > I created a CnavFormPanel.java and changed CnavForm.html to > > CnavFormPanel.html. I left CnavForm.java alone. > > > > In CnavModify.java I removed this > > > > Form form = new CnavForm("cnavFormArea"); > > add(form); > > > > And added this > > > > add(new CnavFormPanel("cnavFormArea")); > > > > That works. Thanks for your help. > > > > Daniel > > > > > > On Wed, Jul 17, 2013 at 10:07 AM, Daniel Watrous > wrote: > > > >> I can make it work if I put the markup from CnavForm.html directly > >> into CnavModify, but the form is not as reusable then. I would have > >> to duplicate the markup for other pages that use the same form... > >> > >> Dnaiel > >> > >> > >> On Wed, Jul 17, 2013 at 9:55 AM, Daniel Watrous > wrote: > >> > >>> That's what I tried to do. I created CnavForm.java and > >>> CnavForm.html. In the latter file I have this > >>> > >>> > >>> // form details > >>> > >>> > >>> > >>> Then I have CnavModify.java and CnavModify.html. You already see > >>> what I have in CnavModify.java from my last email. My CnavModify.html > has this. > >>> > >>> Here's the form > >>> > >>> > >>> Rather than render I'm getting this error: > >>> Last cause: Component [cnavFormArea] (path = [0:cnavFormArea]) must > >>> be applied to a tag of type [form], not: ' wicket:id="cnavFormArea" > >>> id="cnavFormArea3">' (line 0, column 0) > >>> > >>> I'll keep trying and report back when I figure it out. > >>> > >>> Daniel > >>> > >>> > >>> On Tue, Jul 16, 2013 at 10:50 PM, Paul Bors wrote: > >>> > >
Re: getCallbackFunctionBody - Wicket.Ajax.ajax?
Hi, I use the javascript generated by getCallbackFunction just fine. Here's an actual function used as an onclick callback: function (event) { var attrs = {"u":"./103?1-1.IBehaviorListener.0-","i":"veil"}; var params = {'tourAction': "1"}; attrs.ep = params; Wicket.Ajax.ajax(attrs); } The java code that generated it is : // Collect the extra parameters CallbackParameter[] parameters = new CallbackParameter[2]; parameters[0] = CallbackParameter.context("event"); parameters[1] = CallbackParameter.resolved("tourAction", "1"); // Generate callback function CharSequence callbackFunction = getCallbackFunction(parameters); This definitely does an ajax call. I haven't looked closely at the Wicket.Ajax.ajax() code, but it works fine. Bertrand On 19/07/2013 9:58 AM, Frank van Lankvelt wrote: hi all, in the process of upgrading to wicket 6, I have to do some wicket ajax calls from custom javascript callbacks. The AbstractDefaultAjaxBehavior seems to provide a bunch of tools to help me out. But I cannot make sense of the javadoc (& implementation) of #getCallbackFunction: * Generates a javascript function that can take parameters and performs an AJAX call which * includes these parameters. The generated code looks like this: * * * function(param1, param2) { *var attrs = attrsJson; *var params = {'param1': param1, 'param2': param2}; *attrs.ep = jQuery.extend(attrs.ep, params); *Wicket.Ajax.ajax(attrs); * } * But AFAIK the last line of the generated function Wicket.Ajax.ajax(attrs) does not do an ajax call. It just uses jQuery to register event listeners. So have I missed something, or is this a bug? thanks, Frank - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Append elements in ajax request
Hello, I have a catch-all feedback panel which displays feedback messages at the top of my web pages. It slides-in the message boxes and adds a "close" link to each one. It also has an event handler which makes sure it redraws itself each time Wicket handles an ajax request: @Override public void onEvent(IEvent a_event) { // This makes sure the panel always adds itself to the ajax response if (a_event.getPayload() instanceof AjaxRequestTarget) { ((AjaxRequestTarget) a_event.getPayload()).add(this); } } This way, I don't have to add it explicitly to the request target each time a component adds a session message. After each request, the default behavior is to clear all rendered feedback messages from the session. My problem is that each time an ajax request is made, the currently displayed feedback message list is replaced by a new one. This removes any unclosed messages still present from the DOM. How can I tell Wicket ajax to append DOM elements to a parent instead of re-rendering the parent and its children? Is there another solution? Not clearing the messages from the session and displaying them again is not an option because the fade-in animation would be repeated. Regards, Bertrand - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
getCallbackFunctionBody - Wicket.Ajax.ajax?
hi all, in the process of upgrading to wicket 6, I have to do some wicket ajax calls from custom javascript callbacks. The AbstractDefaultAjaxBehavior seems to provide a bunch of tools to help me out. But I cannot make sense of the javadoc (& implementation) of #getCallbackFunction: * Generates a javascript function that can take parameters and performs an AJAX call which * includes these parameters. The generated code looks like this: * * * function(param1, param2) { *var attrs = attrsJson; *var params = {'param1': param1, 'param2': param2}; *attrs.ep = jQuery.extend(attrs.ep, params); *Wicket.Ajax.ajax(attrs); * } * But AFAIK the last line of the generated function Wicket.Ajax.ajax(attrs) does not do an ajax call. It just uses jQuery to register event listeners. So have I missed something, or is this a bug? thanks, Frank -- Amsterdam - Oosteinde 11, 1017 WT Amsterdam Boston - 1 Broadway, Cambridge, MA 02142 US +1 877 414 4776 (toll free) Europe +31(0)20 522 4466 www.onehippo.com
AW: AW: CSV-Export change Datepattern
Hello, I add this to my WicketApplication class: @Override protected IConverterLocator newConverterLocator() { ConverterLocator converterLocator = new ConverterLocator(); converterLocator.set(Date.class, new PatternDateConverter("dd.MM. HH:mm:ss",true)); System.out.println(converterLocator.getConverter(Date.class).toString()); return converterLocator; } This works fine. Thank you for your help. Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport & Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax:+49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com -Ursprüngliche Nachricht- Von: Sven Meier [mailto:s...@meiers.net] Gesendet: Freitag, 19. Juli 2013 09:50 An: users@wicket.apache.org Betreff: Re: AW: CSV-Export change Datepattern In your application override: protected IConverterLocator newConverterLocator() { ConverterLocator locator = new ConverterLocator(); locator.set(...); return locator; } On 07/19/2013 09:43 AM, christoph.ma...@t-systems.com wrote: > I have to do this in my wicketApplication class in his init-method right? > With this call: > Application.get().getConverterLocator().getConverter(Date.class) I only get > the actual converter for the date. How can I register a new PatternConverter > in my application. There is nothing like this > Application.get().getConverterLocator().setConverter(Date.class, new > PatternDateConverter("dd.MM. HH:mm:ss",true))? > > Can anybody give me an example please? > > > Mit freundlichen Grüßen > Christoph Manig > Systems Engineer > > T-Systems International GmbH > Systems Integration - SC Travel, Transport & Logistics Hoyerswerdaer > Str. 18 > 01099 Dresden > tel.: +49 (0) 351 / 8152 - 188 > fax: +49 (0) 351 / 8152 - 209 > email: christoph.ma...@t-systems.com > > -Ursprüngliche Nachricht- > Von: Sven Meier [mailto:s...@meiers.net] > Gesendet: Donnerstag, 18. Juli 2013 16:14 > An: users@wicket.apache.org > Betreff: Re: CSV-Export change Datepattern > > CSVDataExporter uses the Application's converters: > > IConverter converter = > Application.get().getConverterLocator().getConverter(c); > > So register a suitable converter in your application. > > Alternatively create a new Jira issue to allow passing an IConverterLocator > into CSVDataExporter. > > Sven > > On 07/18/2013 03:29 PM, christoph.ma...@t-systems.com wrote: >> Hello, >> >> in my application I have a table which includes a column timestamp. I have >> created this column with the help of a Panel which includes a DateLabel. >> >> columns.add(new PropertyColumn(new >> ResourceModel("protocolRecord.eventTimestamp").wrapOnAssignment(getPage()),"eventTimestamp","eventTimestamp"){ >> @Override >> public void populateItem(Item> >> cellItem, String componentId, IModel model) >> { >> cellItem.add(new DatePanel(componentId, >> model,"eventTimestamp")); >> } >> }); >> >> Here is the declaration of the DateLabel: >> >> public class DatePanel extends Panel { >> public DatePanel(String id, final IModel model, String column) >> { >> super(id, model); >> DateLabel datelabel = new DateLabel("date",new >> PropertyModel(model, column),new PatternDateConverter("dd.MM. >> HH:mm:ss",true)); >> add(datelabel); >> } >> } >> >> So the table shows the date like this 18.07.2013 15:23:53. Furthermore the >> table has an Exporttoolbar for csv. When I click the link for exporting the >> csv, it includes the timestamp like this 2013/07/18. This is wrong. I need >> the full timestamp as it would be shown in the table. Could anybody help me >> please? >> >> Mit freundlichen Grüßen >> Christoph Manig >> email: christoph.ma...@t-systems.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 > - 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: StringResourceModel object value = null
Hi, it's java.text.MessageFormat which renders null parameters as 'null'. I'd suggest you use a custom model that uses two different StringResourceModels depending on the present parameters. Sven On 07/19/2013 10:13 AM, Tommy Sadiq Hinrichsen wrote: Hey I'm using a Stringresourcemodel to display a custom message label. Its constructed like this. new Label("maxAmount", new StringResourceModel("bookkeeping.amount.to.move",null, new Object[]{ new PropertyModel(this, "valueReport.lastValuationDate"), new PropertyModel(this, "valueReport.totalValueLocal"), new PropertyModel(getCurrentSelections().getSelectedLegalEntity(), "bookkeepingCurrency") }))); With the following entry in a property file bookkeeping.amount.to.move=Booked value per {0,date} is {1,number,###.##} {2} My problem is that the valuereport object is not populated before the user makes a choice on the page. So my label is showing like this Booked value per null is null DKK When i try to use "" as default value in the constructor i get a conversion error. Caused by: java.lang.IllegalArgumentException: Cannot format given Object as a Date Anybody got any ideas? Med venlig hilsen / Best regards Tommy Sadiq Hinrichsen - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Mutliple forms - single login popup
Hi Jeff, could you use an AjaxSubmitLink and treat unauthenticated users as a validation failure so that you end up in #onError() of your link? That way, you can keep the submission login in Form#onSubmit()... Bye Stefan Jeff Schneller wrote: > Easy enough to implement when 1 form with submit button on page. Much more > difficult when there are N forms with a submit button on a page. Each modal > would need to have a different onSubmit() behavior so that the correct form > is processed after the authentication occurs. > > > > On Sunday, July 14, 2013 at 11:38 PM, Paul Borș wrote: > >> So what's stopping you from doing so again? >> >> You simply keep the same conditions, if not logged you show the modal pop-up >> with the authentication form. User clicks submit on the login form and >> inside the onSubmit() of the form/button you run your authentication and if >> it passes you post the data, if not you give an error. >> >> ~ Thank you, >> Paul Bors >> >> On Jul 14, 2013, at 10:07 AM, Jeff Schneller > (mailto:j...@mootus.com)> wrote: >> >>> Paul - >>> >>> That is how I am doing it. But I want the buttons to always appear even if >>> not logged in. Then when clicked a modal is shown to login through a form >>> and then the button action is finally executed. >>> >>> On Sunday, July 14, 2013 at 1:15 AM, Paul Bors wrote: Keep a flag in your customized Session for when the user is logged in. I keep the ID of the user record from the db so that if I need the user POJO I can lazy load it later (say to e-mail the user or to show the user's name under the My Profile page etc). If that is null, then show your pop-up, if valid then show your button. ~ Thank you, Paul Bors -Original Message- From: Jeff Schneller [mailto:j...@mootus.com] Sent: Sunday, July 14, 2013 12:13 AM To: users@wicket.apache.org (mailto:users@wicket.apache.org) Subject: Mutliple forms - single login popup Using 1.5.x. I have multiple forms (minimum of 2 but could be any number) on my page being put on the page as a ListView. Each form has its own model and 2 buttons within it that perform some action on its model. Similar to the facebook newsfeed where each news article has its own like and comment button. I have a login form on the page being shown as a jquery modal window. My requirement is that the user must be logged in before either button click is processed. I have code that works but only for one form. I want the button click to perform the business logic when user is logged in and if not logged in - show a modal login form, after successful login then perform the business logic. What is the best/easiest way to do this? Jeff Schneller Co-Founder/CTO, Mootus (http://www.mootus.com) j...@mootus.com (mailto:a...@mootus.com) M: 1-617-851-0200 Skype: jeff.schneller LinkedIn (http://www.linkedin.com/in/jeffschneller) | Twitter (https://twitter.com/Mootusco) | Website (http://www.mootus.com/) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org (mailto:users-unsubscr...@wicket.apache.org) For additional commands, e-mail: users-h...@wicket.apache.org (mailto:users-h...@wicket.apache.org) >>> >>> >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> (mailto:users-unsubscr...@wicket.apache.org) >> For additional commands, e-mail: users-h...@wicket.apache.org >> (mailto:users-h...@wicket.apache.org) >> >> > > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
StringResourceModel object value = null
Hey I'm using a Stringresourcemodel to display a custom message label. Its constructed like this. new Label("maxAmount", new StringResourceModel("bookkeeping.amount.to.move",null, new Object[]{ new PropertyModel(this, "valueReport.lastValuationDate"), new PropertyModel(this, "valueReport.totalValueLocal"), new PropertyModel(getCurrentSelections().getSelectedLegalEntity(), "bookkeepingCurrency") }))); With the following entry in a property file bookkeeping.amount.to.move=Booked value per {0,date} is {1,number,###.##} {2} My problem is that the valuereport object is not populated before the user makes a choice on the page. So my label is showing like this Booked value per null is null DKK When i try to use "" as default value in the constructor i get a conversion error. Caused by: java.lang.IllegalArgumentException: Cannot format given Object as a Date Anybody got any ideas? Med venlig hilsen / Best regards Tommy Sadiq Hinrichsen
Re: AW: CSV-Export change Datepattern
In your application override: protected IConverterLocator newConverterLocator() { ConverterLocator locator = new ConverterLocator(); locator.set(...); return locator; } On 07/19/2013 09:43 AM, christoph.ma...@t-systems.com wrote: I have to do this in my wicketApplication class in his init-method right? With this call: Application.get().getConverterLocator().getConverter(Date.class) I only get the actual converter for the date. How can I register a new PatternConverter in my application. There is nothing like this Application.get().getConverterLocator().setConverter(Date.class, new PatternDateConverter("dd.MM. HH:mm:ss",true))? Can anybody give me an example please? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport & Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax:+49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com -Ursprüngliche Nachricht- Von: Sven Meier [mailto:s...@meiers.net] Gesendet: Donnerstag, 18. Juli 2013 16:14 An: users@wicket.apache.org Betreff: Re: CSV-Export change Datepattern CSVDataExporter uses the Application's converters: IConverter converter = Application.get().getConverterLocator().getConverter(c); So register a suitable converter in your application. Alternatively create a new Jira issue to allow passing an IConverterLocator into CSVDataExporter. Sven On 07/18/2013 03:29 PM, christoph.ma...@t-systems.com wrote: Hello, in my application I have a table which includes a column timestamp. I have created this column with the help of a Panel which includes a DateLabel. columns.add(new PropertyColumn(new ResourceModel("protocolRecord.eventTimestamp").wrapOnAssignment(getPage()),"eventTimestamp","eventTimestamp"){ @Override public void populateItem(Item> cellItem, String componentId, IModel model) { cellItem.add(new DatePanel(componentId, model,"eventTimestamp")); } }); Here is the declaration of the DateLabel: public class DatePanel extends Panel { public DatePanel(String id, final IModel model, String column) { super(id, model); DateLabel datelabel = new DateLabel("date",new PropertyModel(model, column),new PatternDateConverter("dd.MM. HH:mm:ss",true)); add(datelabel); } } So the table shows the date like this 18.07.2013 15:23:53. Furthermore the table has an Exporttoolbar for csv. When I click the link for exporting the csv, it includes the timestamp like this 2013/07/18. This is wrong. I need the full timestamp as it would be shown in the table. Could anybody help me please? Mit freundlichen Grüßen Christoph Manig email: christoph.ma...@t-systems.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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: CSV-Export change Datepattern
I have to do this in my wicketApplication class in his init-method right? With this call: Application.get().getConverterLocator().getConverter(Date.class) I only get the actual converter for the date. How can I register a new PatternConverter in my application. There is nothing like this Application.get().getConverterLocator().setConverter(Date.class, new PatternDateConverter("dd.MM. HH:mm:ss",true))? Can anybody give me an example please? Mit freundlichen Grüßen Christoph Manig Systems Engineer T-Systems International GmbH Systems Integration - SC Travel, Transport & Logistics Hoyerswerdaer Str. 18 01099 Dresden tel.: +49 (0) 351 / 8152 - 188 fax:+49 (0) 351 / 8152 - 209 email: christoph.ma...@t-systems.com -Ursprüngliche Nachricht- Von: Sven Meier [mailto:s...@meiers.net] Gesendet: Donnerstag, 18. Juli 2013 16:14 An: users@wicket.apache.org Betreff: Re: CSV-Export change Datepattern CSVDataExporter uses the Application's converters: IConverter converter = Application.get().getConverterLocator().getConverter(c); So register a suitable converter in your application. Alternatively create a new Jira issue to allow passing an IConverterLocator into CSVDataExporter. Sven On 07/18/2013 03:29 PM, christoph.ma...@t-systems.com wrote: > Hello, > > in my application I have a table which includes a column timestamp. I have > created this column with the help of a Panel which includes a DateLabel. > > columns.add(new PropertyColumn(new > ResourceModel("protocolRecord.eventTimestamp").wrapOnAssignment(getPage()),"eventTimestamp","eventTimestamp"){ > @Override > public void populateItem(Item> > cellItem, String componentId, IModel model) > { > cellItem.add(new DatePanel(componentId, > model,"eventTimestamp")); > } > }); > > Here is the declaration of the DateLabel: > > public class DatePanel extends Panel { > public DatePanel(String id, final IModel model, String column) > { > super(id, model); > DateLabel datelabel = new DateLabel("date",new > PropertyModel(model, column),new PatternDateConverter("dd.MM. > HH:mm:ss",true)); > add(datelabel); > } > } > > So the table shows the date like this 18.07.2013 15:23:53. Furthermore the > table has an Exporttoolbar for csv. When I click the link for exporting the > csv, it includes the timestamp like this 2013/07/18. This is wrong. I need > the full timestamp as it would be shown in the table. Could anybody help me > please? > > Mit freundlichen Grüßen > Christoph Manig > email: christoph.ma...@t-systems.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