步驟一.先建置一個PopupLinkExamples.html
<html>
<body>
<a wicket:id ="popupLink">彈出窗口</a>
</body>
</html>
步驟二.建置PopupLinkExamples.java
package wicket.examples.html.body.base.popuplink;
import wicket.examples.html.body.base.hello.HelloWicket;
import wicket.markup.html.WebPage;
import wicket.markup.html.link.BookmarkablePageLink;
import wicket.markup.html.link.PopupSettings;
public class PopupLinkExamples extends WebPage {
public PopupLinkExamples(){
super();
BookmarkablePageLink cPopupLink = new BookmarkablePageLink("popupLink",HelloWicket.class);
PopupSettings cPopupSettings = new PopupSettings();
cPopupSettings.setHeight(350);
cPopupSettings.setWidth(350);
cPopupLink.setPopupSettings(cPopupSettings);
this.add(cPopupLink);
}
}
步驟三.修改Examples.html & Examples.java
...
<tr>
<td><a wicket:id="Examples10">show PopupLinkExamplesPage</a></td>
</tr>
...
...
add(new PageLink("Examples10",PopupLinkExamples.class));
...
沒有留言:
張貼留言