JBoss Rich Faces SVN: r482 - trunk/richfaces/dataTable/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-04-23 10:35:24 -0400 (Mon, 23 Apr 2007)
New Revision: 482
Modified:
trunk/richfaces/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss
Log:
were added border-collapse: collapse for dr-table and empty-cells: show for dr-table-cell
Modified: trunk/richfaces/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss
===================================================================
--- trunk/richfaces/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss 2007-04-23 14:20:36 UTC (rev 481)
+++ trunk/richfaces/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss 2007-04-23 14:35:24 UTC (rev 482)
@@ -10,6 +10,7 @@
<f:verbatim skin="tableBorderColor" />
</u:style>
<u:style name="background-color" skin="tableBackgroundColor" /> <!--tableBackgroundColor-->
+ <u:style name="border-collapse" value="collapse" />
</u:selector>
<u:selector name=".dr-table-cell" >
@@ -23,6 +24,7 @@
<u:style name="font-size" skin="generalSizeFont"/> <!--generalSizeFont-->
<u:style name="color" skin="generalTextColor"/> <!--generalTextColor-->
<u:style name="font-family" skin="generalFamilyFont"/> <!--generalFamilyFont-->
+ <u:style name="empty-cells" value="show"/>
</u:selector>
<u:selector name=".dr-subtable-cell" >
19 years
JBoss Rich Faces SVN: r481 - trunk/richfaces/dataTable/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: vkukharchuk
Date: 2007-04-23 10:20:36 -0400 (Mon, 23 Apr 2007)
New Revision: 481
Modified:
trunk/richfaces/dataTable/src/main/config/component/dataTable.xml
Log:
Modified: trunk/richfaces/dataTable/src/main/config/component/dataTable.xml
===================================================================
--- trunk/richfaces/dataTable/src/main/config/component/dataTable.xml 2007-04-23 14:17:36 UTC (rev 480)
+++ trunk/richfaces/dataTable/src/main/config/component/dataTable.xml 2007-04-23 14:20:36 UTC (rev 481)
@@ -52,6 +52,7 @@
<property>
<name>cellpadding</name>
<classname>java.lang.String</classname>
+ <description>This attribute specifies the amount of space between the border of the cell and its contents.</description>
<defaultvalue>"0"</defaultvalue>
</property>
<property>
19 years
JBoss Rich Faces SVN: r480 - trunk/richfaces/dataTable/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: vkukharchuk
Date: 2007-04-23 10:17:36 -0400 (Mon, 23 Apr 2007)
New Revision: 480
Modified:
trunk/richfaces/dataTable/src/main/config/component/dataGrid.xml
Log:
Modified: trunk/richfaces/dataTable/src/main/config/component/dataGrid.xml
===================================================================
--- trunk/richfaces/dataTable/src/main/config/component/dataGrid.xml 2007-04-23 13:42:24 UTC (rev 479)
+++ trunk/richfaces/dataTable/src/main/config/component/dataGrid.xml 2007-04-23 14:17:36 UTC (rev 480)
@@ -61,6 +61,7 @@
<property>
<name>cellpadding</name>
<classname>java.lang.String</classname>
+ <description>This attribute specifies the amount of space between the border of the cell and its contents.</description>
<defaultvalue>"0"</defaultvalue>
</property>
<property>
19 years
JBoss Rich Faces SVN: r479 - trunk/docs/userguide/en/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkukharchuk
Date: 2007-04-23 09:42:24 -0400 (Mon, 23 Apr 2007)
New Revision: 479
Modified:
trunk/docs/userguide/en/modules/RFCtechreqs.xml
Log:
Modified: trunk/docs/userguide/en/modules/RFCtechreqs.xml
===================================================================
--- trunk/docs/userguide/en/modules/RFCtechreqs.xml 2007-04-22 22:43:58 UTC (rev 478)
+++ trunk/docs/userguide/en/modules/RFCtechreqs.xml 2007-04-23 13:42:24 UTC (rev 479)
@@ -129,9 +129,9 @@
<itemizedlist>
<listitem>Internet Explorer 5.0 - 7.0</listitem>
- <listitem>Firefox 1.0 - 2.0</listitem>
+ <listitem>Firefox 1.5 - 2.0</listitem>
- <listitem>Opera 8.0 - 9.0</listitem>
+ <listitem>Opera 8.5 - 9.0</listitem>
<listitem>Netscape 7.0</listitem>
19 years
JBoss Rich Faces SVN: r478 - trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-04-22 18:43:58 -0400 (Sun, 22 Apr 2007)
New Revision: 478
Modified:
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
getAttributeNS() return string value, not attribute instance
Modified: trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-04-22 22:20:28 UTC (rev 477)
+++ trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-04-22 22:43:58 UTC (rev 478)
@@ -77,7 +77,7 @@
if (element.getAttributeNS) {
var attr = element.getAttributeNS('http://richfaces.ajax4jsf.org/rich', name);
if (attr) {
- return attr.nodeValue;
+ return attr;
}
}
19 years
JBoss Rich Faces SVN: r477 - trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-04-22 18:20:28 -0400 (Sun, 22 Apr 2007)
New Revision: 477
Modified:
trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java
Log:
Code updated to comply with http://jira.jboss.com/jira/browse/RF-84 (lazy initialization for helper renderers introduced)
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java 2007-04-22 22:20:24 UTC (rev 476)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java 2007-04-22 22:20:28 UTC (rev 477)
@@ -68,20 +68,26 @@
FACETS_PREDEFINED.add(MULTI);
}
- private Renderer dragIndicatorViewRenderer;
+ private Renderer dragIndicatorViewRenderer = null;
+
+ private synchronized Renderer getViewRenderer() {
+ if (dragIndicatorViewRenderer == null) {
+ try {
+ dragIndicatorViewRenderer = (Renderer) Class.forName("org.richfaces.renderkit.html.DragIndicatorViewRenderer").newInstance();
+ } catch (InstantiationException e) {
+ throw new FacesException(e);
+ } catch (IllegalAccessException e) {
+ throw new FacesException(e);
+ } catch (ClassNotFoundException e) {
+ throw new FacesException(e);
+ }
+ }
+ return dragIndicatorViewRenderer;
+ }
+
public DragIndicatorRendererBase() {
super();
-
- try {
- dragIndicatorViewRenderer = (Renderer) Class.forName("org.richfaces.renderkit.html.DragIndicatorViewRenderer").newInstance();
- } catch (InstantiationException e) {
- throw new FacesException(e);
- } catch (IllegalAccessException e) {
- throw new FacesException(e);
- } catch (ClassNotFoundException e) {
- throw new FacesException(e);
- }
}
/* (non-Javadoc)
@@ -159,8 +165,8 @@
renderChild(context, facet);
} else {
- dragIndicatorViewRenderer.encodeBegin(context, component);
- dragIndicatorViewRenderer.encodeEnd(context, component);
+ getViewRenderer().encodeBegin(context, component);
+ getViewRenderer().encodeEnd(context, component);
context.getResponseWriter().flush();
}
19 years
JBoss Rich Faces SVN: r476 - trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-04-22 18:20:24 -0400 (Sun, 22 Apr 2007)
New Revision: 476
Modified:
trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/TabRendererBase.java
Log:
Code updated to comply with http://jira.jboss.com/jira/browse/RF-84 (lazy initialization for helper renderers introduced)
Modified: trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/TabRendererBase.java
===================================================================
--- trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/TabRendererBase.java 2007-04-22 21:07:41 UTC (rev 475)
+++ trunk/richfaces/tabPanel/src/main/java/org/richfaces/renderkit/TabRendererBase.java 2007-04-22 22:20:24 UTC (rev 476)
@@ -40,19 +40,25 @@
public class TabRendererBase extends RendererBase implements TabEncoder {
private RendererBase tabHeaderRenderer;
+ private synchronized RendererBase getHeaderRenderer() {
+ if (tabHeaderRenderer == null) {
+ Package pkg = this.getClass().getPackage();
+ try {
+ tabHeaderRenderer = (RendererBase) Class.forName(pkg.getName() + ".TabHeaderRenderer").newInstance();
+ } catch (InstantiationException e) {
+ throw new FacesException(e);
+ } catch (IllegalAccessException e) {
+ throw new FacesException(e);
+ } catch (ClassNotFoundException e) {
+ throw new FacesException(e);
+ }
+ }
+
+ return tabHeaderRenderer;
+ }
+
public TabRendererBase() {
super();
-
- Package pkg = this.getClass().getPackage();
- try {
- tabHeaderRenderer = (RendererBase) Class.forName(pkg.getName() + ".TabHeaderRenderer").newInstance();
- } catch (InstantiationException e) {
- throw new FacesException(e);
- } catch (IllegalAccessException e) {
- throw new FacesException(e);
- } catch (ClassNotFoundException e) {
- throw new FacesException(e);
- }
}
/**
@@ -64,8 +70,8 @@
* @throws IOException
*/
public void encodeTab(FacesContext context, UITab tab, boolean active) throws IOException {
- tabHeaderRenderer.encodeBegin(context, tab);
- tabHeaderRenderer.encodeEnd(context, tab);
+ getHeaderRenderer().encodeBegin(context, tab);
+ getHeaderRenderer().encodeEnd(context, tab);
}
public String getTabDisplay(FacesContext context, UITab tab) {
19 years
JBoss Rich Faces SVN: r475 - trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-04-22 17:07:41 -0400 (Sun, 22 Apr 2007)
New Revision: 475
Modified:
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
Log:
Debug code commented
Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-04-21 13:59:11 UTC (rev 474)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-04-22 21:07:41 UTC (rev 475)
@@ -196,6 +196,7 @@
toggleSelection: function(e) {
this.tree.deselectAll();
+ /*
var attr = this.elements.text.attributes;
var s = "";
for (var i = 0; i < attr.length; i++) {
@@ -203,10 +204,9 @@
}
alert(s);
+ */
var sClass = Richfaces.getNSAttribute("selectedclass", this.elements.text);
- alert(sClass);
-
if (sClass) {
var classNames = sClass.split(' ')
19 years
JBoss Rich Faces SVN: r474 - trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-04-21 09:59:11 -0400 (Sat, 21 Apr 2007)
New Revision: 474
Modified:
trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example1.jsp
trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example10.jsp
trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example2.jsp
trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example3.jsp
trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/main.jsp
Log:
update
Modified: trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example1.jsp
===================================================================
--- trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example1.jsp 2007-04-20 20:01:56 UTC (rev 473)
+++ trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example1.jsp 2007-04-21 13:59:11 UTC (rev 474)
@@ -51,8 +51,16 @@
</h:outputText>
</h:column>
</rich:dataTable>
-
<h:form>
+ <rich:separator lineType="dashed" height="1" style="padding-top:20px" />
+ <h:outputText value="Source Code:" />
+ <h:outputLink value="http://anonsvn.jboss.org/repos/richfaces/trunk/richfaces-samples/richface...">
+ <h:outputText value="Page" />
+ </h:outputLink>
+ <h:outputLink value="http://anonsvn.jboss.org/repos/richfaces/trunk/richfaces-samples/richface...">
+ <h:outputText value="Project" />
+ </h:outputLink>
+ <rich:separator lineType="dashed" height="1" style="padding-top:20px" />
<h:commandLink value="back to example list" action="main"></h:commandLink>
</h:form>
</f:view>
Modified: trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example10.jsp
===================================================================
--- trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example10.jsp 2007-04-20 20:01:56 UTC (rev 473)
+++ trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example10.jsp 2007-04-21 13:59:11 UTC (rev 474)
@@ -13,7 +13,7 @@
<body>
<f:view>
-
+
<h:form id="form">
<rich:dataTable value="#{salesReport.items}" var="item">
<f:facet name="header">
@@ -39,6 +39,7 @@
<h:inputText value="#{item.proposedPrice}" size="7">
<a4j:support event="onchange" reRender="margin" />
</h:inputText>
+
</h:column>
<h:column>
<h:outputText value="#{item.salesCost}" />
@@ -56,22 +57,39 @@
</a4j:outputPanel>
</h:form>
+
+
<h:form id="form1">
- <f:verbatim><table></f:verbatim>
+ <f:verbatim><table class="dr-table rich-table" id="form1:_id0" border="0" cellpadding="0" cellspacing="0">
+ <colgroup span="4"></colgroup>
+<thead><tr class="dr-table-header rich-table-header"><td id="form:_id0:_id2" class="dr-table-headercell rich-table-headercell">Product Code</td><td id="form:_id0:_id4" class="dr-table-headercell rich-table-headercell">Proposed Price</td><td id="form:_id0:_id6" class="dr-table-headercell rich-table-headercell">Sales Cost</td><td id="form:_id0:_id8" class="dr-table-headercell rich-table-headercell">Proposed Gross Margin</td></tr></thead><tbody>
+ </f:verbatim>
<a4j:repeat id="rep" value="#{salesReport.items}" var="item">
- <f:verbatim><tr><td></f:verbatim>
+ <f:verbatim><tr class="dr-table-firstrow rich-table-firstrow">
+ <td id="form1:_id0:0:_id10" class="dr-table-cell rich-table-cell">
+ </f:verbatim>
+
+ <h:outputText value="#{item.productCode}" />
+
+ <f:verbatim></td><td id="form1:_id0:0:_id12" class="dr-table-cell rich-table-cell"></f:verbatim>
<h:inputText value="#{item.proposedPrice}" size="7">
- <a4j:support event="onchange" reRender="margin1" />
+ <a4j:support event="onchange" ajaxSingle="true" reRender="margin1" />
</h:inputText>
- <f:verbatim></td><td></f:verbatim>
+ <f:verbatim></td>
+ <td id="form1:_id0:0:_id16" class="dr-table-cell rich-table-cell">
+ </f:verbatim>
+ <h:outputText value="#{item.salesCost}" />
+ <f:verbatim></td><td id="form:_id0:0:_id12" class="dr-table-cell rich-table-cell"></f:verbatim>
<h:outputText id="margin1" value="#{item.proposedGrossMargin}">
<f:convertNumber pattern="$###0.000" />
</h:outputText>
<f:verbatim></td></tr></f:verbatim>
</a4j:repeat>
- <f:verbatim></table></f:verbatim>
+ <f:verbatim></tbody></table></f:verbatim>
</h:form>
+
+
<h:form>
Modified: trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example2.jsp
===================================================================
--- trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example2.jsp 2007-04-20 20:01:56 UTC (rev 473)
+++ trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example2.jsp 2007-04-21 13:59:11 UTC (rev 474)
@@ -108,10 +108,21 @@
<h:commandLink action="changeSkin" value="Wine">
<a4j:actionparam name="skin" value="wine" assignTo="#{skinBean.name}" />
</h:commandLink>
-
- <rich:separator lineType="dashed" height="1" />
+ </h:form>
+
+ <h:form>
+ <rich:separator lineType="dashed" height="1" style="padding-top:20px" />
+ <h:outputText value="Source Code:" />
+ <h:outputLink value="http://anonsvn.jboss.org/repos/richfaces/trunk/richfaces-samples/richface...">
+ <h:outputText value="Page" />
+ </h:outputLink>
+ <h:outputLink value="http://anonsvn.jboss.org/repos/richfaces/trunk/richfaces-samples/richface...">
+ <h:outputText value="Project" />
+ </h:outputLink>
+ <rich:separator lineType="dashed" height="1" style="padding-top:20px" />
<h:commandLink value="back to example list" action="main"></h:commandLink>
</h:form>
+
</f:view>
</body>
</html>
Modified: trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example3.jsp
===================================================================
--- trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example3.jsp 2007-04-20 20:01:56 UTC (rev 473)
+++ trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/example3.jsp 2007-04-21 13:59:11 UTC (rev 474)
@@ -114,6 +114,14 @@
<h:form>
<rich:separator lineType="dashed" height="1" style="padding-top:20px" />
+ <h:outputText value="Source Code:" />
+ <h:outputLink value="http://anonsvn.jboss.org/repos/richfaces/trunk/richfaces-samples/richface...">
+ <h:outputText value="Page" />
+ </h:outputLink>
+ <h:outputLink value="http://anonsvn.jboss.org/repos/richfaces/trunk/richfaces-samples/richface...">
+ <h:outputText value="Project" />
+ </h:outputLink>
+ <rich:separator lineType="dashed" height="1" style="padding-top:20px" />
<h:commandLink value="back to example list" action="main"></h:commandLink>
</h:form>
</f:view>
Modified: trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/main.jsp
===================================================================
--- trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/main.jsp 2007-04-20 20:01:56 UTC (rev 473)
+++ trunk/richfaces-samples/richfaces-art-datatable/src/main/webapp/pages/main.jsp 2007-04-21 13:59:11 UTC (rev 474)
@@ -13,6 +13,7 @@
<h:commandLink value="Example #3. Look-n-Feel Customization with Predefined Classes" action="example3" />
<h:commandLink value="Example #4. Look-n-Feel Customization. Using Classes and Styles" action="example4" />
<h:commandLink value="Example #10. Ajax Update" action="example10" />
+
</h:panelGrid>
</h:form>
</f:view>
19 years
JBoss Rich Faces SVN: r473 - in trunk/richfaces: common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-04-20 16:01:56 -0400 (Fri, 20 Apr 2007)
New Revision: 473
Modified:
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-common.js
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js
trunk/richfaces/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx
trunk/richfaces/tree/src/main/java/org/richfaces/component/UITreeNode.java
trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
Log:
Initial fixes for http://jira.jboss.com/jira/browse/RF-88
Modified: trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-common.js
===================================================================
--- trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-common.js 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-common.js 2007-04-20 20:01:56 UTC (rev 473)
@@ -1,8 +1,8 @@
DnD.getDnDDefaultParams = function(elt) {
- var attr = elt.attributes["rich:defaultdndparams"];
+ var attr = Richfaces.getNSAttribute("defaultdndparams", elt);
if (attr) {
- var params = attr.value.parseJSON();
+ var params = attr.parseJSON();
if (params) {
return params;
}
@@ -14,10 +14,10 @@
DnD.getDnDMergedParams = function(elt, name) {
var params = DnD.getDnDDefaultParams(elt);
- var attr = elt.attributes[name];
+ var attr = Richfaces.getNSAttribute(name, elt);
if (attr) {
- var dndParams = attr.value.parseJSON();
+ var dndParams = attr.parseJSON();
if (params) {
if (dndParams) {
Object.extend(params, dndParams);
@@ -31,11 +31,11 @@
};
DnD.getDnDDragParams = function(elt) {
- return DnD.getDnDMergedParams(elt, "rich:dragdndparams");
+ return DnD.getDnDMergedParams(elt, "dragdndparams");
};
DnD.getDnDDropParams = function(elt) {
- return DnD.getDnDMergedParams(elt, "rich:dropdndparams");
+ return DnD.getDnDMergedParams(elt, "dropdndparams");
};
DnD.setDefaultDnDParams = function(params) {
Modified: trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
===================================================================
--- trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2007-04-20 20:01:56 UTC (rev 473)
@@ -81,7 +81,7 @@
startDrag : function(event) {
var type = this.getContentType();
-
+
if (type) {
var indicator = this.getIndicator();
Modified: trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-04-20 20:01:56 UTC (rev 473)
@@ -71,4 +71,30 @@
for (var i = 0; i < children.length; i++ ) {
Richfaces.visitTree(children[i], callback);
}
+};
+
+Richfaces.getNSAttribute = function (name, element) {
+ if (element.getAttributeNS) {
+ var attr = element.getAttributeNS('http://richfaces.ajax4jsf.org/rich', name);
+ if (attr) {
+ return attr.nodeValue;
+ }
+ }
+
+ var attrName = "rich:" + name;
+
+ var attr = element.attributes[attrName];
+ if (attr) {
+ return attr.nodeValue;
+ }
+
+ var attributes = element.attributes;
+ for (var i = 0; i < attributes.length; i++) {
+ attr = attributes[i];
+ if (attr && attrName == attr.nodeName) {
+ return attr.nodeValue;
+ }
+ }
+
+ return null;
};
\ No newline at end of file
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2007-04-20 20:01:56 UTC (rev 473)
@@ -114,6 +114,7 @@
PrototypeScript.class.getName(),
"/org/richfaces/renderkit/html/scripts/json/json.js",
DnDScript.class.getName(),
+ "/org/richfaces/renderkit/html/scripts/utils.js",
"/org/richfaces/renderkit/html/scripts/dnd/dnd-common.js",
"/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js"
};
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2007-04-20 20:01:56 UTC (rev 473)
@@ -190,6 +190,7 @@
PrototypeScript.class.getName(),
"/org/richfaces/renderkit/html/scripts/json/json.js",
DnDScript.class.getName(),
+ "/org/richfaces/renderkit/html/scripts/utils.js",
"/org/richfaces/renderkit/html/scripts/dnd/dnd-common.js",
"/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js"
};
Modified: trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js
===================================================================
--- trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js 2007-04-20 20:01:56 UTC (rev 473)
@@ -43,11 +43,6 @@
drag.params = this.options.parameters;
drag.params[this.id] = this.id;
- /*var attr = this.id.attributes["rich_f:draggableoptions"];
- if (attr) {
- Object.extend(drag.params, attr.value.parseJSON().parameters);
- }*/
-
this.setIndicator(event);
//this.dragEnter(event);
Modified: trunk/richfaces/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx
===================================================================
--- trunk/richfaces/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx 2007-04-20 20:01:56 UTC (rev 473)
@@ -15,6 +15,7 @@
new org.ajax4jsf.framework.resource.PrototypeScript(),
new org.ajax4jsf.framework.ajax.AjaxScript(),
new org.ajax4jsf.dnd.DnDScript(),
+ /org/richfaces/renderkit/html/scripts/utils.js,
/org/richfaces/renderkit/html/scripts/dnd/dnd-common.js,
scripts/drag-indicator.js
</h:scripts>
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/component/UITreeNode.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/component/UITreeNode.java 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/component/UITreeNode.java 2007-04-20 20:01:56 UTC (rev 473)
@@ -8,6 +8,7 @@
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
@@ -31,6 +32,9 @@
public abstract class UITreeNode extends UIComponentBase implements
TreeListenerEventsProducer, Draggable, Dropzone {
+ private String dragType;
+ private Object acceptedTypes;
+
public static final String COMPONENT_TYPE = "org.richfaces.TreeNode";
public static final String COMPONENT_FAMILY = "org.richfaces.TreeNode";
@@ -105,7 +109,7 @@
tree.broadcast(event);
}
}
-
+
if (event instanceof AjaxEvent) {
AjaxRendererUtils.addRegionsFromComponent(this, getFacesContext());
}
@@ -134,8 +138,8 @@
public NodeSelectedListener[] getNodeSelectListeners() {
return (NodeSelectedListener[]) getFacesListeners(NodeSelectedListener.class);
}
-
-
+
+
/**
* Finds direct parent {@link UITree} component or throws
* {@link ClassCastException} if parent is not {@link UITree}
@@ -148,7 +152,7 @@
if (parent == null) {
return null;
}
-
+
if (parent instanceof UITree) {
return (UITree) parent;
@@ -198,7 +202,7 @@
public void setDragValue(Object value) {
// TODO Auto-generated method stub
-
+
}
public Object getDropValue() {
@@ -207,6 +211,76 @@
public void setDropValue(Object o) {
// TODO Auto-generated method stub
-
+
}
+
+ public void setAcceptedTypes(Object types) {
+ this.acceptedTypes = types;
+ }
+
+ /*
+ * List of drag types to be processd by the current drop zone.
+ * Getter for acceptedTypes
+ * @return acceptedTypes value from local variable or value bindings
+ */
+ public Object getAcceptedTypes( ){
+ if (null != this.acceptedTypes)
+ {
+ return this.acceptedTypes;
+ }
+ ValueBinding vb = getValueBinding("acceptedTypes");
+ if (null != vb){
+ return (Object)vb.getValue(getFacesContext());
+ } else {
+ UITree tree = getUITree();
+ if (tree != null) {
+ return tree.getAcceptedTypes();
+ }
+
+ return null;
+ }
+ }
+
+ public void setDragType(String dragType) {
+ this.dragType = dragType;
+ }
+
+ /*
+ * Key of a drag object. It's used to define a necessity of processing the current dragged element on the drop zone side
+ * Getter for dragType
+ * @return dragType value from local variable or value bindings
+ */
+ public String getDragType( ){
+ if (null != this.dragType)
+ {
+ return this.dragType;
+ }
+ ValueBinding vb = getValueBinding("dragType");
+ if (null != vb){
+ return (String)vb.getValue(getFacesContext());
+ } else {
+ UITree tree = getUITree();
+ if (tree != null) {
+ return tree.getDragType();
+ }
+
+ return null;
+ }
+ }
+
+ public Object saveState(FacesContext context) {
+ Object[] state = new Object[3];
+ state[0] = super.saveState(context);
+ state[1] = this.dragType;
+ state[2] = this.acceptedTypes;
+
+ return state;
+ }
+
+ public void restoreState(FacesContext context, Object state) {
+ Object[] _state = (Object[]) state;
+ super.restoreState(context, _state[0]);
+ this.dragType = (String) _state[1];
+ this.acceptedTypes = _state[2];
+ }
}
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-04-20 20:01:56 UTC (rev 473)
@@ -167,7 +167,7 @@
}
}
- ajaxKeys.clear();
+ tree.setAjaxKeys(null);
}
} catch (Exception e) {
throw new FacesException(e);
Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item-dnd.js 2007-04-20 20:01:56 UTC (rev 473)
@@ -54,9 +54,9 @@
},
getDropzoneOptions: function() {
- var attr = this.elements.icon.attributes["rich:dropzoneoptions"];
+ var attr = Richfaces.getNSAttribute("dropzoneoptions", this.elements.icon);
if (attr) {
- return attr.value.parseJSON();
+ return attr.parseJSON();
}
return null;
@@ -105,9 +105,9 @@
},
getDraggableOptions: function() {
- var attr = this.elements.icon.attributes["rich:draggableoptions"];
+ var attr = Richfaces.getNSAttribute("draggableoptions", this.elements.icon);
if (attr) {
- return attr.value.parseJSON();
+ return attr.parseJSON();
}
return null;
Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-04-20 20:01:56 UTC (rev 473)
@@ -56,9 +56,9 @@
this.elements.icon = $(this.id + Tree.ID_DEVIDER + Tree.ID_ICON);
this.elements.text = $(this.id + Tree.ID_DEVIDER + Tree.ID_TEXT);
- var contextMenu = this.elements.icon.attributes['rich:oncontextmenu'];
- if (contextMenu && contextMenu.value.length > 0) {
- this.onContextMenu = new Function(contextMenu.value + "; return true;");
+ var contextMenu = Richfaces.getNSAttribute("oncontextmenu", this.elements.icon);
+ if (contextMenu && contextMenu.length > 0) {
+ this.onContextMenu = new Function(contextMenu + "; return true;");
}
var childsTd = $(childsRowId + Tree.ID_DEVIDER + Tree.ID_CHILDS_TD);
@@ -164,59 +164,79 @@
processMouseOut: function(e) {
if (this.isMouseIn) {
this.isMouseIn = false;
- var classNames = this.elements.text.attributes['rich:highlightedclass'].nodeValue.split(' ')
- for (var i = 0; i < classNames.length; i++) {
- Element.removeClassName(this.elements.text, classNames[i]);
+ var hClass = Richfaces.getNSAttribute("highlightedclass", this.elements.text);
+ if (hClass) {
+ var classNames = hClass.split(' ')
+ for (var i = 0; i < classNames.length; i++) {
+ Element.removeClassName(this.elements.text, classNames[i]);
+ }
+ if (window.drag){
+ this.dragLeave(e);
+ }
}
- if (window.drag){
- this.dragLeave(e);
- }
}
},
processMouseOver: function(e) {
if(!this.isMouseIn) {
this.isMouseIn = true;
- var classNames = this.elements.text.attributes['rich:highlightedclass'].nodeValue.split(' ')
- for (var i = 0; i < classNames.length; i++) {
- Element.addClassName(this.elements.text, classNames[i]);
+ var hClass = Richfaces.getNSAttribute("highlightedclass", this.elements.text);
+ if (hClass) {
+ var classNames = hClass.split(' ')
+ for (var i = 0; i < classNames.length; i++) {
+ Element.addClassName(this.elements.text, classNames[i]);
+ }
+ if (window.drag) {
+ this.dragEnter(e);
+ }
}
- if (window.drag) {
- this.dragEnter(e);
- }
}
},
toggleSelection: function(e) {
this.tree.deselectAll();
- var classNames = this.elements.text.attributes['rich:selectedclass'].nodeValue.split(' ')
- for (var i = 0; i < classNames.length; i++) {
- Element.addClassName(this.elements.text, classNames[i]);
+ var attr = this.elements.text.attributes;
+ var s = "";
+ for (var i = 0; i < attr.length; i++) {
+ s += attr[i].nodeName + ": " + attr[i].nodeValue + "; ";
}
- this.tree.input.value = this.id;
- this.tree.selectionManager.activeItem = this;
-
- if (this.tree.options.onSelection) this.tree.options.onSelection(this.id);
- this.tree.showNode(this.elements.text.parentNode);
+
+ alert(s);
+
+ var sClass = Richfaces.getNSAttribute("selectedclass", this.elements.text);
+ alert(sClass);
- if (e && e.type == "mousedown" /* can be keydown */) {
- if(Event.isLeftClick(e)) {
- var src = Event.element(e);
- if(src.tagName && (
- src.tagName=='INPUT' ||
- src.tagName=='SELECT' ||
- src.tagName=='OPTION' ||
- src.tagName=='BUTTON' ||
- src.tagName=='TEXTAREA')) return;
+ if (sClass) {
- Event.stop(e);
-
- Event.observe(this.elements.icon, "mousemove", this.listenDragBound);
- Event.observe(this.elements.text, "mousemove", this.listenDragBound);
+ var classNames = sClass.split(' ')
+ for (var i = 0; i < classNames.length; i++) {
+ Element.addClassName(this.elements.text, classNames[i]);
+ }
+ this.tree.input.value = this.id;
+ this.tree.selectionManager.activeItem = this;
+
+ if (this.tree.options.onSelection) this.tree.options.onSelection(this.id);
+ this.tree.showNode(this.elements.text.parentNode);
- Event.observe(this.elements.icon, "mouseup", this.stopListenDragBound);
- Event.observe(this.elements.text, "mouseup", this.stopListenDragBound);
+ if (e && e.type == "mousedown" /* can be keydown */) {
+ if(Event.isLeftClick(e)) {
+ var src = Event.element(e);
+ if(src.tagName && (
+ src.tagName=='INPUT' ||
+ src.tagName=='SELECT' ||
+ src.tagName=='OPTION' ||
+ src.tagName=='BUTTON' ||
+ src.tagName=='TEXTAREA')) return;
+
+ Event.stop(e);
+
+ Event.observe(this.elements.icon, "mousemove", this.listenDragBound);
+ Event.observe(this.elements.text, "mousemove", this.listenDragBound);
+
+ Event.observe(this.elements.icon, "mouseup", this.stopListenDragBound);
+ Event.observe(this.elements.text, "mouseup", this.stopListenDragBound);
+ }
}
}
},
@@ -233,9 +253,12 @@
},
deselect: function() {
- var classNames = this.elements.text.attributes['rich:selectedclass'].nodeValue.split(' ')
- for (var i = 0; i < classNames.length; i++) {
- Element.removeClassName(this.elements.text, classNames[i]);
+ var sClass = Richfaces.getNSAttribute("selectedclass", this.elements.text);
+ if (sClass) {
+ var classNames = sClass.split(' ')
+ for (var i = 0; i < classNames.length; i++) {
+ Element.removeClassName(this.elements.text, classNames[i]);
+ }
}
},
Modified: trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-04-20 20:01:56 UTC (rev 473)
@@ -53,8 +53,8 @@
Event.stop(event);
this.onselect(event);
- var attr = $(event.selectedNode + Tree.ID_DEVIDER + Tree.ID_ICON).attributes['rich:ajaxselectedlistener'];
- if (attr && attr.nodeValue) {
+ var attr = Richfaces.getNSAttribute("ajaxselectedlistener", $(event.selectedNode + Tree.ID_DEVIDER + Tree.ID_ICON));
+ if (attr) {
this.onAjaxSelect(event);
}
} else if (event[Richfaces.TreeExpandEvent]){
Modified: trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
===================================================================
--- trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2007-04-20 16:26:34 UTC (rev 472)
+++ trunk/richfaces/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2007-04-20 20:01:56 UTC (rev 473)
@@ -74,6 +74,7 @@
javaScripts.add("/org/richfaces/renderkit/html/scripts/json/json.js");
javaScripts.add("prototype.js");
javaScripts.add("dnd.js");
+ javaScripts.add("/org/richfaces/renderkit/html/scripts/utils.js");
javaScripts.add("/org/richfaces/renderkit/html/scripts/dnd/dnd-common.js");
javaScripts.add("/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js");
javaScripts.add("/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js");
19 years