public void updateLabelComponent(FacesContext context, HtmlOutputLabel label, String forInput)
{
boolean hasMark = (label.getChildCount()>0);
// Find Input Control (only if forInput Attribute has been set!)
InputTag inputTag = null;
if (StringUtils.isNotEmpty(forInput) && !forInput.equals("*"))
{ // Set Label input Id
UIComponent input = FacesUtils.getFacesApplication().findComponent(context, forInput, tag);
if (input!=null && (input instanceof InputTag))
{ // Check Read-Only
inputTag = ((InputTag)input);
}
}
// Is the Mark required?
boolean required = (inputTag!=null ? inputTag.isInputRequired() : isValueRequired());
if (required==hasMark)
return;
// Add or remove the mark
if (required)
addRequiredMark(label);