Re: AjaxFormComponentUpdatingBehavior is not working
This is the produced HTML for selSupplier: lt;select name=parameterPanel:selSupplier id=selSupplier9gt; lt;option value=0gt;Supplier 0lt;/optiongt; lt;option value=1gt;Supplier 1lt;/optiongt; lt;option value=2gt;Supplier 2lt;/optiongt;lt;option value=3gt;Supplier 3lt;/optiongt; lt;option value=4gt;Supplier 4lt;/optiongt; lt;option value=5gt;Supplier 5lt;/optiongt; lt;option value=6gt;Supplier 6lt;/optiongt;lt;option value=7gt;Supplier 7lt;/optiongt; lt;option value=8gt;Supplier 8lt;/optiongt; lt;option value=9gt;Supplier 9lt;/optiongt;lt;/selectgt; This is the generated HTML of my test-page which is working: lt;!DOCTYPE htmlgt;lt;html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.orggt;lt;headgt;lt;script type=text/javascript src=./wicket/resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-1.11.1-ver-1407233400871.jsgt;lt;/scriptgt;lt;script type=text/javascript src=./wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1407233400871.jsgt;lt;/scriptgt;lt;script type=text/javascript src=./wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-ajax-jquery-ver-1407233400871.jsgt;lt;/scriptgt;lt;script type=text/javascript src=./wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-ajax-jquery-debug-ver-1407233400871.jsgt;lt;/scriptgt;lt;script type=text/javascript id=wicket-ajax-debug-enablegt;/*lt;![CDATA[*/Wicket.Ajax.DebugWindow.enabled=true;/*]]gt;*/lt;/scriptgt;lt;script type=text/javascript id=wicket-ajax-base-urlgt;/*lt;![CDATA[*/Wicket.Ajax.baseUrl=?0;/*]]gt;*/lt;/scriptgt;lt;meta http-equiv=Content-Type content=text/html; charset=UTF-8gt;lt;titlegt;WicketTestlt;/titlegt;lt;script type=text/javascript gt;/*lt;![CDATA[*/Wicket.Event.add(window, domready, function(event) { Wicket.Ajax.ajax({u:./?0-2.IBehaviorListener.0-form-panel-plantType,e:change,c:plantType1,ad:true,m:POST});;;});/*]]gt;*/lt;/scriptgt;lt;/headgt;lt;bodygt; lt;form wicket:id=form id=form2 method=post action=./?0-2.IFormSubmitListener-formgt;lt;div style=width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hiddengt;lt;input type=hidden name=form2_hf_0 id=form2_hf_0 /gt;lt;/divgt; lt;wicket:container wicket:id=panelgt;lt;wicket:panelgt; lt;select wicket:id=plantType name=panel:plantType id=plantType1gt;lt;option selected=selected value=gt;Bitte wählenlt;/optiongt;lt;option value=0gt;Obstlt;/optiongt;lt;option value=1gt;Gemüselt;/optiongt;lt;/selectgt;lt;select wicket:id=plants name=panel:plants id=plants3gt;lt;option selected=selected value=gt;Bitte wählenlt;/optiongt;lt;/selectgt; lt;/wicket:panelgt;lt;/wicket:containergt; lt;/formgt;lt;/bodygt;lt;/htmlgt; But the HTML of my original application does not contain a single lt;scriptgt; tag. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-is-not-working-tp4666877p4666888.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: AjaxFormComponentUpdatingBehavior is not working
Hi, Sorry. You said script (and I repeated it) but I actually thought about select ... Do you use IHeaderResponseDecorator in YourApplication ? ( http://wicketinaction.com/2012/07/wicket-6-resource-management/) Is it possible that you filter out all JavaScriptHeaderItems by chance ? Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Wed, Aug 6, 2014 at 8:57 AM, brushmate brushm...@gmail.com wrote: This is the produced HTML for selSupplier: lt;select name=parameterPanel:selSupplier id=selSupplier9gt; lt;option value=0gt;Supplier 0lt;/optiongt; lt;option value=1gt;Supplier 1lt;/optiongt; lt;option value=2gt;Supplier 2lt;/optiongt;lt;option value=3gt;Supplier 3lt;/optiongt; lt;option value=4gt;Supplier 4lt;/optiongt; lt;option value=5gt;Supplier 5lt;/optiongt; lt;option value=6gt;Supplier 6lt;/optiongt;lt;option value=7gt;Supplier 7lt;/optiongt; lt;option value=8gt;Supplier 8lt;/optiongt; lt;option value=9gt;Supplier 9lt;/optiongt;lt;/selectgt; This is the generated HTML of my test-page which is working: lt;!DOCTYPE htmlgt;lt;html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=http://wicket.apache.orggt;lt;headgt;lt;script type=text/javascript src=./wicket/resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-1.11.1-ver-1407233400871.jsgt;lt;/scriptgt;lt;script type=text/javascript src=./wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-event-jquery-ver-1407233400871.jsgt;lt;/scriptgt;lt;script type=text/javascript src=./wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-ajax-jquery-ver-1407233400871.jsgt;lt;/scriptgt;lt;script type=text/javascript src=./wicket/resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/res/js/wicket-ajax-jquery-debug-ver-1407233400871.jsgt;lt;/scriptgt;lt;script type=text/javascript id=wicket-ajax-debug-enablegt;/*lt;![CDATA[*/Wicket.Ajax.DebugWindow.enabled=true;/*]]gt;*/lt;/scriptgt;lt;script type=text/javascript id=wicket-ajax-base-urlgt;/*lt;![CDATA[*/Wicket.Ajax.baseUrl=?0;/*]]gt;*/lt;/scriptgt;lt;meta http-equiv=Content-Type content=text/html; charset=UTF-8gt;lt;titlegt;WicketTestlt;/titlegt;lt;script type=text/javascript gt;/*lt;![CDATA[*/Wicket.Event.add(window, domready, function(event) { Wicket.Ajax.ajax({u:./?0-2.IBehaviorListener.0-form-panel-plantType,e:change,c:plantType1,ad:true,m:POST});;;});/*]]gt;*/lt;/scriptgt;lt;/headgt;lt;bodygt; lt;form wicket:id=form id=form2 method=post action=./?0-2.IFormSubmitListener-formgt;lt;div style=width:0px;height:0px;position:absolute;left:-100px;top:-100px;overflow:hiddengt;lt;input type=hidden name=form2_hf_0 id=form2_hf_0 /gt;lt;/divgt; lt;wicket:container wicket:id=panelgt;lt;wicket:panelgt; lt;select wicket:id=plantType name=panel:plantType id=plantType1gt;lt;option selected=selected value=gt;Bitte wählenlt;/optiongt;lt;option value=0gt;Obstlt;/optiongt;lt;option value=1gt;Gemüselt;/optiongt;lt;/selectgt;lt;select wicket:id=plants name=panel:plants id=plants3gt;lt;option selected=selected value=gt;Bitte wählenlt;/optiongt;lt;/selectgt; lt;/wicket:panelgt;lt;/wicket:containergt; lt;/formgt;lt;/bodygt;lt;/htmlgt; But the HTML of my original application does not contain a single lt;scriptgt; tag. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-is-not-working-tp4666877p4666888.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: AjaxFormComponentUpdatingBehavior is not working
No I do not use any Decorator. I have another page where I am using an AjaxSelfUpdatingTimerBehavior which updates the contents of the page periodically. All components of this page are in the same project. The page is working and updates its contents every 2 seconds. Also the lt;scriptgt; tags are available in the generated HTML. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-is-not-working-tp4666877p4666890.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: AjaxFormComponentUpdatingBehavior is not working
Do you override AjaxFormComponentUpdatingBehavior#renderHead() without calling super.renderHead() ? You pasted an excerpt of the panel, so I should ask .. :-) Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Wed, Aug 6, 2014 at 9:22 AM, brushmate brushm...@gmail.com wrote: No I do not use any Decorator. I have another page where I am using an AjaxSelfUpdatingTimerBehavior which updates the contents of the page periodically. All components of this page are in the same project. The page is working and updates its contents every 2 seconds. Also the lt;scriptgt; tags are available in the generated HTML. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-is-not-working-tp4666877p4666890.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: AjaxFormComponentUpdatingBehavior is not working
I have done a terrible mistake... I have been working on an old file that actually was not invoked in the current version of the webapp. Everything is working as expected. I am so sorry for wasting your time :-( Thank you very much for trying to help me anyways. Once again sorry! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-is-not-working-tp4666877p4666892.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
AjaxFormComponentUpdatingBehavior is not working
I am building a webapp based on Wicket. I have a WebPage that contains a StatelessForm which contains a FormComponentPanel. The FormComponentPanel is provided by a different library. This works fine without any AJAX-stuff. But now I want to react to onchange-events of a DropDownChoice and thus I added a AjaxFormComponentUpdatingBehavior to my DropDownChoice. This is a excerpt of my FormComponentPanel: public class ParameterForm extends FormComponentPanelMaplt;String, String { private final DropDownChoice selSupplier; private final DropDownChoice selProjects; public ParameterForm(final String id, final List suppliers, final List projects) { super(id); selSupplier = new DropDownChoice(selSupplier, Model.of(), new ListModel(suppliers)); selProjects = new DropDownChoice(selProjects, Model.of(), new ListModel(projects)); setModel(new MapModel()); selSupplier.setOutputMarkupid(true);} @Override protected void onInitialize() {super.onInitialize(); selSupplier.add(new AjaxFormComponentUpdatingBehavior(onchange) { private static final long serialVersionUID = 7643295763275649586L;@Override protected void onUpdate(final AjaxRequestTarget target) { System.out.println(selSupplier.getConvertedInput());} }); add(selSupplier); add(selProjects); }} Now I would expect to get a message on the command-line when I select another item, but nothing happens. Wicket does not put any script-tags into the generated HTML and I do not see the WICKET AJAX DEBUG-button. Can someone tell me what I am doing wrong? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-is-not-working-tp4666877.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: AjaxFormComponentUpdatingBehavior is not working
Hi, By using Ajax behavior/component you make the page stateful. I guess you want it to be stateless (because you use StatelessForm). Aren't there any errors in the server logs or in the browser's JS console ? Wicket Ajax Debug console appears only in DEV mode and only when there is an Ajax behavior in the page. What do you mean by there are no script elements in the produced html ? What is the produced markup for selSupplier component ? Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Aug 5, 2014 at 1:58 PM, brushmate brushm...@gmail.com wrote: I am building a webapp based on Wicket. I have a WebPage that contains a StatelessForm which contains a FormComponentPanel. The FormComponentPanel is provided by a different library. This works fine without any AJAX-stuff. But now I want to react to onchange-events of a DropDownChoice and thus I added a AjaxFormComponentUpdatingBehavior to my DropDownChoice. This is a excerpt of my FormComponentPanel: public class ParameterForm extends FormComponentPanelMaplt;String, String { private final DropDownChoice selSupplier; private final DropDownChoice selProjects; public ParameterForm(final String id, final List suppliers, final List projects) { super(id); selSupplier = new DropDownChoice(selSupplier, Model.of(), new ListModel(suppliers)); selProjects = new DropDownChoice(selProjects, Model.of(), new ListModel(projects)); setModel(new MapModel()); selSupplier.setOutputMarkupid(true);} @Override protected void onInitialize() {super.onInitialize(); selSupplier.add(new AjaxFormComponentUpdatingBehavior(onchange) { private static final long serialVersionUID = 7643295763275649586L;@Override protected void onUpdate(final AjaxRequestTarget target) { System.out.println(selSupplier.getConvertedInput());} }); add(selSupplier); add(selProjects); }} Now I would expect to get a message on the command-line when I select another item, but nothing happens. Wicket does not put any script-tags into the generated HTML and I do not see the WICKET AJAX DEBUG-button. Can someone tell me what I am doing wrong? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-is-not-working-tp4666877.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: AjaxFormComponentUpdatingBehavior is not working
Sorry I have finished work for today, I will post the output tomorrow. The generated HTML does not contain any script tags, so no JavaScript is loaded. Wicket is in DEV mode. I created another Wicket application and also used a StatelessForm, FormComponentPanel, two DropDownChoices and an AjaxFormComponentUpdatingBehavior. On this test-page everything works as expected. The only difference is that both the page and the panel are in the same project. I get no exceptions in the logs and the browsers console shows nothing. Am 05.08.2014 14:07 schrieb Martin Grigorov-4 [via Apache Wicket] ml-node+s1842946n4666878...@n4.nabble.com: Hi, By using Ajax behavior/component you make the page stateful. I guess you want it to be stateless (because you use StatelessForm). Aren't there any errors in the server logs or in the browser's JS console ? Wicket Ajax Debug console appears only in DEV mode and only when there is an Ajax behavior in the page. What do you mean by there are no script elements in the produced html ? What is the produced markup for selSupplier component ? Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Aug 5, 2014 at 1:58 PM, brushmate [hidden email] http://user/SendEmail.jtp?type=nodenode=4666878i=0 wrote: I am building a webapp based on Wicket. I have a WebPage that contains a StatelessForm which contains a FormComponentPanel. The FormComponentPanel is provided by a different library. This works fine without any AJAX-stuff. But now I want to react to onchange-events of a DropDownChoice and thus I added a AjaxFormComponentUpdatingBehavior to my DropDownChoice. This is a excerpt of my FormComponentPanel: public class ParameterForm extends FormComponentPanelMaplt;String, String { private final DropDownChoice selSupplier; private final DropDownChoice selProjects; public ParameterForm(final String id, final List suppliers, final List projects) { super(id); selSupplier = new DropDownChoice(selSupplier, Model.of(), new ListModel(suppliers)); selProjects = new DropDownChoice(selProjects, Model.of(), new ListModel(projects)); setModel(new MapModel()); selSupplier.setOutputMarkupid(true);} @Override protected void onInitialize() {super.onInitialize(); selSupplier.add(new AjaxFormComponentUpdatingBehavior(onchange) { private static final long serialVersionUID = 7643295763275649586L; @Override protected void onUpdate(final AjaxRequestTarget target) { System.out.println(selSupplier.getConvertedInput()); } }); add(selSupplier); add(selProjects); }} Now I would expect to get a message on the command-line when I select another item, but nothing happens. Wicket does not put any script-tags into the generated HTML and I do not see the WICKET AJAX DEBUG-button. Can someone tell me what I am doing wrong? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-is-not-working-tp4666877.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=4666878i=1 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=4666878i=2 -- If you reply to this email, your message will be added to the discussion below: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-is-not-working-tp4666877p4666878.html To unsubscribe from AjaxFormComponentUpdatingBehavior is not working, click here http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4666877code=YnJ1c2htYXRlQGdtYWlsLmNvbXw0NjY2ODc3fC05MTIzMjM2MzY= . NAML http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-is-not-working-tp4666877p4666881.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
AjaxFormComponentUpdatingBehavior(onchange) not working on DropDownChoice
Dear Forum, I have added AjaxFormComponentUpdatingBehavior to a DropDownChoice to hide a text field or to make it visible, according to the value selected from DropDownChoice. AjaxFormComponentUpdatingBehavior is hiding the text field, as expected, but it is not making it visible when it should. Surely, if it hides a form object, it should equally make it visible, should it not? Code: public class HomePage extends WebPage { DropDownChoiceString choice = new DropDownChoiceString(choice, new ModelString(), Arrays.asList( new String[] { A, B, C } )); TextFieldString textField = new TextFieldString(textField, new ModelString()); Form textDropDownAjaxForm = new Form(genericForm); public HomePage(final PageParameters parameters) { textDropDownAjaxForm.add(textField); textDropDownAjaxForm.add(choice); add(textDropDownAjaxForm); textField.setOutputMarkupId(true); choice.add(new AjaxFormComponentUpdatingBehavior(onchange) { protected void onUpdate(AjaxRequestTarget target) { if ( choice.getModelObject() == A ){ *textField.setVisible(true);* } else { *textField.setVisible(false);* } *target.addComponent(textField);* } }); } } and here is the HTML: body form wicket:id=genericForm select wicket:id=choice optionChoose one/option /select text field: input wicket:id=textField type=text / /form /body Thanks in advance for any help, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-onchange-not-working-on-DropDownChoice-tp3674937p3674937.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: AjaxFormComponentUpdatingBehavior(onchange) not working on DropDownChoice
textField.setOutputMarkupPlaceholderTag(true); On Mon, Jul 18, 2011 at 1:16 PM, lucast lucastol...@hotmail.com wrote: Dear Forum, I have added AjaxFormComponentUpdatingBehavior to a DropDownChoice to hide a text field or to make it visible, according to the value selected from DropDownChoice. AjaxFormComponentUpdatingBehavior is hiding the text field, as expected, but it is not making it visible when it should. Surely, if it hides a form object, it should equally make it visible, should it not? Code: public class HomePage extends WebPage { DropDownChoiceString choice = new DropDownChoiceString(choice, new ModelString(), Arrays.asList( new String[] { A, B, C } )); TextFieldString textField = new TextFieldString(textField, new ModelString()); Form textDropDownAjaxForm = new Form(genericForm); public HomePage(final PageParameters parameters) { textDropDownAjaxForm.add(textField); textDropDownAjaxForm.add(choice); add(textDropDownAjaxForm); textField.setOutputMarkupId(true); choice.add(new AjaxFormComponentUpdatingBehavior(onchange) { protected void onUpdate(AjaxRequestTarget target) { if ( choice.getModelObject() == A ){ *textField.setVisible(true);* } else { *textField.setVisible(false);* } *target.addComponent(textField);* } }); } } and here is the HTML: body form wicket:id=genericForm select wicket:id=choice optionChoose one/option /select text field: input wicket:id=textField type=text / /form /body Thanks in advance for any help, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-onchange-not-working-on-DropDownChoice-tp3674937p3674937.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