Re: [Wicket-user] Ajax component replaceWith and browser back-button problems
Pretty sure. I'm using Maven2 and the JAR name is wicket-1.3.0-incubating-SNAPSHOT.jar On 3/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: auto is something from 2.0, are you sure you have the right jars? -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Thanks Eelco Igor I got the api and src and made the changes for AbstractValidator - will also try to add some stuff to the wiki page as soon as I finish refactoring. But I have a big problem with the usage of wicket:message attribute (tag works fine). This is the error: wicket.markup.MarkupException: Unable to find component with id 'auto-message_attr' in [MarkupContainer [...]] This is the offending markup: input type=submit wicket:message=value= login.submit/ Any idea how to proceed? Looks like something related to wicket:message attribute i18n broke. Thanks, Peter. On 3/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: we only have an unofficial release for it that is a zip. search the list for it, it is in martijn's dir somewhere. other then that all the jars/src/and javadocs are available from that wicketstuff.org maven repo. all the new classes in wicket.validator package have pretty good javadocs so that might be a place to start -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Ok, my bad - the documentation does mention the package change to wicket.validation.validator.AbstractValidator But the API looks a lot different, can you quickly point me to the online Javadoc corresponding to 1.3.0-incubating-SNAPSHOT - also if it is downloadable as a zip or something. Thanks, Peter. On 3/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: hmm, it is briefly mentioned under Validation Changes i dont remember if we still have abstract validator or not, see the source of other alidators and if they extend something. -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Igor, I now see that there is a 1.3.0-incubating-SNAPSHOT (as opposed to 1.3-incubating-SNAPSHOT which I was using earlier). I assume this is the latest version and just switched. But Looks like wicket.markup.html.form.validation.AbstractValidatorhas disappeared. I don't see a mention of this at http://cwiki.apache.org/WICKET/migrate-13.html can you help? Other API changes I noted: - getObject(Component) in AbstractReadOnlyModel became getObject() - FeedBackMessage.getMessage() returns Object not String - IStringResourceLoader added one method signature loadStringResource(Component, String) Thanks, Peter. On 3/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: peter can you try updating to the lastest snapshot and trying again? -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Matej - I am using wicket-1.3-incubating-SNAPSHOT.jar dated 2007-03-12 Let me know if you need any more details. On the Page in question I had tried setVersioned with both true and false, same result. Thanks, Peter. On 3/28/07, Matej Knopp [EMAIL PROTECTED] wrote: Peter, are you using 1.x? this can be caused by ajax requests being non-versioned in 1.2. In 1.x, the changes should be merged to latest version. On 3/28/07, Igor Vaynberg [EMAIL PROTECTED] wrote: matej didnt you fix this in 1.x svn? -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Hi, I have a panel A that is replaced by another panel B over Ajax using Component.replaceWith (). Panel B contains a few Links. Say I navigate to this Page and trigger the event that causes panel B to replace Panel A. Then I click one of the Link(s) within Panel B that brings up another page. Now when I use the browser back button I see the first Page where B is visible as expected. But now when I click on another Link within B - it causes a Wicket runtime exception: component [...] not found on page [...] Everywhere else across the app, browser back-button works beautifully. Is this problem to be expected if you have links within an area on a page refreshed using Ajax and then you use the browser back button to try other links in that area? Thanks, Peter. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's
Re: [Wicket-user] Binding and validating domain objects
Not all values will be overwritten, and if you don't check for concurrent updates (your users will try to modify the same object at the same time!) you are in for some hefty support calls. And if you disable a field, its value will not be part of the form processing, also something to take into consideration. Hibernate and JPA use optimistic locking by introducing a version field. The first person to save the update 'wins'. The second will not be able to update (the version has been upped, effectively changing the logical key for the object, so the update will not find the record). This version can be stored in your model or even in your form [1]. Also, how are you going to resolve the relations? Person - Address? Are you going to create those as well? I think your approach is novel, but may need some thorough thinking. Martijn [1] http://martijndashorst.com/blog/2006/02/13/wicket-goodie-hibernate-versioned-form/ On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: Hi all, I'm migrating a spring-mvc project to wicket. In this project domain objects are directly exposed to the ui (without DTOs in between). The objects are validated using the spring bean validation framework (part of springmodules). This module creates a unique Validator (a spring interface) from annotations given in the fields/properties of every validatable object. Then you inject this global validator to your controllers (in the case of spring-mvc) so they can validate their form/command (the bound object). The result of validation is an Errors objects, with field errors and global errors (more precisely, error codes to be resolved against a messages resource). It's pretty easy to map these errors from bean properties to wicket component ids. This should be done inside onSubmit(), once the object is bound (for example, using a CompoundPropertyModel). So, to recap: domain objects directly exposed to the ui, Validator created from annotations in validatable domain objects, domain objects bound by PropertyModels, domain objects validated by injected validator during onSubmit. Up to this point I'm pretty happy with the results, validation is almost trivial with the annotations and the valang dsl, and I like it being inside the domain instead of tied to the ui components. One problem I have due to avoiding DTOs is that most of the time I don't want to serialize my form models, because they are (often big) entities with lazy loaded associations. So in principle I would use an LoadableDetachableModel to load the entity from the repository each time the model is reattached. But suppose I'm updating a UserProfile. The first time it would be ok to populate the model from the persistent profile to be updated. But once the form is submitted there's no point in loading the profile from the repository again because its properties would be overwritten from those coming from the form anyway. So I'm tempted to subclass AbstractDetachableModel so that it loads the profile from the repository upon creation, but instantiates a brand new profile to be populated from the form upon reattachment. Is there a better pattern for this? Anyone has run into the same problem? Cheers, Carlos - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Ajax component replaceWith and browser back-button problems
And the Ajax replace / browser back-button problem is still there even in 1.3.0 [29-Mar]. Do you need me to open a JIRA? I'll revert to 1.3 for now. Thanks, Peter. On 3/29/07, Peter Thomas [EMAIL PROTECTED] wrote: Pretty sure. I'm using Maven2 and the JAR name is wicket-1.3.0-incubating-SNAPSHOT.jar On 3/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: auto is something from 2.0, are you sure you have the right jars? -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Thanks Eelco Igor I got the api and src and made the changes for AbstractValidator - will also try to add some stuff to the wiki page as soon as I finish refactoring. But I have a big problem with the usage of wicket:message attribute (tag works fine). This is the error: wicket.markup.MarkupException: Unable to find component with id 'auto-message_attr' in [MarkupContainer [...]] This is the offending markup: input type=submit wicket:message=value= login.submit/ Any idea how to proceed? Looks like something related to wicket:message attribute i18n broke. Thanks, Peter. On 3/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: we only have an unofficial release for it that is a zip. search the list for it, it is in martijn's dir somewhere. other then that all the jars/src/and javadocs are available from that wicketstuff.org maven repo. all the new classes in wicket.validator package have pretty good javadocs so that might be a place to start -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Ok, my bad - the documentation does mention the package change to wicket.validation.validator.AbstractValidator But the API looks a lot different, can you quickly point me to the online Javadoc corresponding to 1.3.0-incubating-SNAPSHOT - also if it is downloadable as a zip or something. Thanks, Peter. On 3/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: hmm, it is briefly mentioned under Validation Changes i dont remember if we still have abstract validator or not, see the source of other alidators and if they extend something. -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Igor, I now see that there is a 1.3.0-incubating-SNAPSHOT (as opposed to 1.3-incubating-SNAPSHOT which I was using earlier). I assume this is the latest version and just switched. But Looks like wicket.markup.html.form.validation.AbstractValidator has disappeared. I don't see a mention of this at http://cwiki.apache.org/WICKET/migrate-13.html can you help? Other API changes I noted: - getObject(Component) in AbstractReadOnlyModel became getObject() - FeedBackMessage.getMessage() returns Object not String - IStringResourceLoader added one method signature loadStringResource(Component, String) Thanks, Peter. On 3/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: peter can you try updating to the lastest snapshot and trying again? -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Matej - I am using wicket-1.3-incubating-SNAPSHOT.jardated 2007-03-12 Let me know if you need any more details. On the Page in question I had tried setVersioned with both true and false, same result. Thanks, Peter. On 3/28/07, Matej Knopp [EMAIL PROTECTED] wrote: Peter, are you using 1.x? this can be caused by ajax requests being non-versioned in 1.2. In 1.x, the changes should be merged to latest version. On 3/28/07, Igor Vaynberg [EMAIL PROTECTED] wrote: matej didnt you fix this in 1.x svn? -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Hi, I have a panel A that is replaced by another panel B over Ajax using Component.replaceWith (). Panel B contains a few Links. Say I navigate to this Page and trigger the event that causes panel B to replace Panel A. Then I click one of the Link(s) within Panel B that brings up another page. Now when I use the browser back button I see the first Page where B is visible as expected. But now when I click on another Link within B - it causes a Wicket runtime exception: component [...] not found on page [...] Everywhere else across the app, browser back-button works beautifully. Is this problem to be expected if you have links within an area on a
[Wicket-user] Internationalization and DropDownChoice
Hello, I had the following: one extended DropDownChoice with different languages and some fields in a form. When the user changes it, I get success in getting the translation of everything in the page, and also Wicket maintains whatever the user wrote in the fields, so it's nice. But I have a problem with one DropDownChoice which cointains countries. By default, it show the english names of all the countries in the world. In the onSelectionChanged of the languages DropDownChoice I reload the country names from the database, and make the following: countries = new DropDownChoice(country, getCountries()); userInformationForm.replace(countries); It works, at the same time I change the language, I get the country list in that language, but if the user selected one country, I can't maintain his selection... Any ideas? It should be easy as long as the ID of the country is the same... Thank you very very much for your help, Oskar -- View this message in context: http://www.nabble.com/Internationalization-and-DropDownChoice-tf3485705.html#a9731005 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Radio.getValue?
pinging/bump Eelco to answer:) Fra: [EMAIL PROTECTED] på vegne af Nino Wael Sendt: on 28-03-2007 09:54 Til: wicket-user@lists.sourceforge.net Emne: SV: [Wicket-user] Radio.getValue? Ok, let me try to explain another way. If you create a page where you use the radio component. The radios represent various kinds of datasets(OLAP cubes in this case but it does not really matter). On monday the 1. march you record with jmeter your test case(jmeter only records the http requests). In your test case you must select the retirement dataset (which has the value radio5 on the html page). Some time has passed now and you want to run your jmeter test, but on your page some of the datasets has been removed (they wasnt needed or was not allowed to be shown). So now the page no longer contains the radio with the value radio5, and your jmeter test will fail because wicket cant find the radio(another error scenario would be if the radios changed order). So if radio component allowed the use of Ichoicerenderer, it could generate the value based on the id of the ichoicerenderer for the particular dataitem. This would bring better persistance to the radios. At least when testing with jmeter. Did I do a better job explaining?:) Some could argue that it's not issue, but it would be very handy to have the ability to use the ichoicerender with every component that makes use of the value attribute in inputs(havent thought it through though). Because it would make it easier to use tools as jmeter. I would suggest that to avoid nameclashing we could use the components name.getIdValue as value attribute. I am aware that this would bring in a possible vuernability, if duplicate items are inserted and that could cause problems i guess? regards Nino Fra: [EMAIL PROTECTED] på vegne af Eelco Hillenius Sendt: ti 27-03-2007 18:40 Til: wicket-user@lists.sourceforge.net Emne: Re: [Wicket-user] Radio.getValue? I'm afraid I don't really understand your problem Nino. Eelco On 3/26/07, Nino Wael [EMAIL PROTECTED] wrote: Hi We are doing some extensive Jmeter testing, and have run into a technical problem regarding radios, which are the following: If you had 5 radios on a page at a given time, their value would have been radio1, radio2.. radio5. If you then pulled out radio number 4 then the list would be this, radio1, radio2 .. radio4. Now only the one previously called radio4 should not have been selectable. This renders our jmeter test pretty vuernable if some of the stuff no longer are available. Im not sure if I can use a ichoicerenderer, looking at the code from getValue, it's pretty hardcoded am I correct? If possible i'd like to just use the IChoiceRenderer's getId instead, that should fix the problem. regards Nino - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user winmail.dat- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] AJAX modal window (1.2.5)and form
Hmm after some extensive testing. It appears as the radiochoice cant be used with ajax when applying the ajaxformupdating component (the update a called but the radiochoice model arent updated), I am using onchance attribute to trigger ajax are this wrong? It works just fine when using dropdown. Not matter if its on a page or panel.. regards Nino Fra: [EMAIL PROTECTED] på vegne af Nino Wael Sendt: ma 26-03-2007 15:18 Til: wicket-user@lists.sourceforge.net Emne: SV: [Wicket-user] AJAX modal window (1.2.5)and form it's not a nested form: body concept ideas: display questionaire on main page, have popups when adding questions with available question types. form wicket:id=form input type=submit wicket:id=addQuestion / /form div wicket:id=modalquestionpopup/div div wicket:id=selectedradionone/div /body form tag are closed before the popup tag(modalquestionpopup). I'll try creating a page instead? regards Nino -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] på vegne af Matej Knopp Sendt: ma 26-03-2007 14:37 Til: wicket-user@lists.sourceforge.net Emne: Re: [Wicket-user] AJAX modal window (1.2.5)and form If you have nested forms it will fail. Nested forms are not supported in wicket 1.2. If you need separate form in modal window in 1.2, the safest bet is to use a page inside modal window. -Matej On 3/26/07, Nino Wael [EMAIL PROTECTED] wrote: Hi I have a AJAX modal window wich contains a form. In the form there a an radiochoice that has an ajax formcomponentupdatingbehavior. Now the updating behavior are trigered but the model of the radiochoice aren't being updated. Also on the basepage where you can trigger the modal window, I also have a form. Not sure if this should make anything fail? snip of the code from the panel thats used in the modal window: public QuestionSelectorPanel(String id, final IModel selectedQuestion, final ModalWindow modalQuestionPop, final Label label) { super(id); Form form = new Form(form); final RadioChoice questionRadio = new RadioChoice(questions, selectedQuestion, Question.getTypes()); questionRadio.setOutputMarkupId(true); questionRadio.add(new AjaxFormComponentUpdatingBehavior(onchange) { protected void onUpdate(AjaxRequestTarget target) { System.out.print(selected value should print here!: + selectedQuestion.toString()); // below are working, label prints out foobar // label.setModelObject(foobar!); target.addComponent(label); modalQuestionPop.close(target); } }); add(form); form.add(questionRadio); } snip of the basecode: final ModalWindow modalQuestionPop = new ModalWindow( modalquestionpopup); add(modalQuestionPop); Label label = new Label(selectedradio, selectedQuestion); label.setOutputMarkupId(true); modalQuestionPop.setOutputMarkupId(true); modalQuestionPop.setTitle(Please select a Question type); modalQuestionPop.setContent(new QuestionSelectorPanel(modalQuestionPop .getContentId(), selectedQuestion, modalQuestionPop, label)); Form form = new Form(form); AjaxSubmitButton addQuestion = new AjaxSubmitButton(addQuestion, form) { protected void onSubmit(wicket.ajax.AjaxRequestTarget arg0, Form arg1) { modalQuestionPop.show(arg0); }; }; form.add(addQuestion); add(form); add(label); regards Nino - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn
Re: [Wicket-user] AJAX modal window (1.2.5)and form
heheh obviously i am using onchange and not onchance:) Fra: [EMAIL PROTECTED] på vegne af Nino Wael Sendt: to 29-03-2007 13:42 Til: wicket-user@lists.sourceforge.net; wicket-user@lists.sourceforge.net Emne: Re: [Wicket-user] AJAX modal window (1.2.5)and form Hmm after some extensive testing. It appears as the radiochoice cant be used with ajax when applying the ajaxformupdating component (the update a called but the radiochoice model arent updated), I am using onchance attribute to trigger ajax are this wrong? It works just fine when using dropdown. Not matter if its on a page or panel.. regards Nino Fra: [EMAIL PROTECTED] på vegne af Nino Wael Sendt: ma 26-03-2007 15:18 Til: wicket-user@lists.sourceforge.net Emne: SV: [Wicket-user] AJAX modal window (1.2.5)and form it's not a nested form: body concept ideas: display questionaire on main page, have popups when adding questions with available question types. form wicket:id=form input type=submit wicket:id=addQuestion / /form div wicket:id=modalquestionpopup/div div wicket:id=selectedradionone/div /body form tag are closed before the popup tag(modalquestionpopup). I'll try creating a page instead? regards Nino -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] på vegne af Matej Knopp Sendt: ma 26-03-2007 14:37 Til: wicket-user@lists.sourceforge.net Emne: Re: [Wicket-user] AJAX modal window (1.2.5)and form If you have nested forms it will fail. Nested forms are not supported in wicket 1.2. If you need separate form in modal window in 1.2, the safest bet is to use a page inside modal window. -Matej On 3/26/07, Nino Wael [EMAIL PROTECTED] wrote: Hi I have a AJAX modal window wich contains a form. In the form there a an radiochoice that has an ajax formcomponentupdatingbehavior. Now the updating behavior are trigered but the model of the radiochoice aren't being updated. Also on the basepage where you can trigger the modal window, I also have a form. Not sure if this should make anything fail? snip of the code from the panel thats used in the modal window: public QuestionSelectorPanel(String id, final IModel selectedQuestion, final ModalWindow modalQuestionPop, final Label label) { super(id); Form form = new Form(form); final RadioChoice questionRadio = new RadioChoice(questions, selectedQuestion, Question.getTypes()); questionRadio.setOutputMarkupId(true); questionRadio.add(new AjaxFormComponentUpdatingBehavior(onchange) { protected void onUpdate(AjaxRequestTarget target) { System.out.print(selected value should print here!: + selectedQuestion.toString()); // below are working, label prints out foobar // label.setModelObject(foobar!); target.addComponent(label); modalQuestionPop.close(target); } }); add(form); form.add(questionRadio); } snip of the basecode: final ModalWindow modalQuestionPop = new ModalWindow( modalquestionpopup); add(modalQuestionPop); Label label = new Label(selectedradio, selectedQuestion); label.setOutputMarkupId(true); modalQuestionPop.setOutputMarkupId(true); modalQuestionPop.setTitle(Please select a Question type); modalQuestionPop.setContent(new QuestionSelectorPanel(modalQuestionPop .getContentId(), selectedQuestion, modalQuestionPop, label)); Form form = new Form(form); AjaxSubmitButton addQuestion = new AjaxSubmitButton(addQuestion, form) { protected void onSubmit(wicket.ajax.AjaxRequestTarget arg0, Form arg1) { modalQuestionPop.show(arg0); }; }; form.add(addQuestion); add(form); add(label); regards Nino - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user
Re: [Wicket-user] Binding and validating domain objects
Hi Martijn, Not all values will be overwritten, and if you don't check for concurrent updates (your users will try to modify the same object at the same time!) you are in for some hefty support calls. Concurrent updates won't be common because most of the updated info will be per user, and only one session could be opened per user. Anyway, in case they do happen, I will use optimistic or pessimistic locking depending on the particular scenario (most often pessimistic because concurrent editings won't be frequent); and it's not always that I care about application-level transactionality: you and me can start editing A, then you commit A', then I commit A'', not serializable behaviour, but it would acceptable sometimes. And if you disable a field, its value will not be part of the form processing, also something to take into consideration. Yep, in this case I would use LoadableDetachableModel to load the entity every time. But it's not that often that my forms show just fragments of the entire entity. I'm not proposing/asking for a one-size-fits-all solution, just one that fits a use case like that described for the UserProfile. Also, how are you going to resolve the relations? Person - Address? Are you going to create those as well? Exactly. It's the thing most people do with spring-mvc I guess. There your request parameters are bound to fresh objects by default (although you could override formBackingObject() to change that). The associated objects are created in albis during construction of the main one, and so on recursively. Binding is then done up to arbitrary nesting levels. Regards, Carlos Martijn [1] http://martijndashorst.com/blog/2006/02/13/wicket-goodie-hibernate-versioned-form/ On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: Hi all, I'm migrating a spring-mvc project to wicket. In this project domain objects are directly exposed to the ui (without DTOs in between). The objects are validated using the spring bean validation framework (part of springmodules). This module creates a unique Validator (a spring interface) from annotations given in the fields/properties of every validatable object. Then you inject this global validator to your controllers (in the case of spring-mvc) so they can validate their form/command (the bound object). The result of validation is an Errors objects, with field errors and global errors (more precisely, error codes to be resolved against a messages resource). It's pretty easy to map these errors from bean properties to wicket component ids. This should be done inside onSubmit(), once the object is bound (for example, using a CompoundPropertyModel). So, to recap: domain objects directly exposed to the ui, Validator created from annotations in validatable domain objects, domain objects bound by PropertyModels, domain objects validated by injected validator during onSubmit. Up to this point I'm pretty happy with the results, validation is almost trivial with the annotations and the valang dsl, and I like it being inside the domain instead of tied to the ui components. One problem I have due to avoiding DTOs is that most of the time I don't want to serialize my form models, because they are (often big) entities with lazy loaded associations. So in principle I would use an LoadableDetachableModel to load the entity from the repository each time the model is reattached. But suppose I'm updating a UserProfile. The first time it would be ok to populate the model from the persistent profile to be updated. But once the form is submitted there's no point in loading the profile from the repository again because its properties would be overwritten from those coming from the form anyway. So I'm tempted to subclass AbstractDetachableModel so that it loads the profile from the repository upon creation, but instantiates a brand new profile to be populated from the form upon reattachment. Is there a better pattern for this? Anyone has run into the same problem? Cheers, Carlos - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics
Re: [Wicket-user] Binding and validating domain objects
Also, how are you going to resolve the relations? Person - Address? Are you going to create those as well? Exactly. It's the thing most people do with spring-mvc I guess. There your request parameters are bound to fresh objects by default (although you could override formBackingObject() to change that). The associated objects are created in albis during construction of the main one, and so on recursively. Binding is then done up to arbitrary nesting levels. To state this more precisely: relationships that are more of a component kind (and that will possibly be stored as dependants along the same table as the main entity) will be created in blank (of course, assuming you're in fact editing them from the form); combo-like stuff will be brought back from the database from id each time. I was doing the second using entity--id PropertyEditors in spring-mvc, still don't know how to get the same with wicket but I suppose it won't be hard. Regards, Carlos Martijn [1] http://martijndashorst.com/blog/2006/02/13/wicket-goodie-hibernate-versioned-form/ On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: Hi all, I'm migrating a spring-mvc project to wicket. In this project domain objects are directly exposed to the ui (without DTOs in between). The objects are validated using the spring bean validation framework (part of springmodules). This module creates a unique Validator (a spring interface) from annotations given in the fields/properties of every validatable object. Then you inject this global validator to your controllers (in the case of spring-mvc) so they can validate their form/command (the bound object). The result of validation is an Errors objects, with field errors and global errors (more precisely, error codes to be resolved against a messages resource). It's pretty easy to map these errors from bean properties to wicket component ids. This should be done inside onSubmit(), once the object is bound (for example, using a CompoundPropertyModel). So, to recap: domain objects directly exposed to the ui, Validator created from annotations in validatable domain objects, domain objects bound by PropertyModels, domain objects validated by injected validator during onSubmit. Up to this point I'm pretty happy with the results, validation is almost trivial with the annotations and the valang dsl, and I like it being inside the domain instead of tied to the ui components. One problem I have due to avoiding DTOs is that most of the time I don't want to serialize my form models, because they are (often big) entities with lazy loaded associations. So in principle I would use an LoadableDetachableModel to load the entity from the repository each time the model is reattached. But suppose I'm updating a UserProfile. The first time it would be ok to populate the model from the persistent profile to be updated. But once the form is submitted there's no point in loading the profile from the repository again because its properties would be overwritten from those coming from the form anyway. So I'm tempted to subclass AbstractDetachableModel so that it loads the profile from the repository upon creation, but instantiates a brand new profile to be populated from the form upon reattachment. Is there a better pattern for this? Anyone has run into the same problem? Cheers, Carlos - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net 's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash
[Wicket-user] using fragment inside of form
Hi, I have a fragment inside of form: Form form = new Form( form ); Fragment fragment = new Fragment( fragmendId, markupId ); form.add( fragment ); and markup: form wicket:id=form action= wicket:fragment wicket:id=markupId ... /wicket:fragment /form It fails with WicketMessage: Markup does not contain a fragment with id=markupId;. Though using new Fragment( fragmendId, form:markupId ) it works. Is it a bug? -- View this message in context: http://www.nabble.com/using-fragment-inside-of-form-tf3486450.html#a9733642 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] using fragment inside of form
Move the fragment markup *outside* the form. Martijn On 3/29/07, Dmitry Kandalov [EMAIL PROTECTED] wrote: Hi, I have a fragment inside of form: Form form = new Form( form ); Fragment fragment = new Fragment( fragmendId, markupId ); form.add( fragment ); and markup: form wicket:id=form action= wicket:fragment wicket:id=markupId ... /wicket:fragment /form It fails with WicketMessage: Markup does not contain a fragment with id=markupId;. Though using new Fragment( fragmendId, form:markupId ) it works. Is it a bug? -- View this message in context: http://www.nabble.com/using-fragment-inside-of-form-tf3486450.html#a9733642 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Should i upgrade the wicket 2.0 snapshot?
On Thu, 15 Mar 2007, tooy li(Gmail) wrote: 1.2 and 2.0 snapshot. considering the upgrading in furture, i began my wicket travel on a snapshot of december. after three month , i have to deploy the application into production env, but the wicket 2.0 is still not release . so should I upgrade the application to the latest snapshot? I tried the snapshot of feb, and find some error. and During three months, some things have probably changed in a backwards-incompatible way in trunk. So if you haven't taken fresh snapshot in three months, it's normal that you'll have to make changes in your own code. I don't remember too well, but at least some methods were removed from IModel at some point, slf4j was introduced (though this might have been before December already) etc. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] using fragment inside of form
Martijn Dashorst wrote: Move the fragment markup *outside* the form. It works outside the form. But I want to show/hide some of form inputs and related html tags. -- View this message in context: http://www.nabble.com/using-fragment-inside-of-form-tf3486450.html#a9734356 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Internationalization and DropDownChoice
2 things: 1. Probably you should use an IChoiceRenderer in addition to your current list. 2. you *replace* the component, and with it the selected value, better to use a lazy model to retrieve the list of countries, instead of pushing it to the component ad 2: new DDC(countries, new Model() { public void getObject(...) { return getCountries(); } }, new CountryChoiceRenderer()); Martijn On 3/29/07, Toscano [EMAIL PROTECTED] wrote: Hello, I had the following: one extended DropDownChoice with different languages and some fields in a form. When the user changes it, I get success in getting the translation of everything in the page, and also Wicket maintains whatever the user wrote in the fields, so it's nice. But I have a problem with one DropDownChoice which cointains countries. By default, it show the english names of all the countries in the world. In the onSelectionChanged of the languages DropDownChoice I reload the country names from the database, and make the following: countries = new DropDownChoice(country, getCountries()); userInformationForm.replace(countries); It works, at the same time I change the language, I get the country list in that language, but if the user selected one country, I can't maintain his selection... Any ideas? It should be easy as long as the ID of the country is the same... Thank you very very much for your help, Oskar -- View this message in context: http://www.nabble.com/Internationalization-and-DropDownChoice-tf3485705.html#a9731005 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] using fragment inside of form
Where the fragment is defined is different from where it is used. You define the fragment outside the form (just as you would do a panel, but that is in another file). The fragment is then instantiated and added to the place where it will render itself, in your case: the form. Martijn On 3/29/07, Dmitry Kandalov [EMAIL PROTECTED] wrote: Martijn Dashorst wrote: Move the fragment markup *outside* the form. It works outside the form. But I want to show/hide some of form inputs and related html tags. -- View this message in context: http://www.nabble.com/using-fragment-inside-of-form-tf3486450.html#a9734356 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] using fragment inside of form
Martijn Dashorst wrote: Where the fragment is defined is different from where it is used. You define the fragment outside the form (just as you would do a panel, but that is in another file). The fragment is then instantiated and added to the place where it will render itself, in your case: the form. Well, if I put the fragment outside the form form:markupId makes sense. So it seems like markupId must always be the full path from the form. -- View this message in context: http://www.nabble.com/using-fragment-inside-of-form-tf3486450.html#a9734913 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] AJAX modal window (1.2.5)and form
afaik there's no support for ajax and radio choices currently. On 3/29/07, Nino Wael [EMAIL PROTECTED] wrote: heheh obviously i am using onchange and not onchance:) Fra: [EMAIL PROTECTED] på vegne af Nino Wael Sendt: to 29-03-2007 13:42 Til: wicket-user@lists.sourceforge.net; wicket-user@lists.sourceforge.net Emne: Re: [Wicket-user] AJAX modal window (1.2.5)and form Hmm after some extensive testing. It appears as the radiochoice cant be used with ajax when applying the ajaxformupdating component (the update a called but the radiochoice model arent updated), I am using onchance attribute to trigger ajax are this wrong? It works just fine when using dropdown. Not matter if its on a page or panel.. regards Nino Fra: [EMAIL PROTECTED] på vegne af Nino Wael Sendt: ma 26-03-2007 15:18 Til: wicket-user@lists.sourceforge.net Emne: SV: [Wicket-user] AJAX modal window (1.2.5)and form it's not a nested form: body concept ideas: display questionaire on main page, have popups when adding questions with available question types. form wicket:id=form input type=submit wicket:id=addQuestion / /form div wicket:id=modalquestionpopup/div div wicket:id=selectedradionone/div /body form tag are closed before the popup tag(modalquestionpopup). I'll try creating a page instead? regards Nino -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] på vegne af Matej Knopp Sendt: ma 26-03-2007 14:37 Til: wicket-user@lists.sourceforge.net Emne: Re: [Wicket-user] AJAX modal window (1.2.5)and form If you have nested forms it will fail. Nested forms are not supported in wicket 1.2. If you need separate form in modal window in 1.2, the safest bet is to use a page inside modal window. -Matej On 3/26/07, Nino Wael [EMAIL PROTECTED] wrote: Hi I have a AJAX modal window wich contains a form. In the form there a an radiochoice that has an ajax formcomponentupdatingbehavior. Now the updating behavior are trigered but the model of the radiochoice aren't being updated. Also on the basepage where you can trigger the modal window, I also have a form. Not sure if this should make anything fail? snip of the code from the panel thats used in the modal window: public QuestionSelectorPanel(String id, final IModel selectedQuestion, final ModalWindow modalQuestionPop, final Label label) { super(id); Form form = new Form(form); final RadioChoice questionRadio = new RadioChoice(questions, selectedQuestion, Question.getTypes()); questionRadio.setOutputMarkupId(true); questionRadio.add(new AjaxFormComponentUpdatingBehavior(onchange) { protected void onUpdate(AjaxRequestTarget target) { System.out.print(selected value should print here!: + selectedQuestion.toString()); // below are working, label prints out foobar // label.setModelObject(foobar!); target.addComponent(label); modalQuestionPop.close(target); } }); add(form); form.add(questionRadio); } snip of the basecode: final ModalWindow modalQuestionPop = new ModalWindow( modalquestionpopup); add(modalQuestionPop); Label label = new Label(selectedradio, selectedQuestion); label.setOutputMarkupId(true); modalQuestionPop.setOutputMarkupId(true); modalQuestionPop.setTitle(Please select a Question type); modalQuestionPop.setContent(new QuestionSelectorPanel(modalQuestionPop .getContentId(), selectedQuestion, modalQuestionPop, label)); Form form = new Form(form); AjaxSubmitButton addQuestion = new AjaxSubmitButton(addQuestion, form) { protected void onSubmit(wicket.ajax.AjaxRequestTarget arg0, Form arg1) { modalQuestionPop.show(arg0); }; }; form.add(addQuestion); add(form); add(label); regards Nino - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll
Re: [Wicket-user] Testing repeaters
On Thu, 15 Mar 2007, Daniele Dellafiore wrote: How can I access a cell in the table? What is the path for, say, cell 1,1? Or there are other way using tester? You mean WicketTester? I suppose that you need to know the wicket component paths to use it. As Igor said, you can deduce them from the markup, but if there is any confusion, you can also get your table Component Component table = wicketTester.getComponentFromLastRenderedPage(table:path); and then inspect its children with the debugger of your IDE. This should clear any doubts of the actual paths (which, in the case of repeaters, have confused me as well). Till now I am using httpunit to test tables but I would like to test the wicket component by itself and, more over, the WebPage stays in a Modal Window and I do not know how to test a page in a modal window via httpunit. How's it going with HttpUnit? As I haven't advertised the Selenium RC integration of Wicket Bench in several weeks, here goes again: http://svn.laughingpanda.org/svn/wicket-bench/trunk/wicket-bench-test/src/test/java/test/DictionaryPanelTest.java I find it to nicely complement WicketTester (of 2.0), and like the fact that Selenium uses a real browser, unlike HttpUnit and friends. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] Calling document.getElementById after refreshing the calling component
I have a scenario where I want to perform an action on the server prior to issuing a jsform.submit() on the client. I had been using SubmitLink, but the timing was wrong because I need to tweak some data on the client BEFORE submitting. I finally got the idea to combine AjaxLink and SubmitLink. I get the onClick action on the server when the user clicks the button and I planned on using an AjaxCallDecorator to decorateOnSuccessScript to put the javascript code to submit the form (from SubmitLink). I believe that I have it correct now, but I am experiencing JavaScript problems. I put together this quickstart (minus lib folder) to show the simplified scenario: http://www.nabble.com/file/7527/quickstart-ajaxcalldec.zip quickstart-ajaxcalldec.zip calling document.getElementById('form_id') returns null when the success script fires. Based upon the quickstart that I put together, I think it is because I am refreshing the component that is firing the event to begin with. Could someone with more experience in this give it a looksee? Chuck -- View this message in context: http://www.nabble.com/Calling-document.getElementById-after-%22refreshing%22-the-calling-component-tf3486829.html#a9735077 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] using fragment inside of form
form wicket:id=form span wicket:id=fragment/span /form wicket:fragment wicket:id=foo/wicket:fragment new Form(form).add(new Fragment(fragment, foo)); Should work IMO. Did you read: http://incubator.apache.org/wicket/examplefragments.html Martijn On 3/29/07, Dmitry Kandalov [EMAIL PROTECTED] wrote: Martijn Dashorst wrote: Where the fragment is defined is different from where it is used. You define the fragment outside the form (just as you would do a panel, but that is in another file). The fragment is then instantiated and added to the place where it will render itself, in your case: the form. Well, if I put the fragment outside the form form:markupId makes sense. So it seems like markupId must always be the full path from the form. -- View this message in context: http://www.nabble.com/using-fragment-inside-of-form-tf3486450.html#a9734913 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket's questions
On Tue, 13 Mar 2007, Erik van Oosten wrote: ZedroS Schwart wrote: * Best practices for working with Hibernate and Spring, especialy regarding DAO handling and session ? http://www.databinder.net Or go for wicket-spring and normal spring-hibernate layers as you would do in any other app. This depends on the size of the project though and I have no experience of Databinder, but I wouldn't bind UI code directly to Hibernate except in a small program. -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] using fragment inside of form
Martijn Dashorst wrote: form wicket:id=form /form wicket:fragment wicket:id=foo/wicket:fragment new Form(form).add(new Fragment(fragment, foo)); Should work IMO. Did you read: http://incubator.apache.org/wicket/examplefragments.html You are right. I read it but to much time ago :-( Thanks. -- View this message in context: http://www.nabble.com/using-fragment-inside-of-form-tf3486450.html#a9735380 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Table with TextFields example (Dissapointed in Wicket)
On Mon, 19 Mar 2007, Udora wrote: Because of the my impression so far, I've decided to download the Wicket source and look for answers to my future questions there. Probably I'd be less productive that way but unfortunately I don't clearly see any other alternative. Quite the contrary, wicket (and any open source framework really) is always best used with the source attachments in the IDE, so that you can directly browse Wicket source code in your project. Also wicket-examples source code should be open in another IDE window for great reference. Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Ajax component replaceWith and browser back-button problems
yes, create a jira -igor On 3/29/07, Peter Thomas [EMAIL PROTECTED] wrote: And the Ajax replace / browser back-button problem is still there even in 1.3.0 [29-Mar]. Do you need me to open a JIRA? I'll revert to 1.3 for now. Thanks, Peter. On 3/29/07, Peter Thomas [EMAIL PROTECTED] wrote: Pretty sure. I'm using Maven2 and the JAR name is wicket-1.3.0-incubating-SNAPSHOT.jar On 3/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: auto is something from 2.0, are you sure you have the right jars? -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Thanks Eelco Igor I got the api and src and made the changes for AbstractValidator - will also try to add some stuff to the wiki page as soon as I finish refactoring. But I have a big problem with the usage of wicket:message attribute (tag works fine). This is the error: wicket.markup.MarkupException: Unable to find component with id 'auto-message_attr' in [MarkupContainer [...]] This is the offending markup: input type=submit wicket:message=value= login.submit/ Any idea how to proceed? Looks like something related to wicket:message attribute i18n broke. Thanks, Peter. On 3/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: we only have an unofficial release for it that is a zip. search the list for it, it is in martijn's dir somewhere. other then that all the jars/src/and javadocs are available from that wicketstuff.org maven repo. all the new classes in wicket.validator package have pretty good javadocs so that might be a place to start -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Ok, my bad - the documentation does mention the package change to wicket.validation.validator.AbstractValidator But the API looks a lot different, can you quickly point me to the online Javadoc corresponding to 1.3.0-incubating-SNAPSHOT - also if it is downloadable as a zip or something. Thanks, Peter. On 3/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: hmm, it is briefly mentioned under Validation Changes i dont remember if we still have abstract validator or not, see the source of other alidators and if they extend something. -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Igor, I now see that there is a 1.3.0-incubating-SNAPSHOT (as opposed to 1.3-incubating-SNAPSHOT which I was using earlier). I assume this is the latest version and just switched. But Looks like wicket.markup.html.form.validation.AbstractValidator has disappeared. I don't see a mention of this at http://cwiki.apache.org/WICKET/migrate-13.html can you help? Other API changes I noted: - getObject(Component) in AbstractReadOnlyModel became getObject() - FeedBackMessage.getMessage() returns Object not String - IStringResourceLoader added one method signature loadStringResource(Component, String) Thanks, Peter. On 3/29/07, Igor Vaynberg [EMAIL PROTECTED] wrote: peter can you try updating to the lastest snapshot and trying again? -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Matej - I am using wicket-1.3-incubating-SNAPSHOT.jardated 2007-03-12 Let me know if you need any more details. On the Page in question I had tried setVersioned with both true and false, same result. Thanks, Peter. On 3/28/07, Matej Knopp [EMAIL PROTECTED] wrote: Peter, are you using 1.x? this can be caused by ajax requests being non-versioned in 1.2. In 1.x, the changes should be merged to latest version. On 3/28/07, Igor Vaynberg [EMAIL PROTECTED] wrote: matej didnt you fix this in 1.x svn? -igor On 3/28/07, Peter Thomas [EMAIL PROTECTED] wrote: Hi, I have a panel A that is replaced by another panel B over Ajax using Component.replaceWith (). Panel B contains a few Links. Say I navigate to this Page and trigger the event that causes panel B to replace Panel A. Then I click one of the Link(s) within Panel B that brings up another page. Now when I use the browser back button I see the first Page where B is visible as expected. But now when I click on another Link within B - it causes a Wicket runtime exception:
Re: [Wicket-user] Ajax error handling: deployment vs developmentmode
It appears that the patch is only for versions 1.3 and 2.0, and we are using 1.2.4, hence it won't apply correctly. The failure handler you mentioned works quite well, thank you for that, but it only seems to work in development mode. Basically here is what is happening for me: In development mode, I can only handle my errors using the failure handler In deployment mode, I can only handle my errors using the re-direct to the error page via RequestCycle. What I would like is to be able to use both in either mode in Wicket 1.2.4. Is this possible? Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jean-Baptiste Quenot Sent: Friday, March 23, 2007 6:39 PM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] Ajax error handling: deployment vs developmentmode * Apaar Trivedi: I understand that if my app is in deployment mode then all run time exceptions, including anything which happens during an Ajax request will be caught by my RequestCycle.onRuntimeException, and this is working fine. But how can I replicate this behavior during development mode? During development mode my ajax runtime exceptions merely show up in my Tomcat console, and do not forward to the error page. This is fixed already, see: Use standard exception handling in AjaxRequestTarget http://issues.apache.org/jira/browse/WICKET-313 However I didn't notice different behavior between deployment and development when I had this problem. Also, how can I conceivably handle these errors on the client side, say for instance I experience an ajax runtime error during some request and I would like to display a friendly message in my window, instead of forwarding to the error page, how can this be done? Just define wicketGlobalFailureHandler() JS function in your document. There is a plug-and-play implementation for Dojo here FYI: http://wicket-stuff.svn.sourceforge.net/viewvc/wicket-stuff/branches/wic ket-1.3/wicket-contrib-dojo/src/main/java/wicket/contrib/dojo/markup/htm l/floatingpane/AjaxErrorBehavior.java?revision=1755view=markup Cheers, -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDE V ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Binding and validating domain objects
One problem I have due to avoiding DTOs is that most of the time I don't want to serialize my form models, because they are (often big) entities with lazy loaded associations. So in principle I would use an LoadableDetachableModel to load the entity from the repository each time the model is reattached. But suppose I'm updating a UserProfile. The first time it would be ok to populate the model from the persistent profile to be updated. But once the form is submitted there's no point in loading the profile from the repository again because its properties would be overwritten from those coming from the form anyway. So I'm tempted to subclass AbstractDetachableModel so that it loads the profile from the repository upon creation, but instantiates a brand new profile to be populated from the form upon reattachment. Is there a better pattern for this? Anyone has run into the same problem? Sounds like that could work. Btw, you can still just use LoadableDetachableModels. Something like this? class SomeModel extends LoadableDetachableModel { protected Object load() { return new Foo(); } } new SomeModel(anotherFooThatWasLoaded); The thing I want to point out here is that you can just initialize the LDM with the object you loaded from the database, for the first request, and then implement load like this to get fresh instances on next requests. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Radio.getValue?
Ok, let me try to explain another way. If you create a page where you use the radio component. The radios represent various kinds of datasets(OLAP cubes in this case but it does not really matter). On monday the 1. march you record with jmeter your test case(jmeter only records the http requests). In your test case you must select the retirement dataset (which has the value radio5 on the html page). Some time has passed now and you want to run your jmeter test, but on your page some of the datasets has been removed (they wasnt needed or was not allowed to be shown). So now the page no longer contains the radio with the value radio5, and your jmeter test will fail because wicket cant find the radio(another error scenario would be if the radios changed order). So if radio component allowed the use of Ichoicerenderer, it could generate the value based on the id of the ichoicerenderer for the particular dataitem. This would bring better persistance to the radios. At least when testing with jmeter. Did I do a better job explaining?:) I think I got ya :) Some could argue that it's not issue, but it would be very handy to have the ability to use the ichoicerender with every component that makes use of the value attribute in inputs(havent thought it through though). Because it would make it easier to use tools as jmeter. It would also use a bit more memory and make it's API bigger and thus more complex I'm afraid. I'm not sure whether it is a good feature to build in by default. An alternative could be to enable users to provide their own implementation, i.e. by making getValue non-final. Looking at that code, I don't understand why we even need: private short uuid = -1; as there is no code other than in getValue that changes the value, and that value can just be recreated everytime it is needed (as it is nothing more than a call to getPage().getAutoIndex()). Am I missing something here? WDYT? Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Radio.getValue?
On 3/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Looking at that code, I don't understand why we even need: private short uuid = -1; as there is no code other than in getValue that changes the value, and that value can just be recreated everytime it is needed (as it is nothing more than a call to getPage().getAutoIndex()). Am I missing something here? yes, you are missing the fact that getautoindex() increments the index on every call that is why we cache it in the uuid var. WDYT? personally i dont like making getvalue non-final. this will patch this component for this kind of testing, but what about other components that do not have a stable name? are we going to have to start opening implementation details on all of them just because users want to test it with something static like httpunit? just my 2c. -igor - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] AJAX modal window (1.2.5)and form
there is support for it now on the javascript side. matej, you created a boolean for me in the wicket serialize method, we only need a behavior (or make the current one smarter) that uses that, radios and checkboxes did seem to work at my place On 3/29/07, Matej Knopp [EMAIL PROTECTED] wrote: afaik there's no support for ajax and radio choices currently. On 3/29/07, Nino Wael [EMAIL PROTECTED] wrote: heheh obviously i am using onchange and not onchance:) Fra: [EMAIL PROTECTED] på vegne af Nino Wael Sendt: to 29-03-2007 13:42 Til: wicket-user@lists.sourceforge.net; wicket-user@lists.sourceforge.net Emne: Re: [Wicket-user] AJAX modal window (1.2.5)and form Hmm after some extensive testing. It appears as the radiochoice cant be used with ajax when applying the ajaxformupdating component (the update a called but the radiochoice model arent updated), I am using onchance attribute to trigger ajax are this wrong? It works just fine when using dropdown. Not matter if its on a page or panel.. regards Nino Fra: [EMAIL PROTECTED] på vegne af Nino Wael Sendt: ma 26-03-2007 15:18 Til: wicket-user@lists.sourceforge.net Emne: SV: [Wicket-user] AJAX modal window (1.2.5)and form it's not a nested form: body concept ideas: display questionaire on main page, have popups when adding questions with available question types. form wicket:id=form input type=submit wicket:id=addQuestion / /form div wicket:id=modalquestionpopup/div div wicket:id=selectedradionone/div /body form tag are closed before the popup tag(modalquestionpopup). I'll try creating a page instead? regards Nino -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] på vegne af Matej Knopp Sendt: ma 26-03-2007 14:37 Til: wicket-user@lists.sourceforge.net Emne: Re: [Wicket-user] AJAX modal window (1.2.5)and form If you have nested forms it will fail. Nested forms are not supported in wicket 1.2. If you need separate form in modal window in 1.2, the safest bet is to use a page inside modal window. -Matej On 3/26/07, Nino Wael [EMAIL PROTECTED] wrote: Hi I have a AJAX modal window wich contains a form. In the form there a an radiochoice that has an ajax formcomponentupdatingbehavior. Now the updating behavior are trigered but the model of the radiochoice aren't being updated. Also on the basepage where you can trigger the modal window, I also have a form. Not sure if this should make anything fail? snip of the code from the panel thats used in the modal window: public QuestionSelectorPanel(String id, final IModel selectedQuestion, final ModalWindow modalQuestionPop, final Label label) { super(id); Form form = new Form(form); final RadioChoice questionRadio = new RadioChoice(questions, selectedQuestion, Question.getTypes()); questionRadio.setOutputMarkupId(true); questionRadio.add(new AjaxFormComponentUpdatingBehavior(onchange) { protected void onUpdate(AjaxRequestTarget target) { System.out.print(selected value should print here!: + selectedQuestion.toString()); // below are working, label prints out foobar // label.setModelObject(foobar!); target.addComponent(label); modalQuestionPop.close(target); } }); add(form); form.add(questionRadio); } snip of the basecode: final ModalWindow modalQuestionPop = new ModalWindow( modalquestionpopup); add(modalQuestionPop); Label label = new Label(selectedradio, selectedQuestion); label.setOutputMarkupId(true); modalQuestionPop.setOutputMarkupId(true); modalQuestionPop.setTitle(Please select a Question type); modalQuestionPop.setContent(new QuestionSelectorPanel(modalQuestionPop .getContentId(), selectedQuestion, modalQuestionPop, label)); Form form = new Form(form); AjaxSubmitButton addQuestion = new AjaxSubmitButton(addQuestion, form) { protected void onSubmit(wicket.ajax.AjaxRequestTarget arg0, Form arg1) {
[Wicket-user] nested DataView is not updating model
hi, I am working with DataView where each item will a have a label, checkbox and another Dataview which is created on the fly, but it seems that the models in the sub Dataview is not been attached, when error happens the Sub Dataview which contains fields is not high lighted. Is there a issue to created Nested dataview? Thanks, David C. -- View this message in context: http://www.nabble.com/nested-DataView-is-not-updating-model-tf3487728.html#a9738414 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Radio.getValue?
On 3/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote: Looking at that code, I don't understand why we even need: private short uuid = -1; as there is no code other than in getValue that changes the value, and that value can just be recreated everytime it is needed (as it is nothing more than a call to getPage().getAutoIndex()). Am I missing something here? yes, you are missing the fact that getautoindex() increments the index on every call that is why we cache it in the uuid var. Of course. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] nested DataView is not updating model
what do you mean fields are not highlighted? -igor On 3/29/07, changdt2 [EMAIL PROTECTED] wrote: hi, I am working with DataView where each item will a have a label, checkbox and another Dataview which is created on the fly, but it seems that the models in the sub Dataview is not been attached, when error happens the Sub Dataview which contains fields is not high lighted. Is there a issue to created Nested dataview? Thanks, David C. -- View this message in context: http://www.nabble.com/nested-DataView-is-not-updating-model-tf3487728.html#a9738414 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Binding and validating domain objects
class SomeModel extends LoadableDetachableModel { protected Object load() { return new Foo(); } } new SomeModel(anotherFooThatWasLoaded); Oh, cute! Or even: new LoadableDetachableModel(anotherFooThatWasLoaded) { protected Object load() { return new Foo(); } } I thought that load would be called even the first time. Regarding validation, I'm feeling a tad too frustrated trying to integrate the bean validation framework infrastructure. The problem is that spring validators assume that the bean is already bound. But in the cases where the bean comes from the repositories (inside a session-in-view), at the time it has been invalidly bound only an exception thrown inside a transactional context (for example a @Transactional annotated service method) could avoid persisting an invalid bean. So I could make onSubmit transactional itself resorting to some aop arcane, or I could put the validation inside a service (but then I would face a nightmare of errors/exceptions mapping), or I could get rid of my beloved validators and learn to love wicket validators (which are fine except that I don't like the tight tie that they have with the presentation components). I could momentarily detach the entity before binding it also, but this is a nono for entities with complex lazy-loaded associations. This is the kind of dilemma that I usually solve up not going against the framework (wicket in this case). But if someone has an idea about how validation could happen after binding inside a [EMAIL PROTECTED] context without incurring the risk of persisting an invalid entity, and without losing the ability to simply map errors to ui components, please let me know. Cheers, Carlos The thing I want to point out here is that you can just initialize the LDM with the object you loaded from the database, for the first request, and then implement load like this to get fresh instances on next requests. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] ajax modal window dont' show some time
hi, I find it' s don't pop the ajax modal window when user click the ajaxlink object, some time user have to make twice double click can show it. user has complained it, so what can i do for it? - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] how to unselect a dropdownlist ?
when a dropdown list is first show, it has a please select option to prompt user to select one, when user select and save the record, and edit it again, the drop down list will only show the data, so user cannot unselect some one. so I have to add a into the list. Can i get a better solution? - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] ajax modal window dont' show some time
give us a quickstart that shows this behavior and we can fix it. -igor On 3/29/07, tooy li(Gmail) [EMAIL PROTECTED] wrote: hi, I find it' s don't pop the ajax modal window when user click the ajaxlink object, some time user have to make twice double click can show it. user has complained it, so what can i do for it? - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Binding and validating domain objects
On 3/29/07, Johan Compagner [EMAIL PROTECTED] wrote: and if a user just refreshes the page? or you use it as a response page somewhere else? then suddenly everything is empty? Yeah, that's a good point. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Binding and validating domain objects
and if a user just refreshes the page? or you use it as a response page somewhere else? then suddenly everything is empty? If the user refreshes the page the previous request parameters will be reposted and will overwrite the fresh form model object properties, so he will see the page as was before his last non-submitted changes. That seems fine to me. What I'm not sure is about what will happen if the first page (the one previous to any submission) is reloaded. Will wicket reinstantiate the form so the contents will be correctly reloaded from the repository? Or will it reuse the form stored in the session whose model will now return a blank object? Cheers, Carlos On 3/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote: One problem I have due to avoiding DTOs is that most of the time I don't want to serialize my form models, because they are (often big) entities with lazy loaded associations. So in principle I would use an LoadableDetachableModel to load the entity from the repository each time the model is reattached. But suppose I'm updating a UserProfile. The first time it would be ok to populate the model from the persistent profile to be updated. But once the form is submitted there's no point in loading the profile from the repository again because its properties would be overwritten from those coming from the form anyway. So I'm tempted to subclass AbstractDetachableModel so that it loads the profile from the repository upon creation, but instantiates a brand new profile to be populated from the form upon reattachment. Is there a better pattern for this? Anyone has run into the same problem? Sounds like that could work. Btw, you can still just use LoadableDetachableModels. Something like this? class SomeModel extends LoadableDetachableModel { protected Object load() { return new Foo(); } } new SomeModel(anotherFooThatWasLoaded); The thing I want to point out here is that you can just initialize the LDM with the object you loaded from the database, for the first request, and then implement load like this to get fresh instances on next requests. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] nested DataView is not updating model
this is what I have public class MyRadioChoice extends RadioChoice { public MyRadioChoice(final String id, final IModel model,List choices) { super(id,model,choices);} public boolean wantOnSelectionChangedNotifications(){return true;} } public void populateItem(final Item item) { QuestionModel questionModel = (QuestionModel)item.getModelObject(); item.add(new MyRadioChoice(question,new PropertyModel(question,question)),lisOfYesNo); ResultDataProvider rdp = new ResultDataProvider(); MyResultDVO rdvo = new MyResultDVO(); rdvo.setResultDVO(questionModel.getSubQuestionModels()); rdp.setResultDVO(rdvo); DataView dataView = new DataView(CommonConstants.FOLLOWUP_QUESTION , rdp) { protected void populateItem(final Item item) { Question question = ((QuestionModel)obj).getQuestion(); TextFirld ft = new TextField(subQuestion, new PropertyModel(question,question), type) ft.setRequired(true); item.add(ft); } }; item.add(dataView); } basically the model seems not attached. I do not see the field high lighted when I leave tre field empty. TextFirld ft = new TextField(subQuestion, new PropertyModel(question,question), type) ft.setRequired(true); item.add(ft); Sorry, posted to author by mistake, Regards, David C. igor.vaynberg wrote: what do you mean fields are not highlighted? -igor On 3/29/07, changdt2 [EMAIL PROTECTED] wrote: hi, I am working with DataView where each item will a have a label, checkbox and another Dataview which is created on the fly, but it seems that the models in the sub Dataview is not been attached, when error happens the Sub Dataview which contains fields is not high lighted. Is there a issue to created Nested dataview? Thanks, David C. -- View this message in context: http://www.nabble.com/nested-DataView-is-not-updating-model-tf3487728.html#a9738414 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/nested-DataView-is-not-updating-model-tf3487728.html#a9739403 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Binding and validating domain objects
and if a user just refreshes the page? or you use it as a response page somewhere else? then suddenly everything is empty? If the user refreshes the page the previous request parameters will be reposted and will overwrite the fresh form model object properties, so he will see the page as was before his last non-submitted changes. Only if the request was from a form and when you are not using the render-to-buffer strategy. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] nested DataView is not updating model
if you use dataview in a form you have to set the proper itemreusestrategy so dataview doesnt discard items and rebuild them on every request see dataview.setitemreusestrategy and reuseifmodelsequalstartegy -igor On 3/29/07, changdt2 [EMAIL PROTECTED] wrote: this is what I have public class MyRadioChoice extends RadioChoice { public MyRadioChoice(final String id, final IModel model,List choices) { super(id,model,choices);} public boolean wantOnSelectionChangedNotifications(){return true;} } public void populateItem(final Item item) { QuestionModel questionModel = (QuestionModel)item.getModelObject(); item.add(new MyRadioChoice(question,new PropertyModel(question,question)),lisOfYesNo); ResultDataProvider rdp = new ResultDataProvider(); MyResultDVO rdvo = new MyResultDVO(); rdvo.setResultDVO(questionModel.getSubQuestionModels()); rdp.setResultDVO(rdvo); DataView dataView = new DataView(CommonConstants.FOLLOWUP_QUESTION , rdp) { protected void populateItem(final Item item) { Question question = ((QuestionModel)obj).getQuestion(); TextFirld ft = new TextField(subQuestion, new PropertyModel(question,question), type) ft.setRequired(true); item.add(ft); } }; item.add(dataView); } basically the model seems not attached. I do not see the field high lighted when I leave tre field empty. TextFirld ft = new TextField(subQuestion, new PropertyModel(question,question), type) ft.setRequired(true); item.add(ft); Sorry, posted to author by mistake, Regards, David C. igor.vaynberg wrote: what do you mean fields are not highlighted? -igor On 3/29/07, changdt2 [EMAIL PROTECTED] wrote: hi, I am working with DataView where each item will a have a label, checkbox and another Dataview which is created on the fly, but it seems that the models in the sub Dataview is not been attached, when error happens the Sub Dataview which contains fields is not high lighted. Is there a issue to created Nested dataview? Thanks, David C. -- View this message in context: http://www.nabble.com/nested-DataView-is-not-updating-model-tf3487728.html#a9738414 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/nested-DataView-is-not-updating-model-tf3487728.html#a9739403 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] About ModalWindow example for wicket 1.3
Dear all, At first, I got this exception, after I click Close this window with result OK inside the ModalWindow. wicket.util.io.WicketSerializeableException: Error reading field: locale for object class: class wicket.extensions.ajax.markup.html.modal.ModalWindow$MaskType children-maskType NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:424) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:133) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.lang.Objects.byteArrayToObject(Objects.java:397) at wicket.protocol.http.FilePageStore.getPage(FilePageStore.java:149) at wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:138) at wicket.Session.getPage(Session.java:528) at wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:417) at wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:131) at wicket.RequestCycle.step(RequestCycle.java:1037) at wicket.RequestCycle.steps(RequestCycle.java:1138) at wicket.RequestCycle.request(RequestCycle.java:474) at wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:256) at wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:126) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:816) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) Caused by: java.lang.NullPointerException at wicket.util.io.ClassStreamHandler.createObject(ClassStreamHandler.java:303) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:91) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) ... 35 more After I include the Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()); in the init method, the exception disappear, but the Last modal window result: show nothing after I do something inside the modal window. I checked that it is should not because of the ajax target cannot refresh the the Last modal window result:, as the callback that run the setResult method cannot update the actual result field inside the ModalWindowPage. wicket-user@lists.sourceforge.net Thanks, Man Kam - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] About ModalWindow example for wicket 1.3
what version are you using? can you check if this still happens with latest 1.3 wicket version? -Matej On 3/29/07, Chan Man Kam [EMAIL PROTECTED] wrote: Dear all, At first, I got this exception, after I click Close this window with result OK inside the ModalWindow. wicket.util.io.WicketSerializeableException: Error reading field: locale for object class: class wicket.extensions.ajax.markup.html.modal.ModalWindow$MaskType children-maskType NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:424) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:133) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.lang.Objects.byteArrayToObject(Objects.java:397) at wicket.protocol.http.FilePageStore.getPage(FilePageStore.java:149) at wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:138) at wicket.Session.getPage(Session.java:528) at wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:417) at wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:131) at wicket.RequestCycle.step(RequestCycle.java:1037) at wicket.RequestCycle.steps(RequestCycle.java:1138) at wicket.RequestCycle.request(RequestCycle.java:474) at wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:256) at wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:126) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:816) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) Caused by: java.lang.NullPointerException at wicket.util.io.ClassStreamHandler.createObject(ClassStreamHandler.java:303) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:91) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) ... 35 more After I include the Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()); in the init method, the exception disappear, but the Last modal window result: show nothing after I do something inside the modal window. I checked that it is should not because of the ajax target cannot refresh the the Last modal window result:, as the callback that run the setResult method cannot update the actual result field inside the ModalWindowPage. wicket-user@lists.sourceforge.net Thanks, Man Kam - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list
Re: [Wicket-user] About ModalWindow example for wicket 1.3
I just download it form mvn (http://wicketstuff.org/maven/repository) a few day before. #Generated by Maven #Mon Mar 12 00:03:31 CET 2007 version=1.3-incubating-SNAPSHOT Man Kam Matej Knopp wrote: what version are you using? can you check if this still happens with latest 1.3 wicket version? -Matej On 3/29/07, Chan Man Kam [EMAIL PROTECTED] wrote: Dear all, At first, I got this exception, after I click Close this window with result OK inside the ModalWindow. wicket.util.io.WicketSerializeableException: Error reading field: locale for object class: class wicket.extensions.ajax.markup.html.modal.ModalWindow$MaskType children-maskType NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:424) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:133) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.lang.Objects.byteArrayToObject(Objects.java:397) at wicket.protocol.http.FilePageStore.getPage(FilePageStore.java:149) at wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:138) at wicket.Session.getPage(Session.java:528) at wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:417) at wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:131) at wicket.RequestCycle.step(RequestCycle.java:1037) at wicket.RequestCycle.steps(RequestCycle.java:1138) at wicket.RequestCycle.request(RequestCycle.java:474) at wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:256) at wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:126) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:816) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) Caused by: java.lang.NullPointerException at wicket.util.io.ClassStreamHandler.createObject(ClassStreamHandler.java:303) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:91) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) ... 35 more After I include the Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()); in the init method, the exception disappear, but the Last modal window result: show nothing after I do something inside the modal window. I checked that it is should not because of the ajax target cannot refresh the the Last modal window result:, as the callback that run the setResult method cannot update the actual result field inside the ModalWindowPage. wicket-user@lists.sourceforge.net Thanks, Man Kam - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions
Re: [Wicket-user] Binding and validating domain objects
Only if the request was from a form and when you are not using the render-to-buffer strategy. Sorry Eelco, would you be so kind as to explain this, I'm new to wicket and still a bit ignorant of its internals. I see two access points to the form page: 1) First time you enter the page. 2) Resubmissions due to validation errors. I'm assuming (maybe incorrectly) that during (1) a new form instance will be instantiated, so a new model will be created with it that will return a model object from the repository. Then, during (2), form contents will be posted and bound to a fresh model object which was created from the deserialized LoadableDetachableModel. Under this assumptions I see no problem regarding reloads of the page in state (1) or in state (2). But maybe you mean that the model is instantiated when you create the page (not the form) so there will be just one moment satisfying (1) during the entire session. Sorry if this is all too obvious but take into account that I'm coming from a different controller/action mindset where the session is barely used. Cheers, Carlos On 3/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote: and if a user just refreshes the page? or you use it as a response page somewhere else? then suddenly everything is empty? If the user refreshes the page the previous request parameters will be reposted and will overwrite the fresh form model object properties, so he will see the page as was before his last non-submitted changes. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] About ModalWindow example for wicket 1.3
yeah, that's rather old snapshot, i think it's already fixed. On 3/29/07, Chan Man Kam [EMAIL PROTECTED] wrote: I just download it form mvn (http://wicketstuff.org/maven/repository) a few day before. #Generated by Maven #Mon Mar 12 00:03:31 CET 2007 version=1.3-incubating-SNAPSHOT Man Kam Matej Knopp wrote: what version are you using? can you check if this still happens with latest 1.3 wicket version? -Matej On 3/29/07, Chan Man Kam [EMAIL PROTECTED] wrote: Dear all, At first, I got this exception, after I click Close this window with result OK inside the ModalWindow. wicket.util.io.WicketSerializeableException: Error reading field: locale for object class: class wicket.extensions.ajax.markup.html.modal.ModalWindow$MaskType children-maskType NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:424) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:133) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.lang.Objects.byteArrayToObject(Objects.java:397) at wicket.protocol.http.FilePageStore.getPage(FilePageStore.java:149) at wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:138) at wicket.Session.getPage(Session.java:528) at wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:417) at wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:131) at wicket.RequestCycle.step(RequestCycle.java:1037) at wicket.RequestCycle.steps(RequestCycle.java:1138) at wicket.RequestCycle.request(RequestCycle.java:474) at wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:256) at wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:126) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:816) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) Caused by: java.lang.NullPointerException at wicket.util.io.ClassStreamHandler.createObject(ClassStreamHandler.java:303) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:91) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) ... 35 more After I include the Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()); in the init method, the exception disappear, but the Last modal window result: show nothing after I do something inside the modal window. I checked that it is should not because of the ajax target cannot refresh the the Last modal window result:, as the callback that run the setResult method cannot update the actual result field inside the ModalWindowPage. wicket-user@lists.sourceforge.net Thanks, Man
Re: [Wicket-user] Binding and validating domain objects
if you do a submit and validation erros happening then no new pag is created but the page is reused. but you dont have a problem then because the form will have all the values posted.But if the user does a refresh then in default wicket setting, you dont do a new post, one a page request to the current page because we use redirect_after_post (in a special wicket way) On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: Only if the request was from a form and when you are not using the render-to-buffer strategy. Sorry Eelco, would you be so kind as to explain this, I'm new to wicket and still a bit ignorant of its internals. I see two access points to the form page: 1) First time you enter the page. 2) Resubmissions due to validation errors. I'm assuming (maybe incorrectly) that during (1) a new form instance will be instantiated, so a new model will be created with it that will return a model object from the repository. Then, during (2), form contents will be posted and bound to a fresh model object which was created from the deserialized LoadableDetachableModel. Under this assumptions I see no problem regarding reloads of the page in state (1) or in state (2). But maybe you mean that the model is instantiated when you create the page (not the form) so there will be just one moment satisfying (1) during the entire session. Sorry if this is all too obvious but take into account that I'm coming from a different controller/action mindset where the session is barely used. Cheers, Carlos On 3/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote: and if a user just refreshes the page? or you use it as a response page somewhere else? then suddenly everything is empty? If the user refreshes the page the previous request parameters will be reposted and will overwrite the fresh form model object properties, so he will see the page as was before his last non-submitted changes. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Binding and validating domain objects
3) refresh of the page (is a get, press f5 in your browser) Martijn On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: Only if the request was from a form and when you are not using the render-to-buffer strategy. Sorry Eelco, would you be so kind as to explain this, I'm new to wicket and still a bit ignorant of its internals. I see two access points to the form page: 1) First time you enter the page. 2) Resubmissions due to validation errors. I'm assuming (maybe incorrectly) that during (1) a new form instance will be instantiated, so a new model will be created with it that will return a model object from the repository. Then, during (2), form contents will be posted and bound to a fresh model object which was created from the deserialized LoadableDetachableModel. Under this assumptions I see no problem regarding reloads of the page in state (1) or in state (2). But maybe you mean that the model is instantiated when you create the page (not the form) so there will be just one moment satisfying (1) during the entire session. Sorry if this is all too obvious but take into account that I'm coming from a different controller/action mindset where the session is barely used. Cheers, Carlos On 3/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote: and if a user just refreshes the page? or you use it as a response page somewhere else? then suddenly everything is empty? If the user refreshes the page the previous request parameters will be reposted and will overwrite the fresh form model object properties, so he will see the page as was before his last non-submitted changes. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] About ModalWindow example for wicket 1.3
i will look at that if i read correclty locale serialization problem this weeken. i dont have acces to my laptop tonigth (and in a RAD race tomorrow again) if people can generate unit test for objects that fail then that would be great On 3/29/07, Chan Man Kam [EMAIL PROTECTED] wrote: Dear all, At first, I got this exception, after I click Close this window with result OK inside the ModalWindow. wicket.util.io.WicketSerializeableException: Error reading field: locale for object class: class wicket.extensions.ajax.markup.html.modal.ModalWindow$MaskType children-maskType NOTE: if you feel Wicket is at fault with this exception, please report to the mailing list. You can switch to JDK based serialization by calling: wicket.util.lang.Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()) e.g. in the init method of your application at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:424) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:133) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:96) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.lang.Objects.byteArrayToObject(Objects.java:397) at wicket.protocol.http.FilePageStore.getPage(FilePageStore.java:149) at wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:138) at wicket.Session.getPage(Session.java:528) at wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:417) at wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:131) at wicket.RequestCycle.step(RequestCycle.java:1037) at wicket.RequestCycle.steps(RequestCycle.java:1138) at wicket.RequestCycle.request(RequestCycle.java:474) at wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:256) at wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:126) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:816) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) Caused by: java.lang.NullPointerException at wicket.util.io.ClassStreamHandler.createObject(ClassStreamHandler.java:303) at wicket.util.io.WicketObjectInputStream.readObjectOverride(WicketObjectInputStream.java:91) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:342) at wicket.util.io.ClassStreamHandler$ObjectFieldAndIndex.readField(ClassStreamHandler.java:869) at wicket.util.io.ClassStreamHandler.readFields(ClassStreamHandler.java:414) ... 35 more After I include the Objects.setObjectStreamFactory(new IObjectStreamFactory.DefaultObjectStreamFactory()); in the init method, the exception disappear, but the Last modal window result: show nothing after I do something inside the modal window. I checked that it is should not because of the ajax target cannot refresh the the Last modal window result:, as the callback that run the setResult method cannot update the actual result field inside the ModalWindowPage. wicket-user@lists.sourceforge.net Thanks, Man Kam - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash
Re: [Wicket-user] Binding and validating domain objects
3) refresh of the page (is a get, press f5 in your browser) (1) and (2) were intended to be states where a reload could be attempted. There is no point in adding a third explicit refresh item. But anyway, not only f5 but C-R and View/Reload (I'm using firefox) do a reload, which consists of repeating the last request, which could be a post or a get, depending on the method you specify for your form; in any case the form contents will be resubmitted. Of course, this doesn't mean that things will work as I first suggested/asked. Cheers, Carlos Martijn On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: Only if the request was from a form and when you are not using the render-to-buffer strategy. Sorry Eelco, would you be so kind as to explain this, I'm new to wicket and still a bit ignorant of its internals. I see two access points to the form page: 1) First time you enter the page. 2) Resubmissions due to validation errors. I'm assuming (maybe incorrectly) that during (1) a new form instance will be instantiated, so a new model will be created with it that will return a model object from the repository. Then, during (2), form contents will be posted and bound to a fresh model object which was created from the deserialized LoadableDetachableModel. Under this assumptions I see no problem regarding reloads of the page in state (1) or in state (2). But maybe you mean that the model is instantiated when you create the page (not the form) so there will be just one moment satisfying (1) during the entire session. Sorry if this is all too obvious but take into account that I'm coming from a different controller/action mindset where the session is barely used. Cheers, Carlos On 3/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote: and if a user just refreshes the page? or you use it as a response page somewhere else? then suddenly everything is empty? If the user refreshes the page the previous request parameters will be reposted and will overwrite the fresh form model object properties, so he will see the page as was before his last non-submitted changes. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Binding and validating domain objects
You forget the redirect after post, or even when nothing is submitted. First render of the page refresh... Martijn On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: 3) refresh of the page (is a get, press f5 in your browser) (1) and (2) were intended to be states where a reload could be attempted. There is no point in adding a third explicit refresh item. But anyway, not only f5 but C-R and View/Reload (I'm using firefox) do a reload, which consists of repeating the last request, which could be a post or a get, depending on the method you specify for your form; in any case the form contents will be resubmitted. Of course, this doesn't mean that things will work as I first suggested/asked. Cheers, Carlos Martijn On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: Only if the request was from a form and when you are not using the render-to-buffer strategy. Sorry Eelco, would you be so kind as to explain this, I'm new to wicket and still a bit ignorant of its internals. I see two access points to the form page: 1) First time you enter the page. 2) Resubmissions due to validation errors. I'm assuming (maybe incorrectly) that during (1) a new form instance will be instantiated, so a new model will be created with it that will return a model object from the repository. Then, during (2), form contents will be posted and bound to a fresh model object which was created from the deserialized LoadableDetachableModel. Under this assumptions I see no problem regarding reloads of the page in state (1) or in state (2). But maybe you mean that the model is instantiated when you create the page (not the form) so there will be just one moment satisfying (1) during the entire session. Sorry if this is all too obvious but take into account that I'm coming from a different controller/action mindset where the session is barely used. Cheers, Carlos On 3/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote: and if a user just refreshes the page? or you use it as a response page somewhere else? then suddenly everything is empty? If the user refreshes the page the previous request parameters will be reposted and will overwrite the fresh form model object properties, so he will see the page as was before his last non-submitted changes. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net 's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org
Re: [Wicket-user] how to unselect a dropdownlist ?
Don't make the drop down choice required when a null value is valid. Martijn On 3/29/07, tooy li(Gmail) [EMAIL PROTECTED] wrote: when a dropdown list is first show, it has a please select option to prompt user to select one, when user select and save the record, and edit it again, the drop down list will only show the data, so user cannot unselect some one. so I have to add a into the list. Can i get a better solution? - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Binding and validating domain objects
You forget the redirect after post, or even when nothing is submitted. First render of the page refresh... I have been reading about the redirect after post pattern (of which I wasn't aware) here http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost and now I understand your point. Will wicket always work in this mode? Is this configurable? Another thing that I asked before in this thread and of which I'm still not sure is about page creation. When will pages be created? Every time they are accessed or just the first and then serialized into the session? This is relevant to form model management because if my model discriminates between the first time the form is entered and other times (for example after resubmission), things won't work as expected if the model is instantiated just once along the entire session (instead of once every time I enter the form page for a new, say UserProfile, update). Cheers, Carlos Martijn On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: 3) refresh of the page (is a get, press f5 in your browser) (1) and (2) were intended to be states where a reload could be attempted. There is no point in adding a third explicit refresh item. But anyway, not only f5 but C-R and View/Reload (I'm using firefox) do a reload, which consists of repeating the last request, which could be a post or a get, depending on the method you specify for your form; in any case the form contents will be resubmitted. Of course, this doesn't mean that things will work as I first suggested/asked. Cheers, Carlos Martijn On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: Only if the request was from a form and when you are not using the render-to-buffer strategy. Sorry Eelco, would you be so kind as to explain this, I'm new to wicket and still a bit ignorant of its internals. I see two access points to the form page: 1) First time you enter the page. 2) Resubmissions due to validation errors. I'm assuming (maybe incorrectly) that during (1) a new form instance will be instantiated, so a new model will be created with it that will return a model object from the repository. Then, during (2), form contents will be posted and bound to a fresh model object which was created from the deserialized LoadableDetachableModel. Under this assumptions I see no problem regarding reloads of the page in state (1) or in state (2). But maybe you mean that the model is instantiated when you create the page (not the form) so there will be just one moment satisfying (1) during the entire session. Sorry if this is all too obvious but take into account that I'm coming from a different controller/action mindset where the session is barely used. Cheers, Carlos On 3/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote: and if a user just refreshes the page? or you use it as a response page somewhere else? then suddenly everything is empty? If the user refreshes the page the previous request parameters will be reposted and will overwrite the fresh form model object properties, so he will see the page as was before his last non-submitted changes. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net 's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___
Re: [Wicket-user] Binding and validating domain objects
yess the rendering strategy is configurable. But do you really want to resubmit always? i already told you when a page is created or reused. Its .created once (bookmarkable or by your sellf setResponsePage(ne MyPage());) then with a form submit it will reuse that instance from the session On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: You forget the redirect after post, or even when nothing is submitted. First render of the page refresh... I have been reading about the redirect after post pattern (of which I wasn't aware) here http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost and now I understand your point. Will wicket always work in this mode? Is this configurable? Another thing that I asked before in this thread and of which I'm still not sure is about page creation. When will pages be created? Every time they are accessed or just the first and then serialized into the session? This is relevant to form model management because if my model discriminates between the first time the form is entered and other times (for example after resubmission), things won't work as expected if the model is instantiated just once along the entire session (instead of once every time I enter the form page for a new, say UserProfile, update). Cheers, Carlos Martijn On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: 3) refresh of the page (is a get, press f5 in your browser) (1) and (2) were intended to be states where a reload could be attempted. There is no point in adding a third explicit refresh item. But anyway, not only f5 but C-R and View/Reload (I'm using firefox) do a reload, which consists of repeating the last request, which could be a post or a get, depending on the method you specify for your form; in any case the form contents will be resubmitted. Of course, this doesn't mean that things will work as I first suggested/asked. Cheers, Carlos Martijn On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: Only if the request was from a form and when you are not using the render-to-buffer strategy. Sorry Eelco, would you be so kind as to explain this, I'm new to wicket and still a bit ignorant of its internals. I see two access points to the form page: 1) First time you enter the page. 2) Resubmissions due to validation errors. I'm assuming (maybe incorrectly) that during (1) a new form instance will be instantiated, so a new model will be created with it that will return a model object from the repository. Then, during (2), form contents will be posted and bound to a fresh model object which was created from the deserialized LoadableDetachableModel. Under this assumptions I see no problem regarding reloads of the page in state (1) or in state (2). But maybe you mean that the model is instantiated when you create the page (not the form) so there will be just one moment satisfying (1) during the entire session. Sorry if this is all too obvious but take into account that I'm coming from a different controller/action mindset where the session is barely used. Cheers, Carlos On 3/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote: and if a user just refreshes the page? or you use it as a response page somewhere else? then suddenly everything is empty? If the user refreshes the page the previous request parameters will be reposted and will overwrite the fresh form model object properties, so he will see the page as was before his last non-submitted changes. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket
Re: [Wicket-user] Binding and validating domain objects
On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: You forget the redirect after post, or even when nothing is submitted. First render of the page refresh... I have been reading about the redirect after post pattern (of which I wasn't aware) here http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost and now I understand your point. Will wicket always work in this mode? Is this configurable? It is configurable. Read up in IRequestCycleSettings#RenderStrategy (ONE_PASS_RENDER, REDIRECT_TO_RENDER or the default REDIRECT_TO_BUFFER). Another thing that I asked before in this thread and of which I'm still not sure is about page creation. When will pages be created? Every time they are accessed or just the first and then serialized into the session? Bookmarkable pages accessed by their bookmarkable URLs will be created every time. Everything else is created when you do, and then kept in memory for later use. Depending on the session store (ISessionStore) implementation you are using, they may be serialized only to be de-serialized when users push the back button and the version they want cannot be found anymore in memory. Otherwise, just the instance as you put it there will be used. Note 'detachement' though. Components and models are detached at the end of requests to enable you to clean up temporary state and possibly optimize the ammount of memory that is needed for the long term. This is relevant to form model management because if my model discriminates between the first time the form is entered and other times (for example after resubmission), things won't work as expected if the model is instantiated just once along the entire session (instead of once every time I enter the form page for a new, say UserProfile, update). So, you cannot depend on the model being created on every request. However, you can depend on your model being detached on the end of a request, and if you combine that with lazily attaching like LoadableDetachableModel does (easy to implement yourself too), you can achieve the same thing as if you would have the models recreated on every request. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Binding and validating domain objects
On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: You forget the redirect after post, or even when nothing is submitted. First render of the page refresh... Will wicket always work in this mode? Is this configurable? Read: http://cwiki.apache.org/WICKET/render-strategies.html Another thing that I asked before in this thread and of which I'm still not sure is about page creation. When will pages be created? A page is created when: - you do new MyPage() - someone requests a bookmarkable url (a link, the homepage, refresh of such a page) All subsequent requests will retrieve that page (and version) from the page store (can be the session, filesystem, database), and work on that instance. Martijn -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] XSD / Validation
Hi, I am new to Wicket and want to use XHTML and validate the files. I use IntelliJ Idea but I could not succeed in validating. I run into two problems: - I did not find any wicket.xsd? I just found a DTD, but I don't know how I should use it. - How can I switch the file extension to xhtml (at the moment Wicket only searches for .html). This would allow me to easily set up IntelliJ to validate only the *.xhtml files. Thanks for your help. Johannes Schneider -- Johannes Schneider Im Lindenwasen 15 72810 Gomaringen Fon +49 7072 9229972 Fax +49 7072 50 [EMAIL PROTECTED] http://www.johannes-schneider.info smime.p7s Description: S/MIME Cryptographic Signature - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Binding and validating domain objects
Thank you very much Martijn and Eelco, I won't say you made it crystal clear to me now, but I understand a tad more. I would now reformulate my (1) and (2) states as: (1) The form is entered from a bookmarkable page. (2) The form is posted (POST) to a non-bookmarkable page because of normal submission. and a new one: (3) The pre-rendered buffer is gotten (GET) from a reload, back/forward or history (assuming REDIRECT_TO_BUFFER). Suppose we use a LoadableDetachableModel as the one suggested by Eelco before. A new form is created in (1), so a new model is created too. As this is the first time its model object is accessed, an entity from the repository will be returned. The page populated with this model object will be rendered and stored into the buffer. The same form is reutilized in (2). As this isn't the first time its model is asked for its object it will return a brand new object. The page populated with this blank model object overwritten from the POST request parameters will again be rendered and stored into the buffer. Because we are using the redirect after post pattern what we get after a reload will be the buffered page which has been rendered from the right model object in each case. I don't know how many buffers will be pooled, or the way they are identified, but assuming an ideal* 1-1 mapping between buffers and requests, I can't see the problem for the other cases: back/forward and history. Ok, because of redirect-after-post we won't be resubmitting the form every time as I thought at first, that's clear, but because of redirect-to-buffer we won't be rerendering it either. That would be another history for redirect-to-render because in that case the connection between the original request and the current state is lost. * maybe the problem is in this assumption, isn't it? Thank you again. Regards, Carlos On 3/29/07, Eelco Hillenius [EMAIL PROTECTED] wrote: On 3/29/07, Carlos Pita [EMAIL PROTECTED] wrote: You forget the redirect after post, or even when nothing is submitted. First render of the page refresh... I have been reading about the redirect after post pattern (of which I wasn't aware) here http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost and now I understand your point. Will wicket always work in this mode? Is this configurable? It is configurable. Read up in IRequestCycleSettings#RenderStrategy (ONE_PASS_RENDER, REDIRECT_TO_RENDER or the default REDIRECT_TO_BUFFER). Another thing that I asked before in this thread and of which I'm still not sure is about page creation. When will pages be created? Every time they are accessed or just the first and then serialized into the session? Bookmarkable pages accessed by their bookmarkable URLs will be created every time. Everything else is created when you do, and then kept in memory for later use. Depending on the session store (ISessionStore) implementation you are using, they may be serialized only to be de-serialized when users push the back button and the version they want cannot be found anymore in memory. Otherwise, just the instance as you put it there will be used. Note 'detachement' though. Components and models are detached at the end of requests to enable you to clean up temporary state and possibly optimize the ammount of memory that is needed for the long term. This is relevant to form model management because if my model discriminates between the first time the form is entered and other times (for example after resubmission), things won't work as expected if the model is instantiated just once along the entire session (instead of once every time I enter the form page for a new, say UserProfile, update). So, you cannot depend on the model being created on every request. However, you can depend on your model being detached on the end of a request, and if you combine that with lazily attaching like LoadableDetachableModel does (easy to implement yourself too), you can achieve the same thing as if you would have the models recreated on every request. Eelco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list
Re: [Wicket-user] Internationalization and DropDownChoice
Hello, Thank you very much for your fast answer. I'm using what you said, but sure I'm not doing in the way I should because it doesn't work as expected. Now I can get keep the country selected, but it is not refreshed when changing the locale. This is what I have: countries = new DropDownChoice (country, new Model() { public List getObject() { return getCountries(); } }, getCountries(), new CountryChoiceRenderer()); I think that the getObject method is never called. The getCountries ones is prepared so that if the user changes the locale, it gets the correct names for the countries. So I just need getCountries to be called everytime the languages dropdown is changed. So,I think I should write something in this method of the languages DropDownChoice: public void onSelectionChanged (Object newSelection) { } Again, thank you very much for your help. Oskar Martijn Dashorst wrote: 2 things: 1. Probably you should use an IChoiceRenderer in addition to your current list. 2. you *replace* the component, and with it the selected value, better to use a lazy model to retrieve the list of countries, instead of pushing it to the component ad 2: new DDC(countries, new Model() { public void getObject(...) { return getCountries(); } }, new CountryChoiceRenderer()); Martijn On 3/29/07, Toscano [EMAIL PROTECTED] wrote: Hello, I had the following: one extended DropDownChoice with different languages and some fields in a form. When the user changes it, I get success in getting the translation of everything in the page, and also Wicket maintains whatever the user wrote in the fields, so it's nice. But I have a problem with one DropDownChoice which cointains countries. By default, it show the english names of all the countries in the world. In the onSelectionChanged of the languages DropDownChoice I reload the country names from the database, and make the following: countries = new DropDownChoice(country, getCountries()); userInformationForm.replace(countries); It works, at the same time I change the language, I get the country list in that language, but if the user selected one country, I can't maintain his selection... Any ideas? It should be easy as long as the ID of the country is the same... Thank you very very much for your help, Oskar -- View this message in context: http://www.nabble.com/Internationalization-and-DropDownChoice-tf3485705.html#a9731005 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- Learn Wicket at ApacheCon Europe: http://apachecon.com Join the wicket community at irc.freenode.net: ##wicket Wicket 1.2.5 will keep your server alive. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/Internationalization-and-DropDownChoice-tf3485705.html#a9746837 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Lifecycle issue with getVariation
can you show us your code? Chris Colman wrote: there is a reason why some of the stuff is done where it is. now, I believe that with the minor change that I have made everything is still being done in the exact same order so there should be no consequences of this change. It's just that all the stuff done in commonInit is now being slightly deferred so that it uses completely constructed objects instead of partially constructed objects - that can't be a bad thing can it? I've certainly had no trouble with my page creation and usage with this change - in fact things that I couldn't get to work before now work perfectly! Source changes: I've taken a more inclusive, simpler approach that changes RequestCycle and BookmarkablePageRequestTarget instead of changing the DefaultPageFactory. This means absolutely no explicit calling of the commonInit method by users. I had to change 3 pages in the test cases so that they do their init in commonInit instead of the constructor and all test cases now succeed. I can make available a copy of my modified 1.2.5 source with all changes clearly marked if any one is interested. Java is interesting in that virtual methods appear to 'semi' work on partially constructed objects (which can make you think everything is fine). C++ on the other hand did not allow the virtual function mechanism to work properly until objects were completely constructed. So prior to constructor completion, for non abstract methods, C++ just calls the current class' method instead of the most derived class' method and, for abstract methods, it could result in the strange but extremely useful 'call of pure virtual (abstract) function' error. When you got that error you knew you were dancing with the devil. I think Java lets you keep on dancing... im not sure there is a reason for the markup loading for bodcontainer, we might be able to do that lazily when getbodycontainer() is called. Other frameworks (eg,. Echo2) handle this partial construction problem by automatically calling an init method on the class whenever you add it to the system after instantiation. The user doesn't need to (and shouldn't) explicitly call init() as it's done for them. They can even override init() if they want to but must first call super.init() prior to doing any of their own initialization work. In fact this is the exact pattern of initialization that you have implemented for wicket's WebApplication. It seems to make sense to me that the same pattern would apply to WebPage. juergen are you reading with us? -igor - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/Lifecycle-issue-with-getVariation-tf3476789.html#a9747169 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Lifecycle issue with getVariation
ah, sorry. this is the code i take it. just not in response to my original post (at least on nabble). Chris Colman wrote: i'm not sure what i think about this yet. can you show us the exact code modifications and use cases you have coded up? (boiled down to the important parts, if possible) Ok, here's the changed bits you requested. Only 3 Java classes need minor changes in the framework: [I added the deferred init to WebPage but a more simpler approach is to add the auto init mechanism to Page to avoid the need for casting. Option: You could make the mechanism switchable via an application setting so that existing code and test cases work in the same way as they do now] RequestCycle.java public final void setResponsePage(final Page page) { // CJC 20070329 - added to auto init WebPages to allow // getVariation to work properly if ( page instanceof WebPage ) { WebPage webPage = (WebPage)page; if ( !webPage.isInitialized() ) webPage.commonInit(); } IRequestTarget target = new PageRequestTarget(page); setRequestTarget(target); } WebPage.java // CJC 20070329 - defer commonInit till after complete construction /** true when the page has been initialized */ private boolean initialized = false; /** * Returns the initialization state. This is used by other parts of * the framework that will automatically call commonInit on * uninitialized pages */ public boolean isInitialized() { return initialized; } public void commonInit() { // CJC 20070329 - defer commonInit till after // complete construction initialized = true; ... } +remove the commonInit calls from WebPage constructors BookmarkablePageRequestTarget.java private final Page getPage(RequestCycle requestCycle) { if (page == null pageClass != null !requestCycle.getRedirect()) { page = newPage(pageClass, requestCycle); // CJC 20070329 - added to auto init WebPages to allow // getVariation to work properly if ( page instanceof WebPage ) { WebPage webPage = (WebPage)page; if ( !webPage.isInitialized() ) webPage.commonInit(); } } return page; } In terms of use cases they're basically our own app plus all the wicket test cases. Three test cases required initialization to be performed in an overridden commonInit instead of the constructor to work - which is standard for most OO frameworks of any kind, not just UI frameworks (MFC::createWindow, OWL::SetupWindow) - you just don't want to be playing with partially constructed objects. also, it would be good if you could explain how this solves any problems other than getVariation(). getVariation is the biggy at the moment for me but I'm sure as more users adopt wicket they'll come up with similar scenarios that highlight this problem. It's feasible to come up with scenarios that don't even involve framework features but rather, a user's own WebPage derived class hierarchy. This example will cause problems doing initialization in the constructors: class BasePage { public BasePage(params) { addTitleComponent(); } public void addTitleComponent() { calls getTitle() to get text of the title and creates a Label } public abstract String getTitle(); } class MyPage extends BasePage { String title = null; public MyPage(params) { title = use params to lookup a particular object in database andget its name } // !! this gets called before the constructor has initialized title !! public String getTitle() { return title; } } I trust that's informative enough to help you guys make a good decision on how to deal with this but if you need anything else please let me know. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net
Re: [Wicket-user] Lifecycle issue with getVariation
Okay, here's my opinion: People have been using Wicket for years now and this is the first bug of this type I have heard of. I am very reluctant attempt any sort of generic framework-level fix to the semantics of Java object construction (regardless of how anyone feels about the practices defined by the JLS). Java objects construct the way that they do and we use Java object constructors because we like that simplicity. Your bug is reported and will be fixed. Further, any other problem like this (and again, I've not heard of any) can be worked around using onAttach(). Chris Colman wrote: I have a constructor that takes parameters and then uses the parameters to set up a variable that is used in getVariation(). There appears to be a lifecycle issue here because getVariation is being called from within a base class constructor - before my constructor's code below the super(parameters) has had a chance to get called. Consequently getVariation() is called before the variable has been initialized causing a NPE. Here's the stack dump: at com.MyPage.getVariation(MyPage.java:66) at wicket.Component.getStyle(Component.java:1207) at wicket.markup.MarkupCache.markupKey(MarkupCache.java:371) at wicket.markup.MarkupCache.getMarkup(MarkupCache.java:166) at wicket.markup.MarkupCache.getMarkupStream(MarkupCache.java:106) at wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:82 7) at wicket.markup.html.WebPage.commonInit(WebPage.java:235) at wicket.markup.html.WebPage.init(WebPage.java:120) at com.sas.av.ui.wicket.templates.BasePage.init(BasePage.java:66) at com.MyPage.init(MyPage.java:83) Often in these cases it serves the framework users well if the basic construction takes place first and then, only after returning from the instantiation, further initialization is performed - initialization that might only work properly after all constructors have been fully executed. Currently it appears possible for the getStyle and getVariation methods to be invoked while a page is only semi constructed (ie., the constructor stack has not unwound as shown above). Is there a current workaround for this or is it possible to readjust the Wicket lifecycle model slightly to avoid this problem? - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user -- View this message in context: http://www.nabble.com/Lifecycle-issue-with-getVariation-tf3476789.html#a9747403 Sent from the Wicket - User mailing list archive at Nabble.com. - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] what spammers
Life tomorrow be best however. Tomorrow be best, however. Watch them manage save clear. Inboxes cant more than within minutes day. Goldeneye, we carnt times minites because thats what spammers. Sleeping playing postput other minutesif someone suprise somehowif shall? Videos as watch them manage save, clear login to. Founders talk about gthe google news, politics tags. Tags two kings url. Update buys gootube but does means us. Amp view all loading text hours ago. Version, of flash player get the? Manage save clear login to rate ratings. Nearest possible friday by love. Gootube but does, means us watchfrom charged re? With nife kill joke. Something bad happen my name is summer am years. Agent hands nandrews ncaaon infohelp, apissafety useprivacy copyright. Whack reply goldeneye we carnt, times minites. Nose, ears dead jus. Sites linking this, clicks, infoclose amp. Would.gif Description: GIF image - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user