本文整理汇总了Java中org.apache.wicket.markup.html.panel.Fragment.setOutputMarkupId方法的典型用法代码示例。如果您正苦于以下问题:Java Fragment.setOutputMarkupId方法的具体用法?Java Fragment.setOutputMarkupId怎么用?Java Fragment.setOutputMarkupId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.panel.Fragment
的用法示例。
在下文中一共展示了Fragment.setOutputMarkupId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: UserModalPage
import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
public UserModalPage(
final PageReference callerPageRef,
final ModalWindow window,
final UserTO userTO,
final Mode mode,
final boolean resetPassword) {
super();
this.callerPageRef = callerPageRef;
this.window = window;
this.userTO = userTO;
this.mode = mode;
this.resetPassword = resetPassword;
fragment = new Fragment("userModalFrag", "userModalEditFrag", this);
fragment.setOutputMarkupId(true);
add(fragment);
}
示例2: switchContentFragments
import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
/**
* Helper to switch content fragments for us
*
* @param replacement replacement Fragment
* @param target AjaxRequestTarget
*/
private void switchContentFragments(Fragment replacement, AjaxRequestTarget target) {
replacement.setOutputMarkupId(true);
currentFragment.replaceWith(replacement);
if(target != null) {
target.add(replacement);
//resize iframe
target.appendJavaScript("setMainFrameHeight(window.name);");
}
//must keep reference up to date
currentFragment=replacement;
}
示例3: newOutlineSearchSymbolTree
import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
private NestedTree<Symbol> newOutlineSearchSymbolTree(ModalPanel modal, List<Symbol> symbols,
@Nullable String searchInput) {
IModel<HashSet<Symbol>> state;
if (StringUtils.isNotBlank(searchInput)) {
state = new Model<HashSet<Symbol>>(new HashSet<>(symbols));
} else {
state = new Model<HashSet<Symbol>>(new HashSet<>(getChildSymbols(symbols, null)));
}
NestedTree<Symbol> tree = new NestedTree<Symbol>("result", newSymbolTreeProvider(symbols), state) {
private boolean matchFound;
@Override
protected void onInitialize() {
super.onInitialize();
add(new HumanTheme());
}
@Override
protected Component newContentComponent(String id, IModel<Symbol> nodeModel) {
Symbol symbol = nodeModel.getObject();
Fragment fragment = new Fragment(id, "outlineSearchNodeFrag", SourceViewPanel.this);
fragment.setOutputMarkupId(true);
AjaxLink<Void> link = new ViewStateAwareAjaxLink<Void>("link") {
@Override
public void onClick(AjaxRequestTarget target) {
modal.close();
context.onSelect(target, context.getBlobIdent(), symbol.getPosition());
}
};
link.add(symbol.renderIcon("icon"));
link.add(symbol.render("label", null));
link.add(AttributeAppender.append("data-symbolindex", symbols.indexOf(symbol)));
fragment.add(link);
if (!matchFound && matches(symbol, searchInput)) {
link.add(AttributeAppender.append("class", "active"));
matchFound = true;
}
return fragment;
}
};
tree.setOutputMarkupId(true);
return tree;
}
示例4: linkedFragment
import org.apache.wicket.markup.html.panel.Fragment; //导入方法依赖的package包/类
/**
* Fragment which returns the components for the linked view
* @return
*/
private Fragment linkedFragment() {
Fragment frag = new Fragment("fragmentContainer", "linked", this);
//label
frag.add(new Label("twitterAuthLabel", new ResourceModel("twitter.auth.linked")));
//screen name
String twitterName = externalIntegrationLogic.getTwitterName(externalIntegrationInfo);
Label twitterAuthName = new Label("twitterAuthName", new Model<String>(twitterName));
if(StringUtils.isBlank(twitterName)){
twitterAuthName.setDefaultModel(new ResourceModel("error.twitter.details.invalid"));
}
frag.add(twitterAuthName);
//remove link
IndicatingAjaxLink<String> twitterAuthRemoveLink = new IndicatingAjaxLink<String>("twitterAuthRemoveLink") {
private static final long serialVersionUID = 1L;
public void onClick(AjaxRequestTarget target) {
externalIntegrationInfo.setTwitterToken(null);
externalIntegrationInfo.setTwitterSecret(null);
//remove details
if(externalIntegrationLogic.updateExternalIntegrationInfo(externalIntegrationInfo)) {
switchContentFragments(unlinkedFragment(), target);
} else {
target.appendJavaScript("alert('Couldn't remove info');");
return;
}
}
};
ContextImage twitterAuthRemoveIcon = new ContextImage("twitterAuthRemoveIcon",new Model<String>(ProfileConstants.CROSS_IMG));
twitterAuthRemoveLink.add(twitterAuthRemoveIcon);
twitterAuthRemoveLink.add(new AttributeModifier("title", true,new ResourceModel("link.title.unlinktwitter")));
frag.add(twitterAuthRemoveLink);
frag.setOutputMarkupId(true);
return frag;
}