You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by GitBox <gi...@apache.org> on 2019/12/29 00:58:01 UTC

[GitHub] [wicket] chrisco484 commented on issue #375: WICKET-6666 modal dialog

chrisco484 commented on issue #375: WICKET-6666 modal dialog
URL: https://github.com/apache/wicket/pull/375#issuecomment-569463952
 
 
   > This is my take on a new modal dialog/window for Wicket.
   > 
   > I've taken Igor's work as a base but changed a lot of things, so I thought a separate pull-request would be easier to digest:
   > 
   > * JavaScript
   > 
   > All JavaScript is optional now, ModalDialog works without Ajax too.
   > We can safely leave the dialog's markup where it is, no need to move it around. If people want to have the markup somewhere else, they can add the dialog somewhere else (see Java below).
   > JS enhancements (like trap-focus) are located in Wicket behaviors, allowing people to substitute their own solution.
   > 
   > * CSS
   > 
   > I've reorganized the CSS into a theme like we have for several other components. It is changed now to respect the size of the dialog's content.
   > This leaves all customizing to the user, no need for Wicket to get involved (see examples below).
   > 
   > * Java
   > 
   > No need to fiddle with forms (see JavaScript above). Full support for nesting. In my experience many projects like to have a single container on each page to host lazily created dialogs, I've added AjaxListPanel for that.
   > I like the #open(Componente, ART) method, to open a single dialog with different contents. But users like to subclass dialogs to use them from different places, thus we need a #setContent(Component) method too.
   > 
   > * Examples
   > 
   > I've extended the ModalDialogPage example to show-off all new features.
   
   Have you had a chance to check out the wicketstuff ModalX project?
   
   There may be some useful ideas in there that could improve the whole Modal experience for Wicket devs.
   
   The way Wicketstuff Modal X facilitates modal dialogs makes it very easy to open any modal dialog from anywhere in the app just by calling the constructor on the class of the modal you want to open and then calling show().
   
   It supports nesting up to N levels. The 'N' can be specified by the dev.
   
   Any page that needs modal simply needs to implement the org.wicketstuff.modalx.ModalMgr interface (typically you do this once in a commonly used base page class so that the whole app becomes Modal capable very easily).
   
   The ModalMgr base class auto adds 'N' placeholder components to any page that it renders and these are then automatically allocated in sequence each time a new modal is nested upon another one. As the modals are closed the placeholders are freed up in reverse sequence until, when the last modal is closed, they are all freed up and the user can then proceed to open another top level modal etc.,

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services