本文整理汇总了Java中org.apache.wicket.ajax.markup.html.AjaxFallbackLink.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java AjaxFallbackLink.setVisible方法的具体用法?Java AjaxFallbackLink.setVisible怎么用?Java AjaxFallbackLink.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.ajax.markup.html.AjaxFallbackLink
的用法示例。
在下文中一共展示了AjaxFallbackLink.setVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addEditButton
import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入方法依赖的package包/类
private void addEditButton(final String id, final UserProfile userProfile) {
AjaxFallbackLink editButton = new AjaxFallbackLink("editButton",
new ResourceModel("button.edit")) {
private static final long serialVersionUID = 1L;
public void onClick(AjaxRequestTarget target) {
Component newPanel = new MyBusinessEdit(id, userProfile);
newPanel.setOutputMarkupId(true);
MyBusinessDisplay.this.replaceWith(newPanel);
if (target != null) {
target.add(newPanel);
// resize iframe
target.appendJavaScript("setMainFrameHeight(window.name);");
}
}
};
editButton.add(new Label("editButtonLabel", new ResourceModel(
"button.edit")));
editButton.setOutputMarkupId(true);
if (userProfile.isLocked() && !sakaiProxy.isSuperUser()) {
editButton.setVisible(false);
}
add(editButton);
}
示例2: MyStudentDisplay
import org.apache.wicket.ajax.markup.html.AjaxFallbackLink; //导入方法依赖的package包/类
public MyStudentDisplay(final String id, final UserProfile userProfile) {
super(id);
//heading
add(new Label("heading", new ResourceModel("heading.student")));
String course = userProfile.getCourse();
String subjects = userProfile.getSubjects();
int visibleFieldCount = 0;
//course
WebMarkupContainer courseContainer = new WebMarkupContainer("courseContainer");
courseContainer.add(new Label("courseLabel", new ResourceModel("profile.course")));
courseContainer.add(new Label("course", course));
add(courseContainer);
if(StringUtils.isBlank(course)) {
courseContainer.setVisible(false);
} else {
visibleFieldCount++;
}
//subjects
WebMarkupContainer subjectsContainer = new WebMarkupContainer("subjectsContainer");
subjectsContainer.add(new Label("subjectsLabel", new ResourceModel("profile.subjects")));
subjectsContainer.add(new Label("subjects", subjects));
add(subjectsContainer);
if(StringUtils.isBlank(subjects)) {
subjectsContainer.setVisible(false);
} else {
visibleFieldCount++;
}
//edit button
AjaxFallbackLink editButton = new AjaxFallbackLink("editButton", new ResourceModel("button.edit")) {
private static final long serialVersionUID = 1L;
public void onClick(AjaxRequestTarget target) {
Component newPanel = new MyStudentEdit(id, userProfile);
newPanel.setOutputMarkupId(true);
MyStudentDisplay.this.replaceWith(newPanel);
if(target != null) {
target.add(newPanel);
//resize iframe
target.appendJavaScript("setMainFrameHeight(window.name);");
}
}
};
editButton.add(new Label("editButtonLabel", new ResourceModel("button.edit")));
editButton.setOutputMarkupId(true);
if(userProfile.isLocked() && !sakaiProxy.isSuperUser()) {
editButton.setVisible(false);
}
add(editButton);
//no fields message
Label noFieldsMessage = new Label("noFieldsMessage", new ResourceModel("text.no.fields"));
add(noFieldsMessage);
if(visibleFieldCount > 0) {
noFieldsMessage.setVisible(false);
}
}