Re: setReuseItems(true) + transactions = ERROR
Hi, with resuseItems=true the listview will reuse items *on render*, but this doesn't change whether model objects are serialized into the session or not. It rather seems that you're not detaching your models properly. I'd make a wild guess that you keep references to your persistent objects in your row components. Best regards Sven On 06/03/2011 04:56 AM, Gonzalo Aguilar Delgado wrote: Hello, I used to refresh all the components in the listview for each http transaction. But now I tried to use the: setReuseItems(true); When using a ListView. Documentation says that is a must (but I made it to work without it). The problem is that now the objects are serialized and deserialized and not loaded from database in each http transaction. Result is that I always get the following error: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) How can I avoid this error and use the setReuseItems(true)? Thank you in advance. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Model detached before Validate of FormValidator
Palette palette = new Palette(.); form.add(palette); form.add(new IFormValidator() { @Override public void Validate(Form form) { // how to get a list of selected tasks??? } }); You have to set the model to the form by assigning the list or wrap it in a business model. Then you can do a form.getModelObject() in validate method and cast it to the assigned list or business model. Like this public class MyBusinessModel { public List getTasks() { ... } } public class MyComponent extends Panel { public MyComponent(String id, IModel model) { super(id, model); Form form = new Form("form", model); Palette palette = new Palette(.); form.add(palette); form.add(new IFormValidator() { @Override public void Validate(Form form) { MyBusinessModel model = (MyBusinessModel) form.getModelObject(); // how to get a list of selected tasks??? List selectedTasks = model.getTasks(); } }); } } Hth Per I read that is a normal behavior. It's because validation occurs before model population. In that way when validation fails model won't be populated. So I would have to do something like textField.getInput() but I had a problem to get a model Object from a Palette. For example: Palette palette = new Palette(.); form.add(palette); form.add(new IFormValidator() { @Override public void Validate(Form form) { // how to get a list of selected tasks??? } }); So I made validation on "onSubmit" method of form. Now I'm fighting with localized message to finish. Thanks! Tito 2011/5/31 Per Newgro Am 31.05.2011 15:10, schrieb Tito: Is this ok? I have to validate model object but it's detached when validate of form validator is called. How can I make this validation? Thanks Provide some code describing the problem please. Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket
First please check the examples-site for links: http://wicketstuff.org/wicket14/linkomatic/ There is a source code link in the right upper corrner. You can use a BookmarkablePageLink for your issue. Cheers Per Am 02.06.2011 17:51, schrieb Ivoneta: hello everyone I need some help.. I have an application based on struts... This application has some links, and I need this links calls a Wicket Pageit is possible? I think that is possible calls ising the url page , but the problem is the wicket generates the urls dinamically... How can I do this? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-tp3568682p3568682.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: setReuseItems(true) + transactions = ERROR
Hi Sven, Thank you for the update. I will check why they are not detached... They should. Tnx again. -- "No subestimes el poder de la gente estúpida en grupos grandes" El vie, 03-06-2011 a las 09:00 +0200, Sven Meier escribió: > Hi, > > with resuseItems=true the listview will reuse items *on render*, but > this doesn't change whether model objects are serialized into the > session or not. > > It rather seems that you're not detaching your models properly. I'd make > a wild guess that you keep references to your persistent objects in your > row components. > > Best regards > Sven > > > On 06/03/2011 04:56 AM, Gonzalo Aguilar Delgado wrote: > > Hello, > > > > I used to refresh all the components in the listview for each http > > transaction. > > > > But now I tried to use the: > > > > setReuseItems(true); > > > > When using a ListView. Documentation says that is a must (but I made it > > to work without it). > > > > The problem is that now the objects are serialized and deserialized and > > not loaded from database in each http transaction. Result is that I > > always get the following error: > > > > Row was updated or deleted by another transaction (or unsaved-value > > mapping was incorrect) > > > > > > How can I avoid this error and use the setReuseItems(true)? > > > > Thank you in advance. > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Model detached before Validate of FormValidator
Sorry, i missed to say that you have to connect bunsinessModel and selected list of palette. Palette palette = new Palette(..., new PropertyModel>(model, "tasks"), ...); Per Palette palette = new Palette(.); form.add(palette); form.add(new IFormValidator() { @Override public void Validate(Form form) { // how to get a list of selected tasks??? } }); You have to set the model to the form by assigning the list or wrap it in a business model. Then you can do a form.getModelObject() in validate method and cast it to the assigned list or business model. Like this public class MyBusinessModel { public List getTasks() { ... } } public class MyComponent extends Panel { public MyComponent(String id, IModel model) { super(id, model); Form form = new Form("form", model); Palette palette = new Palette(.); form.add(palette); form.add(new IFormValidator() { @Override public void Validate(Form form) { MyBusinessModel model = (MyBusinessModel) form.getModelObject(); // how to get a list of selected tasks??? List selectedTasks = model.getTasks(); } }); } } Hth Per I read that is a normal behavior. It's because validation occurs before model population. In that way when validation fails model won't be populated. So I would have to do something like textField.getInput() but I had a problem to get a model Object from a Palette. For example: Palette palette = new Palette(.); form.add(palette); form.add(new IFormValidator() { @Override public void Validate(Form form) { // how to get a list of selected tasks??? } }); So I made validation on "onSubmit" method of form. Now I'm fighting with localized message to finish. Thanks! Tito 2011/5/31 Per Newgro Am 31.05.2011 15:10, schrieb Tito: Is this ok? I have to validate model object but it's detached when validate of form validator is called. How can I make this validation? Thanks Provide some code describing the problem please. Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketTester and the rendered page
See inline On Thu, Jun 2, 2011 at 7:24 PM, msalman wrote: > I am testing an application that starts with a login page. After logging in > the user is taken to the home page. > > > @Test > public void test() > { > > QuickStartApplication app = new QuickStartApplication(); > > > Class clazz = app.getHomePage(); > > WicketTester tester = new WicketTester(new > QuickStartApplication()); > > WebPage loginPage = null; > try > { > loginPage = (WebPage) app.getHomePage().newInstance(); > } > catch (Exception e) > { > e.printStackTrace(); > } > > // Start out with the login Page > > tester.startPage(loginPage); Replace above with: tester.startPage(tester.getApplication.getHomePage()); > tester.assertRenderedPage(LoginPage.class); > > > tester.assertComponent("form:name", TextField.class); > tester.assertComponent("form:password", > PasswordTextField.class); > > > > > // login form > FormTester formTester = tester.newFormTester("form"); > > formTester.setValue("name", "1"); > formTester.setValue("password", "1"); > > // click button to login > tester.executeAjaxEvent("form:submit", "onclick"); > formTester.submit("submit"); the second call here is not needed. you submit the form with AjaxButton > > > > // Successfully logged in. On the HomePage now > tester.assertRenderedPage(HomePage.class); > > > > tester.assertComponent("form:text1", TextField.class); > > > formTester = tester.newFormTester("form"); > > formTester.setValue("text1", "1"); > > > // submit the home page form > tester.executeAjaxEvent("form:submit", "onclick"); > formTester.submit("submit"); the same as #2 > > > tester.assertRenderedPage(HomePage.class); > // Fails here. > // junit.framework.AssertionFailedError: expected: > but > was: > > // Why is that? It has already asserted earlier that it is > the home > page.. Put a breakpoint in your authorization code and see why it believes that there is no logged in user. > > } > > > Am I doing this thing right? Do I understand the Wicket tester right. > > I am attaching a quickstart project that includes the above test. > > As always, I would appreciate any help. > > Thanks. > > > -Mohammad > > http://apache-wicket.1842946.n4.nabble.com/file/n3568766/WicketTesterTest.zip > WicketTesterTest.zip > > > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/WicketTester-and-the-rendered-page-tp3568766p3568766.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
INullAcceptingValidator behavior
Hello, 1) I have a custom validator that implements INullAcceptingValidator. 2) A TextField component in my form has validator (1) attached to it and is setRequired(false). 3) When I submit my form with the text input empty, the validator does NOT get called. It only gets called if there is a value with the HTML input field. I was expecting that the validator would be invoked upon submission even if the text field is empty, in order to validate tha value "null". At least this is what I understand as far as INullAcceptingValidator goes. However, this does not appear to happen. Instead, Wicket goes on to call the form's onSubmit() method with the value "null" inside my model. What am I missing? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: INullAcceptingValidator behavior
Maybe org.apache.wicket.markup.html.form.FormComponent.isInputNullable() which is overridden by org.apache.wicket.markup.html.form.AbstractTextComponent.isInputNullable() On Fri, Jun 3, 2011 at 12:00 PM, Alexandros Karypidis wrote: > Hello, > > 1) I have a custom validator that implements INullAcceptingValidator. > 2) A TextField component in my form has validator (1) attached to it and is > setRequired(false). > 3) When I submit my form with the text input empty, the validator does NOT > get called. It only gets called if there is a value with the HTML input > field. > > I was expecting that the validator would be invoked upon submission even if > the text field is empty, in order to validate tha value "null". At least > this is what I understand as far as INullAcceptingValidator goes. However, > this does not appear to happen. Instead, Wicket goes on to call the form's > onSubmit() method with the value "null" inside my model. > > What am I missing? > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: INullAcceptingValidator behavior
Hello again, I'm in a weird place. I've stepped through the code and located my problem in: http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5-RC4.2/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java At line 1383, the method "validateValidators()" visits all validators. While iterating, it reaches my validator BUT decides to skip it because of the check on line 1398: if (isNull == false || validator instanceof INullAcceptingValidator) The problem is that my validator is "wrapped" by class "ValidatorAdapter": http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5-RC4.2/wicket-core/src/main/java/org/apache/wicket/validation/ValidatorAdapter.java As you can see, this class implements IValidator and therefore the check fails, even though the value of the "wrapped" validator is in fact an instance of INullAcceptingValidator. I would have got the expected behavior if the check was written as: if (isNull == false || validator instanceof INullAcceptingValidator || ( // wicket should check against the actual validator: validator instanceof ValidatorAdapter && validator.getValidator() iinstanceof INullAcceptingValidator) ) Could this be a bug? On Fri, 03 Jun 2011 12:05:46 +0300, Martin Grigorov wrote: Maybe org.apache.wicket.markup.html.form.FormComponent.isInputNullable() which is overridden by org.apache.wicket.markup.html.form.AbstractTextComponent.isInputNullable() On Fri, Jun 3, 2011 at 12:00 PM, Alexandros Karypidis wrote: Hello, 1) I have a custom validator that implements INullAcceptingValidator. 2) A TextField component in my form has validator (1) attached to it and is setRequired(false). 3) When I submit my form with the text input empty, the validator does NOT get called. It only gets called if there is a value with the HTML input field. I was expecting that the validator would be invoked upon submission even if the text field is empty, in order to validate tha value "null". At least this is what I understand as far as INullAcceptingValidator goes. However, this does not appear to happen. Instead, Wicket goes on to call the form's onSubmit() method with the value "null" inside my model. What am I missing? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: INullAcceptingValidator behavior
Yes. It looks like a bug On Fri, Jun 3, 2011 at 12:47 PM, Alexandros Karypidis wrote: > Hello again, > > I'm in a weird place. I've stepped through the code and located my problem > in: > > http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5-RC4.2/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java > > At line 1383, the method "validateValidators()" visits all validators. While > iterating, it reaches my validator BUT decides to skip it because of the > check on line 1398: > > if (isNull == false || validator instanceof INullAcceptingValidator) > > The problem is that my validator is "wrapped" by class "ValidatorAdapter": > > http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5-RC4.2/wicket-core/src/main/java/org/apache/wicket/validation/ValidatorAdapter.java > > As you can see, this class implements IValidator and therefore the check > fails, even though the value of the "wrapped" validator is in fact an > instance of INullAcceptingValidator. > > I would have got the expected behavior if the check was written as: > > if (isNull == false > || validator instanceof INullAcceptingValidator > || ( > // wicket should check against the actual validator: > validator instanceof ValidatorAdapter && > validator.getValidator() iinstanceof > INullAcceptingValidator) > ) > > Could this be a bug? > > On Fri, 03 Jun 2011 12:05:46 +0300, Martin Grigorov > wrote: > >> Maybe org.apache.wicket.markup.html.form.FormComponent.isInputNullable() >> which is overridden by >> org.apache.wicket.markup.html.form.AbstractTextComponent.isInputNullable() >> >> On Fri, Jun 3, 2011 at 12:00 PM, Alexandros Karypidis >> wrote: >>> >>> Hello, >>> >>> 1) I have a custom validator that implements INullAcceptingValidator. >>> 2) A TextField component in my form has validator (1) attached to it and >>> is >>> setRequired(false). >>> 3) When I submit my form with the text input empty, the validator does >>> NOT >>> get called. It only gets called if there is a value with the HTML input >>> field. >>> >>> I was expecting that the validator would be invoked upon submission even >>> if >>> the text field is empty, in order to validate tha value "null". At least >>> this is what I understand as far as INullAcceptingValidator goes. >>> However, >>> this does not appear to happen. Instead, Wicket goes on to call the >>> form's >>> onSubmit() method with the value "null" inside my model. >>> >>> What am I missing? >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: INullAcceptingValidator behavior
BTW, I just located where the adapter is instantiated. Again, in: http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5-RC4.2/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java You will find in line 465: add((Behavior)new ValidatorAdapter(validator)); I really can't see how my INullAcceptingValidator could ever get a chance to process a null value, unless the check of "validateValidators()" is changed... On Fri, 03 Jun 2011 12:47:57 +0300, Alexandros Karypidis wrote: Hello again, I'm in a weird place. I've stepped through the code and located my problem in: http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5-RC4.2/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java At line 1383, the method "validateValidators()" visits all validators. While iterating, it reaches my validator BUT decides to skip it because of the check on line 1398: if (isNull == false || validator instanceof INullAcceptingValidator) The problem is that my validator is "wrapped" by class "ValidatorAdapter": http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5-RC4.2/wicket-core/src/main/java/org/apache/wicket/validation/ValidatorAdapter.java As you can see, this class implements IValidator and therefore the check fails, even though the value of the "wrapped" validator is in fact an instance of INullAcceptingValidator. I would have got the expected behavior if the check was written as: if (isNull == false || validator instanceof INullAcceptingValidator || ( // wicket should check against the actual validator: validator instanceof ValidatorAdapter && validator.getValidator() iinstanceof INullAcceptingValidator) ) Could this be a bug? On Fri, 03 Jun 2011 12:05:46 +0300, Martin Grigorov wrote: Maybe org.apache.wicket.markup.html.form.FormComponent.isInputNullable() which is overridden by org.apache.wicket.markup.html.form.AbstractTextComponent.isInputNullable() On Fri, Jun 3, 2011 at 12:00 PM, Alexandros Karypidis wrote: Hello, 1) I have a custom validator that implements INullAcceptingValidator. 2) A TextField component in my form has validator (1) attached to it and is setRequired(false). 3) When I submit my form with the text input empty, the validator does NOT get called. It only gets called if there is a value with the HTML input field. I was expecting that the validator would be invoked upon submission even if the text field is empty, in order to validate tha value "null". At least this is what I understand as far as INullAcceptingValidator goes. However, this does not appear to happen. Instead, Wicket goes on to call the form's onSubmit() method with the value "null" inside my model. What am I missing? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: INullAcceptingValidator behavior
Ok, I'll open a JIRA and refer to this thread. Fix seems easy enough. On Fri, 03 Jun 2011 12:50:40 +0300, Martin Grigorov wrote: Yes. It looks like a bug On Fri, Jun 3, 2011 at 12:47 PM, Alexandros Karypidis wrote: Hello again, I'm in a weird place. I've stepped through the code and located my problem in: http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5-RC4.2/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java At line 1383, the method "validateValidators()" visits all validators. While iterating, it reaches my validator BUT decides to skip it because of the check on line 1398: if (isNull == false || validator instanceof INullAcceptingValidator) The problem is that my validator is "wrapped" by class "ValidatorAdapter": http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5-RC4.2/wicket-core/src/main/java/org/apache/wicket/validation/ValidatorAdapter.java As you can see, this class implements IValidator and therefore the check fails, even though the value of the "wrapped" validator is in fact an instance of INullAcceptingValidator. I would have got the expected behavior if the check was written as: if (isNull == false || validator instanceof INullAcceptingValidator || ( // wicket should check against the actual validator: validator instanceof ValidatorAdapter && validator.getValidator() iinstanceof INullAcceptingValidator) ) Could this be a bug? On Fri, 03 Jun 2011 12:05:46 +0300, Martin Grigorov wrote: Maybe org.apache.wicket.markup.html.form.FormComponent.isInputNullable() which is overridden by org.apache.wicket.markup.html.form.AbstractTextComponent.isInputNullable() On Fri, Jun 3, 2011 at 12:00 PM, Alexandros Karypidis wrote: Hello, 1) I have a custom validator that implements INullAcceptingValidator. 2) A TextField component in my form has validator (1) attached to it and is setRequired(false). 3) When I submit my form with the text input empty, the validator does NOT get called. It only gets called if there is a value with the HTML input field. I was expecting that the validator would be invoked upon submission even if the text field is empty, in order to validate tha value "null". At least this is what I understand as far as INullAcceptingValidator goes. However, this does not appear to happen. Instead, Wicket goes on to call the form's onSubmit() method with the value "null" inside my model. What am I missing? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception
Hello, I have ModalWindow with form inside html: wicket:panel> ... java: add(okButton = new AjaxSubmitLink("closeOK", this) { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { save(); window.close(target); } }); If I press button few times before it closes - it wicket will throw an exception org.apache.wicket.WicketRuntimeException: Submit Button closeOK (path=centralPanel:offerList:rejectOfferWindow:content:offerForm:closeOK) is not visible at org.apache.wicket.markup.html.form.Form$2.component(Form.java:620) Any ideas how fix this problem? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-in-ModalWindow-throws-Submit-Button-is-not-visible-exception-tp3570446p3570446.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception
Make the button disabled with JavaScript after the first click, or raise a flag at server side that it is clicked and all further clicks should be ignored if the flag is true On Fri, Jun 3, 2011 at 1:03 PM, Tier wrote: > Hello, > > I have ModalWindow with form inside > > html: > > wicket:panel> > > ... > > > > > > > java: > > add(okButton = new AjaxSubmitLink("closeOK", this) > { > @Override > protected void onSubmit(AjaxRequestTarget target, > Form form) > { > save(); > window.close(target); > } > }); > > If I press button few times before it closes - it wicket will throw an > exception > > org.apache.wicket.WicketRuntimeException: Submit Button closeOK > (path=centralPanel:offerList:rejectOfferWindow:content:offerForm:closeOK) is > not visible > at org.apache.wicket.markup.html.form.Form$2.component(Form.java:620) > > Any ideas how fix this problem? > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-in-ModalWindow-throws-Submit-Button-is-not-visible-exception-tp3570446p3570446.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: INullAcceptingValidator behavior
https://issues.apache.org/jira/browse/WICKET-3767 On Fri, 03 Jun 2011 12:56:06 +0300, Alexandros Karypidis wrote: Ok, I'll open a JIRA and refer to this thread. Fix seems easy enough. On Fri, 03 Jun 2011 12:50:40 +0300, Martin Grigorov wrote: Yes. It looks like a bug On Fri, Jun 3, 2011 at 12:47 PM, Alexandros Karypidis wrote: Hello again, I'm in a weird place. I've stepped through the code and located my problem in: http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5-RC4.2/wicket-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java At line 1383, the method "validateValidators()" visits all validators. While iterating, it reaches my validator BUT decides to skip it because of the check on line 1398: if (isNull == false || validator instanceof INullAcceptingValidator) The problem is that my validator is "wrapped" by class "ValidatorAdapter": http://svn.apache.org/repos/asf/wicket/releases/wicket-1.5-RC4.2/wicket-core/src/main/java/org/apache/wicket/validation/ValidatorAdapter.java As you can see, this class implements IValidator and therefore the check fails, even though the value of the "wrapped" validator is in fact an instance of INullAcceptingValidator. I would have got the expected behavior if the check was written as: if (isNull == false || validator instanceof INullAcceptingValidator || ( // wicket should check against the actual validator: validator instanceof ValidatorAdapter && validator.getValidator() iinstanceof INullAcceptingValidator) ) Could this be a bug? On Fri, 03 Jun 2011 12:05:46 +0300, Martin Grigorov wrote: Maybe org.apache.wicket.markup.html.form.FormComponent.isInputNullable() which is overridden by org.apache.wicket.markup.html.form.AbstractTextComponent.isInputNullable() On Fri, Jun 3, 2011 at 12:00 PM, Alexandros Karypidis wrote: Hello, 1) I have a custom validator that implements INullAcceptingValidator. 2) A TextField component in my form has validator (1) attached to it and is setRequired(false). 3) When I submit my form with the text input empty, the validator does NOT get called. It only gets called if there is a value with the HTML input field. I was expecting that the validator would be invoked upon submission even if the text field is empty, in order to validate tha value "null". At least this is what I understand as far as INullAcceptingValidator goes. However, this does not appear to happen. Instead, Wicket goes on to call the form's onSubmit() method with the value "null" inside my model. What am I missing? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket 1.5 - return to previous page link
Hello, Is it possible to return to previous page with wicket-link (not browser link). In 1.4 I used: PageprevPage = getPage().getPageMap().get(pageIndicator.getPrevPageId(), -1); throw new RestartResponseAtInterceptPageException(prevPage); Thanks a lot, Marieke Vandamme -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-return-to-previous-page-link-tp3570492p3570492.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception
Hi, I guess the problem is method save() which delays closing of the form and let you click few times consecutively. You can decorate your submit link with an IAjaxCallDecorator in order to disable link on the first click: public class AjaxDisableComponentDecorator implements IAjaxCallDecorator{ private Component componentToHide; public AjaxDisableComponentDecorator(Component componentToHide){ this.componentToHide = componentToHide; } @Override public CharSequence decorateOnFailureScript(Component component, CharSequence script) { //do nothing } @Override public CharSequence decorateOnSuccessScript(Component component, CharSequence script) { //do nothing } @Override public CharSequence decorateScript(Component component, CharSequence script) { return "< disable component with id=componentToHide.getMarkupId()>" + "';" + script ; } } Hello, I have ModalWindow with form inside html: wicket:panel> ... java: add(okButton = new AjaxSubmitLink("closeOK", this) { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { save(); window.close(target); } }); If I press button few times before it closes - it wicket will throw an exception org.apache.wicket.WicketRuntimeException: Submit Button closeOK (path=centralPanel:offerList:rejectOfferWindow:content:offerForm:closeOK) is not visible at org.apache.wicket.markup.html.form.Form$2.component(Form.java:620) Any ideas how fix this problem? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-in-ModalWindow-throws-Submit-Button-is-not-visible-exception-tp3570446p3570446.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5 - return to previous page link
Hi, if I'm not wrong in wicket 1.5 page map has been removed and you should have a compilation error if you write page.getPageMap(). Hello, Is it possible to return to previous page with wicket-link (not browser link). In 1.4 I used: PageprevPage = getPage().getPageMap().get(pageIndicator.getPrevPageId(), -1); throw new RestartResponseAtInterceptPageException(prevPage); Thanks a lot, Marieke Vandamme -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-return-to-previous-page-link-tp3570492p3570492.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketSessionFilter and ignorePaths in WicketFilter
Hello, after some investigation I reached to the following: when a wicket session is created it is added as attribute to the HttpSession: HttpSessionStore.bind(), and inside it setAttribute(request, getSessionAttribute(), newSession); If we assume that inside web.xml the WicketFilter name is "WICKET_FILTER", the getSessionAttribute() method returns "sessionWICKET_FILTER". Then, inside setAttribute(request, getSessionAttribute(), newSession); the attribute name, by which the wicket session will be stored in the HttpSession is formed as String attributeName = getSessionAttributePrefix(request) + name;, where name is "sessionWICKET_FILTER" and getSessionAttributePrefix(request) returns "wicket:WICKET_FILTER:" As a result of all this the wicket session is stored in HttpSession with attribute named "wicket:WICKET_FILTER:sessionWICKET_FILTER" On the other hand when the WicketSessionFilter is asked for the session, it forms it's own attribute value of the stored session: Inside WicketSessionFilter.getSession() (line 208): sessionKey = application.getSessionAttributePrefix(null, filterName) + Session.SESSION_ATTRIBUTE_NAME;, where application.getSessionAttributePrefix(null, filterName) returns "wicket:WICKET_FILTER:" and Session.SESSION_ATTRIBUTE_NAME is "session". As a result WicketSessionFilter tries to get the session with attribute named "wicket:WICKET_FILTER:session" The attribute names from HttpSessionStore ("wicket:WICKET_FILTER:sessionWICKET_FILTER") and WicketSessionFilter("wicket:WICKET_FILTER:session") are different and the session cannot be retrieved. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WicketSessionFilter-and-ignorePaths-in-WicketFilter-tp3570291p3570577.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketSessionFilter and ignorePaths in WicketFilter
Is this Wicket 1.5 ? Create a quickstart and attach it to Jira. On Fri, Jun 3, 2011 at 2:24 PM, hok wrote: > Hello, > after some investigation I reached to the following: > when a wicket session is created it is added as attribute to the > HttpSession: > HttpSessionStore.bind(), and inside it > > setAttribute(request, getSessionAttribute(), newSession); > > If we assume that inside web.xml the WicketFilter name is "WICKET_FILTER", > the getSessionAttribute() method returns "sessionWICKET_FILTER". Then, > inside > setAttribute(request, getSessionAttribute(), newSession); > the attribute name, by which the wicket session will be stored in the > HttpSession is formed as > String attributeName = getSessionAttributePrefix(request) + name;, where > name is "sessionWICKET_FILTER" and getSessionAttributePrefix(request) > returns "wicket:WICKET_FILTER:" > As a result of all this the wicket session is stored in HttpSession with > attribute named > "wicket:WICKET_FILTER:sessionWICKET_FILTER" > > On the other hand when the WicketSessionFilter is asked for the session, it > forms it's own attribute value of the stored session: > Inside WicketSessionFilter.getSession() (line 208): > sessionKey = application.getSessionAttributePrefix(null, filterName) + > Session.SESSION_ATTRIBUTE_NAME;, where > application.getSessionAttributePrefix(null, filterName) returns > "wicket:WICKET_FILTER:" and Session.SESSION_ATTRIBUTE_NAME is "session". As > a result WicketSessionFilter tries to get the session with attribute named > "wicket:WICKET_FILTER:session" > > The attribute names from HttpSessionStore > ("wicket:WICKET_FILTER:sessionWICKET_FILTER") and > WicketSessionFilter("wicket:WICKET_FILTER:session") are different and the > session cannot be retrieved. > > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/WicketSessionFilter-and-ignorePaths-in-WicketFilter-tp3570291p3570577.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Model detached before Validate of FormValidator
Does it means that Model of form is populated before Validate? I didn't know that. In that way I also can use palette model in form and it would have to work too. Thanks for the solution! Tito 2011/6/3 Per Newgro > Sorry, i missed to say that you have to connect bunsinessModel and selected > list of palette. > Palette palette = new Palette(..., new > PropertyModel>(model, "tasks"), ...); > > Per > > Palette palette = new Palette(.); >> form.add(palette); >> >> form.add(new IFormValidator() { >> >> @Override >> public void Validate(Form form) { >> // how to get a list of selected tasks??? >> } >> }); >> >> You have to set the model to the form by assigning the list or wrap it in >> a business model. >> Then you can do a form.getModelObject() in validate method and cast it to >> the assigned >> list or business model. >> >> Like this >> >> public class MyBusinessModel { >> public List getTasks() { >>... >> } >> } >> >> public class MyComponent extends Panel { >> public MyComponent(String id, IModel model) { >>super(id, model); >>Form form = new Form("form", model); >> >> Palette palette = new Palette(.); >> form.add(palette); >> >> form.add(new IFormValidator() { >> >> @Override >> public void Validate(Form form) { >> MyBusinessModel model = (MyBusinessModel) form.getModelObject(); >> // how to get a list of selected tasks??? >> List selectedTasks = model.getTasks(); >> } >> }); >> >> } >> } >> >> >> Hth >> Per >> >>> I read that is a normal behavior. It's because validation occurs before >>> model population. >>> In that way when validation fails model won't be populated. >>> >>> So I would have to do something like textField.getInput() but I had a >>> problem to get a model Object from a Palette. >>> For example: >>> >>> Palette palette = new Palette(.); >>> form.add(palette); >>> >>> form.add(new IFormValidator() { >>> >>> @Override >>> public void Validate(Form form) { >>>// how to get a list of selected tasks??? >>> } >>> }); >>> >>> So I made validation on "onSubmit" method of form. Now I'm fighting with >>> localized message to finish. >>> >>> Thanks! >>> Tito >>> >>> 2011/5/31 Per Newgro >>> >>> Am 31.05.2011 15:10, schrieb Tito: Is this ok? > I have to validate model object but it's detached when validate of form > validator is called. How can I make this validation? > > Thanks > > Provide some code describing the problem please. > Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Wicket 1.5 - return to previous page link
Yes, indeed that's because I post it on the mailinglist, to know what I should use in place. More info: I can't use javascript function history.go(-1), because the page can be bookmarkable. So I check if the prevPageId was past in the page constructor. If passed, I want to go to that cached wicket page, otherwise, I want to make new instance of the page. Thanks ! Marieke Vandamme -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-return-to-previous-page-link-tp3570492p3570629.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketSessionFilter and ignorePaths in WicketFilter
Yes, it's wicket 1.5 https://issues.apache.org/jira/browse/WICKET-3769 https://issues.apache.org/jira/browse/WICKET-3769 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/WicketSessionFilter-and-ignorePaths-in-WicketFilter-tp3570291p3570704.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception
Hello, I have ModalWindow with form inside html: wicket:panel> ... java: add(okButton = new AjaxSubmitLink("closeOK", this) { @Override protected void onSubmit(AjaxRequestTarget target, Form form) { save(); window.close(target); } }); If I press button few times before it closes - it wicket will throw an exception org.apache.wicket.WicketRuntimeException: Submit Button closeOK (path=centralPanel:offerList:rejectOfferWindow:content:offerForm:closeOK) is not visible at org.apache.wicket.markup.html.form.Form$2.component(Form.java:620) Any ideas how fix this problem? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-in-ModalWindow-throws-Submit-Button-is-not-visible-exception-tp3570229p3570229.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: RadioChoice model not updated in tomcat with liferay portal
Changed to RadioGroup and implemented following code. radioBtnOptionA.add(new AjaxEventBehavior("onclick") { @Override protected void onEvent(AjaxRequestTarget target) { // doSomething; radioGroup.setModelObject("optionA"); } }); Implemented above code also for optionB radio button. (you need to implement this for each radio button and add button to radio group) It worked. Thank you for your time. Regards, Shantanu -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioChoice-model-not-updated-in-tomcat-with-liferay-portal-tp3565419p3570878.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Model detached before Validate of FormValidator
Afaik no. Your right. I missed the "alidator" part of the interface IFormValidator. My explanation was related the FromVisitor. Sorry for that. But you could make palette final and access it inside the validate method. Then you could do a palette.|getRecorderComponent().getSelectedChoices(). This method is accessing the component values instead of the model values. Hth (and sorry for my blindness) Per | Does it means that Model of form is populated before Validate? I didn't know that. In that way I also can use palette model in form and it would have to work too. Thanks for the solution! Tito 2011/6/3 Per Newgro Sorry, i missed to say that you have to connect bunsinessModel and selected list of palette. Palette palette = new Palette(..., new PropertyModel>(model, "tasks"), ...); Per Palette palette = new Palette(.); form.add(palette); form.add(new IFormValidator() { @Override public void Validate(Form form) { // how to get a list of selected tasks??? } }); You have to set the model to the form by assigning the list or wrap it in a business model. Then you can do a form.getModelObject() in validate method and cast it to the assigned list or business model. Like this public class MyBusinessModel { public List getTasks() { ... } } public class MyComponent extends Panel { public MyComponent(String id, IModel model) { super(id, model); Form form = new Form("form", model); Palette palette = new Palette(.); form.add(palette); form.add(new IFormValidator() { @Override public void Validate(Form form) { MyBusinessModel model = (MyBusinessModel) form.getModelObject(); // how to get a list of selected tasks??? List selectedTasks = model.getTasks(); } }); } } Hth Per I read that is a normal behavior. It's because validation occurs before model population. In that way when validation fails model won't be populated. So I would have to do something like textField.getInput() but I had a problem to get a model Object from a Palette. For example: Palette palette = new Palette(.); form.add(palette); form.add(new IFormValidator() { @Override public void Validate(Form form) { // how to get a list of selected tasks??? } }); So I made validation on "onSubmit" method of form. Now I'm fighting with localized message to finish. Thanks! Tito 2011/5/31 Per Newgro Am 31.05.2011 15:10, schrieb Tito: Is this ok? I have to validate model object but it's detached when validate of form validator is called. How can I make this validation? Thanks Provide some code describing the problem please. Cheers Per - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Model detached before Validate of FormValidator
No problem, thanks for your answer. We always try to find a solution which is fine for me. When I call getSelectedChoices in Validation method it give us an empty List back. It is like the list it is not uploaded before entering the validation method. Thanks for helping me. Regards Tito 2011/6/3 Per Newgro > Afaik no. Your right. I missed the "alidator" part of the interface > IFormValidator. My explanation was related > the FromVisitor. Sorry for that. > > But you could make palette final and access it inside the validate method. > Then you could do a palette.|getRecorderComponent().getSelectedChoices(). > This method is accessing > the component values instead of the model values. > > Hth (and sorry for my blindness) > Per > > | > >> Does it means that Model of form is populated before Validate? >> I didn't know that. In that way I also can use palette model in form and >> it >> would have to work too. >> >> Thanks for the solution! >> >> Tito >> >> 2011/6/3 Per Newgro >> >> Sorry, i missed to say that you have to connect bunsinessModel and >>> selected >>> list of palette. >>> Palette palette = new Palette(..., new >>> PropertyModel>(model, "tasks"), ...); >>> >>> Per >>> >>> Palette palette = new Palette(.); >>> form.add(palette); form.add(new IFormValidator() { @Override public void Validate(Form form) { // how to get a list of selected tasks??? } }); You have to set the model to the form by assigning the list or wrap it in a business model. Then you can do a form.getModelObject() in validate method and cast it to the assigned list or business model. Like this public class MyBusinessModel { public List getTasks() { ... } } public class MyComponent extends Panel { public MyComponent(String id, IModel model) { super(id, model); Form form = new Form("form", model); Palette palette = new Palette(.); form.add(palette); form.add(new IFormValidator() { @Override public void Validate(Form form) { MyBusinessModel model = (MyBusinessModel) form.getModelObject(); // how to get a list of selected tasks??? List selectedTasks = model.getTasks(); } }); } } Hth Per I read that is a normal behavior. It's because validation occurs before > model population. > In that way when validation fails model won't be populated. > > So I would have to do something like textField.getInput() but I had a > problem to get a model Object from a Palette. > For example: > > Palette palette = new Palette(.); > form.add(palette); > > form.add(new IFormValidator() { > > @Override > public void Validate(Form form) { >// how to get a list of selected tasks??? > } > }); > > So I made validation on "onSubmit" method of form. Now I'm fighting > with > localized message to finish. > > Thanks! > Tito > > 2011/5/31 Per Newgro > > Am 31.05.2011 15:10, schrieb Tito: > >> Is this ok? >> >> I have to validate model object but it's detached when validate of >>> form >>> validator is called. How can I make this validation? >>> >>> Thanks >>> >>> Provide some code describing the problem please. >>> >>> Cheers >> Per >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> >> - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> >
Internal Error shows up in Google Cache
I mentioned a few weeks ago I had some page locking issues. I turned on logging and overrode the PageAccessSynchronizer to log and swallow the page lock exception (it still has the timeout wait, so it's not totally disabled), but of course it hasn't happened since, so I still haven't found the root cause other than some heavier usage (1500 page loads/day is busy for me - go ahead, laugh ;) ... but now I just noticed my search results in Google are showing these Internal Error page in search results! Yikes - Bad news! So, my band-aid fix is this: protected final class MyInternalErrorPage extends InternalErrorPage { private static final long serialVersionUID = 1L; @Override public void renderHead(IHeaderResponse response) { response.renderString(""); } } and in my application init(): getApplicationSettings().setInternalErrorPage(MyInternalErrorPage.class); I'm thinking this might be a good default for this page? Of course we don't want internal errors in the first place, but if they do happen (to a robot), no reason to literally advertise the fact, right? Seems like a drag on the brand name to some degree.. On a side note, does anyone know how to tell google to get rid of a cached search result like this, or am I stuck waiting for the next robot to come along? To see what I mean, google for "Together Auction" (2nd result, crawled May 21, still here June 3): Catalog - Internal Error Internal error. Return to home page. togetherauction.com/firstuu/catalog - Cached OK, back to the page locking issues - the only unusual thing I'm doing is that I have my app deployed at my domain root with suffixes for each of my clients so they each appear to have their own version of the web app served from a common ROOT.war. So my URLs are like this: mydonamin.com/clientname/restOfURL. This is done via a ClientFirstRootRequestMapper extends AbstractComponentMapper (source if anyone is interested: http://pastebin.com/Zxp561JK ) For some reason, this was working great in 1.5 M3 but since I've upgraded to RC3, I'm seeing ;jsessionid= on all my URLs now - not sure if that is related. I mention the RequestMapper because I wonder if this might result in two different clients using same page class with instance keys that might not be unique and thus have locking conflict from that ? Thanks for any insights any of you wiser wicket ones might have to share. -- Jim. TogetherAuction.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Internal Error shows up in Google Cache
For the synchronization issue see WICKET-3740. jsessionid in resource urls (.css, .js, ...) is removed in current trunk About the meta for robots I think it is a good addition to the newly introduced (today) AbstractErrorPage from which all error pages should extend. Please file a RFE. On Fri, Jun 3, 2011 at 6:00 PM, Jim Pinkham wrote: > I mentioned a few weeks ago I had some page locking issues. > > I turned on logging and overrode the PageAccessSynchronizer to log and > swallow the page lock exception (it still has the timeout wait, so > it's not totally disabled), but of course it hasn't happened since, so > I still haven't found the root cause other than some heavier usage > (1500 page loads/day is busy for me - go ahead, laugh ;) > > ... but now I just noticed my search results in Google are showing > these Internal Error page in search results! > > Yikes - Bad news! > > So, my band-aid fix is this: > > protected final class MyInternalErrorPage extends InternalErrorPage { > private static final long serialVersionUID = 1L; > > @Override > public void renderHead(IHeaderResponse response) { > response.renderString(" />"); > } > } > > and in my application init(): > > getApplicationSettings().setInternalErrorPage(MyInternalErrorPage.class); > > I'm thinking this might be a good default for this page? > > Of course we don't want internal errors in the first place, but if > they do happen (to a robot), no reason to literally advertise the > fact, right? Seems like a drag on the brand name to some degree.. > > On a side note, does anyone know how to tell google to get rid of a > cached search result like this, or am I stuck waiting for the next > robot to come along? > > To see what I mean, google for "Together Auction" (2nd result, crawled > May 21, still here June 3): > > Catalog - Internal Error > > Internal error. Return to home page. > togetherauction.com/firstuu/catalog - Cached > > > OK, back to the page locking issues - the only unusual thing I'm doing > is that I have my app deployed at my domain root with suffixes for > each of my clients so they each appear to have their own version of > the web app served from a common ROOT.war. So my URLs are like this: > > mydonamin.com/clientname/restOfURL. This is done via a > ClientFirstRootRequestMapper extends AbstractComponentMapper > (source if anyone is interested: http://pastebin.com/Zxp561JK ) > > For some reason, this was working great in 1.5 M3 but since I've > upgraded to RC3, I'm seeing ;jsessionid= on all my URLs now - not sure > if that is related. > > I mention the RequestMapper because I wonder if this might result in > two different clients using same page class with instance keys that > might not be unique and thus have locking conflict from that ? > > Thanks for any insights any of you wiser wicket ones might have to share. > > -- Jim. > > TogetherAuction.com > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Copying PageMaps from one session to another
Hi folks, perhaps you can help me on this one: I am looking for a way to copy the PageMaps stored in one Session object to another Session object, but I have not been able to find a way of how to do that. Does anybody know how to do that? The reason why I'm trying to do this is because users get assigned a new Session when they log into our system. However, I still want the user to be able to navigate back to what he was looking at before he signed in. Especially I want to redirect the user, after signing in, automatically to the page he looked at, before he went to the sign in page. But due to the assignment of a new session upon login, this information is not available anymore in my new Session's pagemap. So if anybody of you knows a way how to copy PageMaps between Session object, or if you even know of any better way how to accomplish what I want to do, I would be grateful for every nudge in the right direction. Thank you, Andy -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Copying-PageMaps-from-one-session-to-another-tp3571246p3571246.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Wicket-3432 - IE/Ajax file upload
https://issues.apache.org/jira/browse/WICKET-3432 I provided a quickstart for this issue (uploading one or more large files via Ajax) a while ago and Igor tested this with a file around ~700mb and could not reproduce the issue. This issue persists for my team on multiple OS flavors and across varying pieces of hardware (physical and virtual). The workarounds we have applied have not completely resolved the issue. I would like to request that this be re-opened or see if I can get some folks (wicket users or the dev team) to try this quickstart in IE 8 (Windows XP or Windows 7) with files up to 2G. For me, the issue occurs around the ~700MB mark. The symptom is that the file is uploaded to a temporary directory, but the user is never directed to the response page. Firefox 3.6, 4 and Chrome work as expected. Note that a non-ajax form submit for the offending file sizes works in IE as expected, up to 2G. If testing this item, I’d love ideas on what else could be contributing to the problem, even if it possibly could be environmental. Although, we have enough hardware diversity here to mitigate that possibility. I’m even open to alternative upload strategies as a last resort, but I want to avoid flash-based solutions and browser-specific solutions (if possible). Regards, -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-3432-IE-Ajax-file-upload-tp3571293p3571293.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5 and WebPageRenderer warn
Any update on this? I am getting also in 1.5 RC3 On Sun, Oct 17, 2010 at 3:24 PM, Martin Grigorov wrote: > Can you try with latest trunk (1.5-SNAPSHOT) ? > If the warning is still there and you are able to create a quickstart > application then we will be interested to take a look. > Thanks! > > On Sun, Oct 17, 2010 at 5:52 PM, Java Programmer > wrote: > >> Hello, >> I use wicket 1.5-M2.1 right now, and I get warn which I haven't on >> earlier versions: >> WARN 2010-10-17 17:45:55,425 WebPageRenderer: The Buffered response >> should be handled by BufferedResponseRequestHandler >> >> What could be the reason of this warn (the application was slightly >> migrated from 1.4 -> 1.5, but I had solved all compilation issus and >> deprecations)? >> >> -- >> Best regards, >> Adrian >> >> http://www.codeappeal.com/ >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5 and WebPageRenderer warn
try with RC4.2 ... On Fri, Jun 3, 2011 at 7:05 PM, Jim Pinkham wrote: > Any update on this? I am getting also in 1.5 RC3 > > On Sun, Oct 17, 2010 at 3:24 PM, Martin Grigorov wrote: >> Can you try with latest trunk (1.5-SNAPSHOT) ? >> If the warning is still there and you are able to create a quickstart >> application then we will be interested to take a look. >> Thanks! >> >> On Sun, Oct 17, 2010 at 5:52 PM, Java Programmer >> wrote: >> >>> Hello, >>> I use wicket 1.5-M2.1 right now, and I get warn which I haven't on >>> earlier versions: >>> WARN 2010-10-17 17:45:55,425 WebPageRenderer: The Buffered response >>> should be handled by BufferedResponseRequestHandler >>> >>> What could be the reason of this warn (the application was slightly >>> migrated from 1.4 -> 1.5, but I had solved all compilation issus and >>> deprecations)? >>> >>> -- >>> Best regards, >>> Adrian >>> >>> http://www.codeappeal.com/ >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5 - return to previous page link
I don't know if in wicket 1.5 there is something to use in place of your old code. Anyway, you could always implement a custom link with a PageReference to the previous page. Yes, indeed that's because I post it on the mailinglist, to know what I should use in place. More info: I can't use javascript function history.go(-1), because the page can be bookmarkable. So I check if the prevPageId was past in the page constructor. If passed, I want to go to that cached wicket page, otherwise, I want to make new instance of the page. Thanks ! Marieke Vandamme -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-return-to-previous-page-link-tp3570492p3570629.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Copying PageMaps from one session to another
You don't want to copy a page map. If I understand your problem correctly, you may want to check out continueToOriginalDestination(): http://stackoverflow.com/questions/5041879/on-wickets-continuetooriginaldestination-method -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Copying-PageMaps-from-one-session-to-another-tp3571246p3571494.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Copying PageMaps from one session to another
Thank you for your answer, Jonathan. Sadly, continueToOriginalDestination is not what I am looking for. Sorry if I have been to unspecific. I already got the continueToOriginalDestination mechanism integrated and intercepting calls to privileged pages and afterwards sending the user on to where he originally wanted to go works just fine with continueToOriginalDestination. What I am trying to cover now is the situation, when the user willingly clicks on a link that brings him to a sign-in-page. I want to sign the user in and send him back to where he came from. Like he searched for something in my application and is at the page showing the search results. Then he decides to sign in, and I want to take him back right to that page showing the results of his search. In that situation, no navigation has been intercepted and continueToOriginalDestination is no use. Is there any way to do that in Wicket? Other than copying PageMaps? Cheers, Andy -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Copying-PageMaps-from-one-session-to-another-tp3571246p3571536.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: setReuseItems(true) + transactions = ERROR
Hi Again, I checked why I'm receiving this nasty error. It seems that fails in this piece of code of the submit form: @Override protected void onSubmit() { log.debug("Saving content"); IModel model = this.getDefaultModel(); Lead object = (Lead)model.getObject(); if(leadDAO!=null && object!=null) { -->Is not attachedif(leadDAO.isAttached(object)) leadDAO.save(object); } super.onSubmit(); } That's strange because behind there is a LoadableDetachableModel that loads this object. If it's loaded in the submit it MUST be same transaction that loaded it. Maybe it opened another one? Anyway it must be attached because nothing happened in the middle. But is not. Why? Is this normal? I suppose that normal execution is: * Submit is performed. * load() method of the model is executed because transient object is lost on this new http session. * object loaded is sent to the CompoundPropertyModel that encloses it. * The object is updated by the CompoundPropertyModel model. * onSubmit() is executed * getObject() does not executes load() function of the LoadableDetachableModel because it already was loaded. Here comes the question... So then, Why it's not attached? Who oppened a new transaction? Why? LOGS - When onSubmit logs shows as follows: DEBUG - Collections- Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadIdentifiers#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7], was: [com.level2.enterprise.hibernate.generated.Lead.leadIdentifiers#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7] (uninitialized) DEBUG - Collections- Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7] (uninitialized) DEBUG - tractFlushingEventListener - Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects DEBUG - tractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 2 collections DEBUG - Printer- listing entities: DEBUG - Printer- com.level2.enterprise.hibernate.generated.Lead{dateLead=2009-04-03 00:00:00, leadBasicDetails=, email=t...@test.com, dateCreated=2009-11-05 00:00:00, leadIdentifiers=, idLot=132, uuid=com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7, dateUpdated=2011-04-27 20:52:15} DEBUG - JDBCTransaction- re-enabling autocommit DEBUG - JDBCTransaction- committed JDBC Connection DEBUG - ConnectionManager - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources! DEBUG - ibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@5ce0f945] after transaction DEBUG - SessionFactoryUtils- Closing Hibernate Session DEBUG - ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)] DEBUG - ConnectionManager - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources! -- There's one transaction completed. I suppose the one that loaded it. The isAttached created a new transaction: -- DEBUG - ScaffoldingForm- Saving content DEBUG - ibernateTransactionManager - Creating new transaction with name [com.googlecode.genericdao.dao.hibernate.GenericDAO.isAttached]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT DEBUG - SessionImpl- opened session at timestamp: 13071235926 DEBUG - ibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@145edcf5] for Hibernate transaction DEBUG - ibernateTransactionManager - Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@145edcf5] DEBUG - JDBCTransaction- begin DEBUG - ConnectionManager - opening JDBC connection DEBUG - JDBCTransaction- current autocommit status: true DEBUG - JDBCTransaction- disabling autocommit DEBUG - ibernateTransactionManager - Exposing Hibernate transaction as JDBC transaction [jdbc:postgresql://127.0.0.1:5432/op_development_es, UserName=user_development, PostgreSQL Native Driver] DEBUG - ibernateTransactionManager - Initiating transacti
Re: Copying PageMaps from one session to another
Andy, "...Not only security frameworks can use this, you can do it yourself by throwing a RestartResponseAtInterceptPage exception." Josh
Re: setReuseItems(true) + transactions = ERROR
Try using the open session in view filter On Jun 3, 2011 1:55 PM, "Gonzalo Aguilar Delgado" < gagui...@aguilardelgado.com> wrote: > Hi Again, > > I checked why I'm receiving this nasty error. It seems that fails in > this piece of code of the submit form: > > @Override > protected void onSubmit() { > log.debug("Saving content"); > IModel model = this.getDefaultModel(); > Lead object = (Lead)model.getObject(); > if(leadDAO!=null && object!=null) > { > -->Is not attached if(leadDAO.isAttached(object)) > leadDAO.save(object); > } > super.onSubmit(); > } > > That's strange because behind there is a LoadableDetachableModel that > loads this object. If it's loaded in the submit it MUST be same > transaction that loaded it. Maybe it opened another one? > > Anyway it must be attached because nothing happened in the middle. But > is not. > > Why? Is this normal? > > I suppose that normal execution is: > > * Submit is performed. > * load() method of the model is executed because transient object is > lost on this new http session. > * object loaded is sent to the CompoundPropertyModel that encloses it. > * The object is updated by the CompoundPropertyModel model. > * onSubmit() is executed > * getObject() does not executes load() function of the > LoadableDetachableModel because it already was loaded. > > Here comes the question... So then, Why it's not attached? Who oppened a > new transaction? Why? > > LOGS > - > When onSubmit logs shows as follows: > DEBUG - Collections - Collection found: > [com.level2.enterprise.hibernate.generated.Lead.leadIdentifiers#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7], was: [com.level2.enterprise.hibernate.generated.Lead.leadIdentifiers#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7] (uninitialized) > DEBUG - Collections - Collection found: > [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7] (uninitialized) > DEBUG - tractFlushingEventListener - Flushed: 0 insertions, 0 updates, 0 > deletions to 1 objects > DEBUG - tractFlushingEventListener - Flushed: 0 (re)creations, 0 > updates, 0 removals to 2 collections > DEBUG - Printer - listing entities: > DEBUG - Printer - > com.level2.enterprise.hibernate.generated.Lead{dateLead=2009-04-03 > 00:00:00, leadBasicDetails=, email=t...@test.com, > dateCreated=2009-11-05 00:00:00, leadIdentifiers=, > idLot=132, > uuid=com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7, dateUpdated=2011-04-27 20:52:15} > DEBUG - JDBCTransaction - re-enabling autocommit > DEBUG - JDBCTransaction - committed JDBC Connection > DEBUG - ConnectionManager - transaction completed on session > with on_close connection release mode; be sure to close the session to > release JDBC resources! > DEBUG - ibernateTransactionManager - Closing Hibernate Session > [org.hibernate.impl.SessionImpl@5ce0f945] after transaction > DEBUG - SessionFactoryUtils - Closing Hibernate Session > DEBUG - ConnectionManager - releasing JDBC connection [ (open > PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)] > DEBUG - ConnectionManager - transaction completed on session > with on_close connection release mode; be sure to close the session to > release JDBC resources! > -- > There's one transaction completed. I suppose the one that loaded it. > > The isAttached created a new transaction: > -- > DEBUG - ScaffoldingForm - Saving content > DEBUG - ibernateTransactionManager - Creating new transaction with name > [com.googlecode.genericdao.dao.hibernate.GenericDAO.isAttached]: > PROPAGATION_REQUIRED,ISOLATION_DEFAULT > DEBUG - SessionImpl - opened session at timestamp: > 13071235926 > DEBUG - ibernateTransactionManager - Opened new Session > [org.hibernate.impl.SessionImpl@145edcf5] for Hibernate transaction > DEBUG - ibernateTransactionManager - Preparing JDBC Connection of > Hibernate Session [org.hibernate.impl.SessionImpl@145edcf5] > DEBUG - JDBCTransaction - begin > DEBUG - ConnectionManager - opening JDBC connection > DEBUG - JDBCTransaction - current autocommit status: true > DEBUG - JDBCTransaction - disabling autocommit > DEBUG - ibernateTransactionManager - Exposing Hibernate transaction as > JDBC transaction [jdbc:postgresql://127.0.0.1:5432/op_development_es, > UserName=user_development, PostgreSQL Native Driver] > DEBUG - ibernateTransactionManager - Initiating transaction commit > DEBUG - ibernateTransactionManager - Committing Hibernate transaction on > Session [org.hibernate.impl.SessionImpl@145edcf5] > DEBUG - JDBCTransaction - commit > DEBUG - JDBCTransaction - re-enabling autocommit > DEBUG - JDBCTransaction - committed JDBC Connection > DEBUG - ConnectionMa
Re: setReuseItems(true) + transactions = ERROR
Hi James, I added it already: - openSessionInViewFilter org.springframework.orm.hibernate3.support.OpenSessionInViewFilter singleSession true sessionFactoryBeanName opCustomerSessionFactory ... BasicFormApplication /basicform/* REQUEST INCLUDE openSessionInViewFilter /basicform/* REQUEST INCLUDE FORWARD --- But it has something to do with transactions because the session is opened. It's strange. It used to work... But something I changed made it to broke. I even saved some objects before contacting you... hehehehe I messed it up! :D Any directions on this? "No subestimes el poder de la gente estúpida en grupos grandes" El vie, 03-06-2011 a las 13:59 -0400, James Carman escribió: > Try using the open session in view filter - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket
Just mount your pages and make Them bookmarkable On Jun 2, 2011 5:51 PM, "Ivoneta" wrote: > hello everyone > > I need some help.. > > I have an application based on struts... This application has some links, > and I need this links calls a Wicket Pageit is possible? > I think that is possible calls ising the url page , but the problem is the > wicket generates the urls dinamically... > > How can I do this? > > > > -- > View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-tp3568681p3568681.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org >
Re: Copying PageMaps from one session to another
To expand on Josh's suggestion, In your Login link (probably on an abstract page you inherit for other app pages) you would have an onClick that doesn't just setResponsePage(YourLoginPage.class), but instead throws the Restart...exception. That way, when the login completes, it should come back to the page the login link was pressed on. -- Jim. On Fri, Jun 3, 2011 at 1:57 PM, Josh Kamau wrote: > Andy, > > "...Not only security frameworks can use this, you can do it yourself by > throwing a RestartResponseAtInterceptPage exception." > > Josh > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket
Thanks it works :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-tp3568681p3571679.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Copying PageMaps from one session to another
Thanks again for your suggestions. Yes, basically this does work. However, sadly not in my case. Whenever the user logs into our system, we assign a new session to the user. That means, we invalidate the old one, create a new one and attach that to the request cycle. We implemented this as a security means to prevent session fixation. This, however, now leads to a "Page Expired" error page, whenever I want to, after signing the user in, redirect him back to where he was before, because, and this closes the circle to my initial question *g*, in the new sessions pagemap the old page, which the user visited before signing in, does not exist. That was the reason why I wanted to start copying PageMaps from one session to another in the first place. If there are any other suggestions as how to prevent session fixation with Wicket, I'd also be glad to follow any leads into that direction, and probably solve my need to copy PageMaps in a completely different way. Andy -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Copying-PageMaps-from-one-session-to-another-tp3571246p3571733.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: setReuseItems(true) + transactions = ERROR
Hi, are you sure your model is a LDM? IIRC you have a ListView involved. What's the type of this.getDefaultModel() ? I suppose that normal execution is ... Yes, this is the way it is supposed to work. Sven On 06/03/2011 07:55 PM, Gonzalo Aguilar Delgado wrote: Hi Again, I checked why I'm receiving this nasty error. It seems that fails in this piece of code of the submit form: @Override protected void onSubmit() { log.debug("Saving content"); IModel model = this.getDefaultModel(); Lead object = (Lead)model.getObject(); if(leadDAO!=null&& object!=null) { -->Is not attachedif(leadDAO.isAttached(object)) leadDAO.save(object); } super.onSubmit(); } That's strange because behind there is a LoadableDetachableModel that loads this object. If it's loaded in the submit it MUST be same transaction that loaded it. Maybe it opened another one? Anyway it must be attached because nothing happened in the middle. But is not. Why? Is this normal? I suppose that normal execution is: * Submit is performed. * load() method of the model is executed because transient object is lost on this new http session. * object loaded is sent to the CompoundPropertyModel that encloses it. * The object is updated by the CompoundPropertyModel model. * onSubmit() is executed * getObject() does not executes load() function of the LoadableDetachableModel because it already was loaded. Here comes the question... So then, Why it's not attached? Who oppened a new transaction? Why? LOGS - When onSubmit logs shows as follows: DEBUG - Collections- Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadIdentifiers#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7], was: [com.level2.enterprise.hibernate.generated.Lead.leadIdentifiers#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7] (uninitialized) DEBUG - Collections- Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7] (uninitialized) DEBUG - tractFlushingEventListener - Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects DEBUG - tractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 2 collections DEBUG - Printer- listing entities: DEBUG - Printer- com.level2.enterprise.hibernate.generated.Lead{dateLead=2009-04-03 00:00:00, leadBasicDetails=, email=t...@test.com, dateCreated=2009-11-05 00:00:00, leadIdentifiers=, idLot=132, uuid=com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@642b6fc7, dateUpdated=2011-04-27 20:52:15} DEBUG - JDBCTransaction- re-enabling autocommit DEBUG - JDBCTransaction- committed JDBC Connection DEBUG - ConnectionManager - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources! DEBUG - ibernateTransactionManager - Closing Hibernate Session [org.hibernate.impl.SessionImpl@5ce0f945] after transaction DEBUG - SessionFactoryUtils- Closing Hibernate Session DEBUG - ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)] DEBUG - ConnectionManager - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources! -- There's one transaction completed. I suppose the one that loaded it. The isAttached created a new transaction: -- DEBUG - ScaffoldingForm- Saving content DEBUG - ibernateTransactionManager - Creating new transaction with name [com.googlecode.genericdao.dao.hibernate.GenericDAO.isAttached]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT DEBUG - SessionImpl- opened session at timestamp: 13071235926 DEBUG - ibernateTransactionManager - Opened new Session [org.hibernate.impl.SessionImpl@145edcf5] for Hibernate transaction DEBUG - ibernateTransactionManager - Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@145edcf5] DEBUG - JDBCTransaction- begin DEBUG - ConnectionManager - opening JDBC connection DEBUG - JDBCTransaction- current autocommit status: true DEBUG - JDBCTransaction- di
Re: Pushing events to Wicket Push generated outside of Wicket
You don't need to create a component to publish messages. What version are you using? All you need is a IPushChannel token; then you can publish events from any thread to that channel. On 06/01/2011 07:05 PM, Doug Leeper wrote: We have a system that subscribes to events from an ESB. These events need to be then translated / added to the Wicket Push Bus so the appropriate Wicket components get updated appropriately. From what I can see, everything in Wicket Push requires a component. Unfortunately, we need to wire up ESB event listener and subsequently the ESB/Wicket Push Bridge in the Application.init() method (so we think). The Application.init() method doens't have access to a component (unless we create a dummy component) Has someone done this? Is this possible? Any example that can referenced? Thanks in advance. - Doug -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Pushing-events-to-Wicket-Push-generated-outside-of-Wicket-tp3567200p3567200.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org