[
https://issues.apache.org/jira/browse/WICKET-409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Joseph Toth updated WICKET-409:
-------------------------------
Description:
If PopupSettings are set on a BookmarkableLink the target Class of the
BookmarkableLink is constructed twice.
abstract public class LiveHelpStatusPanel extends Panel {
@SpringBean
LiveHelpService liveHelpService;
public LiveHelpStatusPanel(String id) {
super(id);
PopupSettings settings = new PopupSettings();
settings.setHeight(225);
settings.setWidth(350);
BookmarkablePageLink link = new
BookmarkablePageLink("liveHelpLink",
getLiveHelpPage()) {
boolean isSupportOnline = true;
@Override
protected void onAttach() {
List<Buddy> staff =
liveHelpService.getSupportStaff();
for (Buddy buddy : staff) {
if (buddy.isOnline() &&
!buddy.isAway()) {
isSupportOnline = true;
}
}
}
@Override
public boolean isVisible() {
return isSupportOnline;
}
};
link.setPopupSettings(settings);
add(link);
}
public abstract Class getLiveHelpPage();
}
was:
If PopupSettings are set on a BookmarkableLink the target Class of the
BookmarkableLink is constructed twice.
If I change the following code to just use Link instead of BookmarkableLink, it
works fine.
abstract public class LiveHelpStatusPanel extends Panel {
@SpringBean
LiveHelpService liveHelpService;
public LiveHelpStatusPanel(String id) {
super(id);
PopupSettings settings = new PopupSettings();
settings.setHeight(225);
settings.setWidth(350);
BookmarkablePageLink link = new
BookmarkablePageLink("liveHelpLink",
getLiveHelpPage()) {
boolean isSupportOnline = true;
@Override
protected void onAttach() {
List<Buddy> staff =
liveHelpService.getSupportStaff();
for (Buddy buddy : staff) {
if (buddy.isOnline() &&
!buddy.isAway()) {
isSupportOnline = true;
}
}
}
@Override
public boolean isVisible() {
return isSupportOnline;
}
};
link.setPopupSettings(settings);
add(link);
}
public abstract Class getLiveHelpPage();
}
> Page constructed twice when a BookmarkableLink has PopupSettings
> ----------------------------------------------------------------
>
> Key: WICKET-409
> URL: https://issues.apache.org/jira/browse/WICKET-409
> Project: Wicket
> Issue Type: Bug
> Affects Versions: 1.2.5
> Reporter: Joseph Toth
>
> If PopupSettings are set on a BookmarkableLink the target Class of the
> BookmarkableLink is constructed twice.
> abstract public class LiveHelpStatusPanel extends Panel {
> @SpringBean
> LiveHelpService liveHelpService;
> public LiveHelpStatusPanel(String id) {
> super(id);
> PopupSettings settings = new PopupSettings();
> settings.setHeight(225);
> settings.setWidth(350);
> BookmarkablePageLink link = new
> BookmarkablePageLink("liveHelpLink",
> getLiveHelpPage()) {
> boolean isSupportOnline = true;
> @Override
> protected void onAttach() {
> List<Buddy> staff =
> liveHelpService.getSupportStaff();
> for (Buddy buddy : staff) {
> if (buddy.isOnline() &&
> !buddy.isAway()) {
> isSupportOnline = true;
> }
> }
> }
> @Override
> public boolean isVisible() {
> return isSupportOnline;
> }
> };
> link.setPopupSettings(settings);
> add(link);
> }
> public abstract Class getLiveHelpPage();
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.