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">

            <span>Click to open pop-up</span>

      </a>



      <div wicket:id="popupPanel" class="hide">

            <DIV class=row>

                  <DIV id=reviewed-by-title>

                        <H6>Title</H6>

                              <SELECT name=rb-title
wicket:id="fnaTitle"></SELECT>

                  </DIV>

                  <DIV id=reviewed-by-name>

                        <H6>Name</H6>

                        <input name=rb-name wicket:id="reviwer">

                  </DIV>

                  <DIV id=reviewed-by-comments>

                        <H6>Comments</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, IModel<ReviewByVO> model,

                  List<TitleList> titleList) {

            super(id, model);

            add(new PanelForm("panelForm", model, titleList));

      }



      private class PanelForm extends Form {



            @SuppressWarnings("unchecked")

            public PanelForm(String id, IModel<ReviewByVO> model,

                        List<TitleList> titleList) {

                  super(id);

                  final ReviewByVO reviewByVO = model.getObject();

                  this.setModel(new
CompoundPropertyModel<ReviewByVO>(reviewByVO));



                  AjaxLink<ReviewByVO> popupLink = new
AjaxLink<ReviewByVO>("invoker") {



                        @Override

                        public void onClick(AjaxRequestTarget
ajaxrequesttarget) {

                        }

                  };



                  popupPanelWMC = new WebMarkupContainer("popupPanel");

                  popupPanelWMC.setOutputMarkupId(true);



                  popupLink.add(new AttributeModifier("data-showid",

                              new Model<String>("#" +
popupPanelWMC.getMarkupId())));

                  popupLink.add(new AttributeModifier("title", new
Model<String>(

                              "Reviewed By")));



                  final TextField<String> nameTextField = new
TextField<String>(

                              "reviwer");

                  final TextArea<String> commentsTextArea = new
TextArea<String>(

                              "reviewComments");

                  final DropDownChoice<TitleList> titleDropDown = new
DropDownChoice<TitleList>(

                              "fnaTitle", new
PropertyModel<TitleList>(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 print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.com

Reply via email to