In a wicket web page I'm using a ListView to display objects and in a each
line
of this component there is a link to open a  PrettyPopin Modal Window to
edit an object.

The problem is that on submit event the Modal Window doesn't returns to
parent or original page and its reloaded.

First is showed the parent page code

    class ObjListPanel(pageOrigin: WebPage)
      extends Panel("objListPanel") with Serializable {

      add(new ListView[Obj]("listObj", listData) {

        def populateItem(item: ListItem[Obj]) = {
          item.add(new LinkEdit("edit", obj))
        }
      })

      var editObjWinModal = new ModalWindow("modalEditObj")

      editObjWinModal.setPageMapName("modalEditObj")
      editObjWinModal.setResizable(true)
      editObjWinModal.setWindowClosedCallback(new
ModalWindow.WindowClosedCallback() {
        def onClose(target: AjaxRequestTarget) = setResponsePage(pageOrigin)
      })
      add(editObjWinModal)

      private class LinkEdit(id: String, obj: Obj) extends Link[String](id)
{

        add(new Label("label", new Model[String]() {
          override def getObject: String = "Edit"
        }))

        var prettyOpt = new PrettyPopinOptions()
        var pretty = new
PrettyPopinBehavior(prettyOpt.width(550).height(200).followScroll(false))
        add(pretty)

        def onClick() {
          new EditObjPanel(editObjWinModal.getContentId(), this.obj,
pageOrigin);

          setResponsePage(new EditObjPage(this.obj, pageOrigin))
        }

      }

    }

And bellow is the code of a child page, in truth a Panel


    class EditObjPanel(id: String, obj: Obj, pageOrigin: WebPage) extends
Panel(id) {

      var form = new Form[Obj]("form") {
        override protected def onSubmit = {

          objController.salvarObj(obj)

          // This method doesn't work
          // after submit the modal didn't close, instead is reloaded again
          setResponsePage(new EditPontoPage(obj, pageOrigin))
        }
      }

      add(form);
      form.setOutputMarkupId(true)

      container = new WebMarkupContainer("container")

      form.add(container);

    }

I'm working on this code for a couple of hours and I didn't get what is
wrong.

Could someone help me with it?

Bruno Moura

Reply via email to