本文整理汇总了Java中javax.faces.component.html.HtmlCommandLink类的典型用法代码示例。如果您正苦于以下问题:Java HtmlCommandLink类的具体用法?Java HtmlCommandLink怎么用?Java HtmlCommandLink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HtmlCommandLink类属于javax.faces.component.html包,在下文中一共展示了HtmlCommandLink类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: makePageLink
import javax.faces.component.html.HtmlCommandLink; //导入依赖的package包/类
/**
* Makes an HtmlCommandLink component for UI page cursor navigation.
* @param facesContext the active Faces context
* @param page the subject page
* @param pageText the text for the subject page
* @return the new HtmlCommandLink component
*/
private HtmlCommandLink makePageLink(FacesContext facesContext,
int page,
String pageText, boolean isBottom, int linkCount) {
HtmlCommandLink cmd = new HtmlCommandLink();
String sExpr = getActionListenerExpression();
Class a[] = {ActionEvent.class};
MethodBinding mb = facesContext.getApplication().createMethodBinding(sExpr, a);
cmd.setValue(pageText);
cmd.setId((isBottom? "bottomLink_":"topLink_")+linkCount);
cmd.setActionListener(mb);
cmd.getAttributes().put(getCommandAttributeName(), getCommandAttributeValue());
cmd.getAttributes().put(getCursorPageAttributeName(), "" + page);
if (page == getPageCursor().getCurrentPage()) {
if (getCurrentStyleClass().length() > 0) {
cmd.setStyleClass(getCurrentStyleClass());
}
}
return cmd;
}
开发者ID:GeoinformationSystems,项目名称:GeoprocessingAppstore,代码行数:27,代码来源:PageCursorPanel.java
示例2: getStyle
import javax.faces.component.html.HtmlCommandLink; //导入依赖的package包/类
/**
* Can be overwritten by derived classes to overrule the style to be used.
*/
protected String getStyle(FacesContext facesContext, UIComponent link)
{
if (link instanceof HtmlCommandLink)
{
return ((HtmlCommandLink)link).getStyle();
}
return (String)link.getAttributes().get(HTML.STYLE_ATTR);
}
开发者ID:OWASP,项目名称:EJSF,代码行数:14,代码来源:EsapiOutputLinkRenderer.java
示例3: getStyleClass
import javax.faces.component.html.HtmlCommandLink; //导入依赖的package包/类
/**
* Can be overwritten by derived classes to overrule the style class to be used.
*/
protected String getStyleClass(FacesContext facesContext, UIComponent link)
{
if (link instanceof HtmlCommandLink)
{
return ((HtmlCommandLink)link).getStyleClass();
}
return (String)link.getAttributes().get(HTML.STYLE_CLASS_ATTR);
}
开发者ID:OWASP,项目名称:EJSF,代码行数:14,代码来源:EsapiOutputLinkRenderer.java
示例4: getTarget
import javax.faces.component.html.HtmlCommandLink; //导入依赖的package包/类
private String getTarget(UIComponent component) {
// for performance reason: double check for the target attribute
String target;
if (component instanceof HtmlCommandLink) {
target = ((HtmlCommandLink) component).getTarget();
}
else {
target = (String) component.getAttributes().get(HTML.TARGET_ATTR);
}
return target;
}
开发者ID:OWASP,项目名称:EJSF,代码行数:12,代码来源:EsapiOutputLinkRenderer.java
示例5: JsfCommandLinkRenderer
import javax.faces.component.html.HtmlCommandLink; //导入依赖的package包/类
public JsfCommandLinkRenderer(JsfCommandLinkModel model) {
this(HtmlCommandLink.COMPONENT_TYPE, model);
}
开发者ID:Doctusoft,项目名称:jsf-builder,代码行数:4,代码来源:JsfCommandLinkRenderer.java
示例6: renderBehaviorizedJavaScriptAnchorStart
import javax.faces.component.html.HtmlCommandLink; //导入依赖的package包/类
protected void renderBehaviorizedJavaScriptAnchorStart(FacesContext facesContext,
ResponseWriter writer,
UIComponent component,
String clientId,
Map<String, List<ClientBehavior>> behaviors,
FormInfo formInfo)
throws IOException
{
String commandOnclick;
if (component instanceof HtmlCommandLink)
{
commandOnclick = ((HtmlCommandLink)component).getOnclick();
}
else
{
commandOnclick = (String)component.getAttributes().get(HTML.ONCLICK_ATTR);
}
//Calculate the script necessary to submit form
String serverEventCode = buildServerOnclick(facesContext, component, clientId, formInfo);
String onclick = null;
if (commandOnclick == null && (behaviors.isEmpty() ||
(!behaviors.containsKey(ClientBehaviorEvents.CLICK) &&
!behaviors.containsKey(ClientBehaviorEvents.ACTION) ) ) )
{
//we need to render only the submit script
onclick = serverEventCode;
}
else
{
boolean hasSubmittingBehavior = hasSubmittingBehavior(behaviors, ClientBehaviorEvents.CLICK)
|| hasSubmittingBehavior(behaviors, ClientBehaviorEvents.ACTION);
if (!hasSubmittingBehavior)
{
//Ensure required resource javascript is available
ResourceUtils.renderDefaultJsfJsInlineIfNecessary(facesContext, writer);
}
//render a javascript that chain the related code
Collection<ClientBehaviorContext.Parameter> paramList = HtmlRendererUtils.getClientBehaviorContextParameters(
HtmlRendererUtils.mapAttachedParamsToStringValues(facesContext, component));
onclick = HtmlRendererUtils.buildBehaviorChain(facesContext, component,
ClientBehaviorEvents.CLICK, paramList, ClientBehaviorEvents.ACTION, paramList, behaviors,
commandOnclick , hasSubmittingBehavior ? null : serverEventCode);
}
writer.startElement(HTML.ANCHOR_ELEM, component);
writer.writeURIAttribute(HTML.HREF_ATTR, "#", null);
writer.writeAttribute(HTML.ONCLICK_ATTR, onclick, null);
}
开发者ID:OWASP,项目名称:EJSF,代码行数:54,代码来源:EsapiOutputLinkRenderer.java
注:本文中的javax.faces.component.html.HtmlCommandLink类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论