use of com.liferay.faces.alloy.component.outputtooltip.OutputTooltip in project liferay-faces-alloy by liferay.
the class OutputTooltipRenderer method encodeJavaScriptCustom.
@Override
public void encodeJavaScriptCustom(FacesContext facesContext, UIComponent uiComponent) throws IOException {
ClientComponent clientComponent = (ClientComponent) uiComponent;
String clientVarName = getClientVarName(facesContext, clientComponent);
String clientKey = clientComponent.getClientKey();
if (clientKey == null) {
clientKey = clientVarName;
}
ResponseWriter responseWriter = facesContext.getResponseWriter();
OutputTooltip tooltip = (OutputTooltip) uiComponent;
encodeOverlayJavaScriptCustom(responseWriter, facesContext, tooltip, clientKey);
if ((tooltip.getFor() == null) && facesContext.isProjectStage(ProjectStage.Development)) {
logger.error("The 'for' attribute is required for alloy:outputTooltip");
}
// In order to workaround a bug where the tooltip appears in the incorrect place, set the trigger again after
// the tooltip has been initialized
encodeLiferayComponentVar(responseWriter, clientVarName, clientKey);
responseWriter.write(clientVarName);
responseWriter.write(".set('trigger',");
responseWriter.write(clientVarName);
responseWriter.write(".get('trigger'));");
}
use of com.liferay.faces.alloy.component.outputtooltip.OutputTooltip in project liferay-faces-alloy by liferay.
the class OutputTooltipRendererBase method encodeAlloyAttributes.
@Override
public void encodeAlloyAttributes(FacesContext facesContext, ResponseWriter responseWriter, UIComponent uiComponent) throws IOException {
OutputTooltip outputTooltip = (OutputTooltip) uiComponent;
boolean first = true;
String for_ = outputTooltip.getFor();
if (for_ != null) {
encodeTrigger(responseWriter, outputTooltip, for_, first);
first = false;
}
String opacity = outputTooltip.getOpacity();
if (opacity != null) {
encodeOpacity(responseWriter, outputTooltip, opacity, first);
first = false;
}
String position = outputTooltip.getPosition();
if (position != null) {
encodePosition(responseWriter, outputTooltip, position, first);
first = false;
}
Integer zIndex = outputTooltip.getzIndex();
if (zIndex != null) {
encodeZIndex(responseWriter, outputTooltip, zIndex, first);
first = false;
}
encodeHiddenAttributes(facesContext, responseWriter, outputTooltip, first);
}
Aggregations