the problem is that if the panel is hidden initially it doesnt have its div/span tag with an id attribute in the markup, so the ajax request cannot find the tag to redraw.

in situations like this you have to wrap the panel in a webmarkupcontainer, call setoutputmarkupid(true) on it, and target that container in your ajax target.

that way the container will be drawn initially empty : <span id="container"></span> and when you make your panel visible it will contain the panel <span id="container"><span id="panel">....</span></span>

-Igor


On 7/20/06, Paolo Di Tommaso <[EMAIL PROTECTED]> wrote:
I want to change visibility attribute of a panel (containing other components) using Ajax.

The panel initially is hidden  panel.setVisible( false ).

When user change selection in a radio group the panel should become visible.

I've tried to do something like that :

radio.add( new AjaxFormComponentUpdatingBehavior("onclick") {
  
    protected void onUpdate(AjaxRequestTarget target) {
        panel.setVisible( true );
        target.addComponent(panel);
    }
  
} );

But it don't work. Using the AJAX Debugger I could see that event is raised but it reports the following error:

ERROR: Component with id [[form1_panel]] a was not found while trying to perform markup update. Make sure you called component.setOutputMarkupId(true) on the component whose markup you are trying to update.
ERROR: error while processing response: [object Error].Object required

Obviuosly I used setOutputMarkupId(true) on panel.

Any idea why it don't work?


Thanks for helping.

- Paolo

-------------------------------------------------------------------------
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

Reply via email to