JBoss Rich Faces SVN: r1897 - in trunk/sandbox/ui/scrollable-grid/src/main: java/org/richfaces/renderkit/html and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-07-27 11:01:42 -0400 (Fri, 27 Jul 2007)
New Revision: 1897
Modified:
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridRendererState.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SortIconRenderer.java
trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Grid.js
trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader.js
trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
trunk/sandbox/ui/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-itself.jspx
Log:
server rendering of scroll icons
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-07-27 14:58:15 UTC (rev 1896)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-07-27 15:01:42 UTC (rev 1897)
@@ -52,10 +52,6 @@
public static final String SORT_SINGLE = "single";
public static final String SORT_MULTI = "multi";
- public static String ASC_ICON = "ascIcon";
- public static String DESC_ICON = "descIcon";
-
-
private boolean MODEL_RANGE = false;
private final static Log log = LogFactory.getLog(UIScrollableGrid.class);
@@ -387,30 +383,4 @@
public abstract String getSortMode();
public abstract void setSortMode(String mode);
-
- public UIComponent getAscIcon() {
- return getFacet(ASC_ICON);
- }
-
- public void setAscIcon(UIComponent component) {
- if (component == null) {
- getFacets().remove(ASC_ICON);
- } else {
- getFacets().put(ASC_ICON, component);
- }
- }
-
- public UIComponent getDescIcon() {
- return getFacet(DESC_ICON);
- }
-
- public void setDescIcon(UIComponent component) {
- if (component == null) {
- getFacets().remove(DESC_ICON);
- } else {
- getFacets().put(DESC_ICON, component);
- }
- }
-
-
}
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java 2007-07-27 14:58:15 UTC (rev 1896)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java 2007-07-27 15:01:42 UTC (rev 1897)
@@ -17,6 +17,9 @@
*/
public abstract class UIScrollableGridColumn extends UIColumn implements SortSource{
+ public static String ASC_ICON = "ascIcon";
+ public static String DESC_ICON = "descIcon";
+
public Iterator getChildIterator(){
return getChildren().iterator();
}
@@ -50,34 +53,29 @@
}
public UIComponent getAscIcon() {
- UIComponent facet = getFacet(UIScrollableGrid.ASC_ICON);
- if (facet == null) {
- facet = getGrid().getAscIcon();
- }
+ UIComponent facet = getFacet(ASC_ICON);
return facet;
}
public void setAscIcon(UIComponent component) {
if (component == null) {
- getFacets().remove(UIScrollableGrid.ASC_ICON);
+ getFacets().remove(ASC_ICON);
} else {
- getFacets().put(UIScrollableGrid.ASC_ICON, component);
+ getFacets().put(ASC_ICON, component);
}
}
public UIComponent getDescIcon() {
- UIComponent facet = getFacet(UIScrollableGrid.DESC_ICON);
- if (facet == null) {
- facet = getGrid().getDescIcon();
- }
+ UIComponent facet = getFacet(DESC_ICON);
+
return facet;
}
public void setDescIcon(UIComponent component) {
if (component == null) {
- getFacets().remove(UIScrollableGrid.DESC_ICON);
+ getFacets().remove(DESC_ICON);
} else {
- getFacets().put(UIScrollableGrid.DESC_ICON, component);
+ getFacets().put(DESC_ICON, component);
}
}
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridRendererState.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridRendererState.java 2007-07-27 14:58:15 UTC (rev 1896)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/GridRendererState.java 2007-07-27 15:01:42 UTC (rev 1897)
@@ -146,6 +146,7 @@
super();
_grid = grid;
_cachedClientId = grid.getClientId(context);
+ clientId = _cachedClientId;
_previousState = previsiosState;
if(AjaxRendererUtils.isAjaxRequest(context)){
}
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-07-27 14:58:15 UTC (rev 1896)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-07-27 15:01:42 UTC (rev 1897)
@@ -44,6 +44,7 @@
public abstract class ScrollableGridBaseRenderer extends CompositeRenderer {
public final String PARTIAL_UPDATE= "partialUpdate";
+ public final String UPDATE_HEADER = "updateHeader";
public final String FOOTER_PART = "footer";
@@ -53,9 +54,6 @@
private final String COLUMN_NORMAL_TYPE = "normal";
- private static final String ASC_ICON_CREATED = "ASC_ICON_CREATED";
- private static final String DESC_ICON_CREATED = "DESC_ICON_CREATED";
-
private RendererBase cellTemplate = null;
private RendererBase headerCellTemplate = null;
@@ -563,32 +561,9 @@
public void setUpState(FacesContext context, UIScrollableGrid grid) {
GridRendererState.createState(context, grid);
- Map attrs = grid.getAttributes();
-
- if (grid.getAscIcon() == null) {
- attrs.put(ASC_ICON_CREATED, Boolean.TRUE);
- }
-
- if (grid.getDescIcon() == null) {
- attrs.put(DESC_ICON_CREATED, Boolean.TRUE);
- }
-
}
public void tearDownState(FacesContext context, UIScrollableGrid grid){
-
- Map attrs = grid.getAttributes();
- if (attrs.containsKey(ASC_ICON_CREATED)) {
- grid.setAscIcon(null);
- attrs.remove(ASC_ICON_CREATED);
- }
-
- if (attrs.containsKey(DESC_ICON_CREATED)) {
- grid.setDescIcon(null);
- attrs.remove(DESC_ICON_CREATED);
- }
-
-
GridRendererState.restoreState(context);
}
@@ -637,6 +612,8 @@
super.doDecode(context, component);
component.getAttributes().remove(PARTIAL_UPDATE);
+ component.getAttributes().remove(UPDATE_HEADER);
+
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
@@ -691,6 +668,7 @@
if (ajaxContext.isAjaxRequest()) {
component.getAttributes().put(PARTIAL_UPDATE, Boolean.TRUE);
+ component.getAttributes().put(UPDATE_HEADER, Boolean.TRUE);
}
}
}
@@ -733,6 +711,8 @@
UIScrollableGrid grid = (UIScrollableGrid)component;
+
+
GridRendererState state = GridRendererState.createState(context, grid);
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
@@ -769,6 +749,9 @@
//Then call contributors to write additional HTML content
contributorsEncodeHere(context, grid);
+ if (shouldUpdateHeader(component)) {
+ ColumnWalker.iterateOverColumns(context, component, headerRenderer, writer, new GridRendererState(context, null, grid));
+ }
}
@@ -788,6 +771,11 @@
Boolean b = (Boolean) grid.getAttributes().get(PARTIAL_UPDATE);
return b != null && b.booleanValue();
}
+
+ private boolean shouldUpdateHeader(UIComponent grid) {
+ Boolean b = (Boolean) grid.getAttributes().get(PARTIAL_UPDATE);
+ return b != null && b.booleanValue();
+ }
public void encodeChildren(FacesContext context, UIComponent component
) throws IOException {
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SortIconRenderer.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SortIconRenderer.java 2007-07-27 14:58:15 UTC (rev 1896)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/SortIconRenderer.java 2007-07-27 15:01:42 UTC (rev 1897)
@@ -3,10 +3,45 @@
*/
package org.richfaces.renderkit.html;
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.renderkit.RendererBase;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.component.UIScrollableGridColumn;
+
/**
* @author Maksim Kaszynski
*
*/
-public class SortIconRenderer {
+public abstract class SortIconRenderer extends RendererBase {
+
+
+ public void renderAscIcon(FacesContext context, UIComponent component) throws IOException{
+ renderFacetOrIcon(context, component, UIScrollableGridColumn.ASC_ICON, "dr-sgrid-sort-asc");
+ }
+ public void renderDescIcon(FacesContext context, UIComponent component) throws IOException{
+ renderFacetOrIcon(context, component, UIScrollableGridColumn.DESC_ICON, "dr-sgrid-sort-desc");
+ }
+
+ private void renderFacetOrIcon(FacesContext context, UIComponent component, String facetName, String clazz) throws IOException{
+ UIComponent facet = component.getFacet(facetName);
+ if (facet != null) {
+ renderChild(context, facet);
+ } else {
+ renderIcon(context.getResponseWriter(), clazz);
+ }
+ }
+
+ private void renderIcon(ResponseWriter writer, String clazz) throws IOException {
+ writer.startElement(HTML.DIV_ELEM, null);
+ if (clazz != null) {
+ writer.writeAttribute(HTML.class_ATTRIBUTE, clazz, null);
+ }
+ writer.endElement(HTML.DIV_ELEM);
+ }
}
Modified: trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Grid.js
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Grid.js 2007-07-27 14:58:15 UTC (rev 1896)
+++ trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Grid.js 2007-07-27 15:01:42 UTC (rev 1897)
@@ -103,12 +103,12 @@
header.updateSize();
this.getBody().updateSize();
if(this.getFooter()) {this.getFooter().updateSize();}
- }
+ }
if(this.layout) {
this.layout.updateLayout();
}
-
+ header.updateLayout();
header.setFakeColumnWidth();
this.getBody().setFakeColumnWidth();
if(this.getFooter()) {this.getFooter().setFakeColumnWidth();}
Modified: trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader.js
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader.js 2007-07-27 14:58:15 UTC (rev 1896)
+++ trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader.js 2007-07-27 15:01:42 UTC (rev 1897)
@@ -169,6 +169,7 @@
sep.setStyle({cursor: 'auto'});
}
// sort icons
+ //columns[j].sortIcon = new ClientUI.common.box.Box(details[1], null, true);
//columns[j].sortDesc = new ClientUI.common.box.Box(details[1], null, true);
//columns[j].sortAsc = new ClientUI.common.box.Box(details[2], null, true);
j++;
@@ -216,6 +217,7 @@
sep.setStyle({cursor: 'auto'});
}
// sort icons
+ //columns[j].sortIcon = new ClientUI.common.box.Box(details[1], null, true);
//columns[j].sortDesc = new ClientUI.common.box.Box(details[1], null, true);
//columns[j].sortAsc = new ClientUI.common.box.Box(details[2], null, true);
}
@@ -241,7 +243,8 @@
_getCellElements: function(column) {
var details = new Array(3);
var clientId = this.grid.getElement().id;
- details[0] = document.getElementById(clientId + ":hsep_" + column);
+ details[0] = $(clientId + ":hsep_" + column);
+ details[1] = $(clientId + ":hs_" + column);
//details[1] = document.getElementById(clientId + ":hsortd_" + column);
//details[2] = document.getElementById(clientId + ":hsorta_" + column);
return details;
@@ -292,6 +295,7 @@
this.setHeight(this.defaultHeight);
this.setWidth(this.defaultWidth);
this.agjustSeparators();
+ this.updateHeaders();
},
updateLayout: function() {
if(!this.controlCreated || !this.grid.controlCreated) {
@@ -311,6 +315,7 @@
this.frozenContentBox.moveTo(0, 0);
this.headerFrozenRow.setHeight(height);
this.frozenSubstrate.setWidth(frozenContentWidth);
+ this.updateHeaders();
},
getColumns: function() {
return this._columns;
@@ -429,6 +434,26 @@
}
}
},
+
+ updateHeaders : function() {
+ var cols = this.getColumns();
+ for(var i = 0; i < cols.length; i++) {
+ var col = cols[i];
+ var th = col.object;
+ var icon = this._getCellElements(i)[1];
+
+ if (icon) {
+ var newPosX = th.getWidth() - icon.getWidth();
+ var newPosY = (th.getHeight() - icon.getHeight())/2;
+
+ newPosX = Math.floor(newPosX);
+ newPosY = Math.floor(newPosY);
+
+ icon.setStyle({left: newPosX + "px",top: newPosY + "px", visibility : "inherit"});
+ }
+ }
+ },
+
adjustColumnWidth: function(column, width) {
this._columns[column].col.width = width>0 ? width : 1;
if(width<=0) this.getColumns()[column].sep.hide();
Modified: trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-07-27 14:58:15 UTC (rev 1896)
+++ trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-07-27 15:01:42 UTC (rev 1897)
@@ -108,6 +108,7 @@
this.selectionManager.restoreState();
this.eventOnPostSort.fire(options.column, options.order);
}]);
+ this.updateLayout();
},
onScrollComplete : function(request, event, data){
var options = this.dataModel.getCurrentOptions();
Modified: trunk/sandbox/ui/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-27 14:58:15 UTC (rev 1896)
+++ trunk/sandbox/ui/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-27 15:01:42 UTC (rev 1897)
@@ -9,13 +9,13 @@
XPTable
*/
-<u:selector name=".dr-sgrid-hc .sort-asc">
+<u:selector name=".dr-sgrid-sort-asc">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/sort_asc.gif"/>
</u:style>
</u:selector>
-<u:selector name=".dr-sgrid-hc .sort-desc">
+<u:selector name=".dr-sgrid-sort-desc">
<u:style name="background-image">
<f:resource f:key="/org/richfaces/renderkit/html/images/sort_desc.gif"/>
</u:style>
@@ -30,7 +30,18 @@
<f:verbatim>
<![CDATA[
+.dr-sgrid-sort-asc, .dr-sgrid-sort-desc {
+ width: 16px;
+ height: 6px;
+ background-position: 50% 50%;
+ background-repeat: no-repeat;
+}
+.dr-sgrid-sort-icon {
+ position:absolute;
+ visibility: hidden;
+}
+
.dr-sgrid {
font: menu;
background-color: white;
Modified: trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-itself.jspx
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-itself.jspx 2007-07-27 14:58:15 UTC (rev 1896)
+++ trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-itself.jspx 2007-07-27 15:01:42 UTC (rev 1897)
@@ -7,19 +7,24 @@
xmlns:x=" http://ajax4jsf.org/cdk/x"
xmlns:h=" http://ajax4jsf.org/cdk/headers"
xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
-
+ baseclass="org.richfaces.renderkit.html.SortIconRenderer"
class="org.richfaces.renderkit.html.ScrollableGridHeaderItselfRenderer"
component="javax.faces.component.UIComponent"
>
<div id="#{client_id}:hcb_#{cell_index}" class="dr-sgrid-hcbody">
<vcp:body/>
- <c:if test="#{sortAscending}">
- <div align="right" id="#{client_id}:hsorta_#{cell_index}" class="sort-asc" />
- </c:if>
- <c:if test="#{sortDescending}">
- <div align="right" id="#{client_id}:hsortd_#{cell_index}" class="sort-desc" />
- </c:if>
+
+ <div align="right" id="#{client_id}:hs_#{cell_index}" class="dr-sgrid-sort-icon">
+ <c:if test="#{sortAscending}">
+ <f:call name="renderAscIcon"/>
+ </c:if>
+ <c:if test="#{sortDescending}">
+ <f:call name="renderDescIcon"/>
+ </c:if>
+ </div>
+
</div>
+<ajax:update>#{client_id}:hcb_#{cell_index}</ajax:update>
</f:root>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r1896 - trunk/sandbox/samples/calendar-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-07-27 10:58:15 -0400 (Fri, 27 Jul 2007)
New Revision: 1896
Modified:
trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
Log:
Template updating.
Added buttonLabel attribute.
Added onclick with calendar call.
update calendar-sample.
Modified: trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
===================================================================
--- trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-07-27 14:57:54 UTC (rev 1895)
+++ trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-07-27 14:58:15 UTC (rev 1896)
@@ -37,7 +37,8 @@
value="#{calendarBean.selectedDate}"
currentDate="#{calendarBean.currentDate}"
jointPoint="#{calendarBean.jointPoint}"
- direction="#{calendarBean.direction}">
+ direction="#{calendarBean.direction}"
+ buttonLabel="PopUp">
<f:validator validatorId="org.richfaces.CalendarValidator" />
@@ -87,8 +88,8 @@
<f:selectItem itemLabel="auto" itemValue="auto"/>
</h:selectOneRadio>
- <h:commandButton id="calendarPopup" type="button" value="popup" onclick="$(this.form.id+':calendar').component.doSwitch();"/>
- </h:panelGrid>
+ <%-- <h:commandButton id="calendarPopup" type="button" value="popup" onclick="$(this.form.id+':calendar').component.doSwitch();"/>
+ --%> </h:panelGrid>
<h:outputText value="Current date: "/>
<h:outputText value="#{calendarBean.currentDateAsText}" />
17 years, 5 months
JBoss Rich Faces SVN: r1895 - trunk/sandbox/ui/calendar/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-07-27 10:57:54 -0400 (Fri, 27 Jul 2007)
New Revision: 1895
Modified:
trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
Template updating.
Added buttonLabel attribute.
Added onclick with calendar call.
update calendar-sample.
Modified: trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-27 14:29:16 UTC (rev 1894)
+++ trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-27 14:57:54 UTC (rev 1895)
@@ -60,7 +60,9 @@
boolean popup = getUtils().isBooleanAttribute(component, "popup");
if (popup) {]]>
</jsp:scriptlet>
- <span> <input
+ <span
+ id="#{clientId}Popup"
+ > <input
x:passThruWithExclusions="name"
id="#{clientId}Input"
value="#{this:getInputValue(context,component)}"
@@ -76,13 +78,12 @@
size="#{component.attributes['inputSize']}"
style="#{component.attributes['style']}"
tabindex="#{component.attributes['tabindex']}"
- class="#{component.attributes['class']}"
onclick="#{component.attributes['onclick']}">
</input>
<button id="#{clientId}PopupButton"
accesskey="#{component.attributes['accesskey']}"
name="#{clientId}"
- onclick="#{component.attributes['onclick']}"
+ onclick="$(this.form.id+':calendar').component.doSwitch();"
style="#{component.attributes['style']}"
tabindex="#{component.attributes['tabindex']}"
17 years, 5 months
JBoss Rich Faces SVN: r1894 - in trunk/sandbox/ui/scrollable-grid/src: main/javascript/ClientUI/controls/grid and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2007-07-27 10:29:16 -0400 (Fri, 27 Jul 2007)
New Revision: 1894
Modified:
trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js
trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Selection.js
trunk/sandbox/ui/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cell.jspx
trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java
Log:
change name for CSS-classes
Modified: trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-07-27 14:15:05 UTC (rev 1893)
+++ trunk/sandbox/ui/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-07-27 14:29:16 UTC (rev 1894)
@@ -273,9 +273,9 @@
UIScrollableGrid grid = state.getGrid();
writer.startElement("td", grid);
writer.startElement("div", grid);
- getUtils().writeAttribute(writer, "class", "ClientUI_Grid_BCBody1");
+ getUtils().writeAttribute(writer, "class", "dr-sgrid-bcbody1");
writer.startElement("div", grid);
- getUtils().writeAttribute(writer, "class", "ClientUI_Grid_BCBody");
+ getUtils().writeAttribute(writer, "class", "dr-sgrid-bcbody");
String divId = client_id + ":bc_" + cell_id;
getUtils().writeAttribute(writer, "id", divId);
if(!state.isFake()) {
@@ -316,7 +316,7 @@
writer.startElement(HTML.TR_ELEMENT, grid);
state.setFrozenColumnCount(GridUtils.getFrozenColumnsCount(grid));
getUtils().writeAttribute(writer, "id",row_id);
- getUtils().writeAttribute(writer, "class","ClientUI_Grid_BR " + state.getRowClass(index));
+ getUtils().writeAttribute(writer, "class","dr-sgrid-rb " + state.getRowClass(index));
if (log.isDebugEnabled()) {
log.debug("rowIndex : " + index);
@@ -379,7 +379,7 @@
row_id = baseClientId + ":f:" + state.getRowIndex();
writer.startElement("tr", grid);
getUtils().writeAttribute(writer,"id",row_id);
- getUtils().writeAttribute(writer,"class", "ClientUI_Grid_BR");
+ getUtils().writeAttribute(writer,"class", "dr-sgrid-rb");
collection.add(row_id);
}else if(!state.isFrozenColumn() && !normalTRRendered){
@@ -393,7 +393,7 @@
writer.startElement("tr", grid);
getUtils().writeAttribute(writer,"id",row_id);
- getUtils().writeAttribute(writer,"class", "ClientUI_Grid_BR");
+ getUtils().writeAttribute(writer,"class", "dr-sgrid-rb");
normalTRRendered = true;
collection.add(row_id);
Modified: trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-07-27 14:15:05 UTC (rev 1893)
+++ trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-07-27 14:29:16 UTC (rev 1894)
@@ -704,7 +704,7 @@
tbl = this.templNormal.getElement().rows[row].cells;
}
- var cell = document.getElementsByClassName("ClientUI_Grid_BCBody", tbl[index]);
+ var cell = document.getElementsByClassName("dr-sgrid-bcbody", tbl[index]);
return (cell && cell.length && cell.length>0) ? cell[0].innerHTML : "";
},
ensureVisible: function (index) {
Modified: trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Selection.js
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Selection.js 2007-07-27 14:15:05 UTC (rev 1893)
+++ trunk/sandbox/ui/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Selection.js 2007-07-27 14:29:16 UTC (rev 1894)
@@ -268,8 +268,8 @@
while(j <= this.selection.ranges[i].indexes[1]) {
var fElement = $(this.prefix + ":f:" + j);
var nElement = $(this.prefix + ":n:" + j);
- Element.addClassName(fElement, "idg-row-selected-h");
- Element.addClassName(nElement, "idg-row-selected-h");
+ Element.addClassName(fElement, "dr-sgrid-row-selected");
+ Element.addClassName(nElement, "dr-sgrid-row-selected");
Element.addClassName(fElement, "Idg-row-selected");
Element.addClassName(nElement, "Idg-row-selected");
Element.addClassName(fElement, this.selectedClass);
@@ -477,8 +477,8 @@
this.selection.addId(rowIndex);
var fElement = $(this.prefix + ":f:" + rowIndex);
var nElement = $(this.prefix + ":n:" + rowIndex);
- Element.addClassName(fElement, "idg-row-selected-h");
- Element.addClassName(nElement, "idg-row-selected-h");
+ Element.addClassName(fElement, "dr-sgrid-row-selected");
+ Element.addClassName(nElement, "dr-sgrid-row-selected");
Element.addClassName(fElement, "Idg-row-selected");
Element.addClassName(nElement, "Idg-row-selected");
Element.addClassName(fElement, this.selectedClass);
@@ -489,8 +489,8 @@
this.selection.removeId(rowIndex);
var fElement = $(this.prefix + ":f:" + rowIndex);
var nElement = $(this.prefix + ":n:" + rowIndex);
- Element.removeClassName(fElement, "idg-row-selected-h");
- Element.removeClassName(nElement, "idg-row-selected-h");
+ Element.removeClassName(fElement, "dr-sgrid-row-selected");
+ Element.removeClassName(nElement, "dr-sgrid-row-selected");
Element.removeClassName(fElement, "Idg-row-selected");
Element.removeClassName(nElement, "Idg-row-selected");
Element.removeClassName(fElement, this.selectedClass);
@@ -502,8 +502,8 @@
if(this.activeRow != null) {
fElement = $(this.prefix + ":f:" + this.activeRow);
nElement = $(this.prefix + ":n:" + this.activeRow);
- Element.removeClassName(fElement, "idg-row-active-h");
- Element.removeClassName(nElement, "idg-row-active-h");
+ Element.removeClassName(fElement, "dr-sgrid-row-active");
+ Element.removeClassName(nElement, "dr-sgrid-row-active");
Element.removeClassName(fElement, "Idg-row-active");
Element.removeClassName(nElement, "Idg-row-active");
Element.removeClassName(fElement, this.activeClass);
@@ -511,8 +511,8 @@
}
fElement = $(this.prefix + ":f:" + rowIndex);
nElement = $(this.prefix + ":n:" + rowIndex);
- Element.addClassName(fElement, "idg-row-active-h");
- Element.addClassName(nElement, "idg-row-active-h");
+ Element.addClassName(fElement, "dr-sgrid-row-active");
+ Element.addClassName(nElement, "dr-sgrid-row-active");
Element.addClassName(fElement, "Idg-row-active");
Element.addClassName(nElement, "Idg-row-active");
Element.addClassName(fElement, this.activeClass);
Modified: trunk/sandbox/ui/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-27 14:15:05 UTC (rev 1893)
+++ trunk/sandbox/ui/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-27 14:29:16 UTC (rev 1894)
@@ -210,40 +210,28 @@
/**
* Body row style
*/
-.ClientUI_Grid_HO {
+.dr-sgrid-ho {
position: absolute;
height: 10px;
width: 10px;
}
-.ClientUI_Grid_BR {
+.dr-sgrid-rb {
font: normal 8pt arial;
white-space: nowrap;
box-sizing: border-box;
-moz-box-sizing: border-box;
}
-.idg-row-selected-h {
+.dr-sgrid-row-selected {
background-color: #DDDDFF;
}
-.idg-row-active-h {
+.dr-sgrid-row-active {
color : #0000AA;
}
-.ClientUI_Grid_BROdd {
- background-color: #FFFFFF;
- font: normal 8pt arial;
- z-index:2;
-}
-
-.ClientUI_Grid_BREven {
- background-color: #fcfaf6;
- font: normal 8pt arial;
- z-index:2;
-}
-
-.ClientUI_Grid_BCBody {
+.dr-sgrid-bcbody {
cursor: default;
font: normal 8pt arial;
white-space: nowrap;
@@ -262,7 +250,7 @@
/**
* Helper classes for grid template
*/
-.ClientUI_Substrate {
+.dr-sgrid-substrate {
z-index: 48;
filter:Alpha(opacity=0);
position:absolute;
@@ -271,30 +259,16 @@
display:block;
}
-.ClientUI_TmplBox {
+.dr-sgrid-tmplbox {
display: block;
float:left;
}
-.ClientUI_InlineBox {
+.dr-sgrid-inlinebox {
position: relative;
display: block;
overflow: hidden;
}
-
-.FirstClolumn {
- font-weight: bold;
- color: blue;
-}
-
-.RowIndexCell {
- background-color: #ebeadb;
- padding: 0 0 0 0;
- margin: 0 0 0 0;
- font: normal 8pt arial;
- border-bottom: 1px solid #cbc7b8;
- border-right: 1px solid #cbc7b8;
-}
]]>
</f:verbatim>
</f:template>
\ No newline at end of file
Modified: trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cell.jspx
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cell.jspx 2007-07-27 14:15:05 UTC (rev 1893)
+++ trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cell.jspx 2007-07-27 14:29:16 UTC (rev 1894)
@@ -12,7 +12,7 @@
>
<td class="dr-sgrid-bc Idg-column-cell #{component.attributes['styleClass']}" id="#{client_id}:c_#{cell_id}">
- <div id="#{client_id}:bc_#{cell_id}" class="ClientUI_Grid_BCBody #{component.attributes['cellClass']}" style="#{component.attributes['cellStyle']}">
+ <div id="#{client_id}:bc_#{cell_id}" class="dr-sgrid-bcbody #{component.attributes['cellClass']}" style="#{component.attributes['cellStyle']}">
<vcp:body/>
</div>
</td>
Modified: trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-07-27 14:15:05 UTC (rev 1893)
+++ trunk/sandbox/ui/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid.jspx 2007-07-27 14:29:16 UTC (rev 1894)
@@ -68,10 +68,10 @@
<div id="#{clientId}" style="width: #{component.attributes['width']};height: #{component.attributes['height']};" class="dr-sgrid #{component.attributes['styleClass']}" >
<div id="#{clientId}:cs" class="dr-sgrid-hsplit" />
- <div id="#{clientId}_GridHeaderTemplate" class="ClientUI_InlineBox" style="#{hStyle}; width: #{component.attributes['width']};">
- <iframe id="#{clientId}:hs" class="ClientUI_Substrate" src="" scrolling="no" frameborder="0" > <br/> </iframe>
+ <div id="#{clientId}_GridHeaderTemplate" class="dr-sgrid-inlinebox" style="#{hStyle}; width: #{component.attributes['width']};">
+ <iframe id="#{clientId}:hs" class="dr-sgrid-substrate" src="" scrolling="no" frameborder="0" > <br/> </iframe>
<div style="display: block; left: 0px; top: 0px; width: #{sumWidth}px;">
- <span class="ClientUI_TmplBox dr-sgrid-fb" id="#{clientId}:header:FrozenBox">
+ <span class="dr-sgrid-tmplbox dr-sgrid-fb" id="#{clientId}:header:FrozenBox">
<table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
<jsp:scriptlet>
@@ -92,7 +92,7 @@
</table>
</span>
- <span class="ClientUI_TmplBox dr-sgrid-nb" id="#{clientId}:header:NormalBox">
+ <span class="dr-sgrid-tmplbox dr-sgrid-nb" id="#{clientId}:header:NormalBox">
<table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
<jsp:scriptlet>
@@ -118,12 +118,12 @@
- <div id="#{clientId}_GridBodyTemplate" class="ClientUI_InlineBox" style="overflow: auto; width: #{component.attributes['width']}; height: #{component.attributes['height']};">
+ <div id="#{clientId}_GridBodyTemplate" class="dr-sgrid-inlinebox" style="overflow: auto; width: #{component.attributes['width']}; height: #{component.attributes['height']};">
<div id="#{clientId}:scb" style="position: absolute; z-index: 0;">
<div id="#{clientId}:sb" style="position: absolute;" ><br/> </div>
</div>
<div id="#{clientId}:bc" style="display: block; width: #{sumWidth}px;">
- <span class="ClientUI_TmplBox dr-sgrid-fb" id="#{clientId}:body:FrozenBox">
+ <span class="dr-sgrid-tmplbox dr-sgrid-fb" id="#{clientId}:body:FrozenBox">
<table id="#{clientId}:f" cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
<jsp:scriptlet>
@@ -139,9 +139,9 @@
</jsp:scriptlet>
</tbody>
</table>
- <span class="ClientUI_Grid_HO" id="#{clientId}:fho" ><br/></span>
+ <span class="dr-sgrid-ho" id="#{clientId}:fho" ><br/></span>
</span>
- <span class="ClientUI_TmplBox dr-sgrid-nb" id="#{clientId}:body:NormalBox">
+ <span class="dr-sgrid-tmplbox dr-sgrid-nb" id="#{clientId}:body:NormalBox">
<table id="#{clientId}:n" cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
<jsp:scriptlet>
@@ -158,15 +158,15 @@
</jsp:scriptlet>
</tbody>
</table>
- <span class="ClientUI_Grid_HO" id="#{clientId}:nho" ><br/></span>
+ <span class="dr-sgrid-ho" id="#{clientId}:nho" ><br/></span>
</span>
</div>
</div>
- <div id="#{clientId}_GridFooterTemplate" class="ClientUI_InlineBox" style="#{fStyle}; width: #{component.attributes['width']};">
- <iframe id="#{clientId}:fs" class="ClientUI_Substrate" src="" scrolling="no" frameborder="0" > <br/></iframe>
+ <div id="#{clientId}_GridFooterTemplate" class="dr-sgrid-inlinebox" style="#{fStyle}; width: #{component.attributes['width']};">
+ <iframe id="#{clientId}:fs" class="dr-sgrid-substrate" src="" scrolling="no" frameborder="0" > <br/></iframe>
<div style="display: block; width: width: #{sumWidth}px;">
- <span class="ClientUI_TmplBox dr-sgrid-fb" id="#{clientId}:footer:FrozenBox">
+ <span class="dr-sgrid-tmplbox dr-sgrid-fb" id="#{clientId}:footer:FrozenBox">
<table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
<jsp:scriptlet>
@@ -186,7 +186,7 @@
</table>
</span>
- <span class="ClientUI_TmplBox dr-sgrid-nb" id="#{clientId}:footer:NormalBox">
+ <span class="dr-sgrid-tmplbox dr-sgrid-nb" id="#{clientId}:footer:NormalBox">
<table cellpadding="0" cellspacing="0" style="border-collapse:collapse; table-layout:fixed">
<jsp:scriptlet>
Modified: trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java
===================================================================
--- trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java 2007-07-27 14:15:05 UTC (rev 1893)
+++ trunk/sandbox/ui/scrollable-grid/src/test/java/org/richfaces/renderkit/html/ScrollableGridRendererTest.java 2007-07-27 14:29:16 UTC (rev 1894)
@@ -153,7 +153,7 @@
String elemClassAttr = elem.getAttributeValue("class");
res = false;
- if(elemClassAttr.contains("ClientUI_InlineBox")){
+ if(elemClassAttr.contains("dr-sgrid-inlinebox")){
res = true;
}else if(elemClassAttr.contains("dr-sgrid-hsplit")){
res = true;
@@ -205,9 +205,9 @@
assertNotNull(elemClassAttr);
if(element.getId().contains("FrozenBox")){
- assertTrue(elemClassAttr.contains("ClientUI_TmplBox dr-sgrid-fb"));
+ assertTrue(elemClassAttr.contains("dr-sgrid-tmplbox dr-sgrid-fb"));
}else if(element.getId().contains("NormalBox")){
- assertTrue(elemClassAttr.contains("ClientUI_TmplBox dr-sgrid-nb"));
+ assertTrue(elemClassAttr.contains("dr-sgrid-tmplbox dr-sgrid-nb"));
}
17 years, 5 months
JBoss Rich Faces SVN: r1893 - in trunk/ui/tooltip/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-27 10:15:05 -0400 (Fri, 27 Jul 2007)
New Revision: 1893
Modified:
trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx
Log:
optimization tooltip content displaying
Modified: trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
--- trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-07-27 13:37:10 UTC (rev 1892)
+++ trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-07-27 14:15:05 UTC (rev 1893)
@@ -17,6 +17,7 @@
import org.ajax4jsf.framework.util.javascript.JSFunctionDefinition;
import org.ajax4jsf.framework.util.javascript.JSReference;
*/
+import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
@@ -269,8 +270,18 @@
ResponseWriter responseWriter = context.getResponseWriter();
responseWriter.startElement(component.getUsedElementType(), component);
responseWriter.writeAttribute("id", component.getClientId(context) + "content", null);
- responseWriter.write(component.getValue() != null ? component.getValue() : "");
- super.renderChildren(context, component);
+ if("ajax".equals(component.getMode())){
+ // we want to avoid rendering toolTip content during initialy page displaying
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
+ if(ajaxContext != null && ajaxContext.getAjaxAreasToRender().contains(component.getClientId(context) + "content")){
+ responseWriter.write(component.getValue() != null ? component.getValue() : "");
+ super.renderChildren(context, component);
+ }
+ } else {
+ // client mode
+ responseWriter.write(component.getValue() != null ? component.getValue() : "");
+ super.renderChildren(context, component);
+ }
responseWriter.endElement(component.getUsedElementType());
}
Modified: trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
===================================================================
--- trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2007-07-27 13:37:10 UTC (rev 1892)
+++ trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2007-07-27 14:15:05 UTC (rev 1893)
@@ -24,9 +24,16 @@
<f:clientid var="clientId"/>
<span id="#{clientId}" style="position: absolute; display : none;z-index:#{component.attributes['zorder']}; #{component.attributes['style']}" class="dr-rich-tool-tip rich-tool-tip #{component.attributes['styleClass']}">
<f:call name="utils.encodePassThru" />
- <span id="#{clientId}defaultContent" style="display:none">
- <u:insertFacet name="defaultContent" />
- </span>
+ <jsp:scriptlet>
+ <![CDATA[if("ajax".equals(component.getMode()) && component.getFacet("defaultContent")!=null) {]]>
+ </jsp:scriptlet>
+ <span id="#{clientId}defaultContent" style="display:none">
+ <u:insertFacet name="defaultContent" />
+ </span>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
+
<vcp:body>
<f:call name="encodeTooltipText"/>
</vcp:body>
Modified: trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx
===================================================================
--- trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx 2007-07-27 13:37:10 UTC (rev 1892)
+++ trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx 2007-07-27 14:15:05 UTC (rev 1893)
@@ -24,9 +24,16 @@
<f:clientid var="clientId"/>
<div id="#{clientId}" style="position: absolute; display : none;z-index:#{component.attributes['zorder']}; #{component.attributes['style']}" class="dr-rich-tool-tip rich-tool-tip #{component.attributes['styleClass']}">
<f:call name="utils.encodePassThru" />
- <div id="#{clientId}defaultContent" style="display:none">
- <u:insertFacet name="defaultContent" />
- </div>
+ <jsp:scriptlet>
+ <![CDATA[if("ajax".equals(component.getMode()) && component.getFacet("defaultContent")!=null) {]]>
+ </jsp:scriptlet>
+ <div id="#{clientId}defaultContent" style="display:none">
+ <u:insertFacet name="defaultContent" />
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
+
<vcp:body>
<f:call name="encodeTooltipText"/>
</vcp:body>
17 years, 5 months
JBoss Rich Faces SVN: r1892 - trunk/ui/panelmenu/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-27 09:37:10 -0400 (Fri, 27 Jul 2007)
New Revision: 1892
Modified:
trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx
Log:
width bugfix
Modified: trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx
===================================================================
--- trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx 2007-07-27 13:34:47 UTC (rev 1891)
+++ trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx 2007-07-27 13:37:10 UTC (rev 1892)
@@ -24,8 +24,8 @@
<f:clientid var="clientId"/>
<f:call name="utils.encodeBeginFormIfNessesary"/>
- <div style="#{component.style};" class="#{component.styleClass}"
- id="#{clientId}" width="#{component.width}"
+ <div style="width:#{component.width}; #{component.style};" class="#{component.styleClass}"
+ id="#{clientId}"
onclick="#{component.onclick}"
ondblclick="#{component.ondblclick}"
onmousemove="#{component.onmousemove}"
17 years, 5 months
JBoss Rich Faces SVN: r1891 - trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-07-27 09:34:47 -0400 (Fri, 27 Jul 2007)
New Revision: 1891
Modified:
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
http://jira.jboss.com/jira/browse/RF-450
Modified: trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-07-27 13:26:56 UTC (rev 1890)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-07-27 13:34:47 UTC (rev 1891)
@@ -184,9 +184,8 @@
},
hideNLabel: function(event) {
- var TRs = document.getElementsByClassName("dr-sb-int", this.update);
- var nothingLabel = TRs[TRs.length - 1];
- if (/NothingLabel/.test(nothingLabel.id)) {
+ var nothingLabel = $(this.update.id + "NothingLabel");
+ if (nothingLabel) {
Element.hide(nothingLabel);
Event.stopObserving(nothingLabel, "click", this.onNothingLabelClick);
this.hide();
@@ -489,8 +488,11 @@
this.active = true;
}
} else {
- this.active = false;
- this.hide();
+ var nothingLabel = $(this.update.id + "NothingLabel");
+ if (!nothingLabel || 'none' == nothingLabel.style.display) {
+ this.active = false;
+ this.hide();
+ }
}
},
@@ -612,18 +614,18 @@
scroll.scrollLeft = -1;
this.index = 0;
this.prevIndex = -1;
- this.render();
- }
-
- var TRs = document.getElementsByClassName("dr-sb-int", this.update);
- var nothingLabel = TRs[TRs.length - 1];
- if (/NothingLabel/.test(nothingLabel.id)) {
+
+ var nothingLabel = $(this.update.id + "NothingLabel");
+ if (nothingLabel) {
if (this.entryCount < 1) {
Element.show(nothingLabel);
- Event.observe(nothingLabel, "click", this.onNothingLabelClick);
- this.show();
+ Event.observe(nothingLabel, "click", this.onNothingLabelClick);
+ this.show();
}
}
+
+ this.render();
+ }
},
addObservers: function(element) {
17 years, 5 months
JBoss Rich Faces SVN: r1890 - in trunk/cdk/generator/src/main: java/org/ajax4jsf/templatecompiler/elements/vcp and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-07-27 09:26:56 -0400 (Fri, 27 Jul 2007)
New Revision: 1890
Added:
trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java
trunk/cdk/generator/src/main/resources/META-INF/templates/templatecompiler/ajaxRenderedArea.vm
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/A4JRendererElementsFactory.java
Log:
added ajaxrendered area tag
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/A4JRendererElementsFactory.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/A4JRendererElementsFactory.java 2007-07-27 13:00:13 UTC (rev 1889)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/A4JRendererElementsFactory.java 2007-07-27 13:26:56 UTC (rev 1890)
@@ -30,6 +30,7 @@
import org.ajax4jsf.templatecompiler.elements.html.CommentElement;
import org.ajax4jsf.templatecompiler.elements.html.PIElement;
import org.ajax4jsf.templatecompiler.elements.html.TextElement;
+import org.ajax4jsf.templatecompiler.elements.vcp.AjaxRenderedAreaElement;
import org.ajax4jsf.templatecompiler.elements.vcp.HeaderScriptsElement;
import org.ajax4jsf.templatecompiler.elements.vcp.HeaderStylesElement;
import org.w3c.dom.Node;
@@ -102,6 +103,7 @@
mapClasses.put("f:template", RootElement.class.getName());
mapClasses.put("f:root", RootElement.class.getName());
mapClasses.put("jsp:root", RootElement.class.getName());
+ mapClasses.put("ajax:update", AjaxRenderedAreaElement.class.getName());
}
/* (non-Javadoc)
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/AjaxRenderedAreaElement.java 2007-07-27 13:26:56 UTC (rev 1890)
@@ -0,0 +1,60 @@
+/**
+ *
+ */
+package org.ajax4jsf.templatecompiler.elements.vcp;
+
+import org.ajax4jsf.templatecompiler.builder.CompilationContext;
+import org.ajax4jsf.templatecompiler.builder.CompilationException;
+import org.ajax4jsf.templatecompiler.el.ELParser;
+import org.ajax4jsf.templatecompiler.elements.A4JRendererElementsFactory;
+import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
+import org.apache.velocity.VelocityContext;
+import org.w3c.dom.Node;
+
+/**
+ * Add comma separated list of ids to Ajax Context's rendered areas collection.
+ * @author Maksim Kaszynski
+ *
+ */
+public class AjaxRenderedAreaElement extends TemplateElementBase {
+
+ private static final String TEMPLATE = A4JRendererElementsFactory.TEMPLATES_TEMPLATECOMPILER_PATH+"/ajaxRenderedArea.vm";
+
+ private String values;
+
+ public AjaxRenderedAreaElement(Node element,
+ CompilationContext componentBean) {
+ super(element, componentBean);
+ values = ELParser.compileEL(element.getTextContent(), this.getComponentBean());
+ componentBean.addToImport("org.ajax4jsf.context.AjaxContext");
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getBeginElement()
+ */
+ public String getBeginElement() throws CompilationException {
+
+ VelocityContext context = new VelocityContext();
+ context.put("areas", this.values);
+ return this.getComponentBean().processTemplate(getTemplateName(), context);
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.templatecompiler.elements.TemplateElement#getEndElement()
+ */
+ public String getEndElement() throws CompilationException {
+
+ return null;
+ }
+
+ protected String getTemplateName() {
+ return TEMPLATE;
+ }
+
+ @Override
+ public boolean isSkipBody() {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+}
Added: trunk/cdk/generator/src/main/resources/META-INF/templates/templatecompiler/ajaxRenderedArea.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates/templatecompiler/ajaxRenderedArea.vm (rev 0)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates/templatecompiler/ajaxRenderedArea.vm 2007-07-27 13:26:56 UTC (rev 1890)
@@ -0,0 +1,13 @@
+#if($areas)
+ {
+ //Auto-generated block.
+ //Add to ajax context list of element ids passed as *areas* param
+ String [] _areas = (${areas}).split(",\" ");
+ AjaxContext _ajaxContext = AjaxContext.getCurrentInstance(context);
+ if (_ajaxContext.isAjaxRequest()) {
+ for (int _i = 0; _i < _areas.length; _i++) {
+ _ajaxContext.addRenderedArea(_areas[_i]);
+ }
+ }
+ }
+#end
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r1889 - in trunk/sandbox/ui/calendar/src/main: java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-07-27 09:00:13 -0400 (Fri, 27 Jul 2007)
New Revision: 1889
Modified:
trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
Modified: trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml 2007-07-27 12:43:31 UTC (rev 1888)
+++ trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml 2007-07-27 13:00:13 UTC (rev 1889)
@@ -131,5 +131,11 @@
<classname>java.lang.Object</classname>
<description></description>
</property>
+ <property>
+ <name>buttonLabel</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue>"popupButton"</defaultvalue>
+ </property>
</component>
</components>
Modified: trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-27 12:43:31 UTC (rev 1888)
+++ trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-27 13:00:13 UTC (rev 1889)
@@ -121,9 +121,13 @@
public abstract boolean isPopup();
- public abstract void setPopup(boolean direction);
+ public abstract void setPopup(boolean popup);
+ public abstract String getButtonLabel();
+ public abstract void setButtonLabel(String buttonLabel);
+
+
// currentDate processing -------------------------------------------------
public String getValueAsString(FacesContext context, UIComponent component)
Modified: trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-27 12:43:31 UTC (rev 1888)
+++ trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-27 13:00:13 UTC (rev 1889)
@@ -83,10 +83,11 @@
accesskey="#{component.attributes['accesskey']}"
name="#{clientId}"
onclick="#{component.attributes['onclick']}"
- value="#{component.attributes['value']}"
+
style="#{component.attributes['style']}"
tabindex="#{component.attributes['tabindex']}"
type="button">
+ #{component.attributes['buttonLabel']}
</button>
</span>
<jsp:scriptlet>
17 years, 5 months
JBoss Rich Faces SVN: r1888 - trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-27 08:43:31 -0400 (Fri, 27 Jul 2007)
New Revision: 1888
Modified:
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java
Log:
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java 2007-07-27 12:42:18 UTC (rev 1887)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java 2007-07-27 12:43:31 UTC (rev 1888)
@@ -16,6 +16,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+/**
+ * @author Anton Belevich
+ *
+ */
public abstract class RichMessageBaseRenderer extends HeaderResourcesRendererBase{
protected static final Log log = LogFactory.getLog(RichMessageHtmlBaseRenderer.class);
17 years, 5 months