Hi,

In my application I have a "edit <something>" link that opens a popup-window where the user can actually edit "<something>". Giving the window a generic title (like just "Edit" ) would be confusing when multiple pop-ups are open so I tried to make the popup-window title read "Edit <something>" instead.

My problem: The generated JavaScript looks ok but whenever I click on the edit link the popup window that opens just shows the "Page expired" page.


Thanks in advance,

Tobias


P.S. Here's what I (conceptually) try to do ( Wicket 1.3.5 ). The actual code is slightly different and more complex but DOES work when I omit the PopupSettings#setWindowName() call.

public class EditComponent extends Panel {

      private final class EditForm extends Form {

         private ThingToEdit thingToEdit;
         private Link editLink;

         protected EditForm(ThingToEdit someThing) {

                super("form");

                setThingToEdit( someThing );

               // link that opens a new pop-up window
               // where more complex properties
               // of <someThing> be edited
                editLink = new Link("editLink") {

                        public void onClick() {
setResponsePage( new EditSomethingPage( thingToEdit ) ); } };

             editLink.setPopupSettings( createPopupSettings( someThing ) );
             add( "link" , editLink);
             /* more TextFields etc. for performing simple updates */
         }

private static PopupSettings createPopupSettings(ThingToEdit thing) {
            return new PopupSettings().setWindowName("Edit "+thing);
         }

         protected void setThingToEdit(ThingToEdit aThing) {
           this.thingToEdit = aThing;
           if ( editLink != null ) {
editLink.setPopupSettings( createPopupSettings( aThing ) ); }
         }

      }
public EditComponent(String id,List<ThingToEdit> thingsToEdit) {
            super( id );
final EditForm editForm = new EditForm .... ); /* render list of thingsToEdit where clicking on an item will call editForm.setThingToEdit( <clicked item> ) */
      }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to