RE: Please HELP - Value of the model not getting updated in a Panel
Could you please provide some details. I am new to Wicket. Thanks. Regards, Vinay Karmarkar -Original Message- From: Stefan Lindner [mailto:lind...@visionet.de] Sent: Monday, November 30, 2009 1:27 PM To: users@wicket.apache.org Subject: RE: Please HELP - Value of the model not getting updated in a Panel I think your input fields need an AjaxFormUpdatingBehavior Stefan -Ursprüngliche Nachricht- Von: vinay.karmar...@wipro.com [mailto:vinay.karmar...@wipro.com] Gesendet: Montag, 30. November 2009 08:45 An: users@wicket.apache.org Betreff: Please HELP - Value of the model not getting updated in a Panel Hi, I have a panel which is present on a page. The panel consists of a link. By using JQuery I am opening a pop-up when this link is clicked. The pop-up contains a drop-down, text field and a save button. When the Save button is clicked, I am not able to get the new values entered in the drop-down and text field. The related code is as follows: MyPanel.html: wicket:panel form wicket:id=panelForm a class=pop-up href='' wicket:id=invoker data-showid=popupPanel data-width=350 title=Title spanClick to open pop-up/span /a div wicket:id=popupPanel class=hide DIV class=row DIV id=reviewed-by-title H6Title/H6 SELECT name=rb-title wicket:id=fnaTitle/SELECT /DIV DIV id=reviewed-by-name H6Name/H6 input name=rb-name wicket:id=reviwer /DIV DIV id=reviewed-by-comments H6Comments/H6 TEXTAREA name=rb-name wicket:id=reviewComments/TEXTAREA /DIV DIV class=text-right push-down A href=#IMG wicket:id=cancelPopup class=details-trigger pop-up-close alt=Cancel src=Cancel.gif /A A href=#IMG wicket:id=savePopup class=details-trigger pop-up-close alt=Save src=Save.gif /A /DIV /DIV /div /form /wicket:panel MyPanel.java: public class MyPanel extends Panel { private WebMarkupContainer popupPanelWMC; public MyPanel (String id, IModelReviewByVO model, ListTitleList titleList) { super(id, model); add(new PanelForm(panelForm, model, titleList)); } private class PanelForm extends Form { @SuppressWarnings(unchecked) public PanelForm(String id, IModelReviewByVO model, ListTitleList titleList) { super(id); final ReviewByVO reviewByVO = model.getObject(); this.setModel(new CompoundPropertyModelReviewByVO(reviewByVO)); AjaxLinkReviewByVO popupLink = new AjaxLinkReviewByVO(invoker) { @Override public void onClick(AjaxRequestTarget ajaxrequesttarget) { } }; popupPanelWMC = new WebMarkupContainer(popupPanel); popupPanelWMC.setOutputMarkupId(true); popupLink.add(new AttributeModifier(data-showid, new ModelString(# + popupPanelWMC.getMarkupId(; popupLink.add(new AttributeModifier(title, new ModelString( Reviewed By))); final TextFieldString nameTextField = new TextFieldString( reviwer); final TextAreaString commentsTextArea = new TextAreaString( reviewComments); final DropDownChoiceTitleList titleDropDown = new DropDownChoiceTitleList( fnaTitle, new PropertyModelTitleList(model.getObject(), titleList), titleList, new TitleRenderer()); add(popupLink); popupPanelWMC.add(nameTextField); popupPanelWMC.add(commentsTextArea); popupPanelWMC.add(titleDropDown); popupPanelWMC.add(new Button(cancelPopup)); popupPanelWMC.add(new AjaxSubmitLink(savePopup) { @Override public void onSubmit(AjaxRequestTarget target, Form? form) { nameTextField.processInput(); nameTextField.inputChanged(); System.out.println(nameTextField.getRawInput(): + nameTextField.getRawInput()); System.out.println(nameTextField.getValue():
RE: Please HELP - Value of the model not getting updated in a Panel
Try final TextFieldString nameTextField = new TextFieldString(reviwer); nameTextField.add( new AjaxFormComponentUpdatingBehavior() { @Override protected void onUpdate(AjaxRequestTarget target) { // Do nothing } }); Then in your onSubmot method check if the value of nameTextField is present. Stefan -Ursprüngliche Nachricht- Von: vinay.karmar...@wipro.com [mailto:vinay.karmar...@wipro.com] Gesendet: Montag, 30. November 2009 09:52 An: users@wicket.apache.org Betreff: RE: Please HELP - Value of the model not getting updated in a Panel Could you please provide some details. I am new to Wicket. Thanks. Regards, Vinay Karmarkar -Original Message- From: Stefan Lindner [mailto:lind...@visionet.de] Sent: Monday, November 30, 2009 1:27 PM To: users@wicket.apache.org Subject: RE: Please HELP - Value of the model not getting updated in a Panel I think your input fields need an AjaxFormUpdatingBehavior Stefan -Ursprüngliche Nachricht- Von: vinay.karmar...@wipro.com [mailto:vinay.karmar...@wipro.com] Gesendet: Montag, 30. November 2009 08:45 An: users@wicket.apache.org Betreff: Please HELP - Value of the model not getting updated in a Panel Hi, I have a panel which is present on a page. The panel consists of a link. By using JQuery I am opening a pop-up when this link is clicked. The pop-up contains a drop-down, text field and a save button. When the Save button is clicked, I am not able to get the new values entered in the drop-down and text field. The related code is as follows: MyPanel.html: wicket:panel form wicket:id=panelForm a class=pop-up href='' wicket:id=invoker data-showid=popupPanel data-width=350 title=Title spanClick to open pop-up/span /a div wicket:id=popupPanel class=hide DIV class=row DIV id=reviewed-by-title H6Title/H6 SELECT name=rb-title wicket:id=fnaTitle/SELECT /DIV DIV id=reviewed-by-name H6Name/H6 input name=rb-name wicket:id=reviwer /DIV DIV id=reviewed-by-comments H6Comments/H6 TEXTAREA name=rb-name wicket:id=reviewComments/TEXTAREA /DIV DIV class=text-right push-down A href=#IMG wicket:id=cancelPopup class=details-trigger pop-up-close alt=Cancel src=Cancel.gif /A A href=#IMG wicket:id=savePopup class=details-trigger pop-up-close alt=Save src=Save.gif /A /DIV /DIV /div /form /wicket:panel MyPanel.java: public class MyPanel extends Panel { private WebMarkupContainer popupPanelWMC; public MyPanel (String id, IModelReviewByVO model, ListTitleList titleList) { super(id, model); add(new PanelForm(panelForm, model, titleList)); } private class PanelForm extends Form { @SuppressWarnings(unchecked) public PanelForm(String id, IModelReviewByVO model, ListTitleList titleList) { super(id); final ReviewByVO reviewByVO = model.getObject(); this.setModel(new CompoundPropertyModelReviewByVO(reviewByVO)); AjaxLinkReviewByVO popupLink = new AjaxLinkReviewByVO(invoker) { @Override public void onClick(AjaxRequestTarget ajaxrequesttarget) { } }; popupPanelWMC = new WebMarkupContainer(popupPanel); popupPanelWMC.setOutputMarkupId(true); popupLink.add(new AttributeModifier(data-showid, new ModelString(# + popupPanelWMC.getMarkupId(; popupLink.add(new AttributeModifier(title, new ModelString( Reviewed By))); final TextFieldString nameTextField = new TextFieldString( reviwer); final TextAreaString commentsTextArea = new TextAreaString( reviewComments); final DropDownChoiceTitleList titleDropDown = new DropDownChoiceTitleList( fnaTitle, new PropertyModelTitleList(model.getObject(), titleList), titleList, new TitleRenderer()); add(popupLink); popupPanelWMC.add(nameTextField);
RE: Please HELP - Value of the model not getting updated in a Panel
No luck. This did not work... :( Regards, Vinay Karmarkar -Original Message- From: Stefan Lindner [mailto:lind...@visionet.de] Sent: Monday, November 30, 2009 1:27 PM To: users@wicket.apache.org Subject: RE: Please HELP - Value of the model not getting updated in a Panel Try final TextFieldString nameTextField = new TextFieldString(reviwer); nameTextField.add( new AjaxFormComponentUpdatingBehavior() { @Override protected void onUpdate(AjaxRequestTarget target) { // Do nothing } }); Then in your onSubmot method check if the value of nameTextField is present. Stefan -Original Message- From: Vinay Karmarkar (WT01 - BANKING FINANCIAL SERVICES) Sent: Monday, November 30, 2009 2:29 PM To: users@wicket.apache.org Subject: RE: Please HELP - Value of the model not getting updated in a Panel Could you please provide some details. I am new to Wicket. Thanks. Regards, Vinay Karmarkar -Original Message- From: Stefan Lindner [mailto:lind...@visionet.de] Sent: Monday, November 30, 2009 1:27 PM To: users@wicket.apache.org Subject: RE: Please HELP - Value of the model not getting updated in a Panel I think your input fields need an AjaxFormUpdatingBehavior Stefan -Ursprüngliche Nachricht- Von: vinay.karmar...@wipro.com [mailto:vinay.karmar...@wipro.com] Gesendet: Montag, 30. November 2009 08:45 An: users@wicket.apache.org Betreff: Please HELP - Value of the model not getting updated in a Panel Hi, I have a panel which is present on a page. The panel consists of a link. By using JQuery I am opening a pop-up when this link is clicked. The pop-up contains a drop-down, text field and a save button. When the Save button is clicked, I am not able to get the new values entered in the drop-down and text field. The related code is as follows: MyPanel.html: wicket:panel form wicket:id=panelForm a class=pop-up href='' wicket:id=invoker data-showid=popupPanel data-width=350 title=Title spanClick to open pop-up/span /a div wicket:id=popupPanel class=hide DIV class=row DIV id=reviewed-by-title H6Title/H6 SELECT name=rb-title wicket:id=fnaTitle/SELECT /DIV DIV id=reviewed-by-name H6Name/H6 input name=rb-name wicket:id=reviwer /DIV DIV id=reviewed-by-comments H6Comments/H6 TEXTAREA name=rb-name wicket:id=reviewComments/TEXTAREA /DIV DIV class=text-right push-down A href=#IMG wicket:id=cancelPopup class=details-trigger pop-up-close alt=Cancel src=Cancel.gif /A A href=#IMG wicket:id=savePopup class=details-trigger pop-up-close alt=Save src=Save.gif /A /DIV /DIV /div /form /wicket:panel MyPanel.java: public class MyPanel extends Panel { private WebMarkupContainer popupPanelWMC; public MyPanel (String id, IModelReviewByVO model, ListTitleList titleList) { super(id, model); add(new PanelForm(panelForm, model, titleList)); } private class PanelForm extends Form { @SuppressWarnings(unchecked) public PanelForm(String id, IModelReviewByVO model, ListTitleList titleList) { super(id); final ReviewByVO reviewByVO = model.getObject(); this.setModel(new CompoundPropertyModelReviewByVO(reviewByVO)); AjaxLinkReviewByVO popupLink = new AjaxLinkReviewByVO(invoker) { @Override public void onClick(AjaxRequestTarget ajaxrequesttarget) { } }; popupPanelWMC = new WebMarkupContainer(popupPanel); popupPanelWMC.setOutputMarkupId(true); popupLink.add(new AttributeModifier(data-showid, new ModelString(# + popupPanelWMC.getMarkupId(; popupLink.add(new AttributeModifier(title, new ModelString( Reviewed By))); final TextFieldString nameTextField = new TextFieldString( reviwer); final TextAreaString commentsTextArea = new TextAreaString( reviewComments); final DropDownChoiceTitleList titleDropDown = new DropDownChoiceTitleList(
RE: Please HELP - Value of the model not getting updated in a Panel
I think your input fields need an AjaxFormUpdatingBehavior Stefan -Ursprüngliche Nachricht- Von: vinay.karmar...@wipro.com [mailto:vinay.karmar...@wipro.com] Gesendet: Montag, 30. November 2009 08:45 An: users@wicket.apache.org Betreff: Please HELP - Value of the model not getting updated in a Panel Hi, I have a panel which is present on a page. The panel consists of a link. By using JQuery I am opening a pop-up when this link is clicked. The pop-up contains a drop-down, text field and a save button. When the Save button is clicked, I am not able to get the new values entered in the drop-down and text field. The related code is as follows: MyPanel.html: wicket:panel form wicket:id=panelForm a class=pop-up href='' wicket:id=invoker data-showid=popupPanel data-width=350 title=Title spanClick to open pop-up/span /a div wicket:id=popupPanel class=hide DIV class=row DIV id=reviewed-by-title H6Title/H6 SELECT name=rb-title wicket:id=fnaTitle/SELECT /DIV DIV id=reviewed-by-name H6Name/H6 input name=rb-name wicket:id=reviwer /DIV DIV id=reviewed-by-comments H6Comments/H6 TEXTAREA name=rb-name wicket:id=reviewComments/TEXTAREA /DIV DIV class=text-right push-down A href=#IMG wicket:id=cancelPopup class=details-trigger pop-up-close alt=Cancel src=Cancel.gif /A A href=#IMG wicket:id=savePopup class=details-trigger pop-up-close alt=Save src=Save.gif /A /DIV /DIV /div /form /wicket:panel MyPanel.java: public class MyPanel extends Panel { private WebMarkupContainer popupPanelWMC; public MyPanel (String id, IModelReviewByVO model, ListTitleList titleList) { super(id, model); add(new PanelForm(panelForm, model, titleList)); } private class PanelForm extends Form { @SuppressWarnings(unchecked) public PanelForm(String id, IModelReviewByVO model, ListTitleList titleList) { super(id); final ReviewByVO reviewByVO = model.getObject(); this.setModel(new CompoundPropertyModelReviewByVO(reviewByVO)); AjaxLinkReviewByVO popupLink = new AjaxLinkReviewByVO(invoker) { @Override public void onClick(AjaxRequestTarget ajaxrequesttarget) { } }; popupPanelWMC = new WebMarkupContainer(popupPanel); popupPanelWMC.setOutputMarkupId(true); popupLink.add(new AttributeModifier(data-showid, new ModelString(# + popupPanelWMC.getMarkupId(; popupLink.add(new AttributeModifier(title, new ModelString( Reviewed By))); final TextFieldString nameTextField = new TextFieldString( reviwer); final TextAreaString commentsTextArea = new TextAreaString( reviewComments); final DropDownChoiceTitleList titleDropDown = new DropDownChoiceTitleList( fnaTitle, new PropertyModelTitleList(model.getObject(), titleList), titleList, new TitleRenderer()); add(popupLink); popupPanelWMC.add(nameTextField); popupPanelWMC.add(commentsTextArea); popupPanelWMC.add(titleDropDown); popupPanelWMC.add(new Button(cancelPopup)); popupPanelWMC.add(new AjaxSubmitLink(savePopup) { @Override public void onSubmit(AjaxRequestTarget target, Form? form) { nameTextField.processInput(); nameTextField.inputChanged(); System.out.println(nameTextField.getRawInput(): + nameTextField.getRawInput()); System.out.println(nameTextField.getValue(): + nameTextField.getValue()); System.out.println(nameTextField.hasRawInput(): + nameTextField.hasRawInput()); }); add(popupPanelWMC); } } } Regards, Vinay Karmarkar Please do not