Igor, Thanks..what you suggested worked. I was making a mistake in adding the javascript, it wasnt getting included due to a missing wicket:link tag.
Farhan mfs wrote: > > I believe what you are suggesting requires modifying the ModalWindow class > where the modal.js is added. Am i right ? Because without that I am not > sure how can i ensure that my snippet is added/rendered after the modal.js > on my wicket page. I have tried adding the js-snippet on my wicket page > (after the modal-window div tag) but it doesn't work. > > I am just trying to avoid adding a dependency on the new/custom > wicket-extensions.jar (with the modified modal center method) and rely on > the 1.3.6 version only. > > Thanks > Farhan. > > > > igor.vaynberg wrote: >> >> Simply include a js snippet after the modal.js that overrides the method. >> >> -igor >> >> >> On 8/31/09, mfs <farhan.sar...@gmail.com> wrote: >>> >>> Hi Steve, >>> >>> I have come across a scenario where I need to provide custom >>> implementation >>> for the Wicket.Window.prototype.center method. The question I had was, >>> that >>> is there anyway I can override this method without injecting the new >>> modified modal.js (i.e. with the custom center() method impl) in the >>> wicket-extensions.jar. >>> >>> Thanks >>> Farhan. >>> >>> >>> German Morales-3 wrote: >>>> >>>> Hi Steve, >>>> >>>> I answer quickly with some ideas, perhaps it helps. >>>> >>>> It seems that you need a different implementation of the center method >>>> provided by ModalWindow. >>>> >>>> You can see the original in modal.js, in the package >>>> org.apache.wicket.extensions.ajax.markup.html.modal.res of the >>>> wicket-extensions. >>>> You should attempt centering the window to the current browser window, >>>> instead of the viewport. >>>> >>>> You could provide an own javascript with a content like: >>>> >>>> Wicket.Window.prototype.center = function() { >>>> // your own version >>>> }; >>>> >>>> Hope this helps, >>>> >>>> German >>>> >>>> >>>> 2009/1/23 Steve Swinsburg <s.swinsb...@lancaster.ac.uk> >>>> >>>>> Hi all, >>>>> >>>>> I have a fairly long page making use of Modal Windows, and any >>>>> ModalWindow >>>>> that I place onto this page always renders in the exact centre of the >>>>> page >>>>> (vertically). So if the button that opens the window is at the top, >>>>> you >>>>> need >>>>> to scroll down to get to the window. Likewise if the button is at the >>>>> bottom, you'll need to scroll up. This is a pain because sometimes the >>>>> screen just dims out but the window is off screen. >>>>> >>>>> How can I control where the Modal Window is placed on the screen >>>>> vertically? Doesn't seem to be any options. >>>>> >>>>> BTW this is inside an iframe which takes up most of the screen (but >>>>> not >>>>> all). Ideally I'd like the mask to extend over the whole window, not >>>>> just >>>>> the part that the iframe is in (which it currently does, but I can >>>>> live >>>>> with >>>>> that) >>>>> >>>>> >>>>> cheers, >>>>> Steve >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Modal-window-position---always-centred%2C-even-on-long-page-tp21629148p25229119.html >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> > > -- View this message in context: http://www.nabble.com/Modal-window-position---always-centred%2C-even-on-long-page-tp21629148p25251492.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org