Skip to content

Commit

Permalink
add missing Tooltip generation, remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
zhedar committed Apr 27, 2016
1 parent 6f4fdce commit 15b321b
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ public void encodeBegin(FacesContext context, UIComponent component) throws IOEx
String clientId = outerClientId+"Inner";
int span = startColSpanDiv(rw, menu);
rw.startElement("div", menu);
Tooltip.generateTooltip(context, menu, rw);

if (menu.isInline()) {
rw.writeAttribute("class", "form-inline", "class");
} else {
Expand Down Expand Up @@ -482,15 +484,12 @@ protected void renderOption(ResponseWriter rw, UISelectItem selectItem, Object s
final String itemDescription = selectItem.getItemDescription();
final Object itemValue = selectItem.getItemValue();

boolean isItemLabelBlank = itemLabel == null || itemLabel.trim().length() == 0;
itemLabel = isItemLabelBlank ? " " : itemLabel;

renderOption(rw, selectedOption, index, itemLabel, itemDescription, itemValue, selectItem.isItemDisabled());
}

private void renderOption(ResponseWriter rw, Object selectedOption, int index, String itemLabel,
final String description, final Object itemValue, boolean isDisabled) throws IOException {
boolean isItemLabelBlank = itemLabel == null || itemLabel.trim().length() == 0;
boolean isItemLabelBlank = itemLabel == null || itemLabel.trim().isEmpty();
itemLabel = isItemLabelBlank ? " " : itemLabel;

rw.startElement("option", null);
Expand All @@ -513,8 +512,8 @@ private void renderOption(ResponseWriter rw, Object selectedOption, int index, S
}
if (isDisabled)
rw.writeAttribute("disabled", "disabled", "disabled");
rw.write(itemLabel);

rw.write(itemLabel);

rw.endElement("option");
}
Expand Down Expand Up @@ -547,7 +546,7 @@ protected void renderSelectTag(ResponseWriter rw, SelectOneMenu menu) throws IOE
protected void renderSelectTagAttributes(ResponseWriter rw, String clientId, SelectOneMenu menu)
throws IOException {
rw.writeAttribute("id", clientId, null);
Tooltip.generateTooltip(FacesContext.getCurrentInstance(), menu, rw);
//Tooltip.generateTooltip(FacesContext.getCurrentInstance(), menu, rw);
rw.writeAttribute("name", clientId, null);

StringBuilder sb;
Expand Down

0 comments on commit 15b321b

Please sign in to comment.