Refine search
public HtmlCommandLink() { super(); setRendererType("javax.faces.Link"); }
/** * 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); }
/** * <p>Set the value of the <code>onfocus</code> property.</p> * @param onfocus the new property value */ public void setOnfocus(java.lang.String onfocus) { getStateHelper().put(PropertyKeys.onfocus, onfocus); handleAttribute("onfocus", onfocus); }
if (component instanceof HtmlCommandLink) commandOnclick = ((HtmlCommandLink)component).getOnclick(); commandOnclick = (String)component.getAttributes().get(HTML.ONCLICK_ATTR); onClick.append(formInfo.getForm().getClientId(facesContext)); onClick.append("',1,{source:'"); onClick.append(component.getClientId(facesContext)); onClick.append("'});return false;");
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; }
/** * 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(); } else { return (String) link.getAttributes().get(HTML.STYLE_ATTR); } }
if (component instanceof HtmlCommandLink) commandOnclick = ((HtmlCommandLink)component).getOnclick(); commandOnclick = (String)component.getAttributes().get(HTML.ONCLICK_ATTR);
UIComponent component; if ("commandLink".equals(renderType)) { final HtmlCommandLink link = new HtmlCommandLink(); link.setStyleClass(tableLink); link.setActionExpression(this.actionGenerated.getActionExpression()); link.addActionListener(new SetPropertyActionListener(this.actionGenerated.getTargetExpression(), this .getVariableReference(context))); component = link; component = link; component.getChildren().addAll(components); component.getChildren().add(strategy.getOutput()); column.getChildren().add(component);
parent.getChildren().add(wrapper); String wrapperId = PropertyIdGeneratorUtility.getIdentifier(listMemberProperty, index, PANEL_ID_SUFFIX); wrapper.setId(wrapperId); viewEditLink.setTitle(viewEditButtonTitle); MethodExpression actionExpression = FacesExpressionUtility.createMethodExpression( "#{ConfigHelperUIBean.accessMap}", String.class, new Class[0]); viewEditLink.setActionExpression(actionExpression); FacesComponentUtility.addParameter(viewEditLink, this.config, RequestParameterNameConstants.LIST_NAME_PARAM, listName); deleteLink.setTitle(DELETE_MAP_BUTTON_TITLE);
private void handleAttribute(String name, Object value) { List<String> setAttributes = (List<String>) this.getAttributes().get("javax.faces.component.UIComponentBase.attributesThatAreSet"); if (setAttributes == null) { String cname = this.getClass().getName(); if (cname != null && cname.startsWith(OPTIMIZED_PACKAGE)) { setAttributes = new ArrayList<String>(6); this.getAttributes().put("javax.faces.component.UIComponentBase.attributesThatAreSet", setAttributes); } } if (setAttributes != null) { if (value == null) { ValueExpression ve = getValueExpression(name); if (ve == null) { setAttributes.remove(name); } } else if (!setAttributes.contains(name)) { setAttributes.add(name); } } }
final String onclick = commandLink.getOnclick(); if (onclick != null) { sb.append(onclick); .append(commandLink.getClientId(context)).append("';"); for (final Iterator it = commandLink.getChildren().iterator(); it .hasNext();) { final UIComponent child = (UIComponent) it.next(); final String target = commandLink.getTarget(); if (target != null && target.trim().length() > 0) { sb.append(" f.target = '").append(target).append("';"); Object value = commandLink.getValue(); if (value != null) { writer.writeText(value.toString(), JsfConstants.VALUE_ATTR);
/** * Gets Script to be invoked when the pointing device is moves out of this element. * * @return the new onmouseout value */ public String getOnmouseout() { if (_onmouseout != null) { return _onmouseout; } ValueExpression expression = getValueExpression("onmouseout"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
comp.setValueExpression("onmouseup", _onmouseup); comp.setValueExpression("shape", _shape); comp.setValueExpression("immediate", _immediate); comp.setValueExpression("onblur", _onblur); comp.setValueExpression("coords", _coords); comp.addActionListener(new MethodExpressionActionListener(_actionListener)); comp.setValueExpression("onmouseover", _onmouseover); comp.setValueExpression("accesskey", _accesskey); comp.setValueExpression("rev", _rev); comp.setValueExpression("rel", _rel); comp.setValueExpression("onkeydown", _onkeydown); comp.setValueExpression("onkeyup", _onkeyup); comp.setValueExpression("target", _target); comp.setValueExpression("onclick", _onclick); comp.setValueExpression("hreflang", _hreflang);
comp.setValueBinding("style", vb); comp.getAttributes().put("style", _style); comp.setValueBinding("styleClass", vb); comp.getAttributes().put("styleClass", _styleClass); comp.setValueBinding("tabindex", vb); comp.getAttributes().put("tabindex", _tabindex); comp.setValueBinding("onblur", vb); comp.getAttributes().put("onblur", _onblur); comp.setValueBinding("onfocus", vb); comp.getAttributes().put("onfocus", _onfocus); comp.setValueBinding("accesskey", vb); comp.getAttributes().put("accesskey", _accesskey); comp.setValueBinding("onclick", vb); comp.getAttributes().put("onclick", _onclick); comp.setValueBinding("ondblclick", vb);
@Override public String getStyleClass() { final String styleClass = super.getStyleClass(); if (styleClass == null) { return "butter-component-link"; } return styleClass + " butter-component-link"; }
public void processEvent(SystemEvent event) { HtmlCommandLink link = (HtmlCommandLink) event.getSource(); String onClick = link.getOnclick(); Map behaviors = link.getClientBehaviors(); //This is the same check that MyFaces makes to see if the link should render //out with the Ajax handler. if (onClick == null && (behaviors.isEmpty() || (!behaviors.containsKey("click") && !behaviors.containsKey("action")))) { //Here we add an 'action' AjaxBehavior to help MyFaces process the link //as an 'ajax-ified' one. The normal ICEfaces mode is to execute/render //@all so we'll do the same by default here. If an f:ajax tag is present, //our various checks should prevent this from being applied at all. AjaxBehavior actionAjax = new AjaxBehavior(); actionAjax.setExecute(AJAX_ALL); actionAjax.setRender(AJAX_ALL); link.addClientBehavior("action", actionAjax); // AjaxBehavior clickAjax = new AjaxBehavior(); // clickAjax.setExecute(AJAX_ALL); // clickAjax.setRender(AJAX_ALL); // link.addClientBehavior("click", clickAjax); } } }
private void addNewOpenMapMemberPropertyRow(UIComponent parent, PropertyDefinitionMap propertyDefinitionMap) { if (!isReadOnly(propertyDefinitionMap)) { FacesComponentUtility.addVerbatimText(parent, "\n\n<tr><td colspan='3' class='" + PROPERTY_MAP_SUMMARY_BUTTON_FOOTER_STYLE_CLASS + "'>"); // add-new button HtmlCommandLink addNewLink = FacesComponentUtility.addCommandLink(parent, this.config); addNewLink.setTitle(ADD_NEW_MAP_BUTTON_TITLE); //addNewLink.setImmediate(true); // skip validation (we only want to validate upon Save) MethodExpression actionExpression = FacesExpressionUtility.createMethodExpression( "#{ConfigHelperUIBean.addNewOpenMapMemberProperty}", String.class, new Class[0]); addNewLink.setActionExpression(actionExpression); FacesComponentUtility.addParameter(addNewLink, this.config, RequestParameterNameConstants.MAP_NAME_PARAM, propertyDefinitionMap.getName()); FacesComponentUtility.addButton(addNewLink, ADD_NEW_MAP_BUTTON_LABEL, CssStyleClasses.BUTTON_SMALL); FacesComponentUtility.addVerbatimText(parent, "</td></tr>"); } }
if (component instanceof HtmlCommandLink) commandOnclick = ((HtmlCommandLink)component).getOnclick(); commandOnclick = (String)component.getAttributes().get(HTML.ONCLICK_ATTR); onClick.append(formInfo.getForm().getClientId(facesContext)); onClick.append("',1,{source:'"); onClick.append(component.getClientId(facesContext)); onClick.append("'});return false;");
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; }
/** * 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); }