hi, johan... what i mean is.. based on the example below: -
a) Parent Page =========== public ParentPage() extends WebPage{ Link reportLink = new Link("link", new Model()){ @Override public void onClick() { setResponsePage(ReportPage.class); } }; Label label = new Label("linkLabel", text); reportLink .add(label); add(reportLink ); ModalWindow cancelModal = new ModalWindow("cancelModal"); CancelPanel cancelPanel = new CancelPanel("content",cancelModal); add(cancelModal); cancelModal.setContent(cancelPanel); cancelModal.setPageMapName("cancelModal"); // to auto pop up the modal window. ajaxLink = new AjaxLink("cancelModalLink"){ @Override public void onClick(AjaxRequestTarget target) { cancelModal.show(target); } }; add(ajaxLink); // Fire the ajaxLink onclick function getBodyContainer().addOnLoadModifier(new ClickOnceOnLoadModel( ajaxLink ), null ); add(feedback); } b) Child page ( My report Page ) ======================== public ReportPage() extends ParentPage{ add(feedback); add(new ChildPageForm("ChildPageForm")); } private class ChildPageForm extends Form { // execute query // generate the result as Chart ( JFreeChart tool ) // NOTES: taken a long time to load because it generates things } Explanation: ========= Once i click on the reportLink , it will setResponsePage to the ReportPage.class. So, once it load, for what i expected result is pop up the modal window and then the reportPage is loading at the backgroup. BUT then it was NOT. The actual result that i get is once the report page is finish loaded then only turn to pop up the modal window. yes...you r right, my reportPage will taken a long time to load, because it generates the chart. That why i need to pop up a modal window at the same time in order to let the user cancel the reportPage if the user don't wait for the page finish load. thanks for your reply... -kenix Johan Compagner wrote: > > What is that ReportPage is that the page that also loads the modal dialog? > And that page is taken a long time to load? Because it generates things? > > But for the modal dialog to work, the report page (if that is the modal > dialogs parent) > must first be fully loaded there is no other way. > > I stil dont get exactly what you suspect to happen, you think that the > parent page > that generates the report or something and that one doesn't load > completely > because it has to wait for the report > can display the modal dialog already but itself isn't done yet? > > johan > > > > On Feb 4, 2008 2:18 PM, kenixwong <[EMAIL PROTECTED]> wrote: > >> >> thx for reply, johan >> >> yes..you r right, when i click a link, I want redirect to a load a page >> and >> then at the same time, a modal dialog is show immediately... >> >> my current testing here is... the modal window component is call at the >> parent class and then the report form is call at child class. Common >> sense, >> all the component at the parent class will call first before the child >> class' component , right... >> >> yes... right now my page can load the modal window, but it is shown after >> the report page is finish load. The main reason i use the modalwindow is >> feasible the user to make decision whether want terminate the report page >> loading or not ( if the user don't want to wait until the page is finish >> load) >> >> as what you suggested on Jan 31, 2008.. yes.. i did. Add ajaxlink to call >> the modal window and then onload it. The code that i auto fire the >> ajaxlink >> is >> >> getBodyContainer().addOnLoadModifier(new ClickOnceOnLoadModel( ajaxLink >> ), >> null ); >> >> which i get the sample resource from this forum >> >> http://www.nabble.com/modal-window-question---opening-a-modal-window-on-page-load-to12586008.html#a12598786 >> >> yes..it worked. but it is loaded after the page is finish load. :( >> >> >> thanks in advance >> - kenix >> >> >> >> >> Johan Compagner wrote: >> > >> > what do you exactly want? >> > you want a modal dialog to show immedianlty when another page is >> loaded? >> > I think you have to dig into the javascript portion of modal window >> then >> > (or >> > matej can tell you a bit more) >> > >> > first of all the page below it has to load first completely because >> that >> > does contain the div. >> > >> > I do think you should think about your gui a bit more and if there >> isn't >> a >> > better way of doing stuff >> > because showing a modal dialog immediantly on a new page doesn't make >> much >> > sense to me in 99.9% of the cases i can think of >> > >> > johan >> > >> > On Feb 4, 2008 12:24 PM, kenixwong <[EMAIL PROTECTED]> wrote: >> > >> >> >> >> hi, >> >> >> >> can anybody share the solution with me ? >> >> >> >> is that the javaScript is take time to load for the modal window even >> >> this >> >> component is called before the form component is call? >> >> >> >> >> >> anyone can help ? until now i still can't get any solution and >> resource >> >> yet... >> >> >> >> >> >> thanks in advance,... >> >> - kenix >> >> >> >> >> >> >> >> kenixwong wrote: >> >> > >> >> > 2 process cant together in a same time - modal window and form in >> the >> >> same >> >> > page constructor? Is because the process haven't done, so the >> request >> >> > wont send to wicket there? >> >> > >> >> > The main reason i want to implement this features, caused modal >> window >> >> > can prevent the user navigate to other page or feasible the user to >> >> cancel >> >> > the form process if the loading time is longer. Another point is, >> >> because >> >> > my report page is loading with JFreeChart to generate the chart >> report. >> >> If >> >> > the user press right click to Open Link in new tab, the chart at the >> >> > previous tab will have the broken link issue means the chart is cant >> >> > display. So, modal window can play an important role here... >> >> > >> >> > >> >> > I was using the wicket 1.2.4. Is it the version cant support it and >> i >> >> need >> >> > to upgrade ? i read from >> >> > http://cwiki.apache.org/WICKET/wicket-130-rc1.html .. Migration from >> >> 1.2 >> >> > to 1.3, there is not much different for the modal window in both >> >> version.. >> >> > can anyone give some solution to me? >> >> > >> >> > >> >> > Thanks in advance >> >> > - kenix >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > kenixwong wrote: >> >> >> >> >> >> thanks for reply, johan >> >> >> >> >> >> i want to show the modal window once the report page is load. Mean >> >> >> background is continue loading the report and the modal window is >> just >> >> as >> >> >> a control (its features is invisible the background and only close >> >> once >> >> >> action performed is click in the modal window ) to prevent user >> >> navigate >> >> >> to other page. For the modal window it only define one cancel >> button, >> >> >> mean if user click the cancel button, the background ( report page >> ) >> >> is >> >> >> stop. >> >> >> >> >> >> Yes... the modal window is only shown by an ajax link. I get the >> >> source >> >> >> from this forum ..where it can fire the ajaxlink whitout click the >> >> link. >> >> >> Here is the code >> >> >> >> >> >> < getBodyContainer().addOnLoadModifier(new >> ClickOnceOnLoadModel( >> >> >> ajaxLink ), null ); > >> >> >> >> >> >> Even i tried to create a modal window with ajaxlink ( add auto fire >> >> event >> >> >> as above code ) and put at the parent class and the report page is >> the >> >> >> child class. But the result is same, the report page is finish >> loaded >> >> >> then only pop up the modal window. >> >> >> >> >> >> my report page constructor : >> >> >> >> >> >> public LineChart() { >> >> >> /// modal window use panel..declare the modal window setting >> here >> >> >> then add >> >> >> add(modalWindow); >> >> >> >> >> >> // to auto pop up the modal window. >> >> >> ajaxLink = new AjaxLink("cancelReportModalLink"){ >> >> >> @Override >> >> >> public void onClick(AjaxRequestTarget target) { >> >> >> cancelReportModal.show(target); >> >> >> } >> >> >> }; >> >> >> add(ajaxLink); >> >> >> >> >> >> // Fire the ajaxLink onclick function >> >> >> getBodyContainer().addOnLoadModifier(new ClickOnceOnLoadModel( >> >> >> ajaxLink ), null ); >> >> >> >> >> >> add(feedback); >> >> >> add(new LineChartForm("LineChartForm")); >> >> >> } >> >> >> >> >> >> >> >> >> private class LineChartForm extends Form { >> >> >> // execute query >> >> >> // result as in JFreeChart >> >> >> } >> >> >> >> >> >> >> >> >> i add the component for modal window then only come to form. >> >> supposedly >> >> >> it will show the modal window then load the form, am i right . Why >> ? >> 2 >> >> >> process in a same time cant together? Is because the process >> haven't >> >> >> done, so the request wont send to wicket there, >> >> >> >> >> >> 2 way i tried. Call the modal window at Parent class and also child >> >> >> class. But it still given me the same result. >> >> >> >> >> >> between, can you explain more or give example for the onload event >> >> that >> >> >> you mentioned ? onLoad event for the modal window ? I was using the >> >> >> wicket 1.2.4. Is it the version cant support it and i need to >> upgrade >> >> ? >> >> >> >> >> >> >> >> >> >> >> >> Thanks in advance >> >> >> >> >> >> - kenix >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Johan Compagner wrote: >> >> >>> >> >> >>> how do you show the modal dialog?? >> >> >>> Normally the modal dialog is only shown by an ajax link. >> >> >>> I guess you show it on onload event. Then yes the page will first >> >> load >> >> >>> itself >> >> >>> then call onload and then the modal window will show itself >> >> >>> >> >> >>> johan >> >> >>> >> >> >>> >> >> >>> >> >> >>> On Jan 31, 2008 6:16 AM, kenixwong <[EMAIL PROTECTED]> wrote: >> >> >>> >> >> >>>> >> >> >>>> hi, >> >> >>>> >> >> >>>> for the above case, for example... my page constructor: i add the >> >> >>>> component >> >> >>>> ( modal window, feedBackPanel, form ) . Once i load the page, why >> >> the >> >> >>>> modal >> >> >>>> window will only display when the page is finish loaded. Is that >> the >> >> >>>> wicket >> >> >>>> had default set the main thread for the form component? >> >> >>>> >> >> >>>> Thanks in advance >> >> >>>> -- >> >> >>>> View this message in context: >> >> >>>> >> >> >> http://www.nabble.com/is-there-wicket-had-per-defined-the-Thread-for-the-form-component-tp15198385p15198385.html >> >> >>>> Sent from the Wicket - User mailing list archive at >> >> >>>> Nabble.com <http://nabble.com/> <http://nabble.com/>< >> http://nabble.com/> >> >> >>>> . >> >> >>>> >> >> >>>> >> >> >>>> >> >> --------------------------------------------------------------------- >> >> >>>> To unsubscribe, e-mail: [EMAIL PROTECTED] >> >> >>>> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >>>> >> >> >>>> >> >> >>> >> >> >>> >> >> >> >> >> >> >> >> > >> >> > >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/is-there-wicket-had-per-defined-the-Thread-for-the-form-component-tp15198385p15266151.html >> >> Sent from the Wicket - User mailing list archive at >> >> Nabble.com <http://nabble.com/><http://nabble.com/> >> >> . >> >> >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/is-there-wicket-had-per-defined-the-Thread-for-the-form-component-tp15198385p15267910.html >> Sent from the Wicket - User mailing list archive at >> Nabble.com<http://nabble.com/> >> . >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > -- View this message in context: http://www.nabble.com/is-there-wicket-had-per-defined-the-Thread-for-the-form-component-tp15198385p15268878.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]