JBoss Rich Faces SVN: r4268 - trunk/ui/panelmenu/src/main/templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-11-26 11:21:42 -0500 (Mon, 26 Nov 2007)
New Revision: 4268
Modified:
branches/3.1.x/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1424
Modified: branches/3.1.x/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
===================================================================
--- branches/3.1.x/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2007-11-26 16:00:51 UTC (rev 4267)
+++ branches/3.1.x/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2007-11-26 16:21:42 UTC (rev 4268)
@@ -25,7 +25,6 @@
<tr id="row_#{clientId}"
class="#{this:getSelectedClass( context, component )}" >
- <f:call name="utils.encodeId"/>
<td class="dr-pmenu-nowrap #{this:getIconClass( context, component,'left')}">
<f:call name="insertSpacerImages" />
<f:call name="insertImage">
@@ -47,4 +46,4 @@
</tr>
</table>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
===================================================================
--- trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2007-11-26 16:00:51 UTC (rev 4267)
+++ trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2007-11-26 16:21:42 UTC (rev 4268)
@@ -25,7 +25,6 @@
<tr id="row_#{clientId}"
class="#{this:getSelectedClass( context, component )}" >
- <f:call name="utils.encodeId"/>
<td class="dr-pmenu-nowrap #{this:getIconClass( context, component,'left')}">
<f:call name="insertSpacerImages" />
<f:call name="insertImage">
16 years, 4 months
JBoss Rich Faces SVN: r4267 - in branches/3.1.x/sandbox/ui/listShuttle/src/main: java/org/richfaces/renderkit/html/images and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-11-26 11:00:51 -0500 (Mon, 26 Nov 2007)
New Revision: 4267
Modified:
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleControlsHelper.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopy.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopyAll.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopyAllDisabled.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopyDisabled.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemove.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemoveAll.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemoveAllDisabled.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemoveDisabled.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss
branches/3.1.x/sandbox/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
Log:
List shuttle: control images fixed.
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleControlsHelper.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleControlsHelper.java 2007-11-26 15:55:12 UTC (rev 4266)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleControlsHelper.java 2007-11-26 16:00:51 UTC (rev 4267)
@@ -72,7 +72,7 @@
protected static final OrderingComponentRendererBase.ControlsHelper[] HELPERS = new OrderingComponentRendererBase.ControlsHelper[] {
new OrderingComponentRendererBase.ControlsHelper("copyAll", "COPY_ALL_LABEL", DEFAULT_LABEL_COPY_ALL, ListShuttleIconCopyAll.class.getName(), FACET_COPY_ALL,
- " rich-ordering-control-top", ATTRIBUTE_CLASS_COPY_ALL_CONTROL, ATTRIBUTE_CLASS_BUTTON,
+ " rich-shuttle-top", ATTRIBUTE_CLASS_COPY_ALL_CONTROL, ATTRIBUTE_CLASS_BUTTON,
CONTROL_ID_COPY_ALL, ATTRIBUTE_CE_ONCOPYALLCLICK, true) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -81,7 +81,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("disabledCopyAll", "COPY_ALL_LABEL", DEFAULT_LABEL_COPY_ALL, ListShuttleIconCopyAllDisabled.class.getName(), FACET_DIS_COPY_ALL,
- " rich-ordering-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, ATTRIBUTE_CLASS_BUTTON_DISABLED,
+ " rich-shuttle-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, ATTRIBUTE_CLASS_BUTTON_DISABLED,
DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_COPY_ALL), null, false) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -90,7 +90,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("copy", "COPY_LABEL", DEFAULT_LABEL_COPY, ListShuttleIconCopy.class.getName(), FACET_COPY,
- " rich-ordering-control-up", ATTRIBUTE_CLASS_COPY_CONTROL, ATTRIBUTE_CLASS_BUTTON,
+ " rich-shuttle-up", ATTRIBUTE_CLASS_COPY_CONTROL, ATTRIBUTE_CLASS_BUTTON,
CONTROL_ID_COPY, ATTRIBUTE_CE_ONCOPYCLICK ,true) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -99,7 +99,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("disabledCopy", "COPY_LABEL", DEFAULT_LABEL_COPY, ListShuttleIconCopyDisabled.class.getName(), FACET_DIS_COPY,
- " rich-ordering-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, ATTRIBUTE_CLASS_BUTTON_DISABLED,
+ " rich-shuttle-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, ATTRIBUTE_CLASS_BUTTON_DISABLED,
DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_COPY), null, false) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -108,7 +108,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("remove", "REMOVE_LABEL", DEFAULT_LABEL_REMOVE, ListShuttleIconRemove.class.getName(), FACET_REMOVE,
- " rich-ordering-control-down", ATTRIBUTE_CLASS_REMOVE_CONTROL, ATTRIBUTE_CLASS_BUTTON,
+ " rich-shuttle-down", ATTRIBUTE_CLASS_REMOVE_CONTROL, ATTRIBUTE_CLASS_BUTTON,
CONTROL_ID_REMOVE, ATTRIBUTE_CE_ONREMOVECLICK, true) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -117,7 +117,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("disabledRemove", "REMOVE_LABEL", DEFAULT_LABEL_REMOVE, ListShuttleIconRemoveDisabled.class.getName(), FACET_DIS_REMOVE,
- " rich-ordering-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, ATTRIBUTE_CLASS_BUTTON_DISABLED,
+ " rich-shuttle-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, ATTRIBUTE_CLASS_BUTTON_DISABLED,
DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_REMOVE), null, false) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -126,7 +126,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("removeAll", "REMOVE_ALL_LABEL", DEFAULT_LABEL_REMOVE_ALL, ListShuttleIconRemoveAll.class.getName(), FACET_REMOVE_ALL,
- " rich-ordering-control-bottom", ATTRIBUTE_CLASS_REMOVE_ALL_CONTROL, ATTRIBUTE_CLASS_BUTTON,
+ " rich-shuttle-bottom", ATTRIBUTE_CLASS_REMOVE_ALL_CONTROL, ATTRIBUTE_CLASS_BUTTON,
CONTROL_ID_REMOVE_ALL, ATTRIBUTE_CE_ONREMOVEALLCLICK, true) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
@@ -135,7 +135,7 @@
},
new OrderingComponentRendererBase.ControlsHelper("disabledRemoveAll", "REMOVE_ALL_LABEL", DEFAULT_LABEL_REMOVE_ALL, ListShuttleIconRemoveAllDisabled.class.getName(), FACET_DIS_REMOVE_ALL,
- " rich-ordering-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, ATTRIBUTE_CLASS_BUTTON_DISABLED,
+ " rich-shuttle-control-disabled", ATTRIBUTE_CLASS_DISABLED_CONTROL, ATTRIBUTE_CLASS_BUTTON_DISABLED,
DIS_CONTROL_ID_PREFIX.concat(CONTROL_ID_REMOVE_ALL), null, false) {
public boolean isRendered(FacesContext context, UIOrderingBaseComponent list) {
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java 2007-11-26 15:55:12 UTC (rev 4266)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java 2007-11-26 16:00:51 UTC (rev 4267)
@@ -6,6 +6,9 @@
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
@@ -161,6 +164,76 @@
}
}
+ protected void renderDefaultControl(FacesContext context,
+ UIOrderingBaseComponent orderingList, ResponseWriter writer,
+ boolean useFacet, OrderingComponentRendererBase.ControlsHelper helper, String clientId, ResourceBundle bundle, boolean enabled)
+ throws IOException {
+ UIComponent facet = orderingList.getFacet(helper.getFacetName());
+ String customEvent = null;
+ Map attributes = orderingList.getAttributes();
+ if (helper.customEvent != null) {
+ customEvent = (String) attributes.get(helper.customEvent);
+ }
+
+ String styleFromAttribute = (String) attributes
+ .get(helper.styleFromAttribute);
+ String currentStyle = helper.getStyleClassName();
+
+ if (styleFromAttribute != null) {
+ currentStyle = styleFromAttribute.concat(currentStyle);
+ }
+
+ writer.startElement(HTML.DIV_ELEM, orderingList);
+ writer.writeAttribute(HTML.id_ATTRIBUTE, clientId + helper.getIdSuffix(), null);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, "shuttle_button " + currentStyle, null);
+ if (helper.enable) {
+ writer.writeAttribute(HTML.onmousedown_ATTRIBUTE,
+ "Element.addClassName(this, 'shuttle_button_press'); Element.removeClassName(this, 'shuttle_button');", null);
+ writer.writeAttribute(HTML.onmouseup_ATTRIBUTE,
+ "Element.addClassName(this, 'shuttle_button'); Element.removeClassName(this, 'shuttle_button_press');", null);
+ writer.writeAttribute(HTML.onmouseout_ATTRIBUTE,
+ "Element.addClassName(this, 'shuttle_button'); Element.removeClassName(this, 'shuttle_button_press');", null);
+ }
+
+ if (customEvent != null) {
+ writer.writeAttribute(HTML.onclick_ATTRIBUTE, customEvent,null);
+ }
+
+ if (useFacet) {
+ renderChild(context, facet);
+ } else {
+ writer.startElement(HTML.IMG_ELEMENT, orderingList);
+ writer.writeAttribute(HTML.width_ATTRIBUTE, "15", null);
+ writer.writeAttribute(HTML.height_ATTRIBUTE, "15", null);
+ writer.writeAttribute(HTML.border_ATTRIBUTE, "0", null);
+ writer.writeAttribute(HTML.alt_ATTRIBUTE, helper.getFacetName(),
+ null);
+ writer.writeAttribute(HTML.src_ATTRIBUTE, getResource(
+ helper.getImageURI()).getUri(context, null), null);
+
+ writer.endElement(HTML.IMG_ELEMENT);
+
+ if (Boolean.TRUE.equals(attributes.get(SHOW_LABELS_ATTRIBUTE_NAME))) {
+ String label = (String) attributes.get(helper.getLabelAttributeName());
+
+ if (label == null && bundle != null) {
+ try {
+ label = bundle.getString(helper.getBundlePropertyName());
+ } catch (MissingResourceException e) {
+
+ }
+ }
+
+ if (label == null) {
+ label = helper.getDefaultText();
+ }
+
+ writer.writeText(label, null);
+ }
+ }
+ writer.endElement(HTML.DIV_ELEM);
+ }
+
protected void doDecode(FacesContext context, UIComponent component) {
super.doDecode(context, component);
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopy.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopy.java 2007-11-26 15:55:12 UTC (rev 4266)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopy.java 2007-11-26 16:00:51 UTC (rev 4267)
@@ -10,8 +10,7 @@
protected void paintImage(ResourceContext context, Graphics2D g2d,
Color textColor, Color borderColor) {
- g2d.translate(0, 14);
- g2d.scale(1, 0);
+ g2d.rotate(0.5*Math.PI, 7., 7.);
super.paintImage(context, g2d, textColor, borderColor);
}
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopyAll.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopyAll.java 2007-11-26 15:55:12 UTC (rev 4266)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopyAll.java 2007-11-26 16:00:51 UTC (rev 4267)
@@ -5,12 +5,11 @@
import org.ajax4jsf.resource.ResourceContext;
-public class ListShuttleIconCopyAll extends OrderingListIconBottom {
+public class ListShuttleIconCopyAll extends OrderingListIconTop {
protected void paintImage(ResourceContext context, Graphics2D g2d,
Color textColor, Color borderColor) {
- g2d.translate(0, 14);
- g2d.scale(1, 0);
+ g2d.rotate(0.5*Math.PI, 7., 7.);
super.paintImage(context, g2d, textColor, borderColor);
}
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopyAllDisabled.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopyAllDisabled.java 2007-11-26 15:55:12 UTC (rev 4266)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopyAllDisabled.java 2007-11-26 16:00:51 UTC (rev 4267)
@@ -2,7 +2,7 @@
import javax.faces.context.FacesContext;
-public class ListShuttleIconCopyAllDisabled extends OrderingListIconBottom {
+public class ListShuttleIconCopyAllDisabled extends ListShuttleIconCopyAll {
protected Object getDataToStore(FacesContext context, Object data) {
return storeData(context, DISABLED_ICON_COLOR, DISABLED_BACKGROUND_COLOR, DISABLED_BORDER_COLOR);
}
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopyDisabled.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopyDisabled.java 2007-11-26 15:55:12 UTC (rev 4266)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconCopyDisabled.java 2007-11-26 16:00:51 UTC (rev 4267)
@@ -2,7 +2,7 @@
import javax.faces.context.FacesContext;
-public class ListShuttleIconCopyDisabled extends OrderingListIconUp {
+public class ListShuttleIconCopyDisabled extends ListShuttleIconCopy {
protected Object getDataToStore(FacesContext context, Object data) {
return storeData(context, DISABLED_ICON_COLOR, DISABLED_BACKGROUND_COLOR, DISABLED_BORDER_COLOR);
}
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemove.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemove.java 2007-11-26 15:55:12 UTC (rev 4266)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemove.java 2007-11-26 16:00:51 UTC (rev 4267)
@@ -5,12 +5,11 @@
import org.ajax4jsf.resource.ResourceContext;
-public class ListShuttleIconRemove extends OrderingListIconUp {
+public class ListShuttleIconRemove extends OrderingListIconDown {
protected void paintImage(ResourceContext context, Graphics2D g2d,
Color textColor, Color borderColor) {
- g2d.translate(0, 14);
- g2d.scale(1, 0);
+ g2d.rotate(0.5*Math.PI, 7., 7.);
super.paintImage(context, g2d, textColor, borderColor);
}
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemoveAll.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemoveAll.java 2007-11-26 15:55:12 UTC (rev 4266)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemoveAll.java 2007-11-26 16:00:51 UTC (rev 4267)
@@ -5,12 +5,11 @@
import org.ajax4jsf.resource.ResourceContext;
-public class ListShuttleIconRemoveAll extends OrderingListIconTop {
+public class ListShuttleIconRemoveAll extends OrderingListIconBottom {
protected void paintImage(ResourceContext context, Graphics2D g2d,
Color textColor, Color borderColor) {
- g2d.translate(0, 14);
- g2d.scale(1, 0);
+ g2d.rotate(0.5*Math.PI, 7., 7.);
super.paintImage(context, g2d, textColor, borderColor);
}
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemoveAllDisabled.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemoveAllDisabled.java 2007-11-26 15:55:12 UTC (rev 4266)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemoveAllDisabled.java 2007-11-26 16:00:51 UTC (rev 4267)
@@ -2,7 +2,7 @@
import javax.faces.context.FacesContext;
-public class ListShuttleIconRemoveAllDisabled extends OrderingListIconTop {
+public class ListShuttleIconRemoveAllDisabled extends ListShuttleIconRemoveAll {
protected Object getDataToStore(FacesContext context, Object data) {
return storeData(context, DISABLED_ICON_COLOR, DISABLED_BACKGROUND_COLOR, DISABLED_BORDER_COLOR);
}
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemoveDisabled.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemoveDisabled.java 2007-11-26 15:55:12 UTC (rev 4266)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/renderkit/html/images/ListShuttleIconRemoveDisabled.java 2007-11-26 16:00:51 UTC (rev 4267)
@@ -2,7 +2,7 @@
import javax.faces.context.FacesContext;
-public class ListShuttleIconRemoveDisabled extends OrderingListIconUp {
+public class ListShuttleIconRemoveDisabled extends ListShuttleIconRemove {
protected Object getDataToStore(FacesContext context, Object data) {
return storeData(context, DISABLED_ICON_COLOR, DISABLED_BACKGROUND_COLOR, DISABLED_BORDER_COLOR);
}
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss 2007-11-26 15:55:12 UTC (rev 4266)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss 2007-11-26 16:00:51 UTC (rev 4267)
@@ -5,41 +5,20 @@
<f:verbatim><![CDATA[
-
-.ol_button_layout{padding : 15px 8px 15px 0px;}
-.ol_button_border{border : 1px solid #bfbfc0; margin-bottom : 3px;}
-.ol_button{background : url(ol_images/bg_header.png) top left #C6D6EA repeat-x; cursor : pointer; padding : 2px; font-family : Arial; font-size :11px;}
-.ol_button_light{background : url(ol_images/bg_header.png) top left #C6D6EA repeat-x; border : 1px solid #E79A00;cursor : pointer; padding : 1px; font-family : Arial; font-size :11px;}
-.ol_button_dis{background : #bfbfc0; border : 1px solid #bfbfc0; margin-bottom : 3px; padding : 1px}
-.ol_button_press{background : url(ol_images/bg_press.png) top left repeat-x #EAF0F8; border : 1px solid #E79A00; padding : 2px 0px 0px 2px;font-family : Arial; font-size :11px;}
-.ol_center_button_col_valign{vertical-align : middle}
-.ol_right_button_col_valign{vertical-align : middle}
-.ol_button_content{font-family : Arial; font-size :11px; padding : 0px 0px 0px 0px; text-align : center;}
-
-/*
-.ol_button_clicked {
- background : repeat scroll left top;
- border : 1px solid #bfbfc0;
- margin-bottom : 3px;
- cursor : pointer;
- padding : 1px;
+.shuttle_button {
+ background: none repeat scroll 0%;
+ border: 1px solid;
+ cursor: pointer;
+ margin-bottom: 3px;
+ padding: 1px;
}
-.ol_button_dis {
- background : #bfbfc0;
- border : 1px solid #bfbfc0;
- margin-bottom : 3px;
- padding : 1px;
-}
+.shuttle_button_layout{padding : 15px 8px 15px 0px;}
+.shuttle_button_dis{background : #bfbfc0; border : 1px solid #bfbfc0; margin-bottom : 3px; padding : 1px}
+.shuttle_button_press{background : #4A75B5; border : 1px solid #bfbfc0; margin-bottom : 3px; padding : 2px 0px 0px 2px}
+.shuttle_center_button_col_valign{vertical-align : middle}
+.shuttle_right_button_col_valign{vertical-align : middle}
-.ol_button_press {
- background : #4A75B5;
- border : 1px solid #bfbfc0;
- margin-bottom : 3px;
- padding : 2px 0px 0px 2px;
-}
-*/
-
.ol_caption {
padding : 1px;
height: 8px;
@@ -167,14 +146,14 @@
</u:style>
</u:selector>
-<u:selector name=".ol_button">
+<u:selector name=".shuttle_button">
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient" />
</u:style>
<u:style name="background-color" skin="headerBackgroundColor" />
</u:selector>
-<u:selector name=".ol_button_clicked">
+<u:selector name=".shuttle_button_press">
<u:style name="background-image">
<f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListClickedGradient" />
</u:style>
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2007-11-26 15:55:12 UTC (rev 4266)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2007-11-26 16:00:51 UTC (rev 4267)
@@ -9,7 +9,7 @@
class="org.richfaces.renderkit.html.ListShuttleRenderer"
component="org.richfaces.component.UIListShuttle"
>
- <h:styles>css/orderingList.xcss</h:styles>
+ <h:styles>css/listShuttle.xcss</h:styles>
<h:scripts>
new org.ajax4jsf.javascript.PrototypeScript(),
@@ -64,7 +64,7 @@
</div>
</td>
<td>
- <div class="ol_button_layout">
+ <div class="shuttle_button_layout">
<f:call name="encodeShuttleControlsFacets" />
</div>
@@ -106,7 +106,7 @@
</div>
</td>
<td class="ol_center_button_col_valign">
- <div class="ol_button_layout">
+ <div class="shuttle_button_layout rich-ordering-controls">
<f:call name="encodeTLControlsFacets" />
</div>
</td>
16 years, 4 months
JBoss Rich Faces SVN: r4266 - branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-11-26 10:55:12 -0500 (Mon, 26 Nov 2007)
New Revision: 4266
Modified:
branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/LoadResourceRendererBase.java
Log:
RF-1319
Modified: branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/LoadResourceRendererBase.java
===================================================================
--- branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/LoadResourceRendererBase.java 2007-11-26 15:54:49 UTC (rev 4265)
+++ branches/3.1.x/ui/core/src/main/java/org/ajax4jsf/renderkit/LoadResourceRendererBase.java 2007-11-26 15:55:12 UTC (rev 4266)
@@ -74,16 +74,22 @@
throw new FacesException("Source for resource is null for component "+resource.getClientId(context));
}
LinkedHashSet set = new LinkedHashSet(1);
- String uri ;
+ String uri = null ;
if(src instanceof InternetResource){
uri=((InternetResource)src).getUri(context, resource);
} else {
// Process as ordinary url, same as for h:graphicsImage.
- uri=context.getApplication().getViewHandler().
- getResourceURL(context, src.toString());
- uri=context.getExternalContext().encodeResourceURL(uri);
+ if(resource.isRendered()){
+ uri=context.getApplication().getViewHandler().
+ getResourceURL(context, src.toString());
+ uri=context.getExternalContext().encodeResourceURL(uri);
+ }
}
- set.add(uri);
+
+ if (uri != null) {
+ set.add(uri);
+ }
+
return set;
}
16 years, 4 months
JBoss Rich Faces SVN: r4265 - trunk/ui/core/src/main/java/org/ajax4jsf/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-11-26 10:54:49 -0500 (Mon, 26 Nov 2007)
New Revision: 4265
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/LoadResourceRendererBase.java
Log:
RF-1319 (if renderer=='false' doesn't encode styles or scripts)
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/LoadResourceRendererBase.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/LoadResourceRendererBase.java 2007-11-26 15:52:26 UTC (rev 4264)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/renderkit/LoadResourceRendererBase.java 2007-11-26 15:54:49 UTC (rev 4265)
@@ -74,16 +74,22 @@
throw new FacesException("Source for resource is null for component "+resource.getClientId(context));
}
LinkedHashSet set = new LinkedHashSet(1);
- String uri ;
+ String uri = null ;
if(src instanceof InternetResource){
uri=((InternetResource)src).getUri(context, resource);
} else {
// Process as ordinary url, same as for h:graphicsImage.
- uri=context.getApplication().getViewHandler().
- getResourceURL(context, src.toString());
- uri=context.getExternalContext().encodeResourceURL(uri);
+ if(resource.isRendered()){
+ uri=context.getApplication().getViewHandler().
+ getResourceURL(context, src.toString());
+ uri=context.getExternalContext().encodeResourceURL(uri);
+ }
}
- set.add(uri);
+
+ if (uri != null) {
+ set.add(uri);
+ }
+
return set;
}
16 years, 4 months
JBoss Rich Faces SVN: r4264 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-11-26 10:52:26 -0500 (Mon, 26 Nov 2007)
New Revision: 4264
Added:
trunk/docs/userguide/en/src/main/resources/images/dataTable3.png
trunk/docs/userguide/en/src/main/resources/images/datagrid1.png
Removed:
trunk/docs/userguide/en/src/main/resources/images/dataTable2.gif
trunk/docs/userguide/en/src/main/resources/images/datagrid1.gif
trunk/docs/userguide/en/src/main/resources/images/datagrid2.gif
Modified:
trunk/docs/userguide/en/src/main/resources/images/datadefinitionlist2.png
Log:
http://jira.jboss.com/jira/browse/RF-657 - improved description, added pictures.
Deleted: trunk/docs/userguide/en/src/main/resources/images/dataTable2.gif
===================================================================
(Binary files differ)
Added: trunk/docs/userguide/en/src/main/resources/images/dataTable3.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/dataTable3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/docs/userguide/en/src/main/resources/images/datadefinitionlist2.png
===================================================================
(Binary files differ)
Deleted: trunk/docs/userguide/en/src/main/resources/images/datagrid1.gif
===================================================================
(Binary files differ)
Added: trunk/docs/userguide/en/src/main/resources/images/datagrid1.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/datagrid1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/docs/userguide/en/src/main/resources/images/datagrid2.gif
===================================================================
(Binary files differ)
16 years, 4 months
JBoss Rich Faces SVN: r4263 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-11-26 10:51:48 -0500 (Mon, 26 Nov 2007)
New Revision: 4263
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml
trunk/docs/userguide/en/src/main/docbook/included/dataGrid.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/dataGrid.xml
trunk/docs/userguide/en/src/main/docbook/included/dataList.xml
trunk/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml
trunk/docs/userguide/en/src/main/docbook/included/dataTable.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml
Log:
http://jira.jboss.com/jira/browse/RF-657 - improved description, added pictures.
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml 2007-11-26 15:41:31 UTC (rev 4262)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataDefinitionList.xml 2007-11-26 15:51:48 UTC (rev 4263)
@@ -75,7 +75,7 @@
<property><rich:dataDefinitionList></property>
</emphasis> component allows to generate an definition list from a model.</para>
<para>The component has the <emphasis>
- <property>"type"</property>
+ <property>"term"</property>
</emphasis> facet, which corresponds to the <emphasis>
<property>"type"</property>
</emphasis> parameter for the <emphasis>
@@ -119,11 +119,11 @@
<property>"title"</property>
</emphasis> are used for popup title.</para>
- <para>The component is created basing on the <emphasis role="bold">
+ <para>The component was created basing on the <emphasis role="bold">
<property><a4j:repeat></property>
</emphasis> component and as a result it could be partially updated with Ajax. <emphasis>
<property>"ajaxKeys"</property>
- </emphasis> attribute allows to define elements that are updated after an Ajax request.</para>
+ </emphasis> attribute allows to define rows that are updated after an Ajax request.</para>
<para>Here is an example:</para>
<para>
@@ -131,8 +131,8 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:dataDefinitionList value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}"
- binding="#{listBean.dataList}" id="list" rows="5" type="disc">
- <h:outputText value="#{car.make} #{car.model}"></h:outputText>
+ binding="#{listBean.dataList}" id="list">
+ ...
</rich:dataDefinitionList>
...
<a4j:commandButton action"#{listBean.action}" reRender="list" value="Submit"/>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataGrid.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataGrid.desc.xml 2007-11-26 15:41:31 UTC (rev 4262)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataGrid.desc.xml 2007-11-26 15:51:48 UTC (rev 4263)
@@ -13,7 +13,7 @@
<title>DataGrid component</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/datagrid1.gif"/>
+ <imagedata fileref="images/datagrid1.png"/>
</imageobject>
</mediaobject>
</figure>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataGrid.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataGrid.xml 2007-11-26 15:41:31 UTC (rev 4262)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataGrid.xml 2007-11-26 15:51:48 UTC (rev 4263)
@@ -136,11 +136,11 @@
</mediaobject>
</figure>
- <para>The component is created basing on the <emphasis role="bold">
+ <para>The component was created basing on the <emphasis role="bold">
<property><a4j:repeat></property>
</emphasis> component and as a result it could be partially updated with Ajax. <emphasis>
<property>"ajaxKeys"</property>
- </emphasis> attribute allows to define elements that are updated after an Ajax request.</para>
+ </emphasis> attribute allows to define rows that are updated after an Ajax request.</para>
<para>Here is an example:</para>
<para>
@@ -149,7 +149,7 @@
<programlisting role="XML"><![CDATA[...
<rich:dataGrid value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}"
binding="#{listBean.dataGrid}" id="grid" elements="4" columns="2">
- <h:outputText value="#{car.make} #{car.model}"></h:outputText>
+ ...
</rich:dataGrid>
...
<a4j:commandButton action"#{listBean.action}" reRender="grid" value="Submit"/>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataList.xml 2007-11-26 15:41:31 UTC (rev 4262)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataList.xml 2007-11-26 15:51:48 UTC (rev 4263)
@@ -131,11 +131,11 @@
</mediaobject>
</figure>
- <para>The component is created basing on the <emphasis role="bold">
+ <para>The component was created basing on the <emphasis role="bold">
<property><a4j:repeat></property>
</emphasis> component and as a result it could be partially updated with Ajax. <emphasis>
<property>"ajaxKeys"</property>
- </emphasis> attribute allows to define elements that are updated after an Ajax request.</para>
+ </emphasis> attribute allows to define rows that are updated after an Ajax request.</para>
<para>Here is an example:</para>
<para>
@@ -144,7 +144,7 @@
<programlisting role="XML"><![CDATA[...
<rich:dataList value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}"
binding="#{listBean.dataList}" id="list" rows="5" type="disc">
- <h:outputText value="#{car.make} #{car.model}"></h:outputText>
+ ...
</rich:dataList>
...
<a4j:commandButton action"#{listBean.action}" reRender="list" value="Submit"/>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml 2007-11-26 15:41:31 UTC (rev 4262)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataOrderedList.xml 2007-11-26 15:51:48 UTC (rev 4263)
@@ -121,11 +121,11 @@
<property>"title"</property>
</emphasis> are used for popup title.</para>
- <para>The component is created basing on the <emphasis role="bold">
+ <para>The component was created basing on the <emphasis role="bold">
<property><a4j:repeat></property>
</emphasis> component and as a result it could be partially updated with Ajax. <emphasis>
<property>"ajaxKeys"</property>
- </emphasis> attribute allows to define elements that are updated after an Ajax request.</para>
+ </emphasis> attribute allows to define rows that are updated after an Ajax request.</para>
<para>Here is an example:</para>
<para>
@@ -133,8 +133,8 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:dataOrderedList value="#{dataTableScrollerBean.allCars}" var="car" ajaxKeys="#{listBean.list}"
- binding="#{listBean.dataList}" id="list" rows="5" type="disc">
- <h:outputText value="#{car.make} #{car.model}"></h:outputText>
+ binding="#{listBean.dataList}" id="list">
+ ...
</rich:dataOrderedList>
...
<a4j:commandButton action"#{listBean.action}" reRender="list" value="Submit"/>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataTable.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataTable.desc.xml 2007-11-26 15:41:31 UTC (rev 4262)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataTable.desc.xml 2007-11-26 15:51:48 UTC (rev 4263)
@@ -1,29 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<section>
-<sectioninfo>
-<keywordset>
-<keyword>dataTable</keyword>
-</keywordset>
-</sectioninfo>
-<section>
-<title>Description</title>
- <para>The component for tables rendering that allows choosing data from a model and obtains
- built-in support of Ajax updates.</para>
- <figure>
- <title>DataTable component</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/datatable1.gif"/>
- </imageobject>
- </mediaobject>
- </figure>
+ <sectioninfo>
+ <keywordset>
+ <keyword>dataTable</keyword>
+ </keywordset>
+ </sectioninfo>
+ <section>
+ <title>Description</title>
+ <para>The component for tables rendering that allows choosing data from a model and obtains
+ built-in support of Ajax updates.</para>
+ <figure>
+ <title>DataTable component</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/datatable1.gif"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
</section>
<section>
- <title>Key Features</title>
- <itemizedlist>
- <listitem>A completely skinned table and child elements</listitem>
- <listitem>Possibility to insert the complex subcomponents <emphasis><property>"colGroup"</property></emphasis> and "subTable"</listitem>
- <listitem>Possibility to update a limited set of strings with AJAX</listitem>
- </itemizedlist>
+ <title>Key Features</title>
+ <itemizedlist>
+ <listitem>A completely skinned table and child elements</listitem>
+ <listitem>Possibility to insert the complex subcomponents
+ <property>"colGroup"</property> and
+ <property>"subTable"</property></listitem>
+ <listitem>Possibility to update a limited set of strings with AJAX</listitem>
+ </itemizedlist>
+ </section>
</section>
-</section>
\ No newline at end of file
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml 2007-11-26 15:41:31 UTC (rev 4262)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml 2007-11-26 15:51:48 UTC (rev 4263)
@@ -71,75 +71,123 @@
</section>
<section>
<title>Details of Usage</title>
- <para>The <property>table</property> component is very similar to the custom JSF dataTable one,
- except for the common peculiarities of any rich component:</para>
- <itemizedlist>
- <listitem>Skin support. The <property>table</property> completely meets a three-class
- principle of Rich Faces skinnability</listitem>
- <listitem>Support of Ajax updates for a limited set of strings</listitem>
- </itemizedlist>
- <para>Skins support is described in the <link linkend="ArchitectureOverview">corresponding
- section</link>. Ajax support is possible because the component is created basing on the
- <emphasis role="bold">
+ <para>The <emphasis role="bold">
+ <property><rich:dataTable></property>
+ </emphasis> component is similar to the <emphasis role="bold">
+ <property><h:dataTable></property>
+ </emphasis> one, except Ajax support and skinnability . Ajax support is possible, because the
+ component was created basing on the <emphasis role="bold">
<property><a4j:repeat></property>
- </emphasis> component and as a result the component has its possibilities of Ajax updates for
- a limited set of strings. The component is implemented with the <emphasis>
+ </emphasis> component and as a result it could be partially updated with Ajax. <emphasis>
<property>"ajaxKeys"</property>
- </emphasis> attribute for a <property>table</property> and in contrast to the <emphasis
- role="bold">
- <property><a4j:repeat></property>
- </emphasis> outputs the standard HTML structure for table rendering.</para>
+ </emphasis> attribute allows to define rows that are updated after an Ajax request.</para>
+ <para>Here is an example:</para>
+
<para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
<rich:dataTable value="#{capitalsBean.capitals}" var="capitals"
- ajaxKeys="#{bean.ajaxSet}" binding="#{bean.table}" id="table">
- <!--Set of columns and header/footer facets-->
+ ajaxKeys="#{bean.ajaxSet}" binding="#{bean.table}" id="table">
+ ...
</rich:dataTable>
...
- <a4j:commandButton action="#{bean.someAction}" reRender="table"/>
+ <a4j:commandButton action"#{tableBean.action}" reRender="table" value="Submit"/>
...
]]></programlisting>
- <para>For such a table during <property>someAction</property> method processing called with AJAX
- request when the key is pressed it's possible to fill in lot's of ajaxKeys
- with strings indices that are to be updated. A resulting output on the client contains only
- required strings and they are updated in the tree, even when update is specified for the whole
- table.</para>
+ <para> In the example <emphasis>
+ <property>"reRender"</property>
+ </emphasis> attribute contains value of <emphasis>
+ <property>"id"</property>
+ </emphasis> attribute for <emphasis role="bold">
+ <property><rich:dataTable></property>
+ </emphasis> component. As a result the component are updated after an Ajax request.</para>
+
+ <para>The component allows to use <emphasis>
+ <property>"header"</property>
+ </emphasis>, <emphasis>
+ <property>"footer"</property>
+ </emphasis> and <emphasis>
+ <property>"caption"</property>
+ </emphasis> facets for output. See an example below:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+ <rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
+ <f:facet name="caption">United States Capitals</f:facet>
+ <f:facet name="header">Capitals and States Table</f:facet>
+ <rich:column>
+ <f:facet name="header">State Flag</f:facet>
+ <h:graphicImage value="#{cap.stateFlag}"/>
+ <f:facet name="footer">State Flag</f:facet>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">State Name</f:facet>
+ <h:outputText value="#{cap.state}"/>
+ <f:facet name="footer">State Name</f:facet>
+ </rich:column>
+ <rich:column >
+ <f:facet name="header">State Capital</f:facet>
+ <h:outputText value="#{cap.name}"/>
+ <f:facet name="footer">State Capital</f:facet>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Time Zone</f:facet>
+ <h:outputText value="#{cap.timeZone}"/>
+ <f:facet name="footer">Time Zone</f:facet>
+ </rich:column>
+ <f:facet name="footer">Capitals and States Table</f:facet>
+ </rich:dataTable>
+...
+]]></programlisting>
+
+ <para>This is a result:</para>
+
+ <figure>
+ <title>Component usage</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/datatable3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
</section>
<section>
<title>Look-and-Feel Customization</title>
-
+
<para>For skinnability implementation, the components use a <emphasis>
- <property>style class redefinition method.</property>
- </emphasis> Default style classes are mapped on <emphasis>
- <property>skin parameters.</property>
- </emphasis></para>
-
+ <property>style class redefinition method.</property>
+ </emphasis> Default style classes are mapped on <emphasis>
+ <property>skin parameters.</property>
+ </emphasis></para>
+
<para>There are two ways to redefine the appearance of all <emphasis role="bold">
- <property><rich:dataTable></property>
- </emphasis> components at once:</para>
-
+ <property><rich:dataTable></property>
+ </emphasis> components at once:</para>
+
<itemizedlist>
<listitem>
<para>Redefine the corresponding skin parameters</para>
</listitem>
-
+
<listitem>
<para>Add to your style sheets <emphasis>
- <property>style classes</property>
- </emphasis> used by a <emphasis role="bold">
- <property><rich:dataTable></property>
- </emphasis> component</para>
+ <property>style classes</property>
+ </emphasis> used by a <emphasis role="bold">
+ <property><rich:dataTable></property>
+ </emphasis> component</para>
</listitem>
</itemizedlist>
</section>
-
- <section id="SPR">
+
+ <section id="SPR">
<title>Skin Parameters Redefinition</title>
-
+
<table>
<title>Skin parameters redefinition for a table</title>
<tgroup cols="2">
@@ -157,7 +205,7 @@
</tbody>
</tgroup>
</table>
-
+
<table>
<title>Skin parameters redefinition for a header</title>
<tgroup cols="2">
@@ -175,7 +223,7 @@
</tbody>
</tgroup>
</table>
-
+
<table>
<title>Skin parameters redefinition for a footer</title>
<tgroup cols="2">
@@ -193,7 +241,7 @@
</tbody>
</tgroup>
</table>
-
+
<table>
<title>Skin parameters redefinition for a column header</title>
<tgroup cols="2">
@@ -211,7 +259,7 @@
</tbody>
</tgroup>
</table>
-
+
<table>
<title>Skin parameters redefinition for a column footer</title>
<tgroup cols="2">
@@ -229,7 +277,7 @@
</tbody>
</tgroup>
</table>
-
+
<table>
<title>Skin parameters redefinition for cells</title>
<tgroup cols="2">
@@ -255,14 +303,14 @@
</tbody>
</tgroup>
</table>
-
+
</section>
-
+
<section id="DofCCS">
<title>Definition of Custom Style Classes</title>
-
+
<para>On the screenshot there are classes names that define styles for component elements.</para>
-
+
<figure>
<title>DataTable class names</title>
<mediaobject>
@@ -271,7 +319,7 @@
</imageobject>
</mediaobject>
</figure>
-
+
<table>
<title>Classes names that define a whole component appearance</title>
<tgroup cols="2">
@@ -293,7 +341,7 @@
</tbody>
</tgroup>
</table>
-
+
<table>
<title>Classes names that define header and footer elements</title>
<tgroup cols="2">
@@ -304,12 +352,12 @@
</row>
</thead>
<tbody>
-
+
<row>
<entry>rich-table-header</entry>
<entry>Defines styles for a table header row</entry>
</row>
-
+
<row>
<entry>rich-table-header-continue</entry>
<entry>Defines styles for all header lines after the first</entry>
@@ -317,13 +365,13 @@
<row>
<entry>rich-table-subheader</entry>
<entry>Defines styles for a column header</entry>
- </row>
-
+ </row>
+
<row>
<entry>rich-table-footer</entry>
<entry>Defines styles for a footer row</entry>
</row>
-
+
<row>
<entry>rich-table-footer-continue</entry>
<entry>Defines styles for all footer lines after the first</entry>
@@ -335,7 +383,7 @@
</tbody>
</tgroup>
</table>
-
+
<table>
<title>Classes names that define rows and cells of a table</title>
<tgroup cols="2">
@@ -346,11 +394,11 @@
</row>
</thead>
<tbody>
- <row>
+ <row>
<entry>rich-table-headercell</entry>
<entry>Defines styles for a header cell</entry>
</row>
-
+
<row>
<entry>rich-table-subheadercell</entry>
<entry>Defines styles for a column header cell</entry>
@@ -367,12 +415,12 @@
<entry>rich-table-firstrow</entry>
<entry>Defines styles for a table start row</entry>
</row>
-
+
<row>
<entry>rich-table-footercell</entry>
<entry>Defines styles for a footer cell</entry>
</row>
-
+
<row>
<entry>rich-table-subfootercell</entry>
<entry>Defines styles for a column footer cell</entry>
@@ -380,37 +428,44 @@
</tbody>
</tgroup>
</table>
-
+
<para>In order to redefine styles for all <emphasis role="bold">
- <property><rich:dataTable></property>
- </emphasis> components on a page using CSS, it's enough to create classes with the
+ <property><rich:dataTable></property>
+ </emphasis> components on a page using CSS, it's enough to create classes with the
same names and define necessary properties in them.</para>
-
+
<para>To change styles of particular <emphasis role="bold">
- <property><rich:dataTable></property>
- </emphasis> components, define your own style classes in the corresponding <emphasis
- role="bold">
- <property><rich:dataTable></property>
- </emphasis>attributes.</para>
+ <property><rich:dataTable></property>
+ </emphasis> components, define your own style classes in the corresponding <emphasis
+ role="bold">
+ <property><rich:dataTable></property>
+ </emphasis>attributes.</para>
</section>
<section>
<title>Relevant Resources Links</title>
<para>
<ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dataTable.jsf?c=dataT..."
- >Here</ulink> you can see the example of <emphasis role="bold"
- ><property><rich:dataTable></property></emphasis> usage and sources for the given example. </para>
- <para>The article about <emphasis role="bold"><property><rich:dataTable></property></emphasis>
- flexibility can be found <ulink url="http://labs.jboss.com/wiki/RichFacesArticleDataTable"
- >here</ulink>.</para>
- <para>More information about using <emphasis role="bold"
- ><property><rich:dataTable></property></emphasis> and <emphasis role="bold"
- ><property><rich:subTable></property></emphasis> could be found on the <ulink
- url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059044#...">RichFaces Users Forum.</ulink>
+ >Here</ulink> you can see the example of <emphasis role="bold">
+ <property><rich:dataTable></property>
+ </emphasis> usage and sources for the given example. </para>
+ <para>The article about <emphasis role="bold">
+ <property><rich:dataTable></property>
+ </emphasis> flexibility can be found <ulink
+ url="http://labs.jboss.com/wiki/RichFacesArticleDataTable">here</ulink>.</para>
+ <para>More information about using <emphasis role="bold">
+ <property><rich:dataTable></property>
+ </emphasis> and <emphasis role="bold">
+ <property><rich:subTable></property>
+ </emphasis> could be found on the <ulink
+ url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059044#..."
+ >RichFaces Users Forum.</ulink>
</para>
- <para>How to use <emphasis role="bold"><property><rich:dataTable></property></emphasis> and <emphasis
- role="bold"><property><rich:dataScroller></property></emphasis> in a context of Extended
- Data Model see <ulink
+ <para>How to use <emphasis role="bold">
+ <property><rich:dataTable></property>
+ </emphasis> and <emphasis role="bold">
+ <property><rich:dataScroller></property>
+ </emphasis> in a context of Extended Data Model see <ulink
url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=115636"
- >here</ulink>.</para>
+ >here</ulink>.</para>
</section>
</section>
16 years, 4 months
JBoss Rich Faces SVN: r4262 - in management/design: comboBox and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-11-26 10:41:31 -0500 (Mon, 26 Nov 2007)
New Revision: 4262
Added:
management/design/comboBox/
management/design/comboBox/editable combo box vision.doc
Log:
http://jira.jboss.com/jira/browse/RF-1215
Added: management/design/comboBox/editable combo box vision.doc
===================================================================
(Binary files differ)
Property changes on: management/design/comboBox/editable combo box vision.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 4 months
JBoss Rich Faces SVN: r4261 - trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-11-26 10:06:19 -0500 (Mon, 26 Nov 2007)
New Revision: 4261
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
RF-1414
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-11-26 14:22:43 UTC (rev 4260)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-11-26 15:06:19 UTC (rev 4261)
@@ -254,125 +254,123 @@
* Date:
* d - 1-31
* dd+ - 01-31 */
-Object.extend(Date, {
- getDefaultMonthNames: function(shortNames)
- {
- return (shortNames
- ? ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
- : ['January','February','March','April','May','June','July','August','September','October','November','December']);
- },
+Richfaces.Calendar.getDefaultMonthNames = function(shortNames)
+{
+ return (shortNames
+ ? ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
+ : ['January','February','March','April','May','June','July','August','September','October','November','December']);
+};
+
+Richfaces.Calendar.parseDate = function(dateString, pattern, monthNames, monthNamesShort)
+{
+ if (!monthNames) monthNames = Richfaces.Calendar.getDefaultMonthNames();
+ if (!monthNamesShort) monthNamesShort = Richfaces.Calendar.getDefaultMonthNames(true);
- parseDate: function(dateString, pattern, monthNames, monthNamesShort)
- {
- if (!monthNames) monthNames = Date.getDefaultMonthNames();
- if (!monthNamesShort) monthNamesShort = Date.getDefaultMonthNames(true);
-
- var counter=1;
- var y,m,d;
- var a,h,min;
- var shortLabel=false;
-
- pattern = pattern.replace(/([.*+?^<>=!:${}()|[\]\/\\])/g, '\\$1');
- pattern = pattern.replace(/(y+|M+|d+|a|H{1,2}|h{1,2}|m{2})/g,
- function($1) {
- switch ($1) {
- case 'y' :
- case 'yy' : y=counter; counter++; return '(\\d{2})';
- case 'MM' : m=counter; counter++; return '(\\d{2})';
- case 'M' : m=counter; counter++; return '(\\d{1,2})';
- case 'd' : d=counter; counter++; return '(\\d{1,2})';
- case 'MMM': m=counter; counter++; shortLabel=true; return '('+monthNamesShort.join('|')+')';
- case 'a' : a=counter; counter++; return '(AM|am|PM|pm)?';
- case 'HH' :
- case 'hh' : h=counter; counter++; return '(\\d{2})?';
- case 'H' :
- case 'h' : h=counter; counter++; return '(\\d{1,2})?';
- case 'mm' : min=counter; counter++; return '(\\d{2})?';
- }
- // y+,M+,d+
- var ch = $1.charAt(0);
- if (ch=='y') {y=counter; counter++; return '(\\d{4})'};
- if (ch=='M') {m=counter; counter++; return '('+monthNames.join('|')+')'};
- if (ch=='d') {d=counter; counter++; return '(\\d{2})'};
+ var counter=1;
+ var y,m,d;
+ var a,h,min;
+ var shortLabel=false;
+
+ pattern = pattern.replace(/([.*+?^<>=!:${}()|[\]\/\\])/g, '\\$1');
+ pattern = pattern.replace(/(y+|M+|d+|a|H{1,2}|h{1,2}|m{2})/g,
+ function($1) {
+ switch ($1) {
+ case 'y' :
+ case 'yy' : y=counter; counter++; return '(\\d{2})';
+ case 'MM' : m=counter; counter++; return '(\\d{2})';
+ case 'M' : m=counter; counter++; return '(\\d{1,2})';
+ case 'd' : d=counter; counter++; return '(\\d{1,2})';
+ case 'MMM': m=counter; counter++; shortLabel=true; return '('+monthNamesShort.join('|')+')';
+ case 'a' : a=counter; counter++; return '(AM|am|PM|pm)?';
+ case 'HH' :
+ case 'hh' : h=counter; counter++; return '(\\d{2})?';
+ case 'H' :
+ case 'h' : h=counter; counter++; return '(\\d{1,2})?';
+ case 'mm' : min=counter; counter++; return '(\\d{2})?';
}
- );
-
- var re = new RegExp(pattern,'i');
- var match = dateString.match(re);
- if (match!=null)
- {
- var yy = parseInt(match[y],10); if (isNaN(yy)) return null; else if (yy<70) yy+=2000; else if (yy<100) yy+=1900;
- var mm = parseInt(match[m],10); if (isNaN(mm)) mm = Richfaces.Calendar.getMonthByLabel(match[m], shortLabel ? monthNamesShort : monthNames); else if (--mm<0 || mm>11) return null;
- var dd = parseInt(match[d],10); if (isNaN(dd) || dd<1 || dd>daysInMonth(yy, mm)) return null;
+ // y+,M+,d+
+ var ch = $1.charAt(0);
+ if (ch=='y') {y=counter; counter++; return '(\\d{4})'};
+ if (ch=='M') {m=counter; counter++; return '('+monthNames.join('|')+')'};
+ if (ch=='d') {d=counter; counter++; return '(\\d{2})'};
+ }
+ );
+
+ var re = new RegExp(pattern,'i');
+ var match = dateString.match(re);
+ if (match!=null)
+ {
+ var yy = parseInt(match[y],10); if (isNaN(yy)) return null; else if (yy<70) yy+=2000; else if (yy<100) yy+=1900;
+ var mm = parseInt(match[m],10); if (isNaN(mm)) mm = Richfaces.Calendar.getMonthByLabel(match[m], shortLabel ? monthNamesShort : monthNames); else if (--mm<0 || mm>11) return null;
+ var dd = parseInt(match[d],10); if (isNaN(dd) || dd<1 || dd>daysInMonth(yy, mm)) return null;
- // time parsing
- if (min!=undefined && h!=undefined)
- {
- var hh,mmin,aa;
- mmin = parseInt(match[min],10); if (isNaN(mmin) || mmin<0 || mmin>59) return null;
- hh = parseInt(match[h],10); if (isNaN(hh)) return null;
- if (a!=undefined)
+ // time parsing
+ if (min!=undefined && h!=undefined)
+ {
+ var hh,mmin,aa;
+ mmin = parseInt(match[min],10); if (isNaN(mmin) || mmin<0 || mmin>59) return null;
+ hh = parseInt(match[h],10); if (isNaN(hh)) return null;
+ if (a!=undefined)
+ {
+ aa = match[a].toLowerCase();
+ if ((aa!='am' && aa!='pm') || hh<1 || hh>12) return null;
+ if (aa=='pm')
{
- aa = match[a].toLowerCase();
- if ((aa!='am' && aa!='pm') || hh<1 || hh>12) return null;
- if (aa=='pm')
- {
- if (hh!=12) hh+=11;
- } else if (hh==12) hh = 0;
- }
- else if (hh<0 || hh>23) return null;
+ if (hh!=12) hh+=11;
+ } else if (hh==12) hh = 0;
+ }
+ else if (hh<0 || hh>23) return null;
- return new Date(yy, mm, dd, hh, mmin, 0);
+ return new Date(yy, mm, dd, hh, mmin, 0);
+ }
+
+ return new Date(yy, mm, dd);
+ }
+ return null;
+};
+
+Richfaces.Calendar.formatDate = function(date, pattern, monthNames, monthNamesShort) {
+ if (!monthNames) monthNames = Richfaces.Calendar.getDefaultMonthNames();
+ if (!monthNamesShort) monthNamesShort = Richfaces.Calendar.getDefaultMonthNames(true);
+ var mm; var dd; var hh;
+ var result = pattern.replace(/(^|[^\\yMdHhm])(y+|M+|d+|a|H{1,2}|h{1,2}|m{2})/g,
+ function($1,$2,$3) {
+ switch ($3) {
+ case 'y':
+ case 'yy': return $2+date.getYear().toString().slice(-2);
+ case 'M': return $2+(date.getMonth()+1);
+ case 'MM': return $2+((mm = date.getMonth()+1)<10 ? '0'+mm : mm);
+ case 'MMM': return $2+monthNamesShort[date.getMonth()];
+ case 'd': return $2+date.getDate();
+ case 'a' : return $2+(date.getHours()<12 ? 'AM' : 'PM');
+ case 'HH' : return $2+((hh = date.getHours())<10 ? '0'+hh : hh);
+ case 'H' : return $2+date.getHours();
+ case 'hh' : return $2+((hh = date.getHours())==0 ? '12' : (hh<10 ? '0'+hh : (hh>12 ? hh-12 : hh)));
+ case 'h' : return $2+((hh = date.getHours())==0 ? '12' : (hh>12 ? hh-12 : hh));
+ case 'mm' : return $2+((min = date.getMinutes())<10 ? '0'+min : min);
}
-
- return new Date(yy, mm, dd);
+ // y+,M+,d+
+ var ch = $3.charAt(0);
+ if (ch=='y') return $2+date.getFullYear();
+ if (ch=='M') return $2+monthNames[date.getMonth()];
+ if (ch=='d') return $2+((dd = date.getDate())<10 ? '0'+dd : dd);
}
- return null;
- },
+ );
+ return Richfaces.Calendar.unescape(result);
+};
+
+Richfaces.Calendar.escape = function (str)
+{
+ return str.replace(/([yMdaHhm])/g,"\\$1");
+};
- escape : function (str)
- {
- return str.replace(/([yMdaHhm])/g,"\\$1");
- },
-
- unescape : function (str)
- {
- return str.replace(/\\([yMdaHhm])/g,"$1");
- }
-});
-Object.extend(Date.prototype, {
-
- format : function(pattern, monthNames, monthNamesShort) {
- if (!monthNames) monthNames = Date.getDefaultMonthNames();
- if (!monthNamesShort) monthNamesShort = Date.getDefaultMonthNames(true);
- var d = this; var mm; var dd; var hh;
- var result = pattern.replace(/(^|[^\\yMdHhm])(y+|M+|d+|a|H{1,2}|h{1,2}|m{2})/g,
- function($1,$2,$3) {
- switch ($3) {
- case 'y':
- case 'yy': return $2+d.getYear().toString().slice(-2);
- case 'M': return $2+(d.getMonth()+1);
- case 'MM': return $2+((mm = d.getMonth()+1)<10 ? '0'+mm : mm);
- case 'MMM': return $2+monthNamesShort[d.getMonth()];
- case 'd': return $2+d.getDate();
- case 'a' : return $2+(d.getHours()<12 ? 'AM' : 'PM');
- case 'HH' : return $2+((hh = d.getHours())<10 ? '0'+hh : hh);
- case 'H' : return $2+d.getHours();
- case 'hh' : return $2+((hh = d.getHours())==0 ? '12' : (hh<10 ? '0'+hh : (hh>12 ? hh-12 : hh)));
- case 'h' : return $2+((hh = d.getHours())==0 ? '12' : (hh>12 ? hh-12 : hh));
- case 'mm' : return $2+((min = d.getMinutes())<10 ? '0'+min : min);
- }
- // y+,M+,d+
- var ch = $3.charAt(0);
- if (ch=='y') return $2+d.getFullYear();
- if (ch=='M') return $2+monthNames[d.getMonth()];
- if (ch=='d') return $2+((dd = d.getDate())<10 ? '0'+dd : dd);
- }
- );
- return Date.unescape(result);
- }
-});
+Richfaces.Calendar.unescape = function (str)
+{
+ return str.replace(/\\([yMdaHhm])/g,"$1");
+};
+
+
function isLeapYear(year) {
return new Date(year, 1, 29).getDate()==29;
}
@@ -554,7 +552,7 @@
}
var htmlTextHeader = (!this.params.popup ? '<input id="'+this.INPUT_DATE_ID+'" name="'+this.INPUT_DATE_ID+'" type="hidden" style="display:none" value="'+this.getSelectedDateString(this.params.datePattern)+'"/>\n' : '') +
- '<input id="'+this.id+'InputCurrentDate" name="'+this.id+'InputCurrentDate" type="hidden" style="display:none" value="'+this.getCurrentDate().format("MM/yyyy")+'"/>\n' +
+ '<input id="'+this.id+'InputCurrentDate" name="'+this.id+'InputCurrentDate" type="hidden" style="display:none" value="'+Richfaces.Calendar.formatDate(this.getCurrentDate(),"MM/yyyy")+'"/>\n' +
(this.params.popup && Richfaces.browser.isIE6 ? '<iframe src="javascript:\'\'" frameborder="0" scrolling="no" id="' + this.IFRAME_ID + '" style="display:none; position: absolute; width: 1px; height: 1px; background-color:white;">'+'</iframe>\n' : '' )+
'<table id="'+this.id+'" border="0" cellpadding="0" cellspacing="0" class="rich-calendar-exterior rich-calendar-popup'+(this.params.className ? ' '+this.params.className : '')+'" style="'+popupStyles+this.params.style+'"><tbody>\n';
var colspan = (this.params.showWeeksBar ? "8" : "7");
@@ -913,7 +911,7 @@
getSelectedDateString: function(pattern) {
if (!this.selectedDate) return "";
if (!pattern) pattern = this.params.datePattern;
- return this.selectedDate.format(pattern, this.params.monthLabels, this.params.monthLabelsShort);
+ return Richfaces.Calendar.formatDate(this.selectedDate, pattern, this.params.monthLabels, this.params.monthLabelsShort);
},
getPrevYear: function() {
@@ -1440,7 +1438,7 @@
onUpdate: function()
{
- var formattedDate = this.getCurrentDate().format("MM/yyyy");
+ var formattedDate = Richfaces.Calendar.formatDate(this.getCurrentDate(),"MM/yyyy");
$(this.id+'InputCurrentDate').value=formattedDate;
if (this.submitFunction)
@@ -1524,7 +1522,7 @@
var newSelectedDate;
if (date)
{
- if (typeof date=='string') date = Date.parseDate(date,this.params.datePattern, this.params.monthLabels, this.params.monthLabelsShort);
+ if (typeof date=='string') date = Richfaces.Calendar.parseDate(date,this.params.datePattern, this.params.monthLabels, this.params.monthLabelsShort);
newSelectedDate = date;
}
else
@@ -1715,7 +1713,7 @@
if (!calendar.selectedDate || calendar.showApplyButton) return "";
- var text = calendar.selectedDate.format( (calendar.timeType ? calendar.datePattern : calendar.params.datePattern), calendar.params.monthLabels, calendar.params.monthLabelsShort);
+ var text = Richfaces.Calendar.formatDate(calendar.selectedDate,(calendar.timeType ? calendar.datePattern : calendar.params.datePattern), calendar.params.monthLabels, calendar.params.monthLabelsShort);
var markup = new E('div', {'class': 'rich-calendar-btn', 'style': 'white-space:nowrap', 'onclick': "Richfaces.getComponent('calendar',this).showSelectedDate(); return true;"}, [new ET(text)]);
@@ -1726,7 +1724,7 @@
if (!calendar.selectedDate || !calendar.timeType) return "";
- var text = calendar.selectedDate.format( calendar.timePattern, calendar.params.monthLabels, calendar.params.monthLabelsShort);
+ var text = Richfaces.Calendar.formatDate(calendar.selectedDate, calendar.timePattern, calendar.params.monthLabels, calendar.params.monthLabelsShort);
var markup = new E('div', {'class': 'rich-calendar-btn rich-calendar-time', 'style': 'white-space:nowrap', 'onclick': "Richfaces.getComponent('calendar',this).showTimeEditor(this);return true;"}, [new ET(text)]);
@@ -1737,7 +1735,7 @@
CalendarView.previousYearControl = CalendarView.getControl("<<", "prevYear");
CalendarView.nextMonthControl = CalendarView.getControl(">", "nextMonth");
CalendarView.previousMonthControl = CalendarView.getControl("<", "prevMonth");
-CalendarView.currentMonthControl = function (context) { return context.calendar.getCurrentDate().format("MMMM, yyyy", context.monthLabels, context.monthLabelsShort);};
+CalendarView.currentMonthControl = function (context) { return Richfaces.Calendar.formatDate(context.calendar.getCurrentDate(), "MMMM, yyyy", context.monthLabels, context.monthLabelsShort);};
CalendarView.todayControl = CalendarView.getControl("Today", "today");
CalendarView.selectedDateControl = function (context) { return CalendarView.getSelectedDateControl(context.calendar);};
CalendarView.timeControl = function (context) { return CalendarView.getTimeControl(context.calendar);};
16 years, 4 months
JBoss Rich Faces SVN: r4260 - in branches/3.1.x/sandbox/ui/contextMenu/src/main: java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-11-26 09:22:43 -0500 (Mon, 26 Nov 2007)
New Revision: 4260
Modified:
branches/3.1.x/sandbox/ui/contextMenu/src/main/config/component/contextMenu.xml
branches/3.1.x/sandbox/ui/contextMenu/src/main/java/org/richfaces/component/UIContextMenu.java
branches/3.1.x/sandbox/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
branches/3.1.x/sandbox/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
Log:
Context Menu - support for most features
Modified: branches/3.1.x/sandbox/ui/contextMenu/src/main/config/component/contextMenu.xml
===================================================================
--- branches/3.1.x/sandbox/ui/contextMenu/src/main/config/component/contextMenu.xml 2007-11-26 14:22:24 UTC (rev 4259)
+++ branches/3.1.x/sandbox/ui/contextMenu/src/main/config/component/contextMenu.xml 2007-11-26 14:22:43 UTC (rev 4260)
@@ -46,5 +46,12 @@
</description>
<defaultvalue>true</defaultvalue>
</property>
+ <property>
+ <name>disableDefaultMenu</name>
+ <classname>boolean</classname>
+ <description>
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
</component>
</components>
Modified: branches/3.1.x/sandbox/ui/contextMenu/src/main/java/org/richfaces/component/UIContextMenu.java
===================================================================
--- branches/3.1.x/sandbox/ui/contextMenu/src/main/java/org/richfaces/component/UIContextMenu.java 2007-11-26 14:22:24 UTC (rev 4259)
+++ branches/3.1.x/sandbox/ui/contextMenu/src/main/java/org/richfaces/component/UIContextMenu.java 2007-11-26 14:22:43 UTC (rev 4260)
@@ -38,4 +38,8 @@
public abstract void setEvent(String event);
+ public abstract boolean isDisableDefaultMenu();
+
+ public abstract void setDisableDefaultMenu(boolean b);
+
}
Modified: branches/3.1.x/sandbox/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
===================================================================
--- branches/3.1.x/sandbox/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2007-11-26 14:22:24 UTC (rev 4259)
+++ branches/3.1.x/sandbox/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2007-11-26 14:22:43 UTC (rev 4260)
@@ -28,6 +28,7 @@
import java.util.List;
import java.util.Map;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIParameter;
import javax.faces.context.FacesContext;
@@ -97,16 +98,30 @@
public void encodeChildren(FacesContext context, UIComponent component)
throws IOException {
+ UIContextMenu menu = (UIContextMenu) component;
ResponseWriter writer = context.getResponseWriter();
+
+ String event = menu.getEvent();
+
+ if (event == null) {
+ throw new FacesException("Attribute 'event' is not set for component " + component.getClientId(context));
+ }
+
writer.startElement("script", component);
- writer.write("new Richfaces.ContextMenu('");
- writer.write(component.getClientId(context));
- writer.write("',");
+ writer.writeText("new Richfaces.ContextMenu('", null);
+ writer.writeText(component.getClientId(context), null);
+ writer.writeText("',", null);
writeScriptBody(context, component, true);
- writer.write(")");
- writer.write(getClientAttachmentOptions(context, (UIContextMenu) component));
- writer.write(";");
+ writer.writeText(")", null);
+ writer.writeText(getClientAttachmentOptions(context, menu), null);
+ writer.writeText(";", null);
+ if (menu.isDisableDefaultMenu()) {
+ writer.writeText("Richfaces.disableDefaultHandler('", null);
+ writer.writeText(event, null);
+ writer.writeText("');", null);
+ }
+
writer.endElement("script");
}
@@ -121,10 +136,6 @@
String event = contextMenu.getEvent();
- if (event == null) {
- event = "oncontextmenu";
- }
-
function.addParameter(event);
Map params = new LinkedHashMap();
Modified: branches/3.1.x/sandbox/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
===================================================================
--- branches/3.1.x/sandbox/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2007-11-26 14:22:24 UTC (rev 4259)
+++ branches/3.1.x/sandbox/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2007-11-26 14:22:43 UTC (rev 4260)
@@ -1,6 +1,18 @@
-if (!window.Richfaces) var Richfaces = {};
+if (!window.Richfaces) window.Richfaces = {};
Richfaces.ContextMenu = Class.create();
+Array.prototype.invock = function(method) {
+ var args = $A(arguments).slice(1);
+ var a = [];
+
+ for(var i = 0; i < this.length; i++) {
+ var each = this[i];
+ a[i] = each[method].apply(each,args);
+ }
+
+ return a;
+}
+
Richfaces.ContextMenu.prototype = {
initialize: function(id, evaluator) {
@@ -44,7 +56,8 @@
var div = document.createElement("div");
div.id = this.id + ":_auto_created";
$(this.id).appendChild(div);
- new Insertion.Top(div, this.evaluator.invoke('getContent', context||window).join(''));
+ var html = this.evaluator.invoke('getContent', context||window).join('');
+ new Insertion.Top(div, html);
},
@@ -61,4 +74,18 @@
//var oldContext = this.context || {};
return true;
}
-};
\ No newline at end of file
+};
+
+Richfaces.disableDefaultHandler = function(event) {
+ if (event.startsWith('on')) {
+ event = event.substr(2);
+ }
+ Event.observe(document, event, Event.stop);
+};
+
+Richfaces.enableDefaultHandler = function(event) {
+ if (event.startsWith('on')) {
+ event = event.substr(2);
+ }
+ Event.stopObserving(document, event, Event.stop);
+};
16 years, 4 months
JBoss Rich Faces SVN: r4259 - branches/3.1.x/sandbox/samples/contextMenuDemo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-11-26 09:22:24 -0500 (Mon, 26 Nov 2007)
New Revision: 4259
Modified:
branches/3.1.x/sandbox/samples/contextMenuDemo/src/main/webapp/pages/index.jsp
Log:
Context Menu - support for most features
Modified: branches/3.1.x/sandbox/samples/contextMenuDemo/src/main/webapp/pages/index.jsp
===================================================================
--- branches/3.1.x/sandbox/samples/contextMenuDemo/src/main/webapp/pages/index.jsp 2007-11-26 14:22:12 UTC (rev 4258)
+++ branches/3.1.x/sandbox/samples/contextMenuDemo/src/main/webapp/pages/index.jsp 2007-11-26 14:22:24 UTC (rev 4259)
@@ -28,7 +28,7 @@
</a4j:outputPanel>
</div>
<h:form id="f">
- <h:panelGroup id="outputText" >
+ <h:panelGroup id="outputText" style="cursor: alias;">
Right Click Here
<cm:contextMenu submitMode="server" id="m">
<mc:menuItem id="menuItem11" action="#{bean.action}" value="{param} ajax submit" submitMode="ajax" actionListener="#{bean.actionListener}">
16 years, 4 months