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

Reply via email to