Setting title-Tag
Hi, how can I retrieve the web.xml display-name content to show it in the WebPage header titleXYZ/title ? Thank you. __ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
onClick Handle ?
Hi, I'd like to create an own Link in the template document. When I create an Link via Wicket with an onClick attribute, then it calls the page everytime I click on it. What I need is a Link in that way: a onclick=funci('8912aja')Click for Item/a But the 8912aja is created dynamicially, so I can't create them in the template manually. Is there any wicket feature, which can helps me? Actually I need only the value 8912aja, so I can build it manually. Thanks. __ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Getting server-url ?
Hi, how can I get the server-url on which the wicket application is running? like http://www.serverurl.com/WicketApp/ it should return http://www.serverurl.com Thank you __ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
SimpleAttributeModifier on SubmitLink?
Hi, how can I achieve something like that: abschliessen = (SubmitLink) new SubmitLink(abschliessen, antwortForm) { @Override public void onSubmit() { preQuestionInit(); Worker.ClosingTestprocedure(tp); preQuestionInit(); } } .add(new SimpleAttributeModifier( onclick, return confirm('Information...');)); I detected, that the add Statement overwrites the onclick handler for the form submit! How can I have both: After click on the Ok-Button it should fire up the form. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
ListMultipleChoice - Pre fill out
Hi, how can I pre-select some List-Items, when showing the form with the ListMultipleChoice? Thank you for some advice! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: ListMultipleChoice - Pre fill out
and in the html it is also showed as selected ? - Ursprüngliche Mail Von: Pieter Degraeuwe pieter.degrae...@systemworks.be An: users@wicket.apache.org Gesendet: Montag, den 26. Oktober 2009, 13:59:36 Uhr Betreff: Re: ListMultipleChoice - Pre fill out just make sure that the model, which contains the 'selected' items, does already contain the selected items. Your model probably maps to an object property. (in this case, the property is a collection(List/set) . So, add te 'pre-selection' to the collection, and the ListMultipleChoice will follow.. On Mon, Oct 26, 2009 at 1:53 PM, Peter Arnulf Lustig u...@yahoo.dewrote: Hi, how can I pre-select some List-Items, when showing the form with the ListMultipleChoice? Thank you for some advice! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: ListMultipleChoice - Pre fill out
fantastic pedro! it works really great! - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Montag, den 26. Oktober 2009, 14:13:55 Uhr Betreff: Re: ListMultipleChoice - Pre fill out yes: List options = Arrays.asList(a, b, c); add(new ListMultipleChoice(select, new Model((Serializable)Arrays.asList(b)), options)); On Mon, Oct 26, 2009 at 11:06 AM, Peter Arnulf Lustig u...@yahoo.dewrote: and in the html it is also showed as selected ? - Ursprüngliche Mail Von: Pieter Degraeuwe pieter.degrae...@systemworks.be An: users@wicket.apache.org Gesendet: Montag, den 26. Oktober 2009, 13:59:36 Uhr Betreff: Re: ListMultipleChoice - Pre fill out just make sure that the model, which contains the 'selected' items, does already contain the selected items. Your model probably maps to an object property. (in this case, the property is a collection(List/set) . So, add te 'pre-selection' to the collection, and the ListMultipleChoice will follow.. On Mon, Oct 26, 2009 at 1:53 PM, Peter Arnulf Lustig u...@yahoo.de wrote: Hi, how can I pre-select some List-Items, when showing the form with the ListMultipleChoice? Thank you for some advice! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be - 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: why is the model empty?
wow. Thank you! That's helped a lot! .getValue() is the key to success if you use setDefaultFormProcessing = false! - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 17:04:57 Uhr Betreff: Re: why is the model empty? Well, don't know what to tell you. It bypasses validation, which is required in order to set the models to their values. If you submitted akj123 in a text field that was an Integer, we could only set it after validation (which in this case means the value could not be set on the field). So, bypassing validation means that you must also bypass getting your models updated. You can call textfield.getValue() (or similar - can't remember exact name) to get the raw submitted value. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 10:00 AM, Peter Arnulf Lustig u...@yahoo.dewrote: mhmhm! I got this design pattern from http://cwiki.apache.org/WICKET/conditional-validation.html - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:56:38 Uhr Betreff: Re: why is the model empty? Did you look at the javadoc? [1] It says: Sets the defaultFormProcessing property. When false (default is true), all validation and form updating is bypassed and the onSubmit method of that button is called directly, and the onSubmit method of the parent form is not called. A common use for this is to create a cancel button. So, yes, that would prevent the model from being updated. [1] http://fisheye6.atlassian.com/browse/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java?r=HEAD#l118 -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:25 AM, Peter Arnulf Lustig u...@yahoo.de wrote: Does it maybe have something to do with my custom validation? I use setDefaultFormProcessing(false); because I have more submit buttons on one form - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:20:09 Uhr Betreff: Re: why is the model empty? How about! creating! a quickstart! and sending it! to us! (Oh, and no need for so many exclamation points. It could be interpreted as shouting) -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:16 AM, Peter Arnulf Lustig u...@yahoo.de wrote: hey martijn -- But there is a string submitted! Actually it must be printed! But it is null. Is the final declaration correct? - Ursprüngliche Mail Von: Martijn Dashorst martijn.dasho...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:06:22 Uhr Betreff: Re: why is the model empty? Wicket makes empty strings null by default. See one of the Application.getSettings() Martijn On Tue, Oct 20, 2009 at 4:04 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Look at the HTTP request - is the value getting submitted? -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 8:17 AM, Peter Arnulf Lustig u...@yahoo.de wrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: how to update a form model when clicking a link
Have you tried assign a Model to the component which needs to be updated? ModelString model = new ModelString(); --- assign to the component of the form. i.e. final TextField tf = new TextField(txt, model); in Link Execution - tf.setModel(mode); - Ursprüngliche Mail Von: Antoine van Wel antoine.van@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 21. Oktober 2009, 13:22:01 Uhr Betreff: how to update a form model when clicking a link On a page there's a form with a textarea. Somewhere else on the page there is a wicket link, which is not inside the form. The user types something in the textarea and then presses the link. Now what I'd like to achieve is when the code of the link is executed, the model of the form is up-to-date - so what the user has typed, should be inside the model. The form should not be submitted. Any suggestions how this can be done - preferably without writing Javascript? Thanks, Antoine -- take your photos everywhere you go - https://www.memolio.com follow us on Twitter - http://twitter.com/Memolio - 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
why is the model empty?
hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: why is the model empty?
yes! I temper the data! And it is posted to the server! - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:04:21 Uhr Betreff: Re: why is the model empty? Look at the HTTP request - is the value getting submitted? -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 8:17 AM, Peter Arnulf Lustig u...@yahoo.dewrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: why is the model empty?
hey martijn -- But there is a string submitted! Actually it must be printed! But it is null. Is the final declaration correct? - Ursprüngliche Mail Von: Martijn Dashorst martijn.dasho...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:06:22 Uhr Betreff: Re: why is the model empty? Wicket makes empty strings null by default. See one of the Application.getSettings() Martijn On Tue, Oct 20, 2009 at 4:04 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Look at the HTTP request - is the value getting submitted? -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 8:17 AM, Peter Arnulf Lustig u...@yahoo.dewrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: why is the model empty?
Does it maybe have something to do with my custom validation? I use setDefaultFormProcessing(false); because I have more submit buttons on one form - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:20:09 Uhr Betreff: Re: why is the model empty? How about! creating! a quickstart! and sending it! to us! (Oh, and no need for so many exclamation points. It could be interpreted as shouting) -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:16 AM, Peter Arnulf Lustig u...@yahoo.dewrote: hey martijn -- But there is a string submitted! Actually it must be printed! But it is null. Is the final declaration correct? - Ursprüngliche Mail Von: Martijn Dashorst martijn.dasho...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:06:22 Uhr Betreff: Re: why is the model empty? Wicket makes empty strings null by default. See one of the Application.getSettings() Martijn On Tue, Oct 20, 2009 at 4:04 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Look at the HTTP request - is the value getting submitted? -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 8:17 AM, Peter Arnulf Lustig u...@yahoo.de wrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: why is the model empty?
I tried it also with final IModelString tagTitleModel = Model.of(); (..., tagTitleModel) But it won't work! - Ursprüngliche Mail Von: Ernesto Reinaldo Barreiro reier...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:24:16 Uhr Betreff: Re: why is the model empty? Sorry but when is the model object update? final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); just creates and in-mutable model? Or, am I missing something? Best, Ernesto On Tue, Oct 20, 2009 at 3:17 PM, Peter Arnulf Lustig u...@yahoo.dewrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: why is the model empty?
sets the value of the textfield programmatically on the page, and submits the form, the model should be updated by the time he gets to this onSubmit method. How do you mean that? I think wicket sets the model automaticly because the model is attached to the component. - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:28:31 Uhr Betreff: Re: why is the model empty? That's not an immutable model. It's equivalent to new ModelString() - which is fine for this use. Assuming the text field and the button are within a form, and that he sets the value of the textfield programmatically on the page, and submits the form, the model should be updated by the time he gets to this onSubmit method. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:24 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Sorry but when is the model object update? final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); just creates and in-mutable model? Or, am I missing something? Best, Ernesto On Tue, Oct 20, 2009 at 3:17 PM, Peter Arnulf Lustig u...@yahoo.de wrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: why is the model empty?
I am submitting a textfield in a form to wicket. Just the standard HTTP Post -- And everywhere it functions well -- I just can't get it why it won't function there. And I don't utilize any JS (Ajax etc.) for that task! It's weird. - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:40:45 Uhr Betreff: Re: why is the model empty? Yes - that's what I'm saying. On the webpage, presumably with JS, he is saying that he is setting the value of the text field. Then when it's submitted, Wicket should update the model before he gets to onSubmit -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:31 AM, Peter Arnulf Lustig u...@yahoo.dewrote: sets the value of the textfield programmatically on the page, and submits the form, the model should be updated by the time he gets to this onSubmit method. How do you mean that? I think wicket sets the model automaticly because the model is attached to the component. - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:28:31 Uhr Betreff: Re: why is the model empty? That's not an immutable model. It's equivalent to new ModelString() - which is fine for this use. Assuming the text field and the button are within a form, and that he sets the value of the textfield programmatically on the page, and submits the form, the model should be updated by the time he gets to this onSubmit method. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:24 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Sorry but when is the model object update? final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); just creates and in-mutable model? Or, am I missing something? Best, Ernesto On Tue, Oct 20, 2009 at 3:17 PM, Peter Arnulf Lustig u...@yahoo.de wrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: why is the model empty?
ok! Line 148 is interesting. - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:50:31 Uhr Betreff: Re: why is the model empty? Well, again, the only way for me to help you more is to supply a quickstart that reproduces this. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:49 AM, Peter Arnulf Lustig u...@yahoo.dewrote: I am submitting a textfield in a form to wicket. Just the standard HTTP Post -- And everywhere it functions well -- I just can't get it why it won't function there. And I don't utilize any JS (Ajax etc.) for that task! It's weird. - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:40:45 Uhr Betreff: Re: why is the model empty? Yes - that's what I'm saying. On the webpage, presumably with JS, he is saying that he is setting the value of the text field. Then when it's submitted, Wicket should update the model before he gets to onSubmit -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:31 AM, Peter Arnulf Lustig u...@yahoo.de wrote: sets the value of the textfield programmatically on the page, and submits the form, the model should be updated by the time he gets to this onSubmit method. How do you mean that? I think wicket sets the model automaticly because the model is attached to the component. - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:28:31 Uhr Betreff: Re: why is the model empty? That's not an immutable model. It's equivalent to new ModelString() - which is fine for this use. Assuming the text field and the button are within a form, and that he sets the value of the textfield programmatically on the page, and submits the form, the model should be updated by the time he gets to this onSubmit method. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:24 AM, Ernesto Reinaldo Barreiro reier...@gmail.com wrote: Sorry but when is the model object update? final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); just creates and in-mutable model? Or, am I missing something? Best, Ernesto On Tue, Oct 20, 2009 at 3:17 PM, Peter Arnulf Lustig u...@yahoo.de wrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - 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 change this template, choose Tools | Templates * and open the template in the editor. */ package org.omikron.org; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import org.apache.wicket.AttributeModifier; import org.apache.wicket.PageParameters; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.ajax.markup.html.form.AjaxButton; import org.apache.wicket.behavior.SimpleAttributeModifier; import org.apache.wicket.feedback.ContainerFeedbackMessageFilter; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.IChoiceRenderer; import org.apache.wicket.markup.html.form.ListMultipleChoice; import org.apache.wicket.markup.html.form.TextArea; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.link.Link; import org.apache.wicket.markup.html.list.ListItem; import org.apache.wicket.markup.html.list.ListView; import
AW: why is the model empty?
mhmhm! I got this design pattern from http://cwiki.apache.org/WICKET/conditional-validation.html - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:56:38 Uhr Betreff: Re: why is the model empty? Did you look at the javadoc? [1] It says: Sets the defaultFormProcessing property. When false (default is true), all validation and form updating is bypassed and the onSubmit method of that button is called directly, and the onSubmit method of the parent form is not called. A common use for this is to create a cancel button. So, yes, that would prevent the model from being updated. [1] http://fisheye6.atlassian.com/browse/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/Button.java?r=HEAD#l118 -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:25 AM, Peter Arnulf Lustig u...@yahoo.dewrote: Does it maybe have something to do with my custom validation? I use setDefaultFormProcessing(false); because I have more submit buttons on one form - Ursprüngliche Mail Von: Jeremy Thomerson jer...@wickettraining.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:20:09 Uhr Betreff: Re: why is the model empty? How about! creating! a quickstart! and sending it! to us! (Oh, and no need for so many exclamation points. It could be interpreted as shouting) -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 9:16 AM, Peter Arnulf Lustig u...@yahoo.de wrote: hey martijn -- But there is a string submitted! Actually it must be printed! But it is null. Is the final declaration correct? - Ursprüngliche Mail Von: Martijn Dashorst martijn.dasho...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 20. Oktober 2009, 16:06:22 Uhr Betreff: Re: why is the model empty? Wicket makes empty strings null by default. See one of the Application.getSettings() Martijn On Tue, Oct 20, 2009 at 4:04 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Look at the HTTP request - is the value getting submitted? -- Jeremy Thomerson http://www.wickettraining.com On Tue, Oct 20, 2009 at 8:17 AM, Peter Arnulf Lustig u...@yahoo.de wrote: hi, in the submit logic the getModel().getObject() is an empty string although I set it via textfield: final Button tagSubmit = new Button(tagSubmit, Model.of()) { @Override public void onSubmit() { tagTitle.getModel().getObject() // it is empty!! } } }; that's the textfield: final TextFieldString tagTitle = new TextFieldString(tagTitle, Model.of()); - 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 - 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
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
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
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
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
Null Model Error
I have a List-Component and after sending a Form-Request it shows me the error: java.lang.IllegalStateException: Attempt to set model object on null model of component: mainPanel:taggingBereich:addTagging:taggingList at org.apache.wicket.Component.setDefaultModelObject(Component.java:3038) That's the specific List // Component taggingList = new ListMultipleChoiceInteger(taggingList, choices, renderer).setMaxRows(10); taggingList.setOutputMarkupId(true); // Setting Model choices.setObject(new ArrayListInteger(tagging.keySet())); // Model-Variable IModelList? extends Integer choices; // IChoiceRenderer renderer = new IChoiceRendererInteger() { public Object getDisplayValue(Integer arg0) { return tagging.get(arg0); } public String getIdValue(Integer arg0, int arg1) { return arg0.toString(); } }; choices = Model.of((ListInteger) new ArrayListInteger(tagging.keySet())); The of Method is crossed out by eclipse due to some reason I can't recognize -- But it works. Only after submitting the form I get this error (above) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Null Model Error
yes -- I do this here: choices = Model.of((ListInteger) new ArrayListInteger(tagging.keySet())); - Ursprüngliche Mail Von: Md. Jahid Shohel ja...@outscore.se An: users@wicket.apache.org Gesendet: Freitag, den 16. Oktober 2009, 9:53:01 Uhr Betreff: Re: Null Model Error you need to set the model for the list. On Fri, 2009-10-16 at 07:33 +, Peter Arnulf Lustig wrote: choices, - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: Null Model Error
can anyone tell me how to use the list-component model properly? - Ursprüngliche Mail Von: Peter Arnulf Lustig u...@yahoo.de An: users@wicket.apache.org Gesendet: Freitag, den 16. Oktober 2009, 9:55:19 Uhr Betreff: AW: Null Model Error yes -- I do this here: choices = Model.of((ListInteger) new ArrayListInteger(tagging.keySet())); - Ursprüngliche Mail Von: Md. Jahid Shohel ja...@outscore.se An: users@wicket.apache.org Gesendet: Freitag, den 16. Oktober 2009, 9:53:01 Uhr Betreff: Re: Null Model Error you need to set the model for the list. On Fri, 2009-10-16 at 07:33 +, Peter Arnulf Lustig wrote: choices, - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: Null Model Error
wow - great information But how can I create / define such a model -- I can't find anything in the wicket examples! - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Freitag, den 16. Oktober 2009, 13:24:45 Uhr Betreff: Re: AW: Null Model Error You have a list of tagging keys that user can select and a render to it, but you don't have an model to receive the selection made on component. Consider to use this contructor parsing an putTheUserSelectionHereModel http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/ListMultipleChoice.html#ListMultipleChoice%28java.lang.String,%20org.apache.wicket.model.IModel,%20org.apache.wicket.model.IModel,%20org.apache.wicket.markup.html.form.IChoiceRenderer%29 On Fri, Oct 16, 2009 at 6:52 AM, Peter Arnulf Lustig u...@yahoo.dewrote: can anyone tell me how to use the list-component model properly? - Ursprüngliche Mail Von: Peter Arnulf Lustig u...@yahoo.de An: users@wicket.apache.org Gesendet: Freitag, den 16. Oktober 2009, 9:55:19 Uhr Betreff: AW: Null Model Error yes -- I do this here: choices = Model.of((ListInteger) new ArrayListInteger(tagging.keySet())); - Ursprüngliche Mail Von: Md. Jahid Shohel ja...@outscore.se An: users@wicket.apache.org Gesendet: Freitag, den 16. Oktober 2009, 9:53:01 Uhr Betreff: Re: Null Model Error you need to set the model for the list. On Fri, 2009-10-16 at 07:33 +, Peter Arnulf Lustig wrote: choices, - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: Null Model Error
I thank you very much! - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Freitag, den 16. Oktober 2009, 14:13:46 Uhr Betreff: Re: AW: Null Model Error at javadoc: IModeljava.util.CollectionT model But how can I create / define such a model ? I have used org.apache.wicket.model.Model in one project for example like: new ListMultipleChoice(id, new Model(), choises, render) On Fri, Oct 16, 2009 at 9:00 AM, Peter Arnulf Lustig u...@yahoo.dewrote: wow - great information But how can I create / define such a model -- I can't find anything in the wicket examples! - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Freitag, den 16. Oktober 2009, 13:24:45 Uhr Betreff: Re: AW: Null Model Error You have a list of tagging keys that user can select and a render to it, but you don't have an model to receive the selection made on component. Consider to use this contructor parsing an putTheUserSelectionHereModel http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/ListMultipleChoice.html#ListMultipleChoice%28java.lang.String,%20org.apache.wicket.model.IModel,%20org.apache.wicket.model.IModel,%20org.apache.wicket.markup.html.form.IChoiceRenderer%29 On Fri, Oct 16, 2009 at 6:52 AM, Peter Arnulf Lustig u...@yahoo.de wrote: can anyone tell me how to use the list-component model properly? - Ursprüngliche Mail Von: Peter Arnulf Lustig u...@yahoo.de An: users@wicket.apache.org Gesendet: Freitag, den 16. Oktober 2009, 9:55:19 Uhr Betreff: AW: Null Model Error yes -- I do this here: choices = Model.of((ListInteger) new ArrayListInteger(tagging.keySet())); - Ursprüngliche Mail Von: Md. Jahid Shohel ja...@outscore.se An: users@wicket.apache.org Gesendet: Freitag, den 16. Oktober 2009, 9:53:01 Uhr Betreff: Re: Null Model Error you need to set the model for the list. On Fri, 2009-10-16 at 07:33 +, Peter Arnulf Lustig wrote: choices, - 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 - 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
Ajax Update ListMultipleChoice
Hi, how can I refresh the ListMultipleChoice compononent? I use the IModel and IChoiceRenderer Component for filling the list. But it should be refreshed automaticly when doing an update. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to add list-entities dynamicly to ListMultipleChoice Component?
And how is that done via AJAX ? Basicly I'd like to have a input textfield where the user can type a word into, and then after submitting the field he can see it in a ListMultipleChoice Component. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: How to add list-entities dynamicly to ListMultipleChoice Component?
thank you -- that helped me out! - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Donnerstag, den 15. Oktober 2009, 15:07:15 Uhr Betreff: Re: How to add list-entities dynamicly to ListMultipleChoice Component? for the textfield you can use an ajax behaviour, or put it into an form with ajax submit. in your handle code, you update the model object on your listmultiplechoise, and add it or its parent component to ajaxrequesttarget On Thu, Oct 15, 2009 at 9:56 AM, Peter Arnulf Lustig u...@yahoo.dewrote: And how is that done via AJAX ? Basicly I'd like to have a input textfield where the user can type a word into, and then after submitting the field he can see it in a ListMultipleChoice Component. - 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
Many forms on one page and submit handling
Hi, I have one Form-Class which has one main form -- in this form I've got some more forms. Each of them has their own submit button. How can I tell wicket, that it only has to render (validation and so on) only for the form, where the button was pressed? thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Many forms on one page and submit handling
yes I do it like that. But nevertheless it shows the messages everywhere on each form. check this out: public class CreateQuestionsForm extends Form { TextFieldStringtitle; TextAreaStringfragestellung; ModelStringtitleModel; ModelStringfragestellungModel; BooleanisUpdate= false; Questionq; ModelStringsystemTagModel; // Tag TextFieldStringsystemTag; LinksystemTagAdd; public CreateQuestionsForm(String id) { super(id); titleModel = Model.of(); fragestellungModel = Model.of(); title = new RequiredTextFieldString(title, titleModel); fragestellung = new TextAreaString(fragestellung, fragestellungModel); add(title); add(fragestellung); // -- Biete Möglichkeit für Tag-Erstellung Form form = new Form(systemTagForm) { @Override protected void onSubmit() { Tagging t = new Tagging(); t.setTitle(systemTagModel.getObject()); Worker.SaveTagging(t); } }; FeedbackPanel feedbackPanel = new FeedbackPanel(systemTagFormFeedbackPanel); feedbackPanel.setFilter(new ContainerFeedbackMessageFilter(form)); systemTagModel = Model.of(); systemTag = new RequiredTextFieldString(systemTag, systemTagModel); add(form.add(feedbackPanel).add(systemTag)); } public void setUpdate(Question q) { isUpdate = true; this.q = q; title.setModel(Model.of(q.getTitle())); fragestellung.setModel(Model.of(q.getText())); q.setSysTimestamp(new Date()); } @Override protected void onSubmit() { try { if (!isUpdate) { q = new Question(); } q.setText(fragestellung.getDefaultModelObjectAsString()); q.setTitle(title.getDefaultModelObjectAsString()); if (!isUpdate) { Worker.SaveQuestion(q); } else { Worker.UpdateQuestion(q); } info(Frage gespeichert); } catch (Exception e) { error(Jemand hat diesen Datensatz schneller editiert als du und hat somit gewonnen. Lade den Datensatz über die Liste neu!); } } } - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 13. Oktober 2009, 15:44:07 Uhr Betreff: Re: Many forms on one page and submit handling you can add an ComponentFeedbackPanel for each form On Tue, Oct 13, 2009 at 10:39 AM, Peter Arnulf Lustig u...@yahoo.dewrote: Hi, I have one Form-Class which has one main form -- in this form I've got some more forms. Each of them has their own submit button. How can I tell wicket, that it only has to render (validation and so on) only for the form, where the button was pressed? thanks! - 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: Many forms on one page and submit handling
no, that does not work. Now it shows nothing. - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 13. Oktober 2009, 15:54:59 Uhr Betreff: Re: Many forms on one page and submit handling looks like you need to use ComponentFeedbackMessageFilter rather than ContainerFeedbackMessageFilter On Tue, Oct 13, 2009 at 10:46 AM, Peter Arnulf Lustig u...@yahoo.dewrote: yes I do it like that. But nevertheless it shows the messages everywhere on each form. check this out: public class CreateQuestionsForm extends Form { TextFieldStringtitle; TextAreaStringfragestellung; ModelStringtitleModel; ModelStringfragestellungModel; BooleanisUpdate= false; Questionq; ModelStringsystemTagModel; // Tag TextFieldStringsystemTag; LinksystemTagAdd; public CreateQuestionsForm(String id) { super(id); titleModel = Model.of(); fragestellungModel = Model.of(); title = new RequiredTextFieldString(title, titleModel); fragestellung = new TextAreaString(fragestellung, fragestellungModel); add(title); add(fragestellung); // -- Biete Möglichkeit für Tag-Erstellung Form form = new Form(systemTagForm) { @Override protected void onSubmit() { Tagging t = new Tagging(); t.setTitle(systemTagModel.getObject()); Worker.SaveTagging(t); } }; FeedbackPanel feedbackPanel = new FeedbackPanel(systemTagFormFeedbackPanel); feedbackPanel.setFilter(new ContainerFeedbackMessageFilter(form)); systemTagModel = Model.of(); systemTag = new RequiredTextFieldString(systemTag, systemTagModel); add(form.add(feedbackPanel).add(systemTag)); } public void setUpdate(Question q) { isUpdate = true; this.q = q; title.setModel(Model.of(q.getTitle())); fragestellung.setModel(Model.of(q.getText())); q.setSysTimestamp(new Date()); } @Override protected void onSubmit() { try { if (!isUpdate) { q = new Question(); } q.setText(fragestellung.getDefaultModelObjectAsString()); q.setTitle(title.getDefaultModelObjectAsString()); if (!isUpdate) { Worker.SaveQuestion(q); } else { Worker.UpdateQuestion(q); } info(Frage gespeichert); } catch (Exception e) { error(Jemand hat diesen Datensatz schneller editiert als du und hat somit gewonnen. Lade den Datensatz über die Liste neu!); } } } - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Dienstag, den 13. Oktober 2009, 15:44:07 Uhr Betreff: Re: Many forms on one page and submit handling you can add an ComponentFeedbackPanel for each form On Tue, Oct 13, 2009 at 10:39 AM, Peter Arnulf Lustig u...@yahoo.de wrote: Hi, I have one Form-Class which has one main form -- in this form I've got some more forms. Each of them has their own submit button. How can I tell wicket, that it only has to render (validation and so on) only for the form, where the button was pressed? thanks! - 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 -- 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: How do you achieve persistency
Great piece of software! But how did you manage to replace the web.xml filterclass into: filter-classorg.apache.cayenne.conf.WebApplicationContextFilter/filter-class when Wicket needs its own filter class filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class - Ursprüngliche Mail Von: John Armstrong siber...@siberian.org An: users@wicket.apache.org Gesendet: Dienstag, den 6. Oktober 2009, 12:12:11 Uhr Betreff: Re: How do you achieve persistency I use Cayenne (http://cayenne.apache.org/). The GUI tool eliminates any requirement to deal with XML and maps all relationships for you. You can also tweak the XML but its not required or recommended. My workflow is to build my database directly in SQL and then point Cayenne at it and get my persistence layer generated automatically which creates my model and all relationships by following the foreign key constraints(great for legacy projects). When I modify my table structure I tell Cayenne to migrate it and it gives me a list of changes with the option of updating the DB (model wins) or updating the model (DB wins) for each change. Its fantastic for all of the tweaking that goes on in a dev cycle (eg: oops, forget I needed a table that now has to join to this other table.. No problem. Click click done). Insanely great user community and Cayenne has, in my eyes, a very Wicket like dev philosophy that favors convenience and developer productivity over other considerations. Caveat: You can do all of this with Hibernate, I always personally just found Hibernate a bit more complex and 'get in my way' then I needed. Try the quick tutorial they provide and you'll quickly know if its for you or not. John- On Tue, Oct 6, 2009 at 2:34 AM, Peter Arnulf Lustig u...@yahoo.de wrote: What's the fast and easy way? I am asking because of a lot of trouble with hibernate. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: How do you achieve persistency
Cayenne needs his own filter. - Ursprüngliche Mail Von: Olivier Bourgeois olivier.bourgeois@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 7. Oktober 2009, 10:10:00 Uhr Betreff: Re: How do you achieve persistency Why would you replace the Wicket filter ? You can have multiple filters defined in your web.xml , they are chained by your application server. 2009/10/7 Peter Arnulf Lustig u...@yahoo.de Great piece of software! But how did you manage to replace the web.xml filterclass into: filter-classorg.apache.cayenne.conf.WebApplicationContextFilter/filter-class when Wicket needs its own filter class filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class For the persistency question, if you go to filesystem storage and want to have a decent querying system, you can also consider using a JCR content repository : http://en.wikipedia.org/wiki/Content_repository_API_for_Java I believe that most of web applications are manipulating hierarchical data, and for that kind of stuff a Database ORM may not be the most efficient tool. I think Google Storage uses that kind of approach : hirerachical filesystem storage. Of course if you have to do do queries with joins (like in SQL) things will become much more complicated that with a gold old JPA + Hibernate + DBMS - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
org.hibernate.HibernateException: createCriteria is not valid without active transaction
get this error always! I don't understand why. this is my hibernate.cfg.xml hibernate-configuration session-factory name=session1 property name=hibernate.dialectorg.hibernate.dialect.MySQLDialect/property property name=hibernate.connection.driver_classcom.mysql.jdbc.Driver/property property name=hibernate.connection.urljdbc:mysql://localhost:3306/mydb/property property name=hibernate.connection.usernameroot/property property name=hibernate.current_session_context_classorg.hibernate.context.ThreadLocalSessionContext/property mapping resource=org/omikron/test/data/Ticket.hbm.xml/ mapping resource=org/omikron/test/data/Testprocedure.hbm.xml/ mapping resource=org/omikron/test/data/Tag.hbm.xml/ mapping resource=org/omikron/test/data/Testentity.hbm.xml/ mapping resource=org/omikron/test/data/Questionset.hbm.xml/ mapping resource=org/omikron/test/data/Administrator.hbm.xml/ mapping resource=org/omikron/test/data/Systemsetting.hbm.xml/ mapping resource=org/omikron/test/data/Question.hbm.xml/ /session-factory /hibernate-configuration Do you have an idea? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: org.hibernate.HibernateException: createCriteria is not valid without active transaction
How can I do it manually? For example: I have a DataProvider class with a method: public static Administrator getAdministrator(Integer id) { Administrator administrator= (Administrator) HibernateUtil.getSessionFactory().getCurrentSession().createCriteria(Administrator.class).add(Property.forName(id).eq(id)).uniqueResult(); return administrator; } I get the error message. How shall I modify the code? I tried it with Transaction tx = ... and then tx.begin() tx.commit() -- but then suddenly hibernate tries permanently to update an object... wired ! - Ursprüngliche Mail Von: Pieter Degraeuwe pieter.degrae...@systemworks.be An: users@wicket.apache.org Gesendet: Dienstag, den 6. Oktober 2009, 09:29:58 Uhr Betreff: Re: org.hibernate.HibernateException: createCriteria is not valid without active transaction You did not setup your transactions properly. Or you start your transaction manually, or if you like spring, you can let spring manage it. (just add your transction annotations to your services, and, done ! On Tue, Oct 6, 2009 at 9:15 AM, Peter Arnulf Lustig u...@yahoo.dewrote: get this error always! I don't understand why. this is my hibernate.cfg.xml hibernate-configuration session-factory name=session1 property name=hibernate.dialectorg.hibernate.dialect.MySQLDialect/property property name=hibernate.connection.driver_classcom.mysql.jdbc.Driver/property property name=hibernate.connection.urljdbc:mysql://localhost:3306/mydb/property property name=hibernate.connection.usernameroot/property property name=hibernate.current_session_context_classorg.hibernate.context.ThreadLocalSessionContext/property mapping resource=org/omikron/test/data/Ticket.hbm.xml/ mapping resource=org/omikron/test/data/Testprocedure.hbm.xml/ mapping resource=org/omikron/test/data/Tag.hbm.xml/ mapping resource=org/omikron/test/data/Testentity.hbm.xml/ mapping resource=org/omikron/test/data/Questionset.hbm.xml/ mapping resource=org/omikron/test/data/Administrator.hbm.xml/ mapping resource=org/omikron/test/data/Systemsetting.hbm.xml/ mapping resource=org/omikron/test/data/Question.hbm.xml/ /session-factory /hibernate-configuration Do you have an idea? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: org.hibernate.HibernateException: createCriteria is not valid without active transaction
ok! So I need a listener class like HibernateListener and a Transactionfactory in the config xml ? - Ursprüngliche Mail Von: Pieter Degraeuwe pieter.degrae...@systemworks.be An: users@wicket.apache.org Gesendet: Dienstag, den 6. Oktober 2009, 09:49:42 Uhr Betreff: Re: org.hibernate.HibernateException: createCriteria is not valid without active transaction Indeed, when you start a transaction and get an object from the database, hibernate wil persist changes to that object when you transaction (and thus sesseion) is still open. This is normal behaviour. Note that it is in most cases a bad habit to use manual transaction management... On Tue, Oct 6, 2009 at 9:44 AM, Peter Arnulf Lustig u...@yahoo.dewrote: How can I do it manually? For example: I have a DataProvider class with a method: public static Administrator getAdministrator(Integer id) { Administrator administrator= (Administrator) HibernateUtil.getSessionFactory().getCurrentSession().createCriteria(Administrator.class).add(Property.forName(id).eq(id)).uniqueResult(); return administrator; } I get the error message. How shall I modify the code? I tried it with Transaction tx = ... and then tx.begin() tx.commit() -- but then suddenly hibernate tries permanently to update an object... wired ! - Ursprüngliche Mail Von: Pieter Degraeuwe pieter.degrae...@systemworks.be An: users@wicket.apache.org Gesendet: Dienstag, den 6. Oktober 2009, 09:29:58 Uhr Betreff: Re: org.hibernate.HibernateException: createCriteria is not valid without active transaction You did not setup your transactions properly. Or you start your transaction manually, or if you like spring, you can let spring manage it. (just add your transction annotations to your services, and, done ! On Tue, Oct 6, 2009 at 9:15 AM, Peter Arnulf Lustig u...@yahoo.de wrote: get this error always! I don't understand why. this is my hibernate.cfg.xml hibernate-configuration session-factory name=session1 property name=hibernate.dialectorg.hibernate.dialect.MySQLDialect/property property name=hibernate.connection.driver_classcom.mysql.jdbc.Driver/property property name=hibernate.connection.urljdbc:mysql://localhost:3306/mydb/property property name=hibernate.connection.usernameroot/property property name=hibernate.current_session_context_classorg.hibernate.context.ThreadLocalSessionContext/property mapping resource=org/omikron/test/data/Ticket.hbm.xml/ mapping resource=org/omikron/test/data/Testprocedure.hbm.xml/ mapping resource=org/omikron/test/data/Tag.hbm.xml/ mapping resource=org/omikron/test/data/Testentity.hbm.xml/ mapping resource=org/omikron/test/data/Questionset.hbm.xml/ mapping resource=org/omikron/test/data/Administrator.hbm.xml/ mapping resource=org/omikron/test/data/Systemsetting.hbm.xml/ mapping resource=org/omikron/test/data/Question.hbm.xml/ /session-factory /hibernate-configuration Do you have an idea? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How do you achieve persistency
What's the fast and easy way? I am asking because of a lot of trouble with hibernate. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
WebSession Casting unable
Hi, why can't I cast a Websession to a SecurePageSession-Class which extends Websession?! java.lang.ClassCastException: org.apache.wicket.protocol.http.WebSession cannot be cast to org.omikron.test.SecurePageSession In the book I bought (Wicket in Praxis, a german book for wicket 1.4) the author does it like that. Thats my source: public class SecurePageSession extends WebSession{ Integer administratorId; public SecurePageSession(Request request) { super(request); } public synchronized void setAdministrator(Administrator administrator) { administratorId = administrator.getId(); dirty(); } public synchronized void clearAdministrator() { administratorId = null; dirty(); } public synchronized Administrator getAdministrator() { if (administratorId != null ) return AdministratorDataProvider.getAdministrator(administratorId); return null; } public synchronized boolean isAdministratorLogin() { return administratorId != null ? true:false; } public static SecurePageSession get() { return (SecurePageSession) Session.get(); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: WebSession Casting unable
I have overwritten the newSession Method: public class Application extends WebApplication { @Override protected void init() { super.init(); getSecuritySettings().setAuthorizationStrategy(new AdministratorLoginSimplePageAuthStrategy(LoginPage.class)); } @Override public org.apache.wicket.Session newSession(Request request, Response response) { return super.newSession(request, response); } @Override public Class? extends Page getHomePage() { return Backend.class; } } Is this what you mean? - Ursprüngliche Mail Von: Pieter Degraeuwe pieter.degrae...@systemworks.be An: users@wicket.apache.org Gesendet: Montag, den 5. Oktober 2009, 13:29:28 Uhr Betreff: Re: WebSession Casting unable Not each Websession is a SecurePageSession. (but each SecurePageSession IS a WebSession) So, it means that you probably are dealing with a normal WebSession. Is your Application creating the correct Session instance (override the newSession()) On Mon, Oct 5, 2009 at 1:19 PM, Peter Arnulf Lustig u...@yahoo.dewrote: Hi, why can't I cast a Websession to a SecurePageSession-Class which extends Websession?! java.lang.ClassCastException: org.apache.wicket.protocol.http.WebSession cannot be cast to org.omikron.test.SecurePageSession In the book I bought (Wicket in Praxis, a german book for wicket 1.4) the author does it like that. Thats my source: public class SecurePageSession extends WebSession{ Integer administratorId; public SecurePageSession(Request request) { super(request); } public synchronized void setAdministrator(Administrator administrator) { administratorId = administrator.getId(); dirty(); } public synchronized void clearAdministrator() { administratorId = null; dirty(); } public synchronized Administrator getAdministrator() { if (administratorId != null ) return AdministratorDataProvider.getAdministrator(administratorId); return null; } public synchronized boolean isAdministratorLogin() { return administratorId != null ? true:false; } public static SecurePageSession get() { return (SecurePageSession) Session.get(); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: WebSession Casting unable
ah sorry I got it: @Override public org.apache.wicket.Session newSession(Request request, Response response) { return new SecurePageSession(request); } Thank you. I had the auto-fixed solution from netbeans :) - Ursprüngliche Mail Von: Pieter Degraeuwe pieter.degrae...@systemworks.be An: users@wicket.apache.org Gesendet: Montag, den 5. Oktober 2009, 13:29:28 Uhr Betreff: Re: WebSession Casting unable Not each Websession is a SecurePageSession. (but each SecurePageSession IS a WebSession) So, it means that you probably are dealing with a normal WebSession. Is your Application creating the correct Session instance (override the newSession()) On Mon, Oct 5, 2009 at 1:19 PM, Peter Arnulf Lustig u...@yahoo.dewrote: Hi, why can't I cast a Websession to a SecurePageSession-Class which extends Websession?! java.lang.ClassCastException: org.apache.wicket.protocol.http.WebSession cannot be cast to org.omikron.test.SecurePageSession In the book I bought (Wicket in Praxis, a german book for wicket 1.4) the author does it like that. Thats my source: public class SecurePageSession extends WebSession{ Integer administratorId; public SecurePageSession(Request request) { super(request); } public synchronized void setAdministrator(Administrator administrator) { administratorId = administrator.getId(); dirty(); } public synchronized void clearAdministrator() { administratorId = null; dirty(); } public synchronized Administrator getAdministrator() { if (administratorId != null ) return AdministratorDataProvider.getAdministrator(administratorId); return null; } public synchronized boolean isAdministratorLogin() { return administratorId != null ? true:false; } public static SecurePageSession get() { return (SecurePageSession) Session.get(); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: WebSession Casting unable
yeah you are right. Thank you for your help. - Ursprüngliche Mail Von: Pedro Santos pedros...@gmail.com An: users@wicket.apache.org Gesendet: Montag, den 5. Oktober 2009, 13:50:32 Uhr Betreff: Re: WebSession Casting unable your implementation needs to return an instance of SecurePageSession On Mon, Oct 5, 2009 at 8:43 AM, Peter Arnulf Lustig u...@yahoo.dewrote: I have overwritten the newSession Method: public class Application extends WebApplication { @Override protected void init() { super.init(); getSecuritySettings().setAuthorizationStrategy(new AdministratorLoginSimplePageAuthStrategy(LoginPage.class)); } @Override public org.apache.wicket.Session newSession(Request request, Response response) { return super.newSession(request, response); } @Override public Class? extends Page getHomePage() { return Backend.class; } } Is this what you mean? - Ursprüngliche Mail Von: Pieter Degraeuwe pieter.degrae...@systemworks.be An: users@wicket.apache.org Gesendet: Montag, den 5. Oktober 2009, 13:29:28 Uhr Betreff: Re: WebSession Casting unable Not each Websession is a SecurePageSession. (but each SecurePageSession IS a WebSession) So, it means that you probably are dealing with a normal WebSession. Is your Application creating the correct Session instance (override the newSession()) On Mon, Oct 5, 2009 at 1:19 PM, Peter Arnulf Lustig u...@yahoo.de wrote: Hi, why can't I cast a Websession to a SecurePageSession-Class which extends Websession?! java.lang.ClassCastException: org.apache.wicket.protocol.http.WebSession cannot be cast to org.omikron.test.SecurePageSession In the book I bought (Wicket in Praxis, a german book for wicket 1.4) the author does it like that. Thats my source: public class SecurePageSession extends WebSession{ Integer administratorId; public SecurePageSession(Request request) { super(request); } public synchronized void setAdministrator(Administrator administrator) { administratorId = administrator.getId(); dirty(); } public synchronized void clearAdministrator() { administratorId = null; dirty(); } public synchronized Administrator getAdministrator() { if (administratorId != null ) return AdministratorDataProvider.getAdministrator(administratorId); return null; } public synchronized boolean isAdministratorLogin() { return administratorId != null ? true:false; } public static SecurePageSession get() { return (SecurePageSession) Session.get(); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pieter Degraeuwe Systemworks bvba Belgiëlaan 61 9070 Destelbergen GSM: +32 (0)485/68.60.85 Email: pieter.degrae...@systemworks.be visit us at http://www.systemworks.be - 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
Show Validation Errors
Hi, I am trying to show validation errors on a page. Somehow it won't function! But I don't understand why? I mean I am using the right Validation class... Why don't wicket show any error when the user does a wrong input? Thanks! import java.util.Date; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.PasswordTextField; import org.apache.wicket.markup.html.form.RequiredTextField; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.form.validation.EqualPasswordInputValidator; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; import org.apache.wicket.util.value.ValueMap; import org.omikron.test.data.Administrator; import org.omikron.test.data.AdministratorDataProvider; /** * * @author sven.dzepina */ public class CreateAdministratorForm extends Form { private ValueMap properties = new ValueMap(); TextFieldString username; TextFieldString email; TextFieldString firstname; TextFieldString lastname; PasswordTextField password; PasswordTextField password2; Boolean isUpdate = false; Administrator a; public CreateAdministratorForm(String id) { super(id); username = new RequiredTextFieldString(username, new PropertyModelString(properties, username)); password = new PasswordTextField(password, new PropertyModelString(properties, password)); password2 = new PasswordTextField(password2, new PropertyModelString(properties, password2)); email = new RequiredTextField(email, new PropertyModel(properties, email)); firstname = new RequiredTextField(firstname, new PropertyModel(properties, firstname)); lastname = new RequiredTextField(lastname, new PropertyModel(properties, lastname)); add(email); add(password2); add(firstname); add(lastname); add(username); add(password); add(new EqualPasswordInputValidator(password, password2)); } public void setUpdate(Administrator a) { this.a = a; isUpdate = true; IModelString usernameModel = Model.of(a.getUsername()); IModelString emailModel = Model.of(a.getEmail()); IModelString firstnameModel = Model.of(a.getFirstname()); IModelString lastnameModel = Model.of(a.getLastname()); username.setModel(usernameModel); email.setModel(emailModel); firstname.setModel(firstnameModel); lastname.setModel(lastnameModel); } @Override public void onSubmit() { if ( !isUpdate ) { Administrator a = new Administrator(); a.setEmail(email.getModel().getObject()); a.setFirstname(firstname.getModel().getObject()); a.setLastname(lastname.getModel().getObject()); a.setPassword(password.getModel().getObject()); a.setUsername(username.getModel().getObject()); a.setSysTimestamp(new Date()); AdministratorDataProvider administratorDataProvider = new AdministratorDataProvider(); administratorDataProvider.save(a); } else { a.setEmail(email.getModel().getObject()); a.setFirstname(firstname.getModel().getObject()); a.setLastname(lastname.getModel().getObject()); a.setPassword(password.getModel().getObject()); a.setUsername(username.getModel().getObject()); a.setSysTimestamp(new Date()); AdministratorDataProvider administratorDataProvider = new AdministratorDataProvider(); administratorDataProvider.save(a); } } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: Show Validation Errors
Thank you! That does it! - Ursprüngliche Mail Von: Matthias Keller matthias.kel...@ergon.ch An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 10:23:11 Uhr Betreff: Re: Show Validation Errors Hi Peter Try adding a FeedbackPanel to your page Without that, wicket doesn't even know where and how to display the messages. Matt Peter Arnulf Lustig wrote: Hi, I am trying to show validation errors on a page. Somehow it won't function! But I don't understand why? I mean I am using the right Validation class... Why don't wicket show any error when the user does a wrong input? Thanks! import java.util.Date; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.PasswordTextField; import org.apache.wicket.markup.html.form.RequiredTextField; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.form.validation.EqualPasswordInputValidator; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; import org.apache.wicket.util.value.ValueMap; import org.omikron.test.data.Administrator; import org.omikron.test.data.AdministratorDataProvider; /** * * @author sven.dzepina */ public class CreateAdministratorForm extends Form { private ValueMap properties = new ValueMap(); TextFieldString username; TextFieldString email; TextFieldString firstname; TextFieldString lastname; PasswordTextField password; PasswordTextField password2; Boolean isUpdate = false; Administrator a; public CreateAdministratorForm(String id) { super(id); username = new RequiredTextFieldString(username, new PropertyModelString(properties, username)); password = new PasswordTextField(password, new PropertyModelString(properties, password)); password2 = new PasswordTextField(password2, new PropertyModelString(properties, password2)); email = new RequiredTextField(email, new PropertyModel(properties, email)); firstname = new RequiredTextField(firstname, new PropertyModel(properties, firstname)); lastname = new RequiredTextField(lastname, new PropertyModel(properties, lastname)); add(email); add(password2); add(firstname); add(lastname); add(username); add(password); add(new EqualPasswordInputValidator(password, password2)); } public void setUpdate(Administrator a) { this.a = a; isUpdate = true; IModelString usernameModel = Model.of(a.getUsername()); IModelString emailModel = Model.of(a.getEmail()); IModelString firstnameModel = Model.of(a.getFirstname()); IModelString lastnameModel = Model.of(a.getLastname()); username.setModel(usernameModel); email.setModel(emailModel); firstname.setModel(firstnameModel); lastname.setModel(lastnameModel); } @Override public void onSubmit() { if ( !isUpdate ) { Administrator a = new Administrator(); a.setEmail(email.getModel().getObject()); a.setFirstname(firstname.getModel().getObject()); a.setLastname(lastname.getModel().getObject()); a.setPassword(password.getModel().getObject()); a.setUsername(username.getModel().getObject()); a.setSysTimestamp(new Date()); AdministratorDataProvider administratorDataProvider = new AdministratorDataProvider(); administratorDataProvider.save(a); } else { a.setEmail(email.getModel().getObject()); a.setFirstname(firstname.getModel().getObject()); a.setLastname(lastname.getModel().getObject()); a.setPassword(password.getModel().getObject()); a.setUsername(username.getModel().getObject()); a.setSysTimestamp(new Date()); AdministratorDataProvider administratorDataProvider = new AdministratorDataProvider(); administratorDataProvider.save(a); } } } - 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 would you realize a delete-Link in a datagrid row?
Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: How would you realize a delete-Link in a datagrid row?
In addition: my specific problem is, that after clicking on a link which is generated in the datagrid, I am not able to manipulate other components!? How is this possible? - Ursprüngliche Mail Von: Peter Arnulf Lustig u...@yahoo.de An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 11:29:03 Uhr Betreff: How would you realize a delete-Link in a datagrid row? Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: How would you realize a delete-Link in a datagrid row?
Hi Ernesto, I don't get it: How can I change the Label-Text? When I try to change the Model of the component Label, nothing happens. The page reloads and the Label has the old Text (not the new one which is meant to be changed) - Ursprüngliche Mail Von: Ernesto Reinaldo Barreiro reier...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 11:38:33 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? What about replacing the link. e.g. via AJAX, with a new one containing the Do you really want to delete xyz warning... that once clicked actually deletes your entry... and refreshes the datagrid. You could even use the same link and have a flag that says userWantsToDeleteRow and use it to conditionally change the actions to do and the contents to display. Best, Ernesto On Wed, Sep 30, 2009 at 11:29 AM, Peter Arnulf Lustig u...@yahoo.dewrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: How would you realize a delete-Link in a datagrid row?
Thank you! Your solution is really nice. It functions well! I have a problem which the datagrid. After removing a row in the database it throws an exception, because wicket is unable to populate an item (I assume the deleted one) How can I tell wicket to reload the datagrid because something in the DB changed. - Ursprüngliche Mail Von: Linda van der Pal lvd...@heritageagenturen.nl An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 11:43:40 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? I created a deteletButton as follows. I have a DeleteButton innerclass, and a method that adds this button to the panel that is shown in the table. private class DeleteButton extends Button { private static final long serialVersionUID = 1L; public DeleteButton(final String id, final IModelString model) { super(id, model); } @Override public void onSubmit() { try { deleteData((String) getModelObject()); // a method that does the actual data deletion in the database } catch (SQLException se) { error(StringResources.SQLERROR_GET + '\n' + se.getMessage()); } catch (IOException ie) { error(StringResources.IOERROR + '\n' + ie.getMessage()); } } @Override public boolean isEnabled() { return isEditingAuthorised(); } } private void addDeleteLink(final IModel? model) { String id = (String)getIdFromModel(model); // a method that extracts the id from the model (based on what kind of class is in the model) Button deleteButton = new DeleteButton(delete, new ModelString(id)); deleteButton.add(new Image(deleteIcon, new ResourceReference(EmptyIconReference.class, list-remove.png))); deleteButton.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');)); add(deleteButton); } I hope this helps. Regards, Linda Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - 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.409 / Virus Database: 270.13.115/2404 - Release Date: 09/30/09 05:52: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
AW: Rendered html to string
getMarkupStream().toString(); maybe? - Ursprüngliche Mail Von: Luca Provenzani eufor...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 12:32:19 Uhr Betreff: Rendered html to string Hi all, does someone know how to render a wicket component into a String? Thanks Luca - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: How would you realize a delete-Link in a datagrid row?
could you tell me how to use this? I have a Dataview like this: dataView = new DataViewAdministrator(benutzer, new AdministratorDataProvider()) { } thanks! - Ursprüngliche Mail Von: Linda van der Pal lvd...@heritageagenturen.nl An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 13:37:44 Uhr Betreff: Re: AW: How would you realize a delete-Link in a datagrid row? I used this with a AjaxFallbackDefaultDataTable and then I didn't have to tell it that the DB had changed. Peter Arnulf Lustig wrote: Thank you! Your solution is really nice. It functions well! I have a problem which the datagrid. After removing a row in the database it throws an exception, because wicket is unable to populate an item (I assume the deleted one) How can I tell wicket to reload the datagrid because something in the DB changed. - Ursprüngliche Mail Von: Linda van der Pal lvd...@heritageagenturen.nl An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 11:43:40 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? I created a deteletButton as follows. I have a DeleteButton innerclass, and a method that adds this button to the panel that is shown in the table. private class DeleteButton extends Button { private static final long serialVersionUID = 1L; public DeleteButton(final String id, final IModelString model) { super(id, model); } @Override public void onSubmit() { try { deleteData((String) getModelObject()); // a method that does the actual data deletion in the database } catch (SQLException se) { error(StringResources.SQLERROR_GET + '\n' + se.getMessage()); } catch (IOException ie) { error(StringResources.IOERROR + '\n' + ie.getMessage()); } } @Override public boolean isEnabled() { return isEditingAuthorised(); } } private void addDeleteLink(final IModel? model) { String id = (String)getIdFromModel(model); // a method that extracts the id from the model (based on what kind of class is in the model) Button deleteButton = new DeleteButton(delete, new ModelString(id)); deleteButton.add(new Image(deleteIcon, new ResourceReference(EmptyIconReference.class, list-remove.png))); deleteButton.add(new SimpleAttributeModifier(onclick, return confirm('Are you sure?');)); add(deleteButton); } I hope this helps. Regards, Linda Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - 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.409 / Virus Database: 270.13.115/2404 - Release Date: 09/30/09 05:52: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.409 / Virus Database: 270.13.115/2404 - Release Date: 09/30/09 05:52: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
AW: How would you realize a delete-Link in a datagrid row?
How do you achieve, that the dataview is refreshed after clicking delete? - Ursprüngliche Mail Von: rmattler robertmatt...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 14:51:19 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? Another approach would be to created a model window to appear when the delete link is clicked. With the message Are you sure you want to delete xxx? If you select yes, the row is deleted then ajax is used to refresh the dataview. Let me know if you want to use this approach and I will post an example. Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - 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/How-would-you-realize-a-%22delete%22-Link-in-a-datagrid-row--tp2561p25680407.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
AW: How would you realize a delete-Link in a datagrid row?
yes I thought it... :) How do you achieve that the dataview is refreshed after deletion of a row? - Ursprüngliche Mail Von: rmattler robertmatt...@gmail.com An: users@wicket.apache.org Gesendet: Mittwoch, den 30. September 2009, 16:19:11 Uhr Betreff: Re: How would you realize a delete-Link in a datagrid row? Sorry spelling error not model window but modal window. rmattler wrote: Another approach would be to created a model window to appear when the delete link is clicked. With the message Are you sure you want to delete xxx? If you select yes, the row is deleted then ajax is used to refresh the dataview. Let me know if you want to use this approach and I will post an example. Peter Arnulf Lustig wrote: Hi, I'd like to create a delete link where you can delete a row in a datagrid. But when you click on the delete link, the delete label should change and a warning occurs: Do you really want to delete xyz. After the second click it finally deletes the content. How can I achieve that? Could you verbalize the procedure? Thanks!! - 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/How-would-you-realize-a-%22delete%22-Link-in-a-datagrid-row--tp2561p25681996.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