public boolean isReplaceIdWithLabel() { if (_replaceIdWithLabelSet) { return _replaceIdWithLabel; } ValueBinding vb = getValueBinding("replaceIdWithLabel"); if (vb != null) { return ((Boolean) vb.getValue(getFacesContext())).booleanValue(); } return true; }
private String getGlobalSummaryFormat(UIComponent message) { if (message instanceof HtmlMessages) { return ((HtmlMessages)message).getGlobalSummaryFormat(); } else { return (String)message.getAttributes().get("globalSummaryFormat"); } }
private String getSummaryFormat(UIComponent message) { if (message instanceof HtmlMessages) { return ((HtmlMessages)message).getSummaryFormat(); } else { return (String)message.getAttributes().get("summaryFormat"); } }
public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException { super.encodeEnd(facesContext, component); //check for NP renderMessages(facesContext, component); if (component instanceof HtmlMessages && ((HtmlMessages) component).getForceSpan()) { ResponseWriter writer = facesContext.getResponseWriter(); HtmlMessages htmlMessages = (HtmlMessages) component; writer.startElement(HTML.SPAN_ELEM, null); writer.writeAttribute(HTML.ID_ATTR,component.getClientId(facesContext),null); if(htmlMessages.getStyleClass()!=null) writer.writeAttribute(HTML.CLASS_ATTR,htmlMessages.getStyleClass(),null); if(htmlMessages.getStyle()!=null) writer.writeAttribute(HTML.STYLE_ATTR,htmlMessages.getStyle(),null); writer.endElement(HTML.SPAN_ELEM); } }
comp.setValueBinding("globalSummaryFormat", vb); comp.getAttributes().put("globalSummaryFormat", _globalSummaryFormat); comp.setValueBinding("onclick", vb); comp.getAttributes().put("onclick", _onclick); comp.setValueBinding("ondblclick", vb); comp.getAttributes().put("ondblclick", _ondblclick); comp.setValueBinding("onkeydown", vb); comp.getAttributes().put("onkeydown", _onkeydown); comp.setValueBinding("onkeypress", vb); comp.getAttributes().put("onkeypress", _onkeypress); comp.setValueBinding("onkeyup", vb); comp.getAttributes().put("onkeyup", _onkeyup); comp.setValueBinding("onmousedown", vb); comp.getAttributes().put("onmousedown", _onmousedown); comp.setValueBinding("onmousemove", vb);
.findFirstMessagesComponent(context, context.getViewRoot()); if (ajaxMessages != null && ((HtmlMessages) ajaxMessages).getForceSpan())
protected String getSummary(FacesContext facesContext, UIComponent message, FacesMessage facesMessage, String msgClientId) { String msgSummary = facesMessage.getSummary(); if (msgSummary == null) return null; String inputLabel = null; if (msgClientId != null) inputLabel = findInputLabel(facesContext, msgClientId); if (inputLabel == null) inputLabel = ""; if(((message instanceof HtmlMessages && ((HtmlMessages) message).isReplaceIdWithLabel()) || (message instanceof HtmlMessage && ((HtmlMessage) message).isReplaceIdWithLabel()))&& inputLabel.length()!=0) msgSummary = msgSummary.replaceAll(findInputId(facesContext, msgClientId),inputLabel); String summaryFormat; if (message instanceof HtmlMessage) { summaryFormat = ((HtmlMessage)message).getSummaryFormat(); } else { summaryFormat = (String)message.getAttributes().get("summaryFormat"); } if (summaryFormat == null) return msgSummary; MessageFormat format = new MessageFormat(summaryFormat, facesContext.getViewRoot().getLocale()); return format.format(new Object[] {msgSummary, inputLabel}); }
public HtmlMessages() { setRendererType("org.apache.myfaces.Messages"); }
protected String getDetail(FacesContext facesContext, UIComponent message, FacesMessage facesMessage, String msgClientId) { String msgDetail = facesMessage.getDetail(); if (msgDetail == null) return null; String inputLabel = null; if (msgClientId != null) inputLabel = HtmlMessageRenderer.findInputLabel(facesContext, msgClientId); if (inputLabel == null) inputLabel = ""; if(((message instanceof HtmlMessages && ((HtmlMessages) message).isReplaceIdWithLabel()) || (message instanceof HtmlMessage && ((HtmlMessage) message).isReplaceIdWithLabel()))&& inputLabel.length()!=0) msgDetail = msgDetail.replaceAll(HtmlMessageRenderer.findInputId(facesContext, msgClientId),inputLabel); String detailFormat; if (message instanceof HtmlMessage) { detailFormat = ((HtmlMessage)message).getDetailFormat(); } else { detailFormat = (String)message.getAttributes().get("detailFormat"); } if (detailFormat == null) return msgDetail; MessageFormat format = new MessageFormat(detailFormat, facesContext.getViewRoot().getLocale()); return format.format(new Object[] {msgDetail, inputLabel}); }
public boolean isForceSpan() { if (_forceSpanSet) { return _forceSpan; } ValueBinding vb = getValueBinding("forceSpan"); if (vb != null) { return ((Boolean) vb.getValue(getFacesContext())).booleanValue(); } return false; }
protected String getDetail(FacesContext facesContext, UIComponent message, FacesMessage facesMessage, String msgClientId) { String msgDetail = facesMessage.getDetail(); if (msgDetail == null) return null; String inputLabel = null; if (msgClientId != null) inputLabel = findInputLabel(facesContext, msgClientId); if (inputLabel == null) inputLabel = ""; if(((message instanceof HtmlMessages && ((HtmlMessages) message).isReplaceIdWithLabel()) || (message instanceof HtmlMessage && ((HtmlMessage) message).isReplaceIdWithLabel()))&& inputLabel.length()!=0) msgDetail = msgDetail.replaceAll(findInputId(facesContext, msgClientId),inputLabel); String detailFormat; if (message instanceof HtmlMessage) { detailFormat = ((HtmlMessage)message).getDetailFormat(); } else { detailFormat = (String)message.getAttributes().get("detailFormat"); } if (detailFormat == null) return msgDetail; MessageFormat format = new MessageFormat(detailFormat, facesContext.getViewRoot().getLocale()); return format.format(new Object[] {msgDetail, inputLabel}); }
public String getDetailFormat() { if (_detailFormat != null) { return _detailFormat; } ValueBinding vb = getValueBinding("detailFormat"); if (vb != null) { Object value = vb.getValue(getFacesContext()); if (value == null) { return null; } else { return (String) value.toString(); } } return null; }
if (inputLabel == null) inputLabel = ""; if(((message instanceof HtmlMessages && ((HtmlMessages) message).isReplaceIdWithLabel()) || (message instanceof HtmlMessage && ((HtmlMessage) message).isReplaceIdWithLabel()))&& inputLabel.length()!=0)
public String getOnmousedown() { if (_onmousedown != null) { return _onmousedown; } ValueBinding vb = getValueBinding("onmousedown"); if (vb != null) { Object value = vb.getValue(getFacesContext()); if (value == null) { return null; } else { return (String) value.toString(); } } return null; }
public String getOnmousemove() { if (_onmousemove != null) { return _onmousemove; } ValueBinding vb = getValueBinding("onmousemove"); if (vb != null) { Object value = vb.getValue(getFacesContext()); if (value == null) { return null; } else { return (String) value.toString(); } } return null; }
public String getOnmouseout() { if (_onmouseout != null) { return _onmouseout; } ValueBinding vb = getValueBinding("onmouseout"); if (vb != null) { Object value = vb.getValue(getFacesContext()); if (value == null) { return null; } else { return (String) value.toString(); } } return null; }
public String getOnmouseover() { if (_onmouseover != null) { return _onmouseover; } ValueBinding vb = getValueBinding("onmouseover"); if (vb != null) { Object value = vb.getValue(getFacesContext()); if (value == null) { return null; } else { return (String) value.toString(); } } return null; }
public String getEnabledOnUserRole() { if (_enabledOnUserRole != null) { return _enabledOnUserRole; } ValueBinding vb = getValueBinding("enabledOnUserRole"); if (vb != null) { Object value = vb.getValue(getFacesContext()); if (value == null) { return null; } else { return (String) value.toString(); } } return null; }
public String getVisibleOnUserRole() { if (_visibleOnUserRole != null) { return _visibleOnUserRole; } ValueBinding vb = getValueBinding("visibleOnUserRole"); if (vb != null) { Object value = vb.getValue(getFacesContext()); if (value == null) { return null; } else { return (String) value.toString(); } } return null; }
public String getGlobalSummaryFormat() { if (_globalSummaryFormat != null) { return _globalSummaryFormat; } ValueBinding vb = getValueBinding("globalSummaryFormat"); if (vb != null) { Object value = vb.getValue(getFacesContext()); if (value == null) { return null; } else { return (String) value.toString(); } } return null; }