return '\'' + str + '\'';
}
@Override
public void decode(FacesContext context, UIComponent component) {
PopupLayer layer = ((PopupLayer) component);
String visibleKey = component.getClientId(context) + VISIBLE_HIDDEN_FIELD_SUFFIX;
String visibleValue = context.getExternalContext().getRequestParameterMap().get(visibleKey);
if (visibleValue != null) {
boolean visible = Boolean.valueOf(visibleValue);
if (layer.isVisible() != visible) {
layer.setVisible(visible);
}
}
String leftKey = component.getClientId(context) + LEFT_HIDDEN_FIELD_SUFFIX;
String leftValue = context.getExternalContext().getRequestParameterMap().get(leftKey);
if (leftValue != null && leftValue.length() == 0) {
leftValue = null;
}
String popupLeft = layer.getLeft();
if (popupLeft != null && !popupLeft.equals(leftValue) || leftValue != null && !leftValue.equals(popupLeft)) {
layer.setLeft(leftValue);
}
String topKey = component.getClientId(context) + TOP_HIDDEN_FIELD_SUFFIX;
String topValue = context.getExternalContext().getRequestParameterMap().get(topKey);
if (topValue != null && topValue.length() == 0) {
topValue = null;
}
String popupTop = layer.getTop();
if (popupTop != null && !popupTop.equals(topValue) || topValue != null && !topValue.equals(popupTop)) {
layer.setTop(topValue);
}
}