Re: Foundation integrated in wicket
I have implemented Foundation from Zurb with Wicket, currently using version 3 though. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Foundation-integrated-in-wicket-tp4666792p4666796.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
Why is MultiFileUploadField not offering protected boolean forceCloseStreamsOnDetach?
Hi guys, right now I am switching from Singe-FileUpload to MultiFileUpload so I am going to use MultiFileUploadField. But my problem is, that the InputStreams get closed after submitting the form (and refreshing the site - Its inside an wizard of many steps). This happens because of the onDetach-Method inside MultiFileUploadField. I want to use the FileUpload-Models also after the request but I cant overwrite the very useable method protected boolean forceCloseStreamsOnDetach as it exists only in FileUploadField. Any hints why this option is not also merged to MultiFileUploadField? Thanks in Advance for any answer. And please apologize my English, its not my mothers tongue. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Why-is-MultiFileUploadField-not-offering-protected-boolean-forceCloseStreamsOnDetach-tp4666797.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: Possible error with IComponentInheritedModel(s) and stateful pages
Hi Sven, okay, I created a jira issue + quickstart: https://issues.apache.org/jira/browse/WICKET-5655 . Hope that helps :) Kind regards, rza 2014-07-29 19:53 GMT+02:00 Sven Meier s...@meiers.net: Hi, I agree, that look bogus. WICKET-3413 tried to improve on a similar issue though: https://issues.apache.org/jira/browse/WICKET-3413 Wouldn't it be easier, just to always clear FLAG_INHERITABLE_MODEL in #setDefaultModel(), i.e. when a model is set explicitely? Please create a Jira issue. Regards Sven On 07/29/2014 05:26 PM, Raoul Zander wrote: Hi, the flag is not set to true - that's the problem :) See the method Component.setModelImpl(IModel) especially (Line 2981 in Wicket-Core 6.16.0): if (getFlag(FLAG_INHERITABLE_MODEL) !(model instanceof IComponentInheritedModel)) { setFlag(FLAG_INHERITABLE_MODEL, false); } Which should probably be if (getFlag(FLAG_INHERITABLE_MODEL) !(model instanceof IWrapModel)) { setFlag(FLAG_INHERITABLE_MODEL, false); } Regards, rza 2014-07-29 17:09 GMT+02:00 Sven Meier s...@meiers.net: Hi, if I look for setFlag(FLAG_INHERITABLE_MODEL, true), it is called in initModel() only. Please paste the relevant code or even better create a quickstart. Regards Sven On 07/29/2014 04:59 PM, Raoul Zander wrote: In Component.setModelImpl(IModel) - rza 2014-07-29 16:37 GMT+02:00 Sven Meier s...@meiers.net: Hi, the setModel(CompoundPropertyModel ...) actually KEEPS the FLAG_INHERITABLE_MODEL on true where is that? Sven On 07/29/2014 04:29 PM, Raoul Zander wrote: Hi everyone, I think there is some kind of bug in the handling of CompoundPropertyModel (or any IComponentInheritedModel). In Component exists a Flag FLAG_INHERITABLE_MODEL - which is set to true whenever a model is inherited from a parent, so that the model can be nulled onDetach. Thing is: The same flag is set when a IComponentInheritedModel is set as default model (via setModelImpl(IModel)). This leads to exceptions with chained CompoundPropertyModels as in the following scenario: (With correct indention and code high lighting: http://pastebin.com/5iu0qhWw ) // POJOs (implements Serializable omitted) public class Game { private Data data; // getters / setters } public class Data { private Value value; // getters / setters } public class Value { private int number; // getters / setters } // Panels public class DataPanel extends GenericPanelData { public DataPanel(String id) { super(id); } protected void onInitialize() { super.onInitialize(); setModel(new CompoundPropertyModelData(getModel())); add(new ValuePanel(value)); } } public class ValuePanel extends GenericPanelValue { public ValuePanel(String id) { super(id); } protected void onInitialize() { super.onInitialize(); setModel(new CompoundPropertyModelValue(getModel())); add(new Label(number)); } } // and the page public class GamePage extends WebPage { protected void onInitialize() { super.onInitialize(); setDefaultModel(new CompoundPropertyModelGame(new Game())); // make Page stateful like it would happen with AJAX links and alike setStatelessHint(false); add(new DataPanel(data)); } } Markup is irrelevant. The first time the page loads correct but as soon as you refresh the page you'll get the error No get method defined for class: class Game expression: number. Why that? Because the setModel(CompoundPropertyModel ...) actually KEEPS the FLAG_INHERITABLE_MODEL on true so that our custom set model will be nulled on the next detach. In my opinion this is a bug as FLAG_INHERITABLE_MODEL should be true if (and only if) the current component model was inherited - and not if it is *inheritable*. But on the other hand: Maybe i'm using the models the wrong way and there's a better way to achieve the same result (basically using CompoundPorpertyModels on different levels of an object graph) Kind regards, rza - 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
Button and AutoTextLabelResolver
Hi all, it seems it is not possible to use AutoTextLabelResolver with buttons? I always get errors like java.lang.IllegalStateException: no related component found for wicket:label at org.apache.wicket.markup.html.form.AutoLabelTextResolver.resolve(AutoLabelTextResolver.java:258) Button b = new Button(previous); b.setLabel(Model.of(Next Step)); button wicket:id=previous type=submitwicket:label for=previous[next Step]/wicket:label/button Thanx for feedback... kind regards Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Why is MultiFileUploadField not offering protected boolean forceCloseStreamsOnDetach?
Please create a RFE in Jira. Regards Sven On 07/30/2014 10:00 AM, MattyDE wrote: Hi guys, right now I am switching from Singe-FileUpload to MultiFileUpload so I am going to use MultiFileUploadField. But my problem is, that the InputStreams get closed after submitting the form (and refreshing the site - Its inside an wizard of many steps). This happens because of the onDetach-Method inside MultiFileUploadField. I want to use the FileUpload-Models also after the request but I cant overwrite the very useable method protected boolean forceCloseStreamsOnDetach as it exists only in FileUploadField. Any hints why this option is not also merged to MultiFileUploadField? Thanks in Advance for any answer. And please apologize my English, its not my mothers tongue. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Why-is-MultiFileUploadField-not-offering-protected-boolean-forceCloseStreamsOnDetach-tp4666797.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
is it possible to add a css class to FormComponent.setLabel()?
Dear Forum, Currently, I make heavy use of TextField.setLabel(). If adding a css field to TextField is as easy as TextField.add(new AttributeAppender(class, TestCSSClass )); then: How can I add a CSS class to label that has been created for TextField? Thanks in advance, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/is-it-possible-to-add-a-css-class-to-FormComponent-setLabel-tp4666801.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
onfocus event getting called recursively in Apache wicket
I am understanding how to handle JS events like onfocus and onblur in apache wicket. I have a simple form in which there is a textfield. onfocus event on this I am trying to set the textfield to a value. I have observed on running the code that onfocus is called again and again (recursively it seems). I fail to understand why and what I have done wrong. Below is the code : HTML: html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.org; head titleWicket Examples - component reference/title link rel=stylesheet type=text/css href=style.css/ /head body form wicket:id=form INPUT wicket:id=input type=text name=input style=WIDTH: 800px / /form Java: package com.poc.pages; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.ChoiceRenderer; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.model.Model; public class IndexPage extends WebPage { /** * Constructor */ public IndexPage() { Form form = new Form(form); TextFieldString TextInput = new TextFieldString(input,Model.of()); TextInput.add(new AjaxFormComponentUpdatingBehavior(onfocus){ @Override protected void onUpdate(AjaxRequestTarget target) { String thisValue = this.getComponent().getDefaultModelObjectAsString(); thisValue = ChangedNormally; this.getComponent().setDefaultModelObject(ChangedViaDefaultSetModel); target.add(this.getComponent()); System.out.println(onfocus+thisValue); } }); form.add(TextInput); add(form); } } When I focus on textfield here, ChangedViaDefaultSetModel is set and on console onfocusChangedNormally gets print continuously. I fail to undertsand few things : Why does onfocus gets called again and again printing onfocusChangedNormally evertytime on console? How can I get the value of actual model and not default model. WHy does the normal value doesnot get reflected in model whereas on doing setDefaultModel() it works? Thanks For Help -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onfocus-event-getting-called-recursively-in-Apache-wicket-tp4666802.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: onfocus event getting called recursively in Apache wicket
Hi, target.add(this.getComponent()); Wicket will refocus the textField after replacing the markup tag. How can I get the value of actual model and not default model. Sorry, I don't understand that. Regards Sven On 07/30/2014 02:35 PM, suvojit168 wrote: I am understanding how to handle JS events like onfocus and onblur in apache wicket. I have a simple form in which there is a textfield. onfocus event on this I am trying to set the textfield to a value. I have observed on running the code that onfocus is called again and again (recursively it seems). I fail to understand why and what I have done wrong. Below is the code : HTML: html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.org; head titleWicket Examples - component reference/title link rel=stylesheet type=text/css href=style.css/ /head body form wicket:id=form INPUT wicket:id=input type=text name=input style=WIDTH: 800px / /form Java: package com.poc.pages; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.ChoiceRenderer; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.model.Model; public class IndexPage extends WebPage { /** * Constructor */ public IndexPage() { Form form = new Form(form); TextFieldString TextInput = new TextFieldString(input,Model.of()); TextInput.add(new AjaxFormComponentUpdatingBehavior(onfocus){ @Override protected void onUpdate(AjaxRequestTarget target) { String thisValue = this.getComponent().getDefaultModelObjectAsString(); thisValue = ChangedNormally; this.getComponent().setDefaultModelObject(ChangedViaDefaultSetModel); target.add(this.getComponent()); System.out.println(onfocus+thisValue); } }); form.add(TextInput); add(form); } } When I focus on textfield here, ChangedViaDefaultSetModel is set and on console onfocusChangedNormally gets print continuously. I fail to undertsand few things : Why does onfocus gets called again and again printing onfocusChangedNormally evertytime on console? How can I get the value of actual model and not default model. WHy does the normal value doesnot get reflected in model whereas on doing setDefaultModel() it works? Thanks For Help -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onfocus-event-getting-called-recursively-in-Apache-wicket-tp4666802.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
Upgrade to 6.12.0+ with AjaxFormComponentUpdatingBehavior reloads the page
Hi, I just upgraded an Apache Wicket application from 6.12.0 to 6.13.0 with a page including form with the following component: ``` textfield.add(new AjaxFormComponentUpdatingBehavior(onchange) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { target.add(button); String validationMessage = validateModel(model); if (validationMessage != null) { addErrorMessage(target, feedback, validationMessage); button.setEnabled(false); return; } button.setEnabled(true); } }); ``` With 6.13.0, when I write something in the textfield and then press a tab (go to next field), the page automatically gets reloaded. Is this a known issue? What am I missing? Thanks in advance, Behrooz -- -- Behrooz Nobakht
Re: Upgrade to 6.12.0+ with AjaxFormComponentUpdatingBehavior reloads the page
Have you tried 6.16.0? Regards Sven On 07/30/2014 07:11 PM, Behrooz Nobakht wrote: Hi, I just upgraded an Apache Wicket application from 6.12.0 to 6.13.0 with a page including form with the following component: ``` textfield.add(new AjaxFormComponentUpdatingBehavior(onchange) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { target.add(button); String validationMessage = validateModel(model); if (validationMessage != null) { addErrorMessage(target, feedback, validationMessage); button.setEnabled(false); return; } button.setEnabled(true); } }); ``` With 6.13.0, when I write something in the textfield and then press a tab (go to next field), the page automatically gets reloaded. Is this a known issue? What am I missing? Thanks in advance, Behrooz - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting intermittent ListenerInvocationNotAllowedException with AjaxEventBehavior
Hmmm I tried to figure out how to do that but I don't get it. I know to override updateAjaxAttributes() but I'm not sure how of the meaning/function of the childSelector filter string. The selector string that filters the descendants doesn't make too much sense, and I can't find any other documentation. childSelector is not explained in the apache wicket, either. Would you mind elaborating? Thank you! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-intermittent-ListenerInvocationNotAllowedException-with-AjaxEventBehavior-tp4666782p4666806.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: Getting intermittent ListenerInvocationNotAllowedException with AjaxEventBehavior
Hi, there might be other solutions too, but perhaps the child selector will fit nicely: https://issues.apache.org/jira/browse/WICKET-5512 Regards Sven On 07/30/2014 07:33 PM, Lorne Malvo wrote: Hmmm I tried to figure out how to do that but I don't get it. I know to override updateAjaxAttributes() but I'm not sure how of the meaning/function of the childSelector filter string. The selector string that filters the descendants doesn't make too much sense, and I can't find any other documentation. childSelector is not explained in the apache wicket, either. Would you mind elaborating? Thank you! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Getting-intermittent-ListenerInvocationNotAllowedException-with-AjaxEventBehavior-tp4666782p4666806.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: Upgrade to 6.12.0+ with AjaxFormComponentUpdatingBehavior reloads the page
Yes, I've tried all from 6.13.0 to 6.16.0 and the issue is the same. Thanks, Behrooz On Wed, Jul 30, 2014 at 7:32 PM, Sven Meier s...@meiers.net wrote: Have you tried 6.16.0? Regards Sven On 07/30/2014 07:11 PM, Behrooz Nobakht wrote: Hi, I just upgraded an Apache Wicket application from 6.12.0 to 6.13.0 with a page including form with the following component: ``` textfield.add(new AjaxFormComponentUpdatingBehavior(onchange) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { target.add(button); String validationMessage = validateModel(model); if (validationMessage != null) { addErrorMessage(target, feedback, validationMessage); button.setEnabled(false); return; } button.setEnabled(true); } }); ``` With 6.13.0, when I write something in the textfield and then press a tab (go to next field), the page automatically gets reloaded. Is this a known issue? What am I missing? Thanks in advance, Behrooz - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- -- Behrooz Nobakht
Re: Upgrade to 6.12.0+ with AjaxFormComponentUpdatingBehavior reloads the page
Hi, it works fine here with a small example. Please create a quickstart and attach it to a jira issue. Thanks Sven On 07/30/2014 07:42 PM, Behrooz Nobakht wrote: Yes, I've tried all from 6.13.0 to 6.16.0 and the issue is the same. Thanks, Behrooz On Wed, Jul 30, 2014 at 7:32 PM, Sven Meier s...@meiers.net wrote: Have you tried 6.16.0? Regards Sven On 07/30/2014 07:11 PM, Behrooz Nobakht wrote: Hi, I just upgraded an Apache Wicket application from 6.12.0 to 6.13.0 with a page including form with the following component: ``` textfield.add(new AjaxFormComponentUpdatingBehavior(onchange) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { target.add(button); String validationMessage = validateModel(model); if (validationMessage != null) { addErrorMessage(target, feedback, validationMessage); button.setEnabled(false); return; } button.setEnabled(true); } }); ``` With 6.13.0, when I write something in the textfield and then press a tab (go to next field), the page automatically gets reloaded. Is this a known issue? What am I missing? Thanks in advance, Behrooz - 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: onfocus event getting called recursively in Apache wicket
Hi, Thanks for replying. My requirement is to clear the textfield on onfocus (although here I was trying to set a string in textfield). Unless I add the component to ajaxtarget, how will it be updated on UI? Sven Meier wrote How can I get the value of actual model and not default model. Sorry, I don't understand that. Sorry for being vague, I wanted to understand why does doing *this.getComponent().setDefaultModelObject(ChangedViaDefaultSetModel);* change the textfield value but *String thisValue = this.getComponent().getDefaultModelObjectAsString(); thisValue = ChangedNormally;* does not? I think after all both means same here. Correct me if I am wrong. Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onfocus-event-getting-called-recursively-in-Apache-wicket-tp4666802p4666807.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: Upgrade to 6.12.0+ with AjaxFormComponentUpdatingBehavior reloads the page
I tracked down the difference. When using 6.12.0, the HTML source of the page shows: Wicket.Ajax.ajax({u:./wicket/page?3-1.IBehaviorListener.1-table-form-url,e:change,c:url49,ad:true,m:POST}); for the URL textfield that I use the AjaxFormCompnentUpdatingBehavior. However, from 6.13.0, instead the following is generated: Wicket.Ajax.ajax({u:./controllers,e:change,c:url42,ad:true,m:POST}); which is different from above. Note that my page is a mounted page at path /controllers. The “u” field is the callback URL generated by the behavior. How should I fix this? Thanks, Behrooz On Wed, Jul 30, 2014 at 7:59 PM, Sven Meier s...@meiers.net wrote: Hi, it works fine here with a small example. Please create a quickstart and attach it to a jira issue. Thanks Sven On 07/30/2014 07:42 PM, Behrooz Nobakht wrote: Yes, I've tried all from 6.13.0 to 6.16.0 and the issue is the same. Thanks, Behrooz On Wed, Jul 30, 2014 at 7:32 PM, Sven Meier s...@meiers.net wrote: Have you tried 6.16.0? Regards Sven On 07/30/2014 07:11 PM, Behrooz Nobakht wrote: Hi, I just upgraded an Apache Wicket application from 6.12.0 to 6.13.0 with a page including form with the following component: ``` textfield.add(new AjaxFormComponentUpdatingBehavior(onchange) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { target.add(button); String validationMessage = validateModel(model); if (validationMessage != null) { addErrorMessage(target, feedback, validationMessage); button.setEnabled(false); return; } button.setEnabled(true); } }); ``` With 6.13.0, when I write something in the textfield and then press a tab (go to next field), the page automatically gets reloaded. Is this a known issue? What am I missing? Thanks in advance, Behrooz - 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 -- -- Behrooz Nobakht
Re: onfocus event getting called recursively in Apache wicket
Hi, you should do that with JavaScript only. Sven On 07/30/2014 07:35 PM, suvojit168 wrote: Hi, Thanks for replying. My requirement is to clear the textfield on onfocus (although here I was trying to set a string in textfield). Unless I add the component to ajaxtarget, how will it be updated on UI? Sven Meier wrote How can I get the value of actual model and not default model. Sorry, I don't understand that. Sorry for being vague, I wanted to understand why does doing *this.getComponent().setDefaultModelObject(ChangedViaDefaultSetModel);* change the textfield value but *String thisValue = this.getComponent().getDefaultModelObjectAsString(); thisValue = ChangedNormally;* does not? I think after all both means same here. Correct me if I am wrong. Thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/onfocus-event-getting-called-recursively-in-Apache-wicket-tp4666802p4666807.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: Upgrade to 6.12.0+ with AjaxFormComponentUpdatingBehavior reloads the page
Hi, u:./controllers that cannot be a valid url for an ajaxBehavior. You'll have to put a breakpoint in AbstractAjaxBehavior#getCallbackUrl() and see where the url is coming from. Regards Sven On 07/30/2014 10:04 PM, Behrooz Nobakht wrote: I tracked down the difference. When using 6.12.0, the HTML source of the page shows: Wicket.Ajax.ajax({u:./wicket/page?3-1.IBehaviorListener.1-table-form-url,e:change,c:url49,ad:true,m:POST}); for the URL textfield that I use the AjaxFormCompnentUpdatingBehavior. However, from 6.13.0, instead the following is generated: Wicket.Ajax.ajax({u:./controllers,e:change,c:url42,ad:true,m:POST}); which is different from above. Note that my page is a mounted page at path /controllers. The “u” field is the callback URL generated by the behavior. How should I fix this? Thanks, Behrooz On Wed, Jul 30, 2014 at 7:59 PM, Sven Meier s...@meiers.net wrote: Hi, it works fine here with a small example. Please create a quickstart and attach it to a jira issue. Thanks Sven On 07/30/2014 07:42 PM, Behrooz Nobakht wrote: Yes, I've tried all from 6.13.0 to 6.16.0 and the issue is the same. Thanks, Behrooz On Wed, Jul 30, 2014 at 7:32 PM, Sven Meier s...@meiers.net wrote: Have you tried 6.16.0? Regards Sven On 07/30/2014 07:11 PM, Behrooz Nobakht wrote: Hi, I just upgraded an Apache Wicket application from 6.12.0 to 6.13.0 with a page including form with the following component: ``` textfield.add(new AjaxFormComponentUpdatingBehavior(onchange) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { target.add(button); String validationMessage = validateModel(model); if (validationMessage != null) { addErrorMessage(target, feedback, validationMessage); button.setEnabled(false); return; } button.setEnabled(true); } }); ``` With 6.13.0, when I write something in the textfield and then press a tab (go to next field), the page automatically gets reloaded. Is this a known issue? What am I missing? Thanks in advance, Behrooz - 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
Wicketstuff restannotations example throws IllegalStateException: STREAMED with https
I want to use the wicketstuff-restannotations library to implement a restful web service. It seem very handy and I was able to get the example code working fine. To make sure I understood how everything was working and how to access from another server I used curl from the command line to send an HTTP request. It worked fine using http with jetty, but when I tried http://localhost:8443 I get IllegalStateException: STREAMED. See the details below: The following works using curl to post: C:\Software\Curlcurl -H Content-Type: application/json -d {name:Bruce,email:myacco...@gmail.com,password:piano} http://localhost:8080/personsmanager/createPerson It returns this: {name:Bruce,email:myacco...@gmail.com,password:piano} With the following HTTPS curl command I get IllegalStateException: STREAMED (note: the -k/ --insecure switch tells curl not to validate the certificate since it is not in their list) C:\Software\Curlcurl -H -k/ --insecure Content-Type: application/json -d {name:Bruce,email:myacco...@gmail.com,password:piano} https://localhost:8443 /personsmanager/persons Stacktrace shows: java.lang.IllegalStateException: STREAMED at org.eclipse.jetty.server.Request.getReader(Request.java:787) at org.wicketstuff.rest.utils.http.HttpUtils.readStringFromRequest(HttpUtils.ja va:46) at org.wicketstuff.rest.contenthandling.serialdeserial.TextualWebSerialDeserial .requestToObject(TextualWebSerialDeserial.java:83) at org.wicketstuff.rest.utils.reflection.MethodParameter.deserializeObjectFromR equest(MethodParameter.java:278) at org.wicketstuff.rest.utils.reflection.MethodParameter.extractParameterFromAn notation(MethodParameter.java:168) at org.wicketstuff.rest.utils.reflection.MethodParameter.extractParameterValue( MethodParameter.java:117) Does this mean that it the restful annotation will not work over https, or am I doing something wrong? Bruce
Re: Upgrade to 6.12.0+ with AjaxFormComponentUpdatingBehavior reloads the page
Thanks for the hint. It seems that we had a custom MountedMapper with the following specifics: @Override protected void encodePageComponentInfo(Url url, PageComponentInfo info) { // do nothing so that component info does not get // rendered in url } @Override public Url mapHandler(IRequestHandler requestHandler) { if (requestHandler instanceof ListenerInterfaceRequestHandler) { return null; } else { return super.mapHandler(requestHandler); } } I could not figure why this corrupted the callback URLs in the end but when I replaced them with the default one, the issue was resolved. Any idea to understand this better? Thanks, Behrooz On Wed, Jul 30, 2014 at 10:28 PM, Sven Meier s...@meiers.net wrote: Hi, u:./controllers that cannot be a valid url for an ajaxBehavior. You'll have to put a breakpoint in AbstractAjaxBehavior#getCallbackUrl() and see where the url is coming from. Regards Sven On 07/30/2014 10:04 PM, Behrooz Nobakht wrote: I tracked down the difference. When using 6.12.0, the HTML source of the page shows: Wicket.Ajax.ajax({u:./wicket/page?3-1.IBehaviorListener.1-table- form-url,e:change,c:url49,ad:true,m:POST}); for the URL textfield that I use the AjaxFormCompnentUpdatingBehavior. However, from 6.13.0, instead the following is generated: Wicket.Ajax.ajax({u:./controllers,e:change,c: url42,ad:true,m:POST}); which is different from above. Note that my page is a mounted page at path /controllers. The “u” field is the callback URL generated by the behavior. How should I fix this? Thanks, Behrooz On Wed, Jul 30, 2014 at 7:59 PM, Sven Meier s...@meiers.net wrote: Hi, it works fine here with a small example. Please create a quickstart and attach it to a jira issue. Thanks Sven On 07/30/2014 07:42 PM, Behrooz Nobakht wrote: Yes, I've tried all from 6.13.0 to 6.16.0 and the issue is the same. Thanks, Behrooz On Wed, Jul 30, 2014 at 7:32 PM, Sven Meier s...@meiers.net wrote: Have you tried 6.16.0? Regards Sven On 07/30/2014 07:11 PM, Behrooz Nobakht wrote: Hi, I just upgraded an Apache Wicket application from 6.12.0 to 6.13.0 with a page including form with the following component: ``` textfield.add(new AjaxFormComponentUpdatingBehavior(onchange) { private static final long serialVersionUID = 1L; @Override protected void onUpdate(AjaxRequestTarget target) { target.add(button); String validationMessage = validateModel(model); if (validationMessage != null) { addErrorMessage(target, feedback, validationMessage); button.setEnabled(false); return; } button.setEnabled(true); } }); ``` With 6.13.0, when I write something in the textfield and then press a tab (go to next field), the page automatically gets reloaded. Is this a known issue? What am I missing? Thanks in advance, Behrooz - 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 -- -- Behrooz Nobakht