I instantiate the DisclosurePanel as follows.
<g:DisclosurePanel ui:field="dp" width="180px">
<g:customHeader width="100%">
<g:HorizontalPanel width="100%" horizontalAlignment="align_right"
verticalAlignment="align_middle"
styleName='{style.session_header}'>
<g:HTML ui:field='sessionName'></g:HTML>
<g:Image url='images/user-profile.png' ></g:Image>
</g:HorizontalPanel>
</g:customHeader>
<g:FlowPanel styleName='{style.body}'>
<g:HTMLPanel>
<g:Anchor ui:field="link1" styleName='{style.link_item}'>Link 1</g:Anchor>
<g:Anchor href="#userprofile" ui:field="link2" styleName='{style.link_item}'>User Profile</g:Anchor>
<g:Anchor ui:field="logout_link" styleName='{style.link_item}'>Logout</g:Anchor>
</g:HTMLPanel>
</g:FlowPanel>
</g:DisclosurePanel>
public class ActiveSessionPanel extends Composite
{
private static ActiveSessionUiBinder uiBinder = GWT.create(ActiveSessionUiBinder.class);
interface ActiveSessionUiBinder extends UiBinder<Widget, ActiveSessionPanel>
{
}
@UiField
HTML sessionName;
@UiField
Label logout_link;
@UiField
Anchor link1;
@UiField
Anchor link2;
public ActiveSessionPanel()
{
initWidget(uiBinder.createAndBindUi(this));
sessionName.setHTML("Active session");
logout_link.addClickHandler(new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
Window.alert("logout link clicked");
}
});
}
}
However I see the panel and it opens ok, but the links do not produce any response, although they present themselves with underlines, thus I think they are being recognized as links.
Can't figure what I'm doing wrong.