Author: nbelaevski
Date: 2009-04-22 10:59:53 -0400 (Wed, 22 Apr 2009)
New Revision: 13768
Modified:
trunk/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java
trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-6784
Modified:
trunk/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java
===================================================================
---
trunk/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java 2009-04-22
14:53:57 UTC (rev 13767)
+++
trunk/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java 2009-04-22
14:59:53 UTC (rev 13768)
@@ -248,6 +248,8 @@
public void encodeShuttleControlsFacets(FacesContext context, UIOrderingBaseComponent
component,
SelectionState sourceSelectionState, SelectionState targetSelectionState)
throws IOException {
+
+ boolean needsStrut = true;
String clientId = component.getClientId(context);
ResponseWriter writer = context.getResponseWriter();
@@ -269,11 +271,18 @@
}
if (SHUTTLE_HELPERS[i].isRendered(context, component)) {
+ needsStrut = false;
+
//proper assumption about helpers ordering
encodeControlFacet(context, component, SHUTTLE_HELPERS[i], clientId, writer, enabled,
"rich-list-shuttle-button", " rich-shuttle-control");
}
}
+
+ if (needsStrut) {
+ writer.startElement(HTML.SPAN_ELEM, component);
+ writer.endElement(HTML.SPAN_ELEM);
+ }
}
public void encodeTLControlsFacets(FacesContext context, UIOrderingBaseComponent
component, SelectionState selectionState)
Modified: trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java
===================================================================
---
trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java 2009-04-22
14:53:57 UTC (rev 13767)
+++
trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java 2009-04-22
14:59:53 UTC (rev 13768)
@@ -482,6 +482,8 @@
}
public void encodePickListControlsFacets(FacesContext context, UIComponent component,
ListStateFlags listStateFlags) throws IOException {
+ boolean needsStrut = true;
+
String clientId = component.getClientId(context);
boolean enable = false;
@@ -491,6 +493,8 @@
for (int i = 0; i < SHUTTLE_HELPERS.length; i++) {
//Conditionally render the control based on the return value of the control's
corresponding helper.isRendered method
if (SHUTTLE_HELPERS[i].isRendered(context, component)){
+ needsStrut = false;
+
OrderingComponentRendererBase.ControlsHelper helper = SHUTTLE_HELPERS[i];
boolean isDisabled =
helper.getButtonStyleClass().equals(PickListControlsHelper.DISABLED_STYLE_PREF);
@@ -519,6 +523,10 @@
}
}
+ if (needsStrut) {
+ writer.startElement(HTML.SPAN_ELEM, component);
+ writer.endElement(HTML.SPAN_ELEM);
+ }
}
protected void encodeControlFacet(FacesContext context, UIComponent component,
OrderingComponentRendererBase.ControlsHelper helper, String clientId,