Re: [Wicket-user] Making disappear a section
yeah, I didn't think of it like that. On 1/17/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: leaving the frame means leaving the html tags, and that means the component might not be fully hidden as expected if, for example, it has a css border -igor On 1/17/07, Marc-Andre Houle <[EMAIL PROTECTED]> wrote: > Just to know if I'm the only one who think it should be a good idea > that, when outputmarkupId is true, the "frame" of the component is still > there so it can be reprinted using ajax and without having the overhead of > managing to add a new component and setting each one of them to the correct > visibility. > > Maybe not all the type of component, but particularly container can be > of that style. (Like setting invisible a fragment at startup and make it > appear when you click something. > > Anyway, my 2 cents about that. > > Marc > > > On 1/16/07, Marc-Andre Houle < [EMAIL PROTECTED]> wrote: > > > > Just to let know a possible reader, do not override isVisible. It is > > what make me search a long time about this to find out that if you say in > > isVisible something that you don't want, it will make your > > fragment/panel/whateverContainer disapear like before. > > > > So, thats it, don't override isVisible if it is not necessary (Or like > > me becaus eyou don't want to modify some existing lazy code...) > > > > Thanks > > > > Marc > > > > On 1/16/07, Erik van Oosten <[EMAIL PROTECTED]> wrote: > > > > > > Martijn's example works only with JavaScript but needs no server > > > roundtrip. > > > Igor's and my version also works without JavaScript but does need to > > > make a call to the server. > > > > > > My version is probably more useful when you need to switch more > > > things > > > in and out. Now I reread your question, this does not seem to be the > > > case. So either of the Martijn and Igor solutions are appropriate. > > > > > > Erik. > > > > > > > > > Marc-Andre Houle wrote: > > > > Every one of you seem's to have a different answer, but I'm not > > > sure > > > > which one is the best... > > > > > > -- > > > Erik van Oosten > > > http://day-to-day-stuff.blogspot.com/ > > > > > > > > > - > > > > > > Take Surveys. Earn Cash. Influence the Future of IT > > > Join SourceForge.net's Techsay panel and you'll get the chance to > > > share your > > > opinions on IT & business topics through brief surveys - and earn > > > cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > > > ___ > > > Wicket-user mailing list > > > Wicket-user@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > > > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Making disappear a section
Just to know if I'm the only one who think it should be a good idea that, when outputmarkupId is true, the "frame" of the component is still there so it can be reprinted using ajax and without having the overhead of managing to add a new component and setting each one of them to the correct visibility. Maybe not all the type of component, but particularly container can be of that style. (Like setting invisible a fragment at startup and make it appear when you click something. Anyway, my 2 cents about that. Marc On 1/16/07, Marc-Andre Houle <[EMAIL PROTECTED]> wrote: Just to let know a possible reader, do not override isVisible. It is what make me search a long time about this to find out that if you say in isVisible something that you don't want, it will make your fragment/panel/whateverContainer disapear like before. So, thats it, don't override isVisible if it is not necessary (Or like me becaus eyou don't want to modify some existing lazy code...) Thanks Marc On 1/16/07, Erik van Oosten <[EMAIL PROTECTED]> wrote: > > Martijn's example works only with JavaScript but needs no server > roundtrip. > Igor's and my version also works without JavaScript but does need to > make a call to the server. > > My version is probably more useful when you need to switch more things > in and out. Now I reread your question, this does not seem to be the > case. So either of the Martijn and Igor solutions are appropriate. > > Erik. > > > Marc-Andre Houle wrote: > > Every one of you seem's to have a different answer, but I'm not sure > > which one is the best... > > -- > Erik van Oosten > http://day-to-day-stuff.blogspot.com/ > > > - > > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Making disappear a section
leaving the frame means leaving the html tags, and that means the component might not be fully hidden as expected if, for example, it has a css border -igor On 1/17/07, Marc-Andre Houle <[EMAIL PROTECTED]> wrote: Just to know if I'm the only one who think it should be a good idea that, when outputmarkupId is true, the "frame" of the component is still there so it can be reprinted using ajax and without having the overhead of managing to add a new component and setting each one of them to the correct visibility. Maybe not all the type of component, but particularly container can be of that style. (Like setting invisible a fragment at startup and make it appear when you click something. Anyway, my 2 cents about that. Marc On 1/16/07, Marc-Andre Houle <[EMAIL PROTECTED]> wrote: > > Just to let know a possible reader, do not override isVisible. It is > what make me search a long time about this to find out that if you say in > isVisible something that you don't want, it will make your > fragment/panel/whateverContainer disapear like before. > > So, thats it, don't override isVisible if it is not necessary (Or like > me becaus eyou don't want to modify some existing lazy code...) > > Thanks > > Marc > > On 1/16/07, Erik van Oosten <[EMAIL PROTECTED]> wrote: > > > > Martijn's example works only with JavaScript but needs no server > > roundtrip. > > Igor's and my version also works without JavaScript but does need to > > make a call to the server. > > > > My version is probably more useful when you need to switch more things > > > > in and out. Now I reread your question, this does not seem to be the > > case. So either of the Martijn and Igor solutions are appropriate. > > > > Erik. > > > > > > Marc-Andre Houle wrote: > > > Every one of you seem's to have a different answer, but I'm not sure > > > > > which one is the best... > > > > -- > > Erik van Oosten > > http://day-to-day-stuff.blogspot.com/ > > > > > > - > > > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to > > share your > > opinions on IT & business topics through brief surveys - and earn cash > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > ___ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Making disappear a section
Just to let know a possible reader, do not override isVisible. It is what make me search a long time about this to find out that if you say in isVisible something that you don't want, it will make your fragment/panel/whateverContainer disapear like before. So, thats it, don't override isVisible if it is not necessary (Or like me becaus eyou don't want to modify some existing lazy code...) Thanks Marc On 1/16/07, Erik van Oosten <[EMAIL PROTECTED]> wrote: Martijn's example works only with JavaScript but needs no server roundtrip. Igor's and my version also works without JavaScript but does need to make a call to the server. My version is probably more useful when you need to switch more things in and out. Now I reread your question, this does not seem to be the case. So either of the Martijn and Igor solutions are appropriate. Erik. Marc-Andre Houle wrote: > Every one of you seem's to have a different answer, but I'm not sure > which one is the best... -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Making disappear a section
Martijn's example works only with JavaScript but needs no server roundtrip. Igor's and my version also works without JavaScript but does need to make a call to the server. My version is probably more useful when you need to switch more things in and out. Now I reread your question, this does not seem to be the case. So either of the Martijn and Igor solutions are appropriate. Erik. Marc-Andre Houle wrote: > Every one of you seem's to have a different answer, but I'm not sure > which one is the best... -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Making disappear a section
Every one of you seem's to have a different answer, but I'm not sure which one is the best... So, the solution I decided to use is a mix. I still use my fragment, override the isVisible method. (So it can be used to know if it is visible or not.) I can't override setVisible(), but created a method named toggleVisibility() which is setting visibility for each child of this fragment...It is not as clean as I would have wanted, but at least, now, the fragment can disappear ant some markup are still there to be updated. Thanks a lot... Marc On 1/16/07, Erik van Oosten <[EMAIL PROTECTED]> wrote: Another option is to: - attach a AjaxFallbackLink to the arrow, - override the onClick method, - in the method replace the component you want to hide with the one you want to show: compToHide.replaceWith(compToShow); - then finish the method with: if (target != null) { target.addComponent(compToShow); } You now have changed the page structure. Upon the re-render the new component is displayed (non-ajax browser). But in the last step you enable an Ajaxified replace as well. I recently wrote an article about this on my blog: http://day-to-day-stuff.blogspot.com/2007/01/backward-compatible-ajax-development.html Have fun, Erik. Martijn Dashorst wrote: > For individual elements, where you don't mind having all markup > already in the source of the page: > > Hiding: > ajaxrequesttarget.appendJavaScript("document.getElementById('" + > component.getMarkupId() + "').style.display = 'none';"); > > Showing: > ajaxrequesttarget.appendJavaScript("document.getElementById('" + > component.getMarkupId() + "').style.display = '';"); > > Otherwise, put everything in the panel, and update the whole panel > whilst setting the visibility flags of the child components: > > class MyPanel extends Panel { > private WebMarkupContainer normalView; > private WebMarkupContainer detailedView; > private AjaxLink showDetails; > private AjaxLink hideDetails; > > MyPanel() { > ... > add(showDetails = new AjaxLink("showDetails") { > onClick(AjaxRequestTarget t) { > normalView.setVisible(false); > hideDetails.setVisible(true); > detailedView.setVisible(true); > setVisible(false); > t.addComponent(MyPanel.this); > }}); > > The rest is left as an exercise to the reader. > > Martijn > -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Making disappear a section
Another option is to: - attach a AjaxFallbackLink to the arrow, - override the onClick method, - in the method replace the component you want to hide with the one you want to show: compToHide.replaceWith(compToShow); - then finish the method with: if (target != null) { target.addComponent(compToShow); } You now have changed the page structure. Upon the re-render the new component is displayed (non-ajax browser). But in the last step you enable an Ajaxified replace as well. I recently wrote an article about this on my blog: http://day-to-day-stuff.blogspot.com/2007/01/backward-compatible-ajax-development.html Have fun, Erik. Martijn Dashorst wrote: > For individual elements, where you don't mind having all markup > already in the source of the page: > > Hiding: > ajaxrequesttarget.appendJavaScript("document.getElementById('" + > component.getMarkupId() + "').style.display = 'none';"); > > Showing: > ajaxrequesttarget.appendJavaScript("document.getElementById('" + > component.getMarkupId() + "').style.display = '';"); > > Otherwise, put everything in the panel, and update the whole panel > whilst setting the visibility flags of the child components: > > class MyPanel extends Panel { > private WebMarkupContainer normalView; > private WebMarkupContainer detailedView; > private AjaxLink showDetails; > private AjaxLink hideDetails; > > MyPanel() { > ... > add(showDetails = new AjaxLink("showDetails") { > onClick(AjaxRequestTarget t) { > normalView.setVisible(false); > hideDetails.setVisible(true); > detailedView.setVisible(true); > setVisible(false); > t.addComponent(MyPanel.this); > }}); > > The rest is left as an exercise to the reader. > > Martijn > -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Making disappear a section
first! On 1/16/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > lets say you have a component that you want to make invisible via ajax > > wrap that component in a webmarkupcontainer, toggle the visibility of the > component - but repaint the webmarkupcontainer > > that way wicket always knows where the markup needs to go even if the > component is invisible > > -igor > > > On 1/16/07, Marc-Andre Houle <[EMAIL PROTECTED]> wrote: > > > > I try to find something to help me but I haven't found what was needed for > now. > > I want to update a Panel via ajax. When you click on an array, it will > display some information. You click back on the arrow and it will mask the > thing. You click again, everything is back. > > > > You know, like when you click, the arrow is oriented in the button and new > "advanced" feature become visible. > > I tried to use the isVisible tag, but the problem is that it really make > it invisible to ajax to update after I set the isVisible to false. It there > something else I should do? Also, right now I'm doing it only on a label, > is it possible to make disapear a complete "block" of something? I tried > with fragment (what seem's to me the better start) but the ajax framework > does not found the fragment when it is set to setVisible(false). > > > > Surely something exist, but I don't see it... > > > > Marc > > > > > - > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > opinions on IT & business topics through brief surveys - and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > ___ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > -- Vote for Wicket at the http://www.thebeststuffintheworld.com/vote_for/wicket Wicket 1.2.4 is as easy as 1-2-4. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Making disappear a section
lets say you have a component that you want to make invisible via ajax wrap that component in a webmarkupcontainer, toggle the visibility of the component - but repaint the webmarkupcontainer that way wicket always knows where the markup needs to go even if the component is invisible -igor On 1/16/07, Marc-Andre Houle <[EMAIL PROTECTED]> wrote: I try to find something to help me but I haven't found what was needed for now. I want to update a Panel via ajax. When you click on an array, it will display some information. You click back on the arrow and it will mask the thing. You click again, everything is back. You know, like when you click, the arrow is oriented in the button and new "advanced" feature become visible. I tried to use the isVisible tag, but the problem is that it really make it invisible to ajax to update after I set the isVisible to false. It there something else I should do? Also, right now I'm doing it only on a label, is it possible to make disapear a complete "block" of something? I tried with fragment (what seem's to me the better start) but the ajax framework does not found the fragment when it is set to setVisible(false). Surely something exist, but I don't see it... Marc - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Making disappear a section
For individual elements, where you don't mind having all markup already in the source of the page: Hiding: ajaxrequesttarget.appendJavaScript("document.getElementById('" + component.getMarkupId() + "').style.display = 'none';"); Showing: ajaxrequesttarget.appendJavaScript("document.getElementById('" + component.getMarkupId() + "').style.display = '';"); Otherwise, put everything in the panel, and update the whole panel whilst setting the visibility flags of the child components: class MyPanel extends Panel { private WebMarkupContainer normalView; private WebMarkupContainer detailedView; private AjaxLink showDetails; private AjaxLink hideDetails; MyPanel() { ... add(showDetails = new AjaxLink("showDetails") { onClick(AjaxRequestTarget t) { normalView.setVisible(false); hideDetails.setVisible(true); detailedView.setVisible(true); setVisible(false); t.addComponent(MyPanel.this); }}); The rest is left as an exercise to the reader. Martijn On 1/16/07, Marc-Andre Houle <[EMAIL PROTECTED]> wrote: > I try to find something to help me but I haven't found what was needed for > now. > I want to update a Panel via ajax. When you click on an array, it will > display some information. You click back on the arrow and it will mask the > thing. You click again, everything is back. > > You know, like when you click, the arrow is oriented in the button and new > "advanced" feature become visible. > I tried to use the isVisible tag, but the problem is that it really make it > invisible to ajax to update after I set the isVisible to false. It there > something else I should do? Also, right now I'm doing it only on a label, > is it possible to make disapear a complete "block" of something? I tried > with fragment (what seem's to me the better start) but the ajax framework > does not found the fragment when it is set to setVisible(false). > > Surely something exist, but I don't see it... > > Marc > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > -- Vote for Wicket at the http://www.thebeststuffintheworld.com/vote_for/wicket Wicket 1.2.4 is as easy as 1-2-4. Download Wicket now! http://wicketframework.org - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user