Wicket visibility and Panel positioning

2007-09-14 Thread Kirk Israel
I looked over a lot of the usual examples but didn't quite find what I
was looking for... I also tried looking for more information inside of
Pro Wicket. As always, pointers to useful examples and documentation
appreciated.

My overall task is to make a dropdown menu, one that appears under a
graphical More Ajax Link, some kind of Panel containing clickable
links.

First question on visibility: in the Java i had something like
moreMenuPanel = new WebMarkupContainer(moreMenu);
moreMenuPanel.setVisible(false);
moreMenuPanel.setOutputMarkupId(true);
add(moreMenuPanel);
against html
 div wicket:id=moreMenuHey there/div  

And then there was an AjaxFallbackLink with
  public void onClick(AjaxRequestTarget ajaxTarget) {
moreMenuPanel.setVisible(true);
ajaxTarget.addComponent(moreMenuPanel);
}

This didn't do what i expected, the panel didn't appear. The Ajax console shows
ERROR: Component with id [[moreMenu72]] 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.

Is the initial invisibility messing things up? I think I've heard that
Wicket will sometimes not display any markup for things where
isVisible is false? Though in this case in the page source I see
div id=moreMenu72Hey there/div

We have a work around of having an AttributeModifier to set the
visibility, but it seems rather crude... or am i missing the point of
how visibility is used in Wicket?

And once that's solved, there's still the problem of positioning...
ideally this panel is floating, and can be passed a component on the
Java that will determine where it appears. Is this something that
needs to be built from a fairly low level w/ behaviors and custom
javascript, or is there something closer to ready to go?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wicket visibility and Panel positioning

2007-09-14 Thread Matej Knopp
The panel is not rendered when you call setVisible(false). So the
subsequent ajax update has no dom element to replace. You can call
panel.setOutputMarkupPlaceholderTag(true) to work around it.

-Matej

On 9/14/07, Kirk Israel [EMAIL PROTECTED] wrote:
 I looked over a lot of the usual examples but didn't quite find what I
 was looking for... I also tried looking for more information inside of
 Pro Wicket. As always, pointers to useful examples and documentation
 appreciated.

 My overall task is to make a dropdown menu, one that appears under a
 graphical More Ajax Link, some kind of Panel containing clickable
 links.

 First question on visibility: in the Java i had something like
 moreMenuPanel = new WebMarkupContainer(moreMenu);
 moreMenuPanel.setVisible(false);
 moreMenuPanel.setOutputMarkupId(true);
 add(moreMenuPanel);
 against html
  div wicket:id=moreMenuHey there/div

 And then there was an AjaxFallbackLink with
   public void onClick(AjaxRequestTarget ajaxTarget) {
 moreMenuPanel.setVisible(true);
 ajaxTarget.addComponent(moreMenuPanel);
 }

 This didn't do what i expected, the panel didn't appear. The Ajax console 
 shows
 ERROR: Component with id [[moreMenu72]] 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.

 Is the initial invisibility messing things up? I think I've heard that
 Wicket will sometimes not display any markup for things where
 isVisible is false? Though in this case in the page source I see
 div id=moreMenu72Hey there/div

 We have a work around of having an AttributeModifier to set the
 visibility, but it seems rather crude... or am i missing the point of
 how visibility is used in Wicket?

 And once that's solved, there's still the problem of positioning...
 ideally this panel is floating, and can be passed a component on the
 Java that will determine where it appears. Is this something that
 needs to be built from a fairly low level w/ behaviors and custom
 javascript, or is there something closer to ready to go?

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]