Resources folder not found
The the project claims that it cant find a file from /project/secure/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js while i access my page from http://localhost:8080/project/secure/ Which resources folder is the project looking for? _ Windows Live: Make it easier for your friends to see what you’re up to on Facebook. http://www.microsoft.com/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:ms-my:SI_SB_2:092009
Re: DropDownChoice and null value internationalization key
Created the 2531. Thanks. -- View this message in context: http://www.nabble.com/DropDownChoice-and-null-value-internationalization-key-tp25924643p25954595.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Resources folder not found
resources on Wicket are read from the classpath. Just open the class WicketEventReference, if you have the sources installed, and you will see wicket-event.js setting next to it. Ernesto On Mon, Oct 19, 2009 at 9:39 AM, ping ping sping_p...@hotmail.com wrote: The the project claims that it cant find a file from /project/secure/resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js while i access my page from http://localhost:8080/project/secure/ Which resources folder is the project looking for? _ Windows Live: Make it easier for your friends to see what you’re up to on Facebook. http://www.microsoft.com/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:ms-my:SI_SB_2:092009
RE: Localization of values coming from my Model
No, javadoc is ok. You are right. My mistake, sorry. -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] Then is the javadoc wrong? This was taken right from the javadoc? http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wic ket/model/StringResourceModel.html === Example 2 In this example, the resource key is selected based on the evaluation of a property expression: public MyPage extends WebPage { public MyPage(final PageParameters parameters) { WeatherStation ws = new WeatherStation(); add(new Label(weatherMessage, new StringResourceModel(weather.${currentStatus}, this, new Model(ws))); } } Which will call the WeatherStation.getCurrentStatus() method each time the string resource model is used and where the resource bundle for the page contains the entries: weather.sunny=Don't forget sunscreen! weather.raining=You might need an umbrella weather.snowing=Got your skis? weather.overcast=Best take a coat to be safe -Original Message- From: Bernhard Michal [mailto:michal.bernh...@tigra.cz] It doesn't seem correct... StringResourceModel expect string which is supposed to be resource key to find localization in resource bundle. I recommend you to read http://cwiki.apache.org/WICKET/localization-and-skinning-of-applications .html. -Original Message- From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] I tried this and it seems to work. Is this a correct way of doing it? Label gender = new Label(gender, new StringResourceModel(${gender}, this, model)); add(gender); Obviously the StringResourceModel uses the property file for the page. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Localization of values coming from my Model
Use the StringResourceModel with properties bundle, it is very powerful because you can add dynamic data coming from the model. I've done some things like this, assuming infoModel.dateFormat() returns a formated date : new Label(tableTitle, new StringResourceModel(table.title, this, new ModelInfoModel(infoModel))); and in the properties english bundle : table.title=This table was built on $dateFormat And then you create a bundle for each locale you need. Now for something more tricky, you could solve your problem like this. Create the properties bundle : gender.female = Female gender.male = Male active.yes = Yes active.no = No and in your code : new StringResourceModel(gender_${gender}, this, getModel(; new StringResourceModel(active_${active}, this, getModel(; and in your model you simply return the key based on your condition, and it will work magically.
Re: Howto accept other then first locale in HTTP header Accept-Language?
2009/10/16 Per Newgro per.new...@gmx.ch Hi Olivier, isn't mod_jk a bit heavyweight for this little usecase? I don't know your case, for mine, every project I worked on already had a mod_jk. And it is a common pattern with J2EE development : simply because when you have static resources to serve on a high traffic site, then it is Tomcat who becomes heavyweight :) I like the locale usage of wicket. It is like magic and i don't have to worry about it. All i want to add to my application is the check for a supported locale on session startup. But thanks anyway. Per And the overload of getLocale() would'nt work ?
Re: Howto accept other then first locale in HTTP header Accept-Language?
Hi Olivier And the overload of getLocale() would'nt work ? I don't see how it could solve my problem. What i try is to filter the locales assignable to session. It will be assigned in Application.newSession(Request, Response) by usage of the Accepted-Langauge value in header of response. That seems the right place to ensure only supported languages. WIth overwriting Page.getLocale() i don't see the way on howto get the accepted locales of client browser. Thanks Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Open Source projects using Wicket
Hi Martin, The System.out.println() calls are superfluous and will be removed in future releases of Mistletoe. They might be replaced by logger call if and when appropriate. Your comment about the manual is duly noted. I'll try to put together something more polished the next time. Cheers, Martin Grigorov wrote: It is little strange that _your_ (I emphasize here) software uses System.out.println() for logging instead of any of the logging frameworks you created ;-) From the manual on the page it is not very clear how to setup the whole thing. Probably I could manage it but it would be good to add step by step howto for the newbies. -- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket Abstract Tree Question
I have a few questions regarding the wicket abstract/linked tree 1) I need to dynamically update wicket linked/abstract tree data, is that in order to do that, the only way is to remove the abstract tree on the form based on its ID, then adding it back to the form again, is there other alternatives to resolve that? 2)And is that the linked tree treemodel cannot be null? What if inititally the tree data is null, until people dynamically add in new data? _ NEW! Get Windows Live FREE. http://www.get.live.com/wl/all
Ajax Send TextField Input to Server without Form / Submit
Hi, how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket Abstract Tree Question
1) I need to dynamically update wicket linked/abstract tree data, is that in order to do that, the only way is to remove the abstract tree on the form based on its ID, then adding it back to the form again, is there other alternatives to resolve that? I have it working just adding new nodes to treemodel, then updating the parent node component with ajax. 2)And is that the linked tree treemodel cannot be null? What if inititally the tree data is null, until people dynamically add in new data? can to be null, it even has an constructor that don't get any model http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/tree/AbstractTree.html#AbstractTree%28java.lang.String%29 On Mon, Oct 19, 2009 at 8:40 AM, ping ping sping_p...@hotmail.com wrote: I have a few questions regarding the wicket abstract/linked tree 1) I need to dynamically update wicket linked/abstract tree data, is that in order to do that, the only way is to remove the abstract tree on the form based on its ID, then adding it back to the form again, is there other alternatives to resolve that? 2)And is that the linked tree treemodel cannot be null? What if inititally the tree data is null, until people dynamically add in new data? _ NEW! Get Windows Live FREE. http://www.get.live.com/wl/all -- Pedro Henrique Oliveira dos Santos
Re: Ajax Send TextField Input to Server without Form / Submit
how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? yes, you can use an AjaxFormComponentUpdatingBehavior for it I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- you can use AjaxEventBehavior to handle onClick event On Mon, Oct 19, 2009 at 8:50 AM, Peter Arnulf Lustig u...@yahoo.dewrote: Hi, how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
Re: Ajax Send TextField Input to Server without Form / Submit
I'm not sure you can get rid of the form but you could use a JavaScript like: var url = this.url+ 'textField=' + textField.value; wicketAjaxGet(url); Where this.url is the URL of something implementing ILinkListener. The on the onLinkClicked of the listener read you parameter for the request and store the value whenever you need on the server side... I use a similar trick, for some custom components, to update values at server side, that will change as the result of some user interaction. Best, Ernesto On Mon, Oct 19, 2009 at 12:50 PM, Peter Arnulf Lustig u...@yahoo.dewrote: Hi, how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Ajax Send TextField Input to Server without Form / Submit
What do I do with a click-button? The User gets a new TextField when I try to add an AjaxFormComponentUpdatingBehavior. I just want to have a textfield and next to it a button, where it says save. And this should happen without a form. - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:12:34 Uhr Betreff: Re: Ajax Send TextField Input to Server without Form / Submit how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? yes, you can use an AjaxFormComponentUpdatingBehavior for it I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- you can use AjaxEventBehavior to handle onClick event On Mon, Oct 19, 2009 at 8:50 AM, Peter Arnulf Lustig u...@yahoo.dewrote: Hi, how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: Ajax Send TextField Input to Server without Form / Submit
I have to correct myself: I get the right Button. But the next question: how can I use the content of the textfield? final TextField tagTitle = (TextField) new TextField(tagTitle, Model.of()).setOutputMarkupId(true); add(tagTitle); add(new Button(tagSubmit).add(new AjaxFormComponentUpdatingBehavior(onclick) { @Override protected void onUpdate(AjaxRequestTarget arg0) { System.out.println(tagTitle.getModelObject()); } })); - Ursprüngliche Mail Von: Peter Arnulf Lustig u...@yahoo.de An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:36:31 Uhr Betreff: AW: Ajax Send TextField Input to Server without Form / Submit What do I do with a click-button? The User gets a new TextField when I try to add an AjaxFormComponentUpdatingBehavior. I just want to have a textfield and next to it a button, where it says save. And this should happen without a form. - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:12:34 Uhr Betreff: Re: Ajax Send TextField Input to Server without Form / Submit how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? yes, you can use an AjaxFormComponentUpdatingBehavior for it I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- you can use AjaxEventBehavior to handle onClick event On Mon, Oct 19, 2009 at 8:50 AM, Peter Arnulf Lustig u...@yahoo.dewrote: Hi, how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - 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: AW: Ajax Send TextField Input to Server without Form / Submit
add(new Button(tagSubmit).add(new AjaxFormComponentUpdatingBehavior(onclick) { the AjaxFormComponentUpdatingBehavior are to textfield component how can I use the content of the textfield? new Button(tagSubmit).add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { callMyCodeUsingTheInputOnTatTitle(getRequest().getParameter(TAG_TITLE); } @Override public CharSequence getCallbackUrl(boolean onlyTargetActivePage) { return super.getCallbackUrl(onlyTargetActivePage) + + TAG_TITLE + =+Wicket.$('+tagTitle.getMarkupId()+').value; } }); but why don't you what to use the html form tag? you can get is working in a simpler way, even without use an wicket button component. On Mon, Oct 19, 2009 at 9:38 AM, Peter Arnulf Lustig u...@yahoo.dewrote: I have to correct myself: I get the right Button. But the next question: how can I use the content of the textfield? final TextField tagTitle = (TextField) new TextField(tagTitle, Model.of()).setOutputMarkupId(true); add(tagTitle); add(new Button(tagSubmit).add(new AjaxFormComponentUpdatingBehavior(onclick) { @Override protected void onUpdate(AjaxRequestTarget arg0) { System.out.println(tagTitle.getModelObject()); } })); - Ursprüngliche Mail Von: Peter Arnulf Lustig u...@yahoo.de An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:36:31 Uhr Betreff: AW: Ajax Send TextField Input to Server without Form / Submit What do I do with a click-button? The User gets a new TextField when I try to add an AjaxFormComponentUpdatingBehavior. I just want to have a textfield and next to it a button, where it says save. And this should happen without a form. - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:12:34 Uhr Betreff: Re: Ajax Send TextField Input to Server without Form / Submit how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? yes, you can use an AjaxFormComponentUpdatingBehavior for it I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- you can use AjaxEventBehavior to handle onClick event On Mon, Oct 19, 2009 at 8:50 AM, Peter Arnulf Lustig u...@yahoo.de wrote: Hi, how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - 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 -- Pedro Henrique Oliveira dos Santos
AW: AW: Ajax Send TextField Input to Server without Form / Submit
thank you -- I will try your solution. your question: because I have already a form-tag in which I try to execute a seperated business logic. And there is no form-nesting allowed... - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:50:33 Uhr Betreff: Re: AW: Ajax Send TextField Input to Server without Form / Submit add(new Button(tagSubmit).add(new AjaxFormComponentUpdatingBehavior(onclick) { the AjaxFormComponentUpdatingBehavior are to textfield component how can I use the content of the textfield? new Button(tagSubmit).add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { callMyCodeUsingTheInputOnTatTitle(getRequest().getParameter(TAG_TITLE); } @Override public CharSequence getCallbackUrl(boolean onlyTargetActivePage) { return super.getCallbackUrl(onlyTargetActivePage) + + TAG_TITLE + =+Wicket.$('+tagTitle.getMarkupId()+').value; } }); but why don't you what to use the html form tag? you can get is working in a simpler way, even without use an wicket button component. On Mon, Oct 19, 2009 at 9:38 AM, Peter Arnulf Lustig u...@yahoo.dewrote: I have to correct myself: I get the right Button. But the next question: how can I use the content of the textfield? final TextField tagTitle = (TextField) new TextField(tagTitle, Model.of()).setOutputMarkupId(true); add(tagTitle); add(new Button(tagSubmit).add(new AjaxFormComponentUpdatingBehavior(onclick) { @Override protected void onUpdate(AjaxRequestTarget arg0) { System.out.println(tagTitle.getModelObject()); } })); - Ursprüngliche Mail Von: Peter Arnulf Lustig u...@yahoo.de An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:36:31 Uhr Betreff: AW: Ajax Send TextField Input to Server without Form / Submit What do I do with a click-button? The User gets a new TextField when I try to add an AjaxFormComponentUpdatingBehavior. I just want to have a textfield and next to it a button, where it says save. And this should happen without a form. - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:12:34 Uhr Betreff: Re: Ajax Send TextField Input to Server without Form / Submit how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? yes, you can use an AjaxFormComponentUpdatingBehavior for it I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- you can use AjaxEventBehavior to handle onClick event On Mon, Oct 19, 2009 at 8:50 AM, Peter Arnulf Lustig u...@yahoo.de wrote: Hi, how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - 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 -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Wicket Abstract Tree Question
Hi there, thanks for the reply. As for question One, I was wondering that how to update parent node component with Ajax. Dont seem to find any related resources to that Date: Mon, 19 Oct 2009 08:59:01 -0200 Subject: Re: Wicket Abstract Tree Question From: pedros...@gmail.com To: users@wicket.apache.org 1) I need to dynamically update wicket linked/abstract tree data, is that in order to do that, the only way is to remove the abstract tree on the form based on its ID, then adding it back to the form again, is there other alternatives to resolve that? I have it working just adding new nodes to treemodel, then updating the parent node component with ajax. 2)And is that the linked tree treemodel cannot be null? What if inititally the tree data is null, until people dynamically add in new data? can to be null, it even has an constructor that don't get any model http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/tree/AbstractTree.html#AbstractTree%28java.lang.String%29 On Mon, Oct 19, 2009 at 8:40 AM, ping ping sping_p...@hotmail.com wrote: I have a few questions regarding the wicket abstract/linked tree 1) I need to dynamically update wicket linked/abstract tree data, is that in order to do that, the only way is to remove the abstract tree on the form based on its ID, then adding it back to the form again, is there other alternatives to resolve that? 2)And is that the linked tree treemodel cannot be null? What if inititally the tree data is null, until people dynamically add in new data? _ NEW! Get Windows Live FREE. http://www.get.live.com/wl/all -- Pedro Henrique Oliveira dos Santos _ Join the Fantasy Football club and win cash prizes here! http://fantasyfootball.malaysia.msn.com
confirmation component
Hi, Is there any confirmation component in wicket/wicket-stuff? As an example, when user want to delete something, a popup window will come up and ask user whether they are sure what they are doing or not (as like JOptionPane in swing). thanks! //Jahid - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Howto accept other then first locale in HTTP header Accept-Language?
Ho well, I didn't understood correctly your question, sorry. Have you tried tho use a custom WebSession ? - in your WebApplication class overload the newSession method : @Override public Session newSession(Request request, Response response) { return new YourCustomSession(this, request); } - create the class YourCustomSession extending WebSession, then override getLocale() : @Override public Locale getLocale() { // TODO Auto-generated method stub return super.getLocale(); } in YourCustomSession you have access to the Request locale that you can restrict to only supported values in your custom getLocale(). 2009/10/19 Per Newgro per.new...@gmx.ch Hi Olivier And the overload of getLocale() would'nt work ? I don't see how it could solve my problem. What i try is to filter the locales assignable to session. It will be assigned in Application.newSession(Request, Response) by usage of the Accepted-Langauge value in header of response. That seems the right place to ensure only supported languages. WIth overwriting Page.getLocale() i don't see the way on howto get the accepted locales of client browser. Thanks Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: Ajax Send TextField Input to Server without Form / Submit
hi pedro, your code does not function properly (or I'm to stupid to use it :)) -- What is TAG_TITLE ? A constant? Why? -- What does getCallbackURL do? -- What shall I put into onUpdate() Method (tagTitle textfield) many thanks in advance. - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:50:33 Uhr Betreff: Re: AW: Ajax Send TextField Input to Server without Form / Submit add(new Button(tagSubmit).add(new AjaxFormComponentUpdatingBehavior(onclick) { the AjaxFormComponentUpdatingBehavior are to textfield component how can I use the content of the textfield? new Button(tagSubmit).add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { callMyCodeUsingTheInputOnTatTitle(getRequest().getParameter(TAG_TITLE); } @Override public CharSequence getCallbackUrl(boolean onlyTargetActivePage) { return super.getCallbackUrl(onlyTargetActivePage) + + TAG_TITLE + =+Wicket.$('+tagTitle.getMarkupId()+').value; } }); but why don't you what to use the html form tag? you can get is working in a simpler way, even without use an wicket button component. On Mon, Oct 19, 2009 at 9:38 AM, Peter Arnulf Lustig u...@yahoo.dewrote: I have to correct myself: I get the right Button. But the next question: how can I use the content of the textfield? final TextField tagTitle = (TextField) new TextField(tagTitle, Model.of()).setOutputMarkupId(true); add(tagTitle); add(new Button(tagSubmit).add(new AjaxFormComponentUpdatingBehavior(onclick) { @Override protected void onUpdate(AjaxRequestTarget arg0) { System.out.println(tagTitle.getModelObject()); } })); - Ursprüngliche Mail Von: Peter Arnulf Lustig u...@yahoo.de An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:36:31 Uhr Betreff: AW: Ajax Send TextField Input to Server without Form / Submit What do I do with a click-button? The User gets a new TextField when I try to add an AjaxFormComponentUpdatingBehavior. I just want to have a textfield and next to it a button, where it says save. And this should happen without a form. - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:12:34 Uhr Betreff: Re: Ajax Send TextField Input to Server without Form / Submit how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? yes, you can use an AjaxFormComponentUpdatingBehavior for it I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- you can use AjaxEventBehavior to handle onClick event On Mon, Oct 19, 2009 at 8:50 AM, Peter Arnulf Lustig u...@yahoo.de wrote: Hi, how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - 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 -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: confirmation component
link.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure you want to play global thermonuclear war?');)); Martijn On Mon, Oct 19, 2009 at 2:37 PM, Md. Jahid Shohel ja...@outscore.se wrote: Hi, Is there any confirmation component in wicket/wicket-stuff? As an example, when user want to delete something, a popup window will come up and ask user whether they are sure what they are doing or not (as like JOptionPane in swing). thanks! //Jahid - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.4 increases type safety for web applications Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
inmethod IDataSource
Hello, I have a problem with the inmethod IDataSource. I've provided my own implementation for it, including implementing the query method. But for some reason, it only seems to want to return one row, while I know there should be two. Can anybody tell me what I might be doing wrong? It must be that I've made a stupid mistake somewhere, because I did get it working for two other kinds of data. I simply don't see what I did differently. Here's the query method. It's the initializing of the QueryParam variable that fails. When I add in the line that I've commented out just below it, I do get the two rows I'm expecting. public void query(final IQuery query, final IQueryResult result) { String sortProperty = null; boolean sortAsc = true; // is there any sorting if (query.getSortState().getColumns().size() 0) { // get the most relevant column ISortStateColumn state = query.getSortState().getColumns().get(0); // get the column sort properties sortProperty = convertToFieldName(state.getPropertyName()); sortAsc = state.getDirection() == IGridSortState.Direction.ASC; } ListBook resultList; try { filter.setSort(sortProperty); filter.setSortOrder(sortAsc); // HERE'S MY PROBLEM: query.getCount() is 1 for some reason QueryParam qp = new QueryParam(query.getFrom(), query.getCount()); //QueryParam qp = new QueryParam(0, 0); ListBook books = new BookRetriever().getAllBooks(filter, qp); // determine the total count result.setTotalCount(books.size()); resultList = books; } catch (Exception e) { resultList = new ArrayListBook(); } result.setItems(resultList.iterator()); } Regards, Linda - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AW: Ajax Send TextField Input to Server without Form / Submit
-- What is TAG_TITLE ? A constant? Why? A constant to encode/decode an get parameter on your behavior callback url -- What does getCallbackURL do? http://wicket.apache.org/docs/1.4/org/apache/wicket/behavior/AbstractAjaxBehavior.html#getCallbackUrl%28boolean%29 -- What shall I put into onUpdate() Method (tagTitle textfield) you will not get your textfield model updated using this strategy. this behavior attached on your button will only send to server the value on textfield. because I have already a form-tag in which I try to execute a seperated business logic. And there is no form-nesting allowed... 1-you can implement different onSubmit methods on different form buttons 2-you can create another form (not nested) for your textfield component the code solution I posted before is just for you have an idea for how boring and workaround will look like your handler to tagSubmit values On Mon, Oct 19, 2009 at 10:43 AM, Peter Arnulf Lustig u...@yahoo.dewrote: hi pedro, your code does not function properly (or I'm to stupid to use it :)) -- What is TAG_TITLE ? A constant? Why? -- What does getCallbackURL do? -- What shall I put into onUpdate() Method (tagTitle textfield) many thanks in advance. - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:50:33 Uhr Betreff: Re: AW: Ajax Send TextField Input to Server without Form / Submit add(new Button(tagSubmit).add(new AjaxFormComponentUpdatingBehavior(onclick) { the AjaxFormComponentUpdatingBehavior are to textfield component how can I use the content of the textfield? new Button(tagSubmit).add(new AjaxEventBehavior(onclick) { @Override protected void onEvent(AjaxRequestTarget target) { callMyCodeUsingTheInputOnTatTitle(getRequest().getParameter(TAG_TITLE); } @Override public CharSequence getCallbackUrl(boolean onlyTargetActivePage) { return super.getCallbackUrl(onlyTargetActivePage) + + TAG_TITLE + =+Wicket.$('+tagTitle.getMarkupId()+').value; } }); but why don't you what to use the html form tag? you can get is working in a simpler way, even without use an wicket button component. On Mon, Oct 19, 2009 at 9:38 AM, Peter Arnulf Lustig u...@yahoo.de wrote: I have to correct myself: I get the right Button. But the next question: how can I use the content of the textfield? final TextField tagTitle = (TextField) new TextField(tagTitle, Model.of()).setOutputMarkupId(true); add(tagTitle); add(new Button(tagSubmit).add(new AjaxFormComponentUpdatingBehavior(onclick) { @Override protected void onUpdate(AjaxRequestTarget arg0) { System.out.println(tagTitle.getModelObject()); } })); - Ursprüngliche Mail Von: Peter Arnulf Lustig u...@yahoo.de An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:36:31 Uhr Betreff: AW: Ajax Send TextField Input to Server without Form / Submit What do I do with a click-button? The User gets a new TextField when I try to add an AjaxFormComponentUpdatingBehavior. I just want to have a textfield and next to it a button, where it says save. And this should happen without a form. - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Montag, den 19. Oktober 2009, 13:12:34 Uhr Betreff: Re: Ajax Send TextField Input to Server without Form / Submit how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? yes, you can use an AjaxFormComponentUpdatingBehavior for it I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- you can use AjaxEventBehavior to handle onClick event On Mon, Oct 19, 2009 at 8:50 AM, Peter Arnulf Lustig u...@yahoo.de wrote: Hi, how is it possible to submit TextField Input to the server without having a Form (and submit) for this task? I figured out, that AjaxButton only has onSubmit() Method -- I expected also something like onClick -- - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - 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
Re: confirmation component
haha! back to the 80'ies with that quote :)) Martijn Dashorst wrote: link.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure you want to play global thermonuclear war?');)); Martijn On Mon, Oct 19, 2009 at 2:37 PM, Md. Jahid Shohel ja...@outscore.se wrote: Hi, Is there any confirmation component in wicket/wicket-stuff? As an example, when user want to delete something, a popup window will come up and ask user whether they are sure what they are doing or not (as like JOptionPane in swing). thanks! //Jahid - 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: confirmation component
Martijn, thanks, but i was looking for component, but not javascript, otherwise i could use that alert right away, without asking. even more intellijent way, i could use wicket-stuffs modal window to make my own confirmation window. but my question more about is there any already? but thanks anyway :) On Mon, 2009-10-19 at 14:59 +0200, Thies Edeling wrote: Martijn - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: inmethod IDataSource
Does it also happen when you call result.setTotalCount(books.size()) before calling getCount()? From IDataSource: /** * Sets the total items count. Alternatively, if the total item count can't be determined, * either {...@link #MORE_ITEMS} or {...@link #NO_MORE_ITEMS} constant can be used to indicate * whether there are more items left or not. * * If the real items count is specified, it might affect the result of * {...@link IQuery#getCount()}, so it is preferred to call this method before calling * {...@link #setItems(Iterator)}. * * @param count *the total count of items */ public void setTotalCount(int count); -Matej On Mon, Oct 19, 2009 at 2:52 PM, Linda van der Pal lvd...@heritageagenturen.nl wrote: Hello, I have a problem with the inmethod IDataSource. I've provided my own implementation for it, including implementing the query method. But for some reason, it only seems to want to return one row, while I know there should be two. Can anybody tell me what I might be doing wrong? It must be that I've made a stupid mistake somewhere, because I did get it working for two other kinds of data. I simply don't see what I did differently. Here's the query method. It's the initializing of the QueryParam variable that fails. When I add in the line that I've commented out just below it, I do get the two rows I'm expecting. public void query(final IQuery query, final IQueryResult result) { String sortProperty = null; boolean sortAsc = true; // is there any sorting if (query.getSortState().getColumns().size() 0) { // get the most relevant column ISortStateColumn state = query.getSortState().getColumns().get(0); // get the column sort properties sortProperty = convertToFieldName(state.getPropertyName()); sortAsc = state.getDirection() == IGridSortState.Direction.ASC; } ListBook resultList; try { filter.setSort(sortProperty); filter.setSortOrder(sortAsc); // HERE'S MY PROBLEM: query.getCount() is 1 for some reason QueryParam qp = new QueryParam(query.getFrom(), query.getCount()); //QueryParam qp = new QueryParam(0, 0); ListBook books = new BookRetriever().getAllBooks(filter, qp); // determine the total count result.setTotalCount(books.size()); resultList = books; } catch (Exception e) { resultList = new ArrayListBook(); } result.setItems(resultList.iterator()); } Regards, Linda - 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: Howto accept other then first locale in HTTP header Accept-Language?
Hi Olivier, you wrote exactly what i did. But if you check the extraction of locale from request to provide it in session, you can see that only first accepted language is evaluated and used if not-null. But if you assume that first accpeted language is CHINESE and second is FRENCH and the application is supporting FRENCH you don't have any chance to get the second locale. And thats my problem. Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Howto accept other then first locale in HTTP header Accept-Language?
Well, you can't change the behaviour of ServletRequest.getLocale() unless you want to patch your servlet container :) But you make me think it would be great in the Servlet API to have something like setAcceptedLocales(Enumeration e) and let the servlet container do the work of matching the browser locale with your application supported locales. Anyway, it's out of Wicket's scope :-) What you can do is do the work in your overloaded WebSession.getLocale() : @Override public Locale getLocale() { Enumeration _enum = ((WebRequest) request).getHttpServletRequest().getLocales(); // Do your work with locales _enum here return request.getLocale(); }; getLocales() returns what you are looking for, in my case it is : [fr, sv, ar, bg, zh_CN, it, en] 2009/10/19 Per Newgro per.new...@gmx.ch Hi Olivier, you wrote exactly what i did. But if you check the extraction of locale from request to provide it in session, you can see that only first accepted language is evaluated and used if not-null. But if you assume that first accpeted language is CHINESE and second is FRENCH and the application is supporting FRENCH you don't have any chance to get the second locale. And thats my problem. Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: inmethod IDataSource
The total count can not depend on query parameters. It is the total count of all books that match the filter, regardless of offset and pagesize. -Matej On Mon, Oct 19, 2009 at 4:16 PM, Linda van der Pal lvd...@heritageagenturen.nl wrote: The trouble is that getting the books is dependent on the queryparam variable. Matej Knopp wrote: Does it also happen when you call result.setTotalCount(books.size()) before calling getCount()? From IDataSource: /** * Sets the total items count. Alternatively, if the total item count can't be determined, * either {...@link #MORE_ITEMS} or {...@link #NO_MORE_ITEMS} constant can be used to indicate * whether there are more items left or not. * * If the real items count is specified, it might affect the result of * {...@link IQuery#getCount()}, so it is preferred to call this method before calling * {...@link #setItems(Iterator)}. * * @param count * the total count of items */ public void setTotalCount(int count); -Matej On Mon, Oct 19, 2009 at 2:52 PM, Linda van der Pal lvd...@heritageagenturen.nl wrote: Hello, I have a problem with the inmethod IDataSource. I've provided my own implementation for it, including implementing the query method. But for some reason, it only seems to want to return one row, while I know there should be two. Can anybody tell me what I might be doing wrong? It must be that I've made a stupid mistake somewhere, because I did get it working for two other kinds of data. I simply don't see what I did differently. Here's the query method. It's the initializing of the QueryParam variable that fails. When I add in the line that I've commented out just below it, I do get the two rows I'm expecting. public void query(final IQuery query, final IQueryResult result) { String sortProperty = null; boolean sortAsc = true; // is there any sorting if (query.getSortState().getColumns().size() 0) { // get the most relevant column ISortStateColumn state = query.getSortState().getColumns().get(0); // get the column sort properties sortProperty = convertToFieldName(state.getPropertyName()); sortAsc = state.getDirection() == IGridSortState.Direction.ASC; } ListBook resultList; try { filter.setSort(sortProperty); filter.setSortOrder(sortAsc); // HERE'S MY PROBLEM: query.getCount() is 1 for some reason QueryParam qp = new QueryParam(query.getFrom(), query.getCount()); //QueryParam qp = new QueryParam(0, 0); ListBook books = new BookRetriever().getAllBooks(filter, qp); // determine the total count result.setTotalCount(books.size()); resultList = books; } catch (Exception e) { resultList = new ArrayListBook(); } result.setItems(resultList.iterator()); } Regards, Linda - 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 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.422 / Virus Database: 270.14.21/2445 - Release Date: 10/19/09 06:40:00 - 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
How to add a dynamic HTML comment ?
Hi list, I'm trying to add to my page header a comment that contains some informations extracted from my app, like this : !-- App Version 1.0.0 - Build: 2009-10-19 16:20:00 -- But I just can't find a way to do this in Wicket : a component inside a comment is not recognised, and there is no Comment component. Anyone got an idea of how to do this ? thx Olivier
Re: How to add a dynamic HTML comment ?
add(new Label(comment, !-- foo bar --).setEscapeModelStrings(false)); -- Jeremy Thomerson http://www.wickettraining.com On Mon, Oct 19, 2009 at 9:20 AM, Olivier Bourgeois olivier.bourgeois.pro@ gmail.com wrote: Hi list, I'm trying to add to my page header a comment that contains some informations extracted from my app, like this : !-- App Version 1.0.0 - Build: 2009-10-19 16:20:00 -- But I just can't find a way to do this in Wicket : a component inside a comment is not recognised, and there is no Comment component. Anyone got an idea of how to do this ? thx Olivier
Re: inmethod IDataSource
The trouble is that getting the books is dependent on the queryparam variable. Matej Knopp wrote: Does it also happen when you call result.setTotalCount(books.size()) before calling getCount()? From IDataSource: /** * Sets the total items count. Alternatively, if the total item count can't be determined, * either {...@link #MORE_ITEMS} or {...@link #NO_MORE_ITEMS} constant can be used to indicate * whether there are more items left or not. * * If the real items count is specified, it might affect the result of * {...@link IQuery#getCount()}, so it is preferred to call this method before calling * {...@link #setItems(Iterator)}. * * @param count *the total count of items */ public void setTotalCount(int count); -Matej On Mon, Oct 19, 2009 at 2:52 PM, Linda van der Pal lvd...@heritageagenturen.nl wrote: Hello, I have a problem with the inmethod IDataSource. I've provided my own implementation for it, including implementing the query method. But for some reason, it only seems to want to return one row, while I know there should be two. Can anybody tell me what I might be doing wrong? It must be that I've made a stupid mistake somewhere, because I did get it working for two other kinds of data. I simply don't see what I did differently. Here's the query method. It's the initializing of the QueryParam variable that fails. When I add in the line that I've commented out just below it, I do get the two rows I'm expecting. public void query(final IQuery query, final IQueryResult result) { String sortProperty = null; boolean sortAsc = true; // is there any sorting if (query.getSortState().getColumns().size() 0) { // get the most relevant column ISortStateColumn state = query.getSortState().getColumns().get(0); // get the column sort properties sortProperty = convertToFieldName(state.getPropertyName()); sortAsc = state.getDirection() == IGridSortState.Direction.ASC; } ListBook resultList; try { filter.setSort(sortProperty); filter.setSortOrder(sortAsc); // HERE'S MY PROBLEM: query.getCount() is 1 for some reason QueryParam qp = new QueryParam(query.getFrom(), query.getCount()); //QueryParam qp = new QueryParam(0, 0); ListBook books = new BookRetriever().getAllBooks(filter, qp); // determine the total count result.setTotalCount(books.size()); resultList = books; } catch (Exception e) { resultList = new ArrayListBook(); } result.setItems(resultList.iterator()); } Regards, Linda - 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 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.422 / Virus Database: 270.14.21/2445 - Release Date: 10/19/09 06:40:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: inmethod IDataSource
Thanks! I knew I was doing something stupid. :) It's working now. Linda Matej Knopp wrote: The total count can not depend on query parameters. It is the total count of all books that match the filter, regardless of offset and pagesize. -Matej On Mon, Oct 19, 2009 at 4:16 PM, Linda van der Pal lvd...@heritageagenturen.nl wrote: The trouble is that getting the books is dependent on the queryparam variable. Matej Knopp wrote: Does it also happen when you call result.setTotalCount(books.size()) before calling getCount()? From IDataSource: /** * Sets the total items count. Alternatively, if the total item count can't be determined, * either {...@link #MORE_ITEMS} or {...@link #NO_MORE_ITEMS} constant can be used to indicate * whether there are more items left or not. * * If the real items count is specified, it might affect the result of * {...@link IQuery#getCount()}, so it is preferred to call this method before calling * {...@link #setItems(Iterator)}. * * @param count *the total count of items */ public void setTotalCount(int count); -Matej On Mon, Oct 19, 2009 at 2:52 PM, Linda van der Pal lvd...@heritageagenturen.nl wrote: Hello, I have a problem with the inmethod IDataSource. I've provided my own implementation for it, including implementing the query method. But for some reason, it only seems to want to return one row, while I know there should be two. Can anybody tell me what I might be doing wrong? It must be that I've made a stupid mistake somewhere, because I did get it working for two other kinds of data. I simply don't see what I did differently. Here's the query method. It's the initializing of the QueryParam variable that fails. When I add in the line that I've commented out just below it, I do get the two rows I'm expecting. public void query(final IQuery query, final IQueryResult result) { String sortProperty = null; boolean sortAsc = true; // is there any sorting if (query.getSortState().getColumns().size() 0) { // get the most relevant column ISortStateColumn state = query.getSortState().getColumns().get(0); // get the column sort properties sortProperty = convertToFieldName(state.getPropertyName()); sortAsc = state.getDirection() == IGridSortState.Direction.ASC; } ListBook resultList; try { filter.setSort(sortProperty); filter.setSortOrder(sortAsc); // HERE'S MY PROBLEM: query.getCount() is 1 for some reason QueryParam qp = new QueryParam(query.getFrom(), query.getCount()); //QueryParam qp = new QueryParam(0, 0); ListBook books = new BookRetriever().getAllBooks(filter, qp); // determine the total count result.setTotalCount(books.size()); resultList = books; } catch (Exception e) { resultList = new ArrayListBook(); } result.setItems(resultList.iterator()); } Regards, Linda - 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 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.422 / Virus Database: 270.14.21/2445 - Release Date: 10/19/09 06:40:00 - 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 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.422 / Virus Database: 270.14.21/2445 - Release Date: 10/19/09 06:40:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to add a dynamic HTML comment ?
Ha thanks Jeremy ! And I didn't think of that :( 2009/10/19 Jeremy Thomerson jer...@wickettraining.com add(new Label(comment, !-- foo bar --).setEscapeModelStrings(false)); -- Jeremy Thomerson http://www.wickettraining.com
Re: How to add a dynamic HTML comment ?
El lun, 19-10-2009 a las 09:29 -0500, Jeremy Thomerson escribió: add(new Label(comment, !-- foo bar --).setEscapeModelStrings(false)); + .setRenderBodyOnly(true) -- Jeremy Thomerson http://www.wickettraining.com On Mon, Oct 19, 2009 at 9:20 AM, Olivier Bourgeois olivier.bourgeois.pro@ gmail.com wrote: Hi list, I'm trying to add to my page header a comment that contains some informations extracted from my app, like this : !-- App Version 1.0.0 - Build: 2009-10-19 16:20:00 -- But I just can't find a way to do this in Wicket : a component inside a comment is not recognised, and there is no Comment component. Anyone got an idea of how to do this ? thx Olivier - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Howto accept other then first locale in HTTP header Accept-Language?
Olivier Bourgeois schrieb: Well, you can't change the behaviour of ServletRequest.getLocale() unless you want to patch your servlet container :) But you make me think it would be great in the Servlet API to have something like setAcceptedLocales(Enumeration e) and let the servlet container do the work of matching the browser locale with your application supported locales. Anyway, it's out of Wicket's scope :-) What you can do is do the work in your overloaded WebSession.getLocale() : @Override public Locale getLocale() { Enumeration _enum = ((WebRequest) request).getHttpServletRequest().getLocales(); // Do your work with locales _enum here return request.getLocale(); }; getLocales() returns what you are looking for, in my case it is : [fr, sv, ar, bg, zh_CN, it, en] Ok didn't checked that in the application itself until now. In my tests it isn't working because MockHttpRequest.getLocales only returns the first locale. So problem maybe related to test. But with my test-first approach i hit the wall on that. It seems that i have to add a jira for it. Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [ANN] wicket-dnd project
It looks great, men! Which AJAX framework do you use? Regards, Pierre On Tue, Oct 13, 2009 at 3:55 PM, Doug Leeper douglee...@yahoo.com wrote: Thanks Sven! Got it working. -- View this message in context: http://www.nabble.com/-ANN--wicket-dnd-project-tp25727819p25873355.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Sans amis était le grand maître des mondes, Eprouvait manque, ce pour quoi il créa les esprits, Miroirs bienveillants de sa béatitude. Mais au vrai, il ne trouva aucun égal, Du calice du royaume total des âmes Ecume jusqu'à lui l'infinité. (Schiller, l'amitié)
Showing session-stored messages in another window/tab
Hi: We've implemented the classic registration process: - user registers - app sends him an email with a generated link - user clicks that link, which it's oppened in a new window/tab - The UserActivationPage that responds to that link request does: this.info(User account activated); setResponsePage(LoginPage.class); (so the user can log in for the first time) The problem is that the message is only shown when the link is oppened in the same window/tab the user has previously registered. After trying a few things, we ended up doing this.getPageSettings().setAutomaticMultiWindowSupport(false); in MyApplication, which seems to work (we think is related to wicket using the same session, but we're not sure). However, we're not sure whether it's the best way of solving this. Any other ideas or comments? Thanks, Esteban - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Showing session-stored messages in another window/tab
But as I see in org.apache.wicket.Component.info(String), that method already adds that message to the session. Wouldn't be the same? Vytautas Racelis escribió: Hi, maybe getSession().info http://this.info/(User account activated); would help On Mon, Oct 19, 2009 at 8:08 PM, Esteban Masoero emaso...@getsense.com.arwrote: Hi: We've implemented the classic registration process: - user registers - app sends him an email with a generated link - user clicks that link, which it's oppened in a new window/tab - The UserActivationPage that responds to that link request does: this.info(User account activated); setResponsePage(LoginPage.class); (so the user can log in for the first time) The problem is that the message is only shown when the link is oppened in the same window/tab the user has previously registered. After trying a few things, we ended up doing this.getPageSettings().setAutomaticMultiWindowSupport(false); in MyApplication, which seems to work (we think is related to wicket using the same session, but we're not sure). However, we're not sure whether it's the best way of solving this. Any other ideas or comments? Thanks, Esteban - 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
uploaded files in page instance
I have some huge files upto 50Mb in side my page instance , I have to save them in page instance and I cannot reload it everytime from database becasue other users might delete the file . I am getting java.lang.OutOfMemoryError , only way I can resolve this is increasing heap size but Is this a bad idea storing files upto 50Mb inside page instance ?
Reusable components and wicket:id
Hi, We are building a simple survey with Wicket. Essentially, we have a lot of RadioGroup components repeated all over the main survey page. Those components are in fact the same thing (to score some item), but obviously, they reffer to different subjects/groups. For example: Are you happy with X? In doing job A: ( ) very happy ( ) not so much ( ) sucks In doing job B: ( ) very happy ( ) not so much ( ) sucks Are you happy with Y? In doing job A: ( ) very happy ( ) not so much ( ) sucks So we decided to make a reusable component (a panel) for the score input, and repeat it as much as we needed. We also have our survey page with a feedback panel and a form. Inside that form we include the panel many times, one for each item. But the required-field-feedback shows the same wicket:id for a bunch of fields, which isn't what we want. We need a unique wicket:id for each instance of the score input. E.G. Our Panel is like this: ... tr wicket:container wicket:id=score tdinput type=radio wicket:id=optGood//td tdinput type=radio wicket:id=optNotSoMuch//td tdinput type=radio wicket:id=optSucks//td /wicket:container /tr ... And our feedback is like this: * Field 'score' is required. * Field 'score' is required. * Field 'score' is required. * Field 'score' is required. How can I solve this? Thanks Tom; - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: uploaded files in page instance
store them in a temp directory and only give your page the filename. -igor On Mon, Oct 19, 2009 at 10:55 AM, tubin gen fachh...@gmail.com wrote: I have some huge files upto 50Mb in side my page instance , I have to save them in page instance and I cannot reload it everytime from database becasue other users might delete the file . I am getting java.lang.OutOfMemoryError , only way I can resolve this is increasing heap size but Is this a bad idea storing files upto 50Mb inside page instance ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Reusable components and wicket:id
call radiogroup.setlabel() -igor On Mon, Oct 19, 2009 at 10:55 AM, Tomás Rossi tro...@mecon.gov.ar wrote: Hi, We are building a simple survey with Wicket. Essentially, we have a lot of RadioGroup components repeated all over the main survey page. Those components are in fact the same thing (to score some item), but obviously, they reffer to different subjects/groups. For example: Are you happy with X? In doing job A: ( ) very happy ( ) not so much ( ) sucks In doing job B: ( ) very happy ( ) not so much ( ) sucks Are you happy with Y? In doing job A: ( ) very happy ( ) not so much ( ) sucks So we decided to make a reusable component (a panel) for the score input, and repeat it as much as we needed. We also have our survey page with a feedback panel and a form. Inside that form we include the panel many times, one for each item. But the required-field-feedback shows the same wicket:id for a bunch of fields, which isn't what we want. We need a unique wicket:id for each instance of the score input. E.G. Our Panel is like this: ... tr wicket:container wicket:id=score tdinput type=radio wicket:id=optGood//td tdinput type=radio wicket:id=optNotSoMuch//td tdinput type=radio wicket:id=optSucks//td /wicket:container /tr ... And our feedback is like this: * Field 'score' is required. * Field 'score' is required. * Field 'score' is required. * Field 'score' is required. How can I solve this? Thanks Tom; - 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: uploaded files in page instance
I show these files in almost all my pages.So every page before it loads has to create all these files in temp folder , please suggest me what should be the identifier to recognize these files ,I actually have these files inside PancelCachingTab , and this tab gets loaded only when user clicks on on it for the first time. igor.vaynberg wrote: store them in a temp directory and only give your page the filename. -igor On Mon, Oct 19, 2009 at 10:55 AM, tubin gen fachh...@gmail.com wrote: I have some huge files upto 50Mb in side my page instance , I have to save them in page instance and I cannot reload it everytime from database becasue other users might delete the file . I am getting java.lang.OutOfMemoryError , only way I can resolve this is increasing heap size but Is this a bad idea storing files upto 50Mb inside page instance ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25963009.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Showing session-stored messages in another window/tab
Well, Component.info takes WebPage as reporter. Session.info reporter is null. As i understand this will be rendered in session scope instead of single page. But i may be wrong :) Esteban Masoero wrote: But as I see in org.apache.wicket.Component.info(String), that method already adds that message to the session. Wouldn't be the same? Vytautas Racelis escribió: Hi, maybe getSession().info http://this.info/(User account activated); would help On Mon, Oct 19, 2009 at 8:08 PM, Esteban Masoero emaso...@getsense.com.arwrote: Hi: We've implemented the classic registration process: - user registers - app sends him an email with a generated link - user clicks that link, which it's oppened in a new window/tab - The UserActivationPage that responds to that link request does: this.info(User account activated); setResponsePage(LoginPage.class); (so the user can log in for the first time) The problem is that the message is only shown when the link is oppened in the same window/tab the user has previously registered. After trying a few things, we ended up doing this.getPageSettings().setAutomaticMultiWindowSupport(false); in MyApplication, which seems to work (we think is related to wicket using the same session, but we're not sure). However, we're not sure whether it's the best way of solving this. Any other ideas or comments? Thanks, Esteban - 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 -- Regards, Vytautas Racelis --- phone:+370-600-34389 e-mail: turi...@gmail.com www.xaloon.org www.leenle.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Showing session-stored messages in another window/tab
Sadly, you are not right, because I tried what you suggested and the error kept appearing. Anyway, I just wanted to know whether the solution I used was the proper one for this occasion. I didn't say that I'm using wicket 1.3.7. Maybe that has something to do with it? Thanks, Esteban Vytautas Racelis escribió: Well, Component.info takes WebPage as reporter. Session.info reporter is null. As i understand this will be rendered in session scope instead of single page. But i may be wrong :) Esteban Masoero wrote: But as I see in org.apache.wicket.Component.info(String), that method already adds that message to the session. Wouldn't be the same? Vytautas Racelis escribió: Hi, maybe getSession().info http://this.info/(User account activated); would help On Mon, Oct 19, 2009 at 8:08 PM, Esteban Masoero emaso...@getsense.com.arwrote: Hi: We've implemented the classic registration process: - user registers - app sends him an email with a generated link - user clicks that link, which it's oppened in a new window/tab - The UserActivationPage that responds to that link request does: this.info(User account activated); setResponsePage(LoginPage.class); (so the user can log in for the first time) The problem is that the message is only shown when the link is oppened in the same window/tab the user has previously registered. After trying a few things, we ended up doing this.getPageSettings().setAutomaticMultiWindowSupport(false); in MyApplication, which seems to work (we think is related to wicket using the same session, but we're not sure). However, we're not sure whether it's the best way of solving this. Any other ideas or comments? Thanks, Esteban - 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: Showing session-stored messages in another window/tab
you want the message to show on the loginpage or on the activation page? -igor On Mon, Oct 19, 2009 at 10:08 AM, Esteban Masoero emaso...@getsense.com.ar wrote: Hi: We've implemented the classic registration process: - user registers - app sends him an email with a generated link - user clicks that link, which it's oppened in a new window/tab - The UserActivationPage that responds to that link request does: this.info(User account activated); setResponsePage(LoginPage.class); (so the user can log in for the first time) The problem is that the message is only shown when the link is oppened in the same window/tab the user has previously registered. After trying a few things, we ended up doing this.getPageSettings().setAutomaticMultiWindowSupport(false); in MyApplication, which seems to work (we think is related to wicket using the same session, but we're not sure). However, we're not sure whether it's the best way of solving this. Any other ideas or comments? Thanks, Esteban - 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: Showing session-stored messages in another window/tab
- app sends him an email with a generated link can this link encode an parameter like:isActivationFromEmail ? so: loginPageOrActivationPage.add(new Label(id,User account activated).setVisible(getPageParameters().get(isActivationFromEmail)); On Mon, Oct 19, 2009 at 4:24 PM, Esteban Masoero emaso...@getsense.com.arwrote: Sadly, you are not right, because I tried what you suggested and the error kept appearing. Anyway, I just wanted to know whether the solution I used was the proper one for this occasion. I didn't say that I'm using wicket 1.3.7. Maybe that has something to do with it? Thanks, Esteban Vytautas Racelis escribió: Well, Component.info takes WebPage as reporter. Session.info reporter is null. As i understand this will be rendered in session scope instead of single page. But i may be wrong :) Esteban Masoero wrote: But as I see in org.apache.wicket.Component.info(String), that method already adds that message to the session. Wouldn't be the same? Vytautas Racelis escribió: Hi, maybe getSession().info http://this.info/(User account activated); would help On Mon, Oct 19, 2009 at 8:08 PM, Esteban Masoero emaso...@getsense.com.arwrote: Hi: We've implemented the classic registration process: - user registers - app sends him an email with a generated link - user clicks that link, which it's oppened in a new window/tab - The UserActivationPage that responds to that link request does: this.info(User account activated); setResponsePage(LoginPage.class); (so the user can log in for the first time) The problem is that the message is only shown when the link is oppened in the same window/tab the user has previously registered. After trying a few things, we ended up doing this.getPageSettings().setAutomaticMultiWindowSupport(false); in MyApplication, which seems to work (we think is related to wicket using the same session, but we're not sure). However, we're not sure whether it's the best way of solving this. Any other ideas or comments? Thanks, Esteban - 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 -- Pedro Henrique Oliveira dos Santos
Re: Reusable components and wicket:id
Then I'm unable to use the properties file for tweaking the string in question. What is the beauty of panels if they don't prefix its internal ids automatically? Or am I getting it all wrong... :S Tom; Igor Vaynberg escribió: call radiogroup.setlabel() -igor On Mon, Oct 19, 2009 at 10:55 AM, Tomás Rossi tro...@mecon.gov.ar wrote: Hi, We are building a simple survey with Wicket. Essentially, we have a lot of RadioGroup components repeated all over the main survey page. Those components are in fact the same thing (to score some item), but obviously, they reffer to different subjects/groups. For example: Are you happy with X? In doing job A: ( ) very happy ( ) not so much ( ) sucks In doing job B: ( ) very happy ( ) not so much ( ) sucks Are you happy with Y? In doing job A: ( ) very happy ( ) not so much ( ) sucks So we decided to make a reusable component (a panel) for the score input, and repeat it as much as we needed. We also have our survey page with a feedback panel and a form. Inside that form we include the panel many times, one for each item. But the required-field-feedback shows the same wicket:id for a bunch of fields, which isn't what we want. We need a unique wicket:id for each instance of the score input. E.G. Our Panel is like this: ... tr wicket:container wicket:id=score tdinput type=radio wicket:id=optGood//td tdinput type=radio wicket:id=optNotSoMuch//td tdinput type=radio wicket:id=optSucks//td /wicket:container /tr ... And our feedback is like this: * Field 'score' is required. * Field 'score' is required. * Field 'score' is required. * Field 'score' is required. How can I solve this? Thanks Tom; - 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: Showing session-stored messages in another window/tab
I want it to be shown in the LoginPage, because the activation page does not show anything, it only activates the user. I tried something like: LoginPage page = new LoginPage(); page.info(User account activated); setResponsePage(page); but it didn't work. Anyway, as I know, in order to leave a feedback message that needs to be shown in the next whateverPage, you'll need to leave it to the session. Am I missing something? Thanks, Esteban Igor Vaynberg escribió: you want the message to show on the loginpage or on the activation page? -igor On Mon, Oct 19, 2009 at 10:08 AM, Esteban Masoero emaso...@getsense.com.ar wrote: Hi: We've implemented the classic registration process: - user registers - app sends him an email with a generated link - user clicks that link, which it's oppened in a new window/tab - The UserActivationPage that responds to that link request does: this.info(User account activated); setResponsePage(LoginPage.class); (so the user can log in for the first time) The problem is that the message is only shown when the link is oppened in the same window/tab the user has previously registered. After trying a few things, we ended up doing this.getPageSettings().setAutomaticMultiWindowSupport(false); in MyApplication, which seems to work (we think is related to wicket using the same session, but we're not sure). However, we're not sure whether it's the best way of solving this. Any other ideas or comments? Thanks, Esteban - 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: Reusable components and wicket:id
Actually the panel wicket id is an parameter for panel constructor, can you some code? On Mon, Oct 19, 2009 at 5:07 PM, Tomás Rossi tro...@mecon.gov.ar wrote: Then I'm unable to use the properties file for tweaking the string in question. What is the beauty of panels if they don't prefix its internal ids automatically? Or am I getting it all wrong... :S Tom; Igor Vaynberg escribió: call radiogroup.setlabel() -igor On Mon, Oct 19, 2009 at 10:55 AM, Tomás Rossi tro...@mecon.gov.ar wrote: Hi, We are building a simple survey with Wicket. Essentially, we have a lot of RadioGroup components repeated all over the main survey page. Those components are in fact the same thing (to score some item), but obviously, they reffer to different subjects/groups. For example: Are you happy with X? In doing job A: ( ) very happy ( ) not so much ( ) sucks In doing job B: ( ) very happy ( ) not so much ( ) sucks Are you happy with Y? In doing job A: ( ) very happy ( ) not so much ( ) sucks So we decided to make a reusable component (a panel) for the score input, and repeat it as much as we needed. We also have our survey page with a feedback panel and a form. Inside that form we include the panel many times, one for each item. But the required-field-feedback shows the same wicket:id for a bunch of fields, which isn't what we want. We need a unique wicket:id for each instance of the score input. E.G. Our Panel is like this: ... tr wicket:container wicket:id=score tdinput type=radio wicket:id=optGood//td tdinput type=radio wicket:id=optNotSoMuch//td tdinput type=radio wicket:id=optSucks//td /wicket:container /tr ... And our feedback is like this: * Field 'score' is required. * Field 'score' is required. * Field 'score' is required. * Field 'score' is required. How can I solve this? Thanks Tom; - 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 -- Pedro Henrique Oliveira dos Santos
Re: Showing session-stored messages in another window/tab
I haven't thought of that. Thanks, that's another altenative. However, I'll like yo see whether there's a solution using session messages, because I think of them as a nicer alternative. If i don't find a way of achieving this, I'll use the parameter option. thanks, Esteban Pedro Santos escribió: - app sends him an email with a generated link can this link encode an parameter like:isActivationFromEmail ? so: loginPageOrActivationPage.add(new Label(id,User account activated).setVisible(getPageParameters().get(isActivationFromEmail)); On Mon, Oct 19, 2009 at 4:24 PM, Esteban Masoero emaso...@getsense.com.arwrote: Sadly, you are not right, because I tried what you suggested and the error kept appearing. Anyway, I just wanted to know whether the solution I used was the proper one for this occasion. I didn't say that I'm using wicket 1.3.7. Maybe that has something to do with it? Thanks, Esteban Vytautas Racelis escribió: Well, Component.info takes WebPage as reporter. Session.info reporter is null. As i understand this will be rendered in session scope instead of single page. But i may be wrong :) Esteban Masoero wrote: But as I see in org.apache.wicket.Component.info(String), that method already adds that message to the session. Wouldn't be the same? Vytautas Racelis escribió: Hi, maybe getSession().info http://this.info/(User account activated); would help On Mon, Oct 19, 2009 at 8:08 PM, Esteban Masoero emaso...@getsense.com.arwrote: Hi: We've implemented the classic registration process: - user registers - app sends him an email with a generated link - user clicks that link, which it's oppened in a new window/tab - The UserActivationPage that responds to that link request does: this.info(User account activated); setResponsePage(LoginPage.class); (so the user can log in for the first time) The problem is that the message is only shown when the link is oppened in the same window/tab the user has previously registered. After trying a few things, we ended up doing this.getPageSettings().setAutomaticMultiWindowSupport(false); in MyApplication, which seems to work (we think is related to wicket using the same session, but we're not sure). However, we're not sure whether it's the best way of solving this. Any other ideas or comments? Thanks, Esteban - 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: uploaded files in page instance
I have several pages which has links to uploaded files to download, I load this from database and save it inside page instance as instance variable . When user clicks on the download link I retrieve the byte array from the page instance and call download. Several user have different instances of same pages and all these pages have these huge files byte[] . Sure this will cause Outof memory issues. To resolve this I have to use temp folder , every time a page instance gets created I have to create temp folder to save these uploaded files bytes with a proper name so that I can know this folder is for this user and this page and this instance. I am asking do I have to create a naming factory which names the folder for every page instance ? or is there anything available which I can use a as a folder name? fachhoch wrote: I show these files in almost all my pages.So every page before it loads has to create all these files in temp folder , please suggest me what should be the identifier to recognize these files ,I actually have these files inside PancelCachingTab , and this tab gets loaded only when user clicks on on it for the first time. igor.vaynberg wrote: store them in a temp directory and only give your page the filename. -igor On Mon, Oct 19, 2009 at 10:55 AM, tubin gen fachh...@gmail.com wrote: I have some huge files upto 50Mb in side my page instance , I have to save them in page instance and I cannot reload it everytime from database becasue other users might delete the file . I am getting java.lang.OutOfMemoryError , only way I can resolve this is increasing heap size but Is this a bad idea storing files upto 50Mb inside page instance ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964309.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: uploaded files in page instance
Why are you loading the files from the DB before the user asks for them (clicks the download link)? Why are you saving the byte arrays in the page instance? If you really must load them from the DB before the user clicks the download link, save them to a temp file and save only the path of the file in the page (like Igor originally said). -- Jeremy Thomerson http://www.wickettraining.com On Mon, Oct 19, 2009 at 2:40 PM, fachhoch fachh...@gmail.com wrote: I have several pages which has links to uploaded files to download, I load this from database and save it inside page instance as instance variable . When user clicks on the download link I retrieve the byte array from the page instance and call download. Several user have different instances of same pages and all these pages have these huge files byte[] . Sure this will cause Outof memory issues. To resolve this I have to use temp folder , every time a page instance gets created I have to create temp folder to save these uploaded files bytes with a proper name so that I can know this folder is for this user and this page and this instance. I am asking do I have to create a naming factory which names the folder for every page instance ? or is there anything available which I can use a as a folder name? fachhoch wrote: I show these files in almost all my pages.So every page before it loads has to create all these files in temp folder , please suggest me what should be the identifier to recognize these files ,I actually have these files inside PancelCachingTab , and this tab gets loaded only when user clicks on on it for the first time. igor.vaynberg wrote: store them in a temp directory and only give your page the filename. -igor On Mon, Oct 19, 2009 at 10:55 AM, tubin gen fachh...@gmail.com wrote: I have some huge files upto 50Mb in side my page instance , I have to save them in page instance and I cannot reload it everytime from database becasue other users might delete the file . I am getting java.lang.OutOfMemoryError , only way I can resolve this is increasing heap size but Is this a bad idea storing files upto 50Mb inside page instance ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964309.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [ANN] wicket-dnd project
Well, wicket-dnd combines Wicket's standard AJAX support, prototype's Javascript enhancements and a few custom functions to move HTML elements around. I'm glad you like it. Sven Pierre Goupil wrote: It looks great, men! Which AJAX framework do you use? Regards, Pierre On Tue, Oct 13, 2009 at 3:55 PM, Doug Leeper douglee...@yahoo.com wrote: Thanks Sven! Got it working. -- View this message in context: http://www.nabble.com/-ANN--wicket-dnd-project-tp25727819p25873355.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: uploaded files in page instance
Why are you saving the byte arrays in the page instance? I show these files to user with read-only permission , so this user can just view these files ,the owner of these files can delete them anytime , so If I go to database , upon user click , this file might have been deleted by the user , or when user tries to access this file the owner might be deleting this file , to avoid such issues I am loading all the bytes to page instance , so no concurrent access issues . to save them inside temp folders can I ask the page to give some identifier which I can use to name the folder which contains all the files ? or do I have to create my own identifier ? jthomerson wrote: Why are you loading the files from the DB before the user asks for them (clicks the download link)? Why are you saving the byte arrays in the page instance? If you really must load them from the DB before the user clicks the download link, save them to a temp file and save only the path of the file in the page (like Igor originally said). -- Jeremy Thomerson http://www.wickettraining.com On Mon, Oct 19, 2009 at 2:40 PM, fachhoch fachh...@gmail.com wrote: I have several pages which has links to uploaded files to download, I load this from database and save it inside page instance as instance variable . When user clicks on the download link I retrieve the byte array from the page instance and call download. Several user have different instances of same pages and all these pages have these huge files byte[] . Sure this will cause Outof memory issues. To resolve this I have to use temp folder , every time a page instance gets created I have to create temp folder to save these uploaded files bytes with a proper name so that I can know this folder is for this user and this page and this instance. I am asking do I have to create a naming factory which names the folder for every page instance ? or is there anything available which I can use a as a folder name? fachhoch wrote: I show these files in almost all my pages.So every page before it loads has to create all these files in temp folder , please suggest me what should be the identifier to recognize these files ,I actually have these files inside PancelCachingTab , and this tab gets loaded only when user clicks on on it for the first time. igor.vaynberg wrote: store them in a temp directory and only give your page the filename. -igor On Mon, Oct 19, 2009 at 10:55 AM, tubin gen fachh...@gmail.com wrote: I have some huge files upto 50Mb in side my page instance , I have to save them in page instance and I cannot reload it everytime from database becasue other users might delete the file . I am getting java.lang.OutOfMemoryError , only way I can resolve this is increasing heap size but Is this a bad idea storing files upto 50Mb inside page instance ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964309.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964541.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Reusable components and wicket:id
Here goes the java code... RadioButtonGenerico.java (means GenericRadioButton): public class RadioButtonGenericoT extends RadioGroupT { private static final long serialVersionUID = -1725627853431547878L; public RadioButtonGenerico(String id, ListString opciones, IModelT modelo) { super(id, modelo); for (int i = 0; i opciones.size(); i++) { add(new RadioInteger(id + i, new ModelInteger(i))); } } } PanelEncuesta.java (means SurveyPanel): public class PanelEncuesta extends FormComponentPanelDatosEncuesta { private static final long serialVersionUID = -1545571698439481842L; public PanelEncuesta(String id, IModelDatosEncuesta modelo) { super(id, modelo); add(new RadioButtonGenericoDatosEncuesta(rapidezAtencion, DatosEncuesta.CALIFICACIONES, new PropertyModelDatosEncuesta(modelo, rapidezAtencion)).setRequired(true)); add(new RadioButtonGenericoDatosEncuesta(explicacionClara, DatosEncuesta.CALIFICACIONES, new PropertyModelDatosEncuesta(modelo, explicacionClara)).setRequired(true)); add(new RadioButtonGenericoDatosEncuesta(resolucionProblema, DatosEncuesta.CALIFICACIONES, new PropertyModelDatosEncuesta(modelo, resolucionProblema)).setRequired(true)); } } PantallaEncuesta.java: (means SurveyScreen): public class PantallaEncuesta extends WebPage { public PantallaEncuesta() { add(new FeedbackPanel(feedback)); add(new FormEncuesta(formEncuesta)); } public static class FormEncuesta extends FormDatosEncuesta { // (Means SurveyForm) private static final long serialVersionUID = 8582266005577827473L; // Modelo para las respuestas respecto a la atención éfonica. private final DatosEncuesta datosEncuestaTelefonico = new DatosEncuesta(); // Modelo para las respuestas respecto a la atención personal. private final DatosEncuesta datosEncuestaPersonal = new DatosEncuesta(); // Modelo para los datos optativos de la encuesta. private final DatosOptativos datosOptativos = new DatosOptativos(); private CaptchaImageResource captcha = new CaptchaImageResource(); private final ValueMap claveCaptcha = new ValueMap(); public FormEncuesta(String id) { super(id); ... add(new PanelEncuesta(panelTelefonico, new ModelDatosEncuesta(datosEncuestaTelefonico))); add(new PanelEncuesta(panelPersonal, new ModelDatosEncuesta(datosEncuestaPersonal))); ... } ... Pedro Santos escribió: Actually the panel wicket id is an parameter for panel constructor, can you some code? On Mon, Oct 19, 2009 at 5:07 PM, Tomás Rossi tro...@mecon.gov.ar wrote: Then I'm unable to use the properties file for tweaking the string in question. What is the beauty of panels if they don't prefix its internal ids automatically? Or am I getting it all wrong... :S Tom; Igor Vaynberg escribió: call radiogroup.setlabel() -igor On Mon, Oct 19, 2009 at 10:55 AM, Tomás Rossi tro...@mecon.gov.ar wrote: Hi, We are building a simple survey with Wicket. Essentially, we have a lot of RadioGroup components repeated all over the main survey page. Those components are in fact the same thing (to score some item), but obviously, they reffer to different subjects/groups. For example: Are you happy with X? In doing job A: ( ) very happy ( ) not so much ( ) sucks In doing job B: ( ) very happy ( ) not so much ( ) sucks Are you happy with Y? In doing job A: ( ) very happy ( ) not so much ( ) sucks So we decided to make a reusable component (a panel) for the score input, and repeat it as much as we needed. We also have our survey page with a feedback panel and a form. Inside that form we include the panel many times, one for each item. But the required-field-feedback shows the same wicket:id for a bunch of fields, which isn't what we want. We need a unique wicket:id for each instance of the score input. E.G. Our Panel is like this: ... tr wicket:container wicket:id=score tdinput type=radio wicket:id=optGood//td tdinput type=radio wicket:id=optNotSoMuch//td tdinput type=radio wicket:id=optSucks//td /wicket:container /tr ... And our feedback is like this: * Field 'score' is required. * Field 'score' is required. * Field 'score' is required. * Field 'score' is required. How can I solve this? Thanks Tom; - 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: Highlight some words in the markup content
I'd be interested to know if anyone else is using this technique for search highlighting with a DataTable. http://pastebin.com/m5446797d The data in my grid may contain HTML, so that makes it considerably more complicated (my first attempt didn't address this problem). I'd love to know if someone else has a better/simpler way, although this does appear to work fine, it took a day to come up with. In general, I kind of like the idea of separating this concern from the model, whose purpose is just to get the data, and think of this search highlighting as more of a decorator that applies to the entire grid rather than any particular column, since I've got several PropertyColumn subclasses (LinkPropertyColumn, ImagePropertyColumn, NonEscapedHTMLPropertyColumn, ...etc). Hope this helps someone else. Thanks, -- Jim. On Fri, Oct 24, 2008 at 1:06 PM, Jim Pinkham pinkh...@gmail.com wrote: I've got a few embellishments to that idea that others might enjoy. These include the ability to use on non-string properties, and caching the last compiled pattern (maybe uses a bit less CPU than replaceAll each time). protected static class HighlightingModel extends LoadableDetachableModel { private static final long serialVersionUID = 1L; private transient IModel text; private transient IModel searchWord; private transient Pattern lastp; private transient String lastSearch; HighlightingModel(IModel text, IModel searchWord) { this.text = text; this.searchWord = searchWord; } @Override protected String load() { String srch = (String)searchWord.getObject(); Object object = text.getObject(); String txt = ; if (object != null) { IConverter converter = Application.get().getConverterLocator().getConverter(object.getClass()); txt = converter.convertToString(object, Session.get().getLocale()); } if (srch != null) { Pattern p = null; if (lastp != null srch.equals(lastSearch) ) p = lastp; else { try { p = Pattern.compile(srch, Pattern.CASE_INSENSITIVE); } catch (PatternSyntaxException e) { if (e.getIndex()-1) { srch = srch.substring(0, e.getIndex()); try { p = Pattern.compile(srch, Pattern.CASE_INSENSITIVE); } catch (Exception e2) { srch = null; } } else srch = null; } } if (p != null) { Matcher m = p.matcher(txt); return m.replaceFirst(span class=\search\$0/span); } } return txt; } @Override protected void onDetach() { super.onDetach(); text = null; searchWord = null; } } -- Jim Pinkham On Thu, Oct 16, 2008 at 3:24 PM, Thomas Singer wic...@regnis.de wrote: Thanks all. The first tests work fine now, still need to handle the ignore-case searching... Is there anybody else interested in this feature? Then I will try to prepare the IResponseFilter implementation for public viewing/integration in Wicket. as far as i know the response filter runs within the request cycle and request cycle has metadata facility, so We already make use of RequestCycle.get(), but if you don't work on Wicket the full day like you, then one forgets such secrets. -- Cheers, Tom Igor Vaynberg wrote: as far as i know the response filter runs within the request cycle and request cycle has metadata facility, so -igor On Wed, Oct 15, 2008 at 10:07 AM, Thomas Singer wic...@regnis.de wrote: Thanks. But how the filter should know about the request which contains the information about what to highlight? -- Cheers, Tom Igor Vaynberg wrote: iresponsefilter -igor On Wed, Oct 15, 2008 at 8:22 AM, Thomas Singer wic...@regnis.de wrote: OK, this looks trivial, but were should I place this code to replace all content, no matter whether it comes from a page template, border or fragment? -- Cheers, Tom Martijn Dashorst wrote: tekst.replaceAll(searchword, span class=search + searchword + /span); label.setEscapeModelStrings(false); Martijn On Wed, Oct 15, 2008 at 3:56 PM, Thomas Singer wic...@regnis.de wrote: We are using Wicket as base for our website (www.syntevo.com). We have a simple search feature on the website, but want to extend it like it is known to work in forums: the searched words should be highlighted. Does someone
Re: Highlight some words in the markup content
Perhaps you could use a jQuery plugin to do this? Something like [1] - although this is just the first Google result that came up for me. I have not tested this. [1] - http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html -- Jeremy Thomerson http://www.wickettraining.com On Mon, Oct 19, 2009 at 3:12 PM, Jim Pinkham pinkh...@gmail.com wrote: I'd be interested to know if anyone else is using this technique for search highlighting with a DataTable. http://pastebin.com/m5446797d The data in my grid may contain HTML, so that makes it considerably more complicated (my first attempt didn't address this problem). I'd love to know if someone else has a better/simpler way, although this does appear to work fine, it took a day to come up with. In general, I kind of like the idea of separating this concern from the model, whose purpose is just to get the data, and think of this search highlighting as more of a decorator that applies to the entire grid rather than any particular column, since I've got several PropertyColumn subclasses (LinkPropertyColumn, ImagePropertyColumn, NonEscapedHTMLPropertyColumn, ...etc). Hope this helps someone else. Thanks, -- Jim. On Fri, Oct 24, 2008 at 1:06 PM, Jim Pinkham pinkh...@gmail.com wrote: I've got a few embellishments to that idea that others might enjoy. These include the ability to use on non-string properties, and caching the last compiled pattern (maybe uses a bit less CPU than replaceAll each time). protected static class HighlightingModel extends LoadableDetachableModel { private static final long serialVersionUID = 1L; private transient IModel text; private transient IModel searchWord; private transient Pattern lastp; private transient String lastSearch; HighlightingModel(IModel text, IModel searchWord) { this.text = text; this.searchWord = searchWord; } @Override protected String load() { String srch = (String)searchWord.getObject(); Object object = text.getObject(); String txt = ; if (object != null) { IConverter converter = Application.get().getConverterLocator().getConverter(object.getClass()); txt = converter.convertToString(object, Session.get().getLocale()); } if (srch != null) { Pattern p = null; if (lastp != null srch.equals(lastSearch) ) p = lastp; else { try { p = Pattern.compile(srch, Pattern.CASE_INSENSITIVE); } catch (PatternSyntaxException e) { if (e.getIndex()-1) { srch = srch.substring(0, e.getIndex()); try { p = Pattern.compile(srch, Pattern.CASE_INSENSITIVE); } catch (Exception e2) { srch = null; } } else srch = null; } } if (p != null) { Matcher m = p.matcher(txt); return m.replaceFirst(span class=\search\$0/span); } } return txt; } @Override protected void onDetach() { super.onDetach(); text = null; searchWord = null; } } -- Jim Pinkham On Thu, Oct 16, 2008 at 3:24 PM, Thomas Singer wic...@regnis.de wrote: Thanks all. The first tests work fine now, still need to handle the ignore-case searching... Is there anybody else interested in this feature? Then I will try to prepare the IResponseFilter implementation for public viewing/integration in Wicket. as far as i know the response filter runs within the request cycle and request cycle has metadata facility, so We already make use of RequestCycle.get(), but if you don't work on Wicket the full day like you, then one forgets such secrets. -- Cheers, Tom Igor Vaynberg wrote: as far as i know the response filter runs within the request cycle and request cycle has metadata facility, so -igor On Wed, Oct 15, 2008 at 10:07 AM, Thomas Singer wic...@regnis.de wrote: Thanks. But how the filter should know about the request which contains the information about what to highlight? -- Cheers, Tom Igor Vaynberg wrote: iresponsefilter -igor On Wed, Oct 15, 2008 at 8:22 AM, Thomas Singer wic...@regnis.de wrote: OK, this looks trivial, but were should I place this code to replace all content,
Re: Showing session-stored messages in another window/tab
you should call getsession().info() as mentioned in this thread. when you call info() on a component, that messages is scoped to the owning page. when you call getsession().info() the message is scoped to the session and is kept there until rendered. -igor On Mon, Oct 19, 2009 at 12:12 PM, Esteban Masoero emaso...@getsense.com.ar wrote: I want it to be shown in the LoginPage, because the activation page does not show anything, it only activates the user. I tried something like: LoginPage page = new LoginPage(); page.info(User account activated); setResponsePage(page); but it didn't work. Anyway, as I know, in order to leave a feedback message that needs to be shown in the next whateverPage, you'll need to leave it to the session. Am I missing something? Thanks, Esteban Igor Vaynberg escribió: you want the message to show on the loginpage or on the activation page? -igor On Mon, Oct 19, 2009 at 10:08 AM, Esteban Masoero emaso...@getsense.com.ar wrote: Hi: We've implemented the classic registration process: - user registers - app sends him an email with a generated link - user clicks that link, which it's oppened in a new window/tab - The UserActivationPage that responds to that link request does: this.info(User account activated); setResponsePage(LoginPage.class); (so the user can log in for the first time) The problem is that the message is only shown when the link is oppened in the same window/tab the user has previously registered. After trying a few things, we ended up doing this.getPageSettings().setAutomaticMultiWindowSupport(false); in MyApplication, which seems to work (we think is related to wicket using the same session, but we're not sure). However, we're not sure whether it's the best way of solving this. Any other ideas or comments? Thanks, Esteban - 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: uploaded files in page instance
what happens if the owner is deleting the file while you are copying it to the temp dir??? -igor On Mon, Oct 19, 2009 at 12:54 PM, fachhoch fachh...@gmail.com wrote: Why are you saving the byte arrays in the page instance? I show these files to user with read-only permission , so this user can just view these files ,the owner of these files can delete them anytime , so If I go to database , upon user click , this file might have been deleted by the user , or when user tries to access this file the owner might be deleting this file , to avoid such issues I am loading all the bytes to page instance , so no concurrent access issues . to save them inside temp folders can I ask the page to give some identifier which I can use to name the folder which contains all the files ? or do I have to create my own identifier ? jthomerson wrote: Why are you loading the files from the DB before the user asks for them (clicks the download link)? Why are you saving the byte arrays in the page instance? If you really must load them from the DB before the user clicks the download link, save them to a temp file and save only the path of the file in the page (like Igor originally said). -- Jeremy Thomerson http://www.wickettraining.com On Mon, Oct 19, 2009 at 2:40 PM, fachhoch fachh...@gmail.com wrote: I have several pages which has links to uploaded files to download, I load this from database and save it inside page instance as instance variable . When user clicks on the download link I retrieve the byte array from the page instance and call download. Several user have different instances of same pages and all these pages have these huge files byte[] . Sure this will cause Outof memory issues. To resolve this I have to use temp folder , every time a page instance gets created I have to create temp folder to save these uploaded files bytes with a proper name so that I can know this folder is for this user and this page and this instance. I am asking do I have to create a naming factory which names the folder for every page instance ? or is there anything available which I can use a as a folder name? fachhoch wrote: I show these files in almost all my pages.So every page before it loads has to create all these files in temp folder , please suggest me what should be the identifier to recognize these files ,I actually have these files inside PancelCachingTab , and this tab gets loaded only when user clicks on on it for the first time. igor.vaynberg wrote: store them in a temp directory and only give your page the filename. -igor On Mon, Oct 19, 2009 at 10:55 AM, tubin gen fachh...@gmail.com wrote: I have some huge files upto 50Mb in side my page instance , I have to save them in page instance and I cannot reload it everytime from database becasue other users might delete the file . I am getting java.lang.OutOfMemoryError , only way I can resolve this is increasing heap size but Is this a bad idea storing files upto 50Mb inside page instance ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964309.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/uploaded-files-in-page-instance-tp25962716p25964541.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Hippo's patch for wicket ids
I added this: getDebugSettings().setOutputComponentPath(true); to my init() method but selenium is still not happy. Do I have to run wicket it development mode or something to get these settings to work? D/ On Oct 15, 2009, at 11:19 AM, Igor Vaynberg wrote: the only drawback is that it makes your markup longer and that it will take slightly more cpu because the page-relative path has to be computed for every component on the page. -igor On Thu, Oct 15, 2009 at 9:04 AM, Douglas Ferguson doug...@douglasferguson.us wrote: Is there any drawback to using this in production? On Oct 15, 2009, at 10:53 AM, Igor Vaynberg wrote: see idebugsettings.setoutputcomponentpath, this will add wicket:path='component's page relative path' attribute which is stable as long as you do not change the hierarchy and can be used for writing selenium tests. -igor On Thu, Oct 15, 2009 at 4:14 AM, Per Lundholm per.lundh...@gmail.com wrote: Looks like a patch to make it easier to use Selenium to test your webapplication. Selenium is very fond of id in tags. /Per On Thu, Oct 15, 2009 at 9:58 AM, Daniel Frisk dan...@jalbum.net wrote: Ok, I'm lazy and couldn't decipher that code at a glance. What does it do? // Daniel jalbum.net On 2009-10-15, at 03:09, Douglas Ferguson wrote: Has anybody seen this: http://www.onehippo.org/cms7/integration_testing.html Seems like a nice alternative vs. having to set markupIds on all components. Thoughts? They have a patch for wicket: Index: jdk-1.4/wicket/src/main/java/org/apache/wicket/ Session.java = = = *** jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java (revision 724306) --- jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java (working copy) *** *** 1475,1478 --- 1475,1489 { return sequence++; } + + /** +* Retrieves the next available session-unique value for the supplied Component +* +* @param component +*the component which requests the generation of a markup identifier +* @return session-unique value +*/ + public Object getMarkupId(Component component) { + return new Integer(nextSequenceValue()); + } } Index: jdk-1.4/wicket/src/main/java/org/apache/wicket/ Component.java = = = *** jdk-1.4/wicket/src/main/java/org/apache/wicket/ Component.java (revision 724306) --- jdk-1.4/wicket/src/main/java/org/apache/wicket/ Component.java (working copy) *** *** 1426,1437 return null; } ! final int generatedMarkupId = storedMarkupId instanceof Integer ! ? ((Integer)storedMarkupId).intValue() : Session.get ().nextSequenceValue(); ! ! if (storedMarkupId == null) ! { ! setMarkupIdImpl(new Integer (generatedMarkupId)); } // try to read from markup --- 1426,1445 return null; } ! String markupIdPostfix; ! if (!(storedMarkupId instanceof Integer)) { ! Object markupIdFromSession = Session.get().getMarkupId(this); ! if (storedMarkupId == null markupIdFromSession != null) { ! setMarkupIdImpl (markupIdFromSession); ! } ! storedMarkupId = markupIdFromSession; ! } ! if (storedMarkupId instanceof Integer) { ! markupIdPostfix = Integer.toHexString (((Integer) storedMarkupId).intValue()).toLowerCase(); ! } else if (storedMarkupId instanceof String) { ! return (String) storedMarkupId; ! } else { ! markupIdPostfix = storedMarkupId.toString (); } // try to read from markup *** *** 1449,1455 markupIdPrefix = getId(); } - String markupIdPostfix = Integer.toHexString (generatedMarkupId).toLowerCase(); markupIdPostfix = RequestContext.get ().encodeMarkupId (markupIdPostfix); String markupId = markupIdPrefix + markupIdPostfix; --- 1457,1462 Then in their session, they return stable ids private MapString,Integer pluginComponentCounters = new HashMapString,Integer(); // Do not add the @Override annotation on this public Object getMarkupId(Component component) { String markupId = null; for (Component ancestor=component.getParent(); ancestor! =null markupId==null; ancestor=ancestor.getParent()) { if (ancestor
Re: Hippo's patch for wicket ids
you have to write your selenium tests to use that attribute instead of the component id. -igor On Mon, Oct 19, 2009 at 1:39 PM, Douglas Ferguson doug...@douglasferguson.us wrote: I added this: getDebugSettings().setOutputComponentPath(true); to my init() method but selenium is still not happy. Do I have to run wicket it development mode or something to get these settings to work? D/ On Oct 15, 2009, at 11:19 AM, Igor Vaynberg wrote: the only drawback is that it makes your markup longer and that it will take slightly more cpu because the page-relative path has to be computed for every component on the page. -igor On Thu, Oct 15, 2009 at 9:04 AM, Douglas Ferguson doug...@douglasferguson.us wrote: Is there any drawback to using this in production? On Oct 15, 2009, at 10:53 AM, Igor Vaynberg wrote: see idebugsettings.setoutputcomponentpath, this will add wicket:path='component's page relative path' attribute which is stable as long as you do not change the hierarchy and can be used for writing selenium tests. -igor On Thu, Oct 15, 2009 at 4:14 AM, Per Lundholm per.lundh...@gmail.com wrote: Looks like a patch to make it easier to use Selenium to test your webapplication. Selenium is very fond of id in tags. /Per On Thu, Oct 15, 2009 at 9:58 AM, Daniel Frisk dan...@jalbum.net wrote: Ok, I'm lazy and couldn't decipher that code at a glance. What does it do? // Daniel jalbum.net On 2009-10-15, at 03:09, Douglas Ferguson wrote: Has anybody seen this: http://www.onehippo.org/cms7/integration_testing.html Seems like a nice alternative vs. having to set markupIds on all components. Thoughts? They have a patch for wicket: Index: jdk-1.4/wicket/src/main/java/org/apache/wicket/ Session.java = = = *** jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java (revision 724306) --- jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java (working copy) *** *** 1475,1478 --- 1475,1489 { return sequence++; } + + /** + * Retrieves the next available session-unique value for the supplied Component + * + * @param component + * the component which requests the generation of a markup identifier + * @return session-unique value + */ + public Object getMarkupId(Component component) { + return new Integer(nextSequenceValue()); + } } Index: jdk-1.4/wicket/src/main/java/org/apache/wicket/ Component.java = = = *** jdk-1.4/wicket/src/main/java/org/apache/wicket/ Component.java (revision 724306) --- jdk-1.4/wicket/src/main/java/org/apache/wicket/ Component.java (working copy) *** *** 1426,1437 return null; } ! final int generatedMarkupId = storedMarkupId instanceof Integer ! ? ((Integer)storedMarkupId).intValue() : Session.get ().nextSequenceValue(); ! ! if (storedMarkupId == null) ! { ! setMarkupIdImpl(new Integer (generatedMarkupId)); } // try to read from markup --- 1426,1445 return null; } ! String markupIdPostfix; ! if (!(storedMarkupId instanceof Integer)) { ! Object markupIdFromSession = Session.get().getMarkupId(this); ! if (storedMarkupId == null markupIdFromSession != null) { ! setMarkupIdImpl (markupIdFromSession); ! } ! storedMarkupId = markupIdFromSession; ! } ! if (storedMarkupId instanceof Integer) { ! markupIdPostfix = Integer.toHexString (((Integer) storedMarkupId).intValue()).toLowerCase(); ! } else if (storedMarkupId instanceof String) { ! return (String) storedMarkupId; ! } else { ! markupIdPostfix = storedMarkupId.toString (); } // try to read from markup *** *** 1449,1455 markupIdPrefix = getId(); } - String markupIdPostfix = Integer.toHexString (generatedMarkupId).toLowerCase(); markupIdPostfix = RequestContext.get ().encodeMarkupId (markupIdPostfix); String markupId = markupIdPrefix + markupIdPostfix; --- 1457,1462 Then in their session, they return stable ids private MapString,Integer pluginComponentCounters = new HashMapString,Integer(); // Do not add the @Override annotation on this public Object getMarkupId(Component component) {
Re: Hippo's patch for wicket ids
Ah... I guess you can't use the selenium recorder then. D/ On Oct 19, 2009, at 3:43 PM, Igor Vaynberg wrote: you have to write your selenium tests to use that attribute instead of the component id. -igor On Mon, Oct 19, 2009 at 1:39 PM, Douglas Ferguson doug...@douglasferguson.us wrote: I added this: getDebugSettings().setOutputComponentPath(true); to my init() method but selenium is still not happy. Do I have to run wicket it development mode or something to get these settings to work? D/ On Oct 15, 2009, at 11:19 AM, Igor Vaynberg wrote: the only drawback is that it makes your markup longer and that it will take slightly more cpu because the page-relative path has to be computed for every component on the page. -igor On Thu, Oct 15, 2009 at 9:04 AM, Douglas Ferguson doug...@douglasferguson.us wrote: Is there any drawback to using this in production? On Oct 15, 2009, at 10:53 AM, Igor Vaynberg wrote: see idebugsettings.setoutputcomponentpath, this will add wicket:path='component's page relative path' attribute which is stable as long as you do not change the hierarchy and can be used for writing selenium tests. -igor On Thu, Oct 15, 2009 at 4:14 AM, Per Lundholm per.lundh...@gmail.com wrote: Looks like a patch to make it easier to use Selenium to test your webapplication. Selenium is very fond of id in tags. /Per On Thu, Oct 15, 2009 at 9:58 AM, Daniel Frisk dan...@jalbum.net wrote: Ok, I'm lazy and couldn't decipher that code at a glance. What does it do? // Daniel jalbum.net On 2009-10-15, at 03:09, Douglas Ferguson wrote: Has anybody seen this: http://www.onehippo.org/cms7/integration_testing.html Seems like a nice alternative vs. having to set markupIds on all components. Thoughts? They have a patch for wicket: Index: jdk-1.4/wicket/src/main/java/org/apache/wicket/ Session.java = = = = = == *** jdk-1.4/wicket/src/main/java/org/apache/wicket/ Session.java (revision 724306) --- jdk-1.4/wicket/src/main/java/org/apache/wicket/ Session.java (working copy) *** *** 1475,1478 --- 1475,1489 { return sequence++; } + + /** +* Retrieves the next available session-unique value for the supplied Component +* +* @param component +*the component which requests the generation of a markup identifier +* @return session-unique value +*/ + public Object getMarkupId(Component component) { + return new Integer(nextSequenceValue()); + } } Index: jdk-1.4/wicket/src/main/java/org/apache/wicket/ Component.java = = = = = == *** jdk-1.4/wicket/src/main/java/org/apache/wicket/ Component.java (revision 724306) --- jdk-1.4/wicket/src/main/java/org/apache/wicket/ Component.java (working copy) *** *** 1426,1437 return null; } ! final int generatedMarkupId = storedMarkupId instanceof Integer ! ? ((Integer)storedMarkupId).intValue () : Session.get ().nextSequenceValue(); ! ! if (storedMarkupId == null) ! { ! setMarkupIdImpl(new Integer (generatedMarkupId)); } // try to read from markup --- 1426,1445 return null; } ! String markupIdPostfix; ! if (!(storedMarkupId instanceof Integer)) { ! Object markupIdFromSession = Session.get().getMarkupId(this); ! if (storedMarkupId == null markupIdFromSession != null) { ! setMarkupIdImpl (markupIdFromSession); ! } ! storedMarkupId = markupIdFromSession; ! } ! if (storedMarkupId instanceof Integer) { ! markupIdPostfix = Integer.toHexString (((Integer) storedMarkupId).intValue()).toLowerCase(); ! } else if (storedMarkupId instanceof String) { ! return (String) storedMarkupId; ! } else { ! markupIdPostfix = storedMarkupId.toString (); } // try to read from markup *** *** 1449,1455 markupIdPrefix = getId(); } - String markupIdPostfix = Integer.toHexString (generatedMarkupId).toLowerCase(); markupIdPostfix = RequestContext.get ().encodeMarkupId (markupIdPostfix); String markupId = markupIdPrefix + markupIdPostfix; --- 1457,1462 Then in their session, they return stable ids private MapString,Integer
Re: Showing session-stored messages in another window/tab
I'm now calling getSession().info(). However, the message doesn't show up. After debugging for a while I noticed that when de LogjnPage is created, the message I added is there, and is perfectly rendered (I reached the method org.apache.wicket.markup.html.basic.Label.onComponentTagBody(MarkupStream, ComponentTag) for the message label and the srting is there). Strangely, after hitting F8 (Resume in eclipse) I reach the LoginPage constructor again, as if the LoginPage were constructed again (and apparently it is). This time, when the page creates the feedback panel, the session has no messages, because as we may expect they have been consumed by the previous instance of LoginPage. Apparently, this second instance is the definitive instance of the page to be rendered, so finally no messages are shown. I must be doing something really wrong!, any ideas of why am I seeing this strange twice-instanced pages behaviour? Thanks, Esteban Igor Vaynberg escribió: you should call getsession().info() as mentioned in this thread. when you call info() on a component, that messages is scoped to the owning page. when you call getsession().info() the message is scoped to the session and is kept there until rendered. -igor On Mon, Oct 19, 2009 at 12:12 PM, Esteban Masoero emaso...@getsense.com.ar wrote: I want it to be shown in the LoginPage, because the activation page does not show anything, it only activates the user. I tried something like: LoginPage page = new LoginPage(); page.info(User account activated); setResponsePage(page); but it didn't work. Anyway, as I know, in order to leave a feedback message that needs to be shown in the next whateverPage, you'll need to leave it to the session. Am I missing something? Thanks, Esteban Igor Vaynberg escribió: you want the message to show on the loginpage or on the activation page? -igor On Mon, Oct 19, 2009 at 10:08 AM, Esteban Masoero emaso...@getsense.com.ar wrote: Hi: We've implemented the classic registration process: - user registers - app sends him an email with a generated link - user clicks that link, which it's oppened in a new window/tab - The UserActivationPage that responds to that link request does: this.info(User account activated); setResponsePage(LoginPage.class); (so the user can log in for the first time) The problem is that the message is only shown when the link is oppened in the same window/tab the user has previously registered. After trying a few things, we ended up doing this.getPageSettings().setAutomaticMultiWindowSupport(false); in MyApplication, which seems to work (we think is related to wicket using the same session, but we're not sure). However, we're not sure whether it's the best way of solving this. Any other ideas or comments? Thanks, Esteban - 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: Hippo's patch for wicket ids
Does anybody have sample of how to do this? I'm getting this error when I try to use the wicketpath [error] Element //a [...@wicketpath = 'tablePanel_leftList_tableList_pojoList_18_nameCell_namePanelLink_name ']/div not found On Oct 19, 2009, at 3:43 PM, Igor Vaynberg wrote: you have to write your selenium tests to use that attribute instead of the component id. -igor On Mon, Oct 19, 2009 at 1:39 PM, Douglas Ferguson doug...@douglasferguson.us wrote: I added this: getDebugSettings().setOutputComponentPath(true); to my init() method but selenium is still not happy. Do I have to run wicket it development mode or something to get these settings to work? D/ On Oct 15, 2009, at 11:19 AM, Igor Vaynberg wrote: the only drawback is that it makes your markup longer and that it will take slightly more cpu because the page-relative path has to be computed for every component on the page. -igor On Thu, Oct 15, 2009 at 9:04 AM, Douglas Ferguson doug...@douglasferguson.us wrote: Is there any drawback to using this in production? On Oct 15, 2009, at 10:53 AM, Igor Vaynberg wrote: see idebugsettings.setoutputcomponentpath, this will add wicket:path='component's page relative path' attribute which is stable as long as you do not change the hierarchy and can be used for writing selenium tests. -igor On Thu, Oct 15, 2009 at 4:14 AM, Per Lundholm per.lundh...@gmail.com wrote: Looks like a patch to make it easier to use Selenium to test your webapplication. Selenium is very fond of id in tags. /Per On Thu, Oct 15, 2009 at 9:58 AM, Daniel Frisk dan...@jalbum.net wrote: Ok, I'm lazy and couldn't decipher that code at a glance. What does it do? // Daniel jalbum.net On 2009-10-15, at 03:09, Douglas Ferguson wrote: Has anybody seen this: http://www.onehippo.org/cms7/integration_testing.html Seems like a nice alternative vs. having to set markupIds on all components. Thoughts? They have a patch for wicket: Index: jdk-1.4/wicket/src/main/java/org/apache/wicket/ Session.java = = = = = == *** jdk-1.4/wicket/src/main/java/org/apache/wicket/ Session.java (revision 724306) --- jdk-1.4/wicket/src/main/java/org/apache/wicket/ Session.java (working copy) *** *** 1475,1478 --- 1475,1489 { return sequence++; } + + /** +* Retrieves the next available session-unique value for the supplied Component +* +* @param component +*the component which requests the generation of a markup identifier +* @return session-unique value +*/ + public Object getMarkupId(Component component) { + return new Integer(nextSequenceValue()); + } } Index: jdk-1.4/wicket/src/main/java/org/apache/wicket/ Component.java = = = = = == *** jdk-1.4/wicket/src/main/java/org/apache/wicket/ Component.java (revision 724306) --- jdk-1.4/wicket/src/main/java/org/apache/wicket/ Component.java (working copy) *** *** 1426,1437 return null; } ! final int generatedMarkupId = storedMarkupId instanceof Integer ! ? ((Integer)storedMarkupId).intValue () : Session.get ().nextSequenceValue(); ! ! if (storedMarkupId == null) ! { ! setMarkupIdImpl(new Integer (generatedMarkupId)); } // try to read from markup --- 1426,1445 return null; } ! String markupIdPostfix; ! if (!(storedMarkupId instanceof Integer)) { ! Object markupIdFromSession = Session.get().getMarkupId(this); ! if (storedMarkupId == null markupIdFromSession != null) { ! setMarkupIdImpl (markupIdFromSession); ! } ! storedMarkupId = markupIdFromSession; ! } ! if (storedMarkupId instanceof Integer) { ! markupIdPostfix = Integer.toHexString (((Integer) storedMarkupId).intValue()).toLowerCase(); ! } else if (storedMarkupId instanceof String) { ! return (String) storedMarkupId; ! } else { ! markupIdPostfix = storedMarkupId.toString (); } // try to read from markup *** *** 1449,1455 markupIdPrefix = getId(); } - String markupIdPostfix = Integer.toHexString (generatedMarkupId).toLowerCase(); markupIdPostfix = RequestContext.get ().encodeMarkupId (markupIdPostfix);