JBoss Rich Faces SVN: r7208 - trunk/ui/pickList/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-25 12:31:53 -0400 (Tue, 25 Mar 2008)
New Revision: 7208
Modified:
trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-2606
Modified: trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java
===================================================================
--- trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java 2008-03-25 16:30:59 UTC (rev 7207)
+++ trunk/ui/pickList/src/main/java/org/richfaces/renderkit/PickListRenderer.java 2008-03-25 16:31:53 UTC (rev 7208)
@@ -38,9 +38,9 @@
public class PickListRenderer extends HeaderResourcesRendererBase {
private static final String HIDDEN_SUFFIX = "valueKeeper";
- protected static final OrderingComponentRendererBase.ControlsHelper[] SHUTTLE_HELPERS = ListShuttleControlsHelper.HELPERS;
+ protected static final OrderingComponentRendererBase.ControlsHelper[] SHUTTLE_HELPERS = PickListControlsHelper.HELPERS;
protected final static String SHOW_LABELS_ATTRIBUTE_NAME = "showButtonsLabel";
- private static final String MESSAGE_BUNDLE_NAME = OrderingListRendererBase.class.getPackage().getName() + "ListShuttle";
+ private static final String MESSAGE_BUNDLE_NAME = PickListRenderer.class.getPackage().getName() + ".pickList";
private boolean isSelectedList;
private boolean isAvailableList;
@@ -71,11 +71,8 @@
return SelectUtils.getSelectItems(context, component);
}
- private final String bundleName;
-
public PickListRenderer() {
super();
- this.bundleName = MESSAGE_BUNDLE_NAME;
}
public void decode(FacesContext context, UIComponent component) {
@@ -302,21 +299,21 @@
public void encodePickListControlsFacets(FacesContext context, UIComponent component) throws IOException {
String clientId = component.getClientId(context);
ResponseWriter writer = context.getResponseWriter();
- int divider = SHUTTLE_HELPERS.length / 2;
boolean enable = false;
+
for (int i = 0; i < SHUTTLE_HELPERS.length; i++) {
OrderingComponentRendererBase.ControlsHelper helper = SHUTTLE_HELPERS[i];
boolean isDisabled = helper.getButtonStyleClass().equals(ListShuttleControlsHelper.DISABLED_STYLE_PREF);
if (helper.getBundlePropertyName().equals(ListShuttleControlsHelper.BUNDLE_REMOVE_ALL_LABEL)) {
enable = isSelectedList;
- if ((!enable && isDisabled) || (enable && !isDisabled)) {
+ if(enable != isDisabled) {
enable = true;
} else {
enable = false;
}
} else if (helper.getBundlePropertyName().equals(ListShuttleControlsHelper.BUNDLE_COPY_ALL_LABEL)) {
enable = isAvailableList;
- if ((!enable && isDisabled) || (enable && !isDisabled)) {
+ if(enable != isDisabled) {
enable = true;
} else {
enable = false;
@@ -334,35 +331,61 @@
protected void encodeControlFacet(FacesContext context, UIComponent component, OrderingComponentRendererBase.ControlsHelper helper, String clientId,
ResponseWriter writer, boolean enabled, String baseStyle, String baseControlStyle) throws IOException {
+ renderDefaultControl(context, component, writer, helper, clientId, enabled, baseStyle, baseControlStyle);
+ }
+
+ protected ClassLoader getCurrentLoader(Object fallbackClass) {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ if (loader == null) {
+ loader = fallbackClass.getClass().getClassLoader();
+ }
+ return loader;
+ }
+
+ protected String findLocalisedLabel(FacesContext context, String propertyId, String bundleName) {
+ String label = null;
Locale locale = null;
+ String userBundleName = null;
+ ResourceBundle bundle = null;
UIViewRoot viewRoot = context.getViewRoot();
- if (viewRoot != null) {
- locale = viewRoot.getLocale();
+ if ( viewRoot != null) {
+ locale = viewRoot.getLocale();
+ } else {
+ locale = Locale.getDefault();
}
-
- ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
- ResourceBundle bundle = null;
-
- if (locale != null) {
+
+ try {
+ if( null != (userBundleName = context.getApplication().getMessageBundle())) {
+ bundle = ResourceBundle.getBundle(userBundleName,locale, getCurrentLoader(userBundleName));
+ if (bundle != null) {
+ label = bundle.getString(propertyId);
+ }
+ }
+ } catch (MissingResourceException e) {
+ }
+
+ if(label == null && bundleName != null) {
try {
- bundle = ResourceBundle.getBundle(bundleName, locale, contextClassLoader);
+ bundle = ResourceBundle.getBundle(bundleName ,locale, getCurrentLoader(bundleName));
+ if (bundle != null) {
+ label = bundle.getString(propertyId);
+ }
} catch (MissingResourceException e) {
}
}
-
- Map attributes = component.getAttributes();
+
+ return label;
+ }
+
+ protected void renderDefaultControl(FacesContext context, UIComponent component, ResponseWriter writer,
+ OrderingComponentRendererBase.ControlsHelper helper, String clientId, boolean enabled, String baseStyle,
+ String baseControlStyle) throws IOException {
UIComponent facet = component.getFacet(helper.getFacetName());
boolean useFacet = (facet != null && facet.isRendered());
- renderDefaultControl(context, component, writer, useFacet, helper, clientId, bundle, enabled, baseStyle, baseControlStyle);
- }
- protected void renderDefaultControl(FacesContext context, UIComponent orderingList, ResponseWriter writer, boolean useFacet,
- OrderingComponentRendererBase.ControlsHelper helper, String clientId, ResourceBundle bundle, boolean enabled, String baseStyle,
- String baseControlStyle) throws IOException {
- UIComponent facet = orderingList.getFacet(helper.getFacetName());
String customEvent = null;
- Map attributes = orderingList.getAttributes();
+ Map attributes = component.getAttributes();
if (helper.customEvent != null) {
customEvent = (String) attributes.get(helper.customEvent);
@@ -377,7 +400,7 @@
currentStyle = styleFromAttribute.concat(currentStyle);
}
- writer.startElement(HTML.DIV_ELEM, orderingList);
+ writer.startElement(HTML.DIV_ELEM, component);
String controlId = clientId + helper.getIdSuffix();
writer.writeAttribute(HTML.id_ATTRIBUTE, controlId, null); // FIXME:
writer.writeAttribute(HTML.class_ATTRIBUTE, currentStyle, null);
@@ -392,7 +415,7 @@
writer.writeAttribute(HTML.style_ATTRIBUTE, style, null);
if (!useFacet) {
- writer.startElement(HTML.DIV_ELEM, orderingList);
+ writer.startElement(HTML.DIV_ELEM, component);
writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + helper.getButtonStyleClass(), null);
if (helper.enable) {
@@ -402,7 +425,7 @@
writer.writeAttribute(HTML.onmouseout_ATTRIBUTE, "this.className='" + baseStyle + "'", null);
}
- writer.startElement(HTML.a_ELEMENT, orderingList);
+ writer.startElement(HTML.a_ELEMENT, component);
writer.writeAttribute(HTML.id_ATTRIBUTE, controlId + "link", null); // FIXME:
writer.writeAttribute(HTML.HREF_ATTR, "#", null);
writer.writeAttribute(HTML.onclick_ATTRIBUTE, "return false;", null);
@@ -410,14 +433,14 @@
if (!helper.enable) {
writer.writeAttribute(HTML.DISABLED_ATTR, "disabled", null);
writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + "-a-disabled", null);
- writer.startElement(HTML.a_ELEMENT, orderingList);
+ writer.startElement(HTML.a_ELEMENT, component);
} else {
writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + "-selection", null);
writer.writeAttribute(HTML.onblur_ATTRIBUTE, "Control.onblur(this);", null);
writer.writeAttribute(HTML.onfocus_ATTRIBUTE, "Control.onfocus(this);", null);
}
- writer.startElement(HTML.DIV_ELEM, orderingList);
+ writer.startElement(HTML.DIV_ELEM, component);
writer.writeAttribute(HTML.class_ATTRIBUTE, baseStyle + "-content", null);
}
@@ -428,30 +451,23 @@
if (useFacet) {
renderChild(context, facet);
} else {
- writer.startElement(HTML.IMG_ELEMENT, orderingList);
+ writer.startElement(HTML.IMG_ELEMENT, component);
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);
- // TODO check properties!!!
- // writer.write(helper.getDefaultText());
- if (getUtils().isBooleanAttribute(orderingList, SHOW_LABELS_ATTRIBUTE_NAME)) {
-
+ if (getUtils().isBooleanAttribute(component, 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.equals("")) {
+ label = findLocalisedLabel(context, helper.getBundlePropertyName(), MESSAGE_BUNDLE_NAME);
}
if (label == null || label.equals("")) {
label = helper.getDefaultText();
}
-
writer.write(label);
}
}
18 years, 1 month
JBoss Rich Faces SVN: r7207 - in trunk/samples/pickList-sample/src/main: java/org/richfaces and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-25 12:30:59 -0400 (Tue, 25 Mar 2008)
New Revision: 7207
Added:
trunk/samples/pickList-sample/src/main/java/localization_en_US.properties
trunk/samples/pickList-sample/src/main/java/localization_ru_RU.properties
Modified:
trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
trunk/samples/pickList-sample/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp
Log:
add localization
Added: trunk/samples/pickList-sample/src/main/java/localization_en_US.properties
===================================================================
--- trunk/samples/pickList-sample/src/main/java/localization_en_US.properties (rev 0)
+++ trunk/samples/pickList-sample/src/main/java/localization_en_US.properties 2008-03-25 16:30:59 UTC (rev 7207)
@@ -0,0 +1,4 @@
+RICH_PICK_LIST_COPY_ALL_LABEL=Copy All
+RICH_PICK_LIST_COPY_LABEL=Copy
+RICH_PICK_LIST_REMOVE_ALL_LABEL=Remove All
+RICH_PICK_LIST_REMOVE_LABEL=Remove
Added: trunk/samples/pickList-sample/src/main/java/localization_ru_RU.properties
===================================================================
--- trunk/samples/pickList-sample/src/main/java/localization_ru_RU.properties (rev 0)
+++ trunk/samples/pickList-sample/src/main/java/localization_ru_RU.properties 2008-03-25 16:30:59 UTC (rev 7207)
@@ -0,0 +1,4 @@
+RICH_PICK_LIST_COPY_ALL_LABEL=���������� ���
+RICH_PICK_LIST_COPY_LABEL=����������
+RICH_PICK_LIST_REMOVE_ALL_LABEL=������� ���
+RICH_PICK_LIST_REMOVE_LABEL=�������
Modified: trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java 2008-03-25 16:23:48 UTC (rev 7206)
+++ trunk/samples/pickList-sample/src/main/java/org/richfaces/Bean.java 2008-03-25 16:30:59 UTC (rev 7207)
@@ -9,19 +9,19 @@
public class Bean {
-private ArrayList testList = new ArrayList();
+private ArrayList<SelectItem> testList = new ArrayList<SelectItem>();
private String selectedInfo;
private String targetListWidth="140px";
private String sourceListWidth="140px";
private String listsHeight="100px";
- private String copyAllLabel;
- private String copyLabel;
- private String removeLabel;
- private String removeAllLabel;
+ private String copyAllLabel = null;
+ private String copyLabel = null;
+ private String removeLabel = null;
+ private String removeAllLabel = null;
- private String [] values = new String[]{"polecat","suricate"};
- private List listValues = new ArrayList();
+// private String [] values = new String[]{"polecat","suricate"};
+ private List <String> listValues = new ArrayList<String>();
public Bean() {
testList.add(new SelectItem("polecat", "polecat"));
@@ -93,15 +93,15 @@
public void setTestList(ArrayList testList) {
this.testList = testList;
}
+//
+// public String[] getValues() {
+// return values;
+// }
+//
+// public void setValues(String[] values) {
+// this.values = values;
+// }
- public String[] getValues() {
- return values;
- }
-
- public void setValues(String[] values) {
- this.values = values;
- }
-
public String getCopyAllLabel() {
return copyAllLabel;
}
@@ -134,11 +134,11 @@
this.removeAllLabel = removeAllLabel;
}
- public List getListValues() {
+ public List <String> getListValues() {
return listValues;
}
- public void setListValues(List listValues) {
+ public void setListValues(List<String> listValues) {
this.listValues = listValues;
}
Modified: trunk/samples/pickList-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/pickList-sample/src/main/webapp/WEB-INF/faces-config.xml 2008-03-25 16:23:48 UTC (rev 7206)
+++ trunk/samples/pickList-sample/src/main/webapp/WEB-INF/faces-config.xml 2008-03-25 16:30:59 UTC (rev 7207)
@@ -12,4 +12,12 @@
<managed-bean-class>org.richfaces.SkinBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <application>
+ <locale-config>
+ <default-locale>en</default-locale>
+ <supported-locale>ru</supported-locale>
+ </locale-config>
+ <message-bundle>localization</message-bundle>
+ </application>
+
</faces-config>
Modified: trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp 2008-03-25 16:23:48 UTC (rev 7206)
+++ trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp 2008-03-25 16:30:59 UTC (rev 7207)
@@ -56,7 +56,8 @@
copyControlLabel = "#{pickBean.copyLabel}"
removeControlLabel = "#{pickBean.removeLabel}"
removeAllControlLabel ="#{pickBean.removeAllLabel}"
- value="#{pickBean.listValues}">
+ value="#{pickBean.listValues}"
+ showButtonsLabel="true">
<f:selectItem itemValue="cat" itemLabel="cat"/>
<f:selectItem itemValue="dog" itemLabel="dog"/>
<f:selectItems value="#{pickBean.testList}"/>
18 years, 1 month
JBoss Rich Faces SVN: r7206 - trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-03-25 12:23:48 -0400 (Tue, 25 Mar 2008)
New Revision: 7206
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
Log:
fix xhtml bugs
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-03-25 16:19:50 UTC (rev 7205)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-03-25 16:23:48 UTC (rev 7206)
@@ -414,8 +414,8 @@
this.checkFrame();
this.initFileEntryWidth();
this.initLabels(labels);
+ this.processButtons();
this.initFileInput();
- this.processButtons();
},
initLabels: function (labels) {
@@ -427,12 +427,12 @@
},
initFileInput: function () {
- var o = this.currentInput.parentNode;
- var p = o.parentNode;
+ var o = this.currentInput;
+ var p = o.parentNode.parentNode;
p = $(p);
if (p.getWidth() != 0) {
- o.style.width = p.getWidth() + "px";
- o.style.height = p.getHeight() + "px";
+ o.parentNode.style.width = p.getWidth() + "px";
+ o.parentNode.style.height = p.getHeight() + "px";
if (p._onmouseover) {
p.onmouseover = p._onmouseover;
}
18 years, 1 month
JBoss Rich Faces SVN: r7205 - trunk/cdk/generator/src/main/resources/META-INF/templates12.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-25 12:19:50 -0400 (Tue, 25 Mar 2008)
New Revision: 7205
Modified:
trunk/cdk/generator/src/main/resources/META-INF/templates12/componenttest.vm
Log:
http://jira.jboss.com/jira/browse/RF-2726
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/componenttest.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/componenttest.vm 2008-03-25 16:19:34 UTC (rev 7204)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/componenttest.vm 2008-03-25 16:19:50 UTC (rev 7205)
@@ -70,6 +70,8 @@
#if(!$prop.exist && $prop.name != "value")
#if($prop.classname == "java.lang.String")
component.${prop.setterName}( " __$prop.name" );
+ #elseif($prop.classname == "java.lang.Object")
+ component.${prop.setterName}( " __$prop.name" );
#elseif($prop.classname == "java.lang.Boolean")
component.${prop.setterName}( new Boolean(true) );
#end
18 years, 1 month
JBoss Rich Faces SVN: r7204 - trunk/ui/gmap/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-25 12:19:34 -0400 (Tue, 25 Mar 2008)
New Revision: 7204
Modified:
trunk/ui/gmap/src/main/templates/gmap.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2726
Modified: trunk/ui/gmap/src/main/templates/gmap.jspx
===================================================================
--- trunk/ui/gmap/src/main/templates/gmap.jspx 2008-03-25 16:19:27 UTC (rev 7203)
+++ trunk/ui/gmap/src/main/templates/gmap.jspx 2008-03-25 16:19:34 UTC (rev 7204)
@@ -29,12 +29,8 @@
<h:styles>css/gmap.xcss</h:styles>
<h:scripts>new org.ajax4jsf.javascript.PrototypeScript(),script/gmap.js</h:scripts>
-<div id="#{clientId}" class="dr-gmap rich-gmap #{component.attributes['styleClass']}" >
+<div id="#{clientId}" class="dr-gmap rich-gmap #{component.attributes['styleClass']}" x:passThruWithExclusions="id,class,styleClass">
- <f:call name="utils.encodePassThruWithExclusions">
- <f:parameter value="id,class" />
- </f:call>
-
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=#{key}" />
<script type="text/javascript">
//<![CDATA[
18 years, 1 month
JBoss Rich Faces SVN: r7203 - trunk/ui/simpleTogglePanel/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-25 12:19:27 -0400 (Tue, 25 Mar 2008)
New Revision: 7203
Modified:
trunk/ui/simpleTogglePanel/src/test/java/org/richfaces/component/SimpleTogglePanelComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-2726
Modified: trunk/ui/simpleTogglePanel/src/test/java/org/richfaces/component/SimpleTogglePanelComponentTest.java
===================================================================
--- trunk/ui/simpleTogglePanel/src/test/java/org/richfaces/component/SimpleTogglePanelComponentTest.java 2008-03-25 16:19:22 UTC (rev 7202)
+++ trunk/ui/simpleTogglePanel/src/test/java/org/richfaces/component/SimpleTogglePanelComponentTest.java 2008-03-25 16:19:27 UTC (rev 7203)
@@ -26,6 +26,7 @@
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlScript;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.ajax4jsf.tests.HtmlTestUtils;
import org.apache.commons.lang.StringUtils;
import javax.faces.component.UICommand;
@@ -44,7 +45,7 @@
*/
public class SimpleTogglePanelComponentTest extends AbstractAjax4JsfTestCase {
- private static Set javaScripts = new HashSet();
+ private static Set<String> javaScripts = new HashSet<String>();
static {
javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
@@ -221,27 +222,20 @@
public void testRenderScript() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
- List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
- for (Iterator it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
- String srcAttr = item.getSrcAttribute();
+ List<String> scriptSources = HtmlTestUtils.extractScriptSources(page);
+ for (String javascript : javaScripts) {
+ boolean found = false;
+ for (String script : scriptSources) {
+ if (script.indexOf(javascript) >= 0) {
+ found = true;
+ break;
+ }
+ }
+ assertTrue("Component script " + javascript + " is not found in the response", found);
+ }
- if (StringUtils.isNotBlank(srcAttr)) {
- boolean found = false;
- for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
- String src = (String) srcIt.next();
+ }
- found = srcAttr.contains(src);
- if (found) {
- break;
- }
- }
-
- assertTrue(found);
- }
- }
- }
-
/**
* Test simpleTogglePanel switch
*
18 years, 1 month
JBoss Rich Faces SVN: r7202 - in trunk/samples/scrollableDataTableDemo/src/main/webapp: pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-25 12:19:22 -0400 (Tue, 25 Mar 2008)
New Revision: 7202
Modified:
trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/web.xml
trunk/samples/scrollableDataTableDemo/src/main/webapp/pages/scrollable-grid.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-2726
Modified: trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/web.xml 2008-03-25 16:19:17 UTC (rev 7201)
+++ trunk/samples/scrollableDataTableDemo/src/main/webapp/WEB-INF/web.xml 2008-03-25 16:19:22 UTC (rev 7202)
@@ -36,8 +36,11 @@
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
- <filter-class>org.ajax4jsf.FastFilter</filter-class>
- <init-param><param-name>enable-cache</param-name><param-value>false</param-value></init-param>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ <init-param>
+ <param-name>enable-cache</param-name>
+ <param-value>false</param-value>
+ </init-param>
</filter>
<filter>
<display-name>Request Metrics</display-name>
Modified: trunk/samples/scrollableDataTableDemo/src/main/webapp/pages/scrollable-grid.xhtml
===================================================================
--- trunk/samples/scrollableDataTableDemo/src/main/webapp/pages/scrollable-grid.xhtml 2008-03-25 16:19:17 UTC (rev 7201)
+++ trunk/samples/scrollableDataTableDemo/src/main/webapp/pages/scrollable-grid.xhtml 2008-03-25 16:19:22 UTC (rev 7202)
@@ -5,7 +5,7 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:sg="http://labs.jboss.com/jbossrichfaces/ui/scrollableDataTable"
- xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+ xmlns:a4j="http://richfaces.org/a4j"
xmlns:dt="http://labs.jboss.com/jbossrichfaces/ui/dataTable"
>
@@ -30,9 +30,14 @@
color: red;
}
+ .even {
+ background-color: red;
+ }
+ .odd {
+ background-color: green;
+ }
-
</style>
</head>
@@ -54,10 +59,11 @@
rows="40"
width="1800px"
columnClasses="col"
+
height="500px" hideWhenScrolling="false">
- <dt:column width="100px" sortable="false">
+ <h:column width="100px" sortable="false">
<f:facet name="header">
<h:outputText value="Index"></h:outputText>
@@ -71,40 +77,40 @@
</f:facet>
</c:if>
- </dt:column>
+ </h:column>
- <dt:column width="200px" sortExpression="#{issues.key.value}">
+ <h:column width="200px" sortExpression="#{issues.key.value}" sortable="true">
<f:facet name="header">
<h:outputText value="Key"></h:outputText>
</f:facet>
- <h:outputText value="#{issues.key.value}"></h:outputText>
+ <h:outputText id="key" value="#{issues.key.value}"></h:outputText>
<c:if test="#{renderFooter}">
<f:facet name="footer">
<h:outputText value="footer1"></h:outputText>
</f:facet>
</c:if>
- </dt:column>
+ </h:column>
- <dt:column width="200px" sortExpression="#{issues.summary}">
+ <h:column width="200px" sortExpression="#{issues.summary}" sortable="true">
<f:facet name="header">
<h:outputText value="Summary"></h:outputText>
</f:facet>
- <h:outputText value="#{issues.summary}"></h:outputText>
+ <a4j:commandButton value="reset Key" reRender="key" action="#{issues.resetKey}"/>
<c:if test="#{renderFooter}">
<f:facet name="footer">
<h:outputText value="footer2"></h:outputText>
</f:facet>
</c:if>
- </dt:column>
-
- <dt:column width="200px">
+ </h:column>
+ <ui:remove>
+ <h:column width="200px">
<f:facet name="header">
<h:outputText value="Assignee"></h:outputText>
@@ -117,9 +123,9 @@
<h:outputText value="footer3"></h:outputText>
</f:facet>
</c:if>
- </dt:column>
+ </h:column>
- <dt:column width="200px">
+ <h:column width="200px">
<f:facet name="header">
<h:outputText value="Status"></h:outputText>
@@ -138,9 +144,9 @@
<h:outputText value="footer4"></h:outputText>
</f:facet>
</c:if>
- </dt:column>
+ </h:column>
- <dt:column width="200px">
+ <h:column width="200px">
<f:facet name="header">
<h:outputText value="Reporter"></h:outputText>
@@ -153,9 +159,9 @@
<h:outputText value="footer5"></h:outputText>
</f:facet>
</c:if>
- </dt:column>
+ </h:column>
- <dt:column width="200px">
+ <h:column width="200px">
<f:facet name="header">
<h:outputText value="Priority"></h:outputText>
@@ -174,9 +180,9 @@
<h:outputText value="footer6"></h:outputText>
</f:facet>
</c:if>
- </dt:column>
+ </h:column>
- <dt:column width="200px">
+ <h:column width="200px">
<f:facet name="header">
<h:outputText value="Resolution"></h:outputText>
@@ -189,7 +195,8 @@
<h:outputText value="footer8"></h:outputText>
</f:facet>
</c:if>
- </dt:column>
+ </h:column>
+</ui:remove>
</sg:scrollableDataTable>
<h:commandButton value="submit"></h:commandButton>
<h:messages showDetail="true"/>
@@ -197,6 +204,12 @@
<h:outputLink target="_blank" value="resource:///org/ajax4jsf/javascript/jsshell.html">Console</h:outputLink>
+ <script>
+ //<![CDATA[
+ LOG._log = function(msg) {console.log(msg);}
+ //]]>
+ </script>
+
</f:view>
</body>
18 years, 1 month
JBoss Rich Faces SVN: r7201 - trunk/ui/suggestionbox/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-25 12:19:17 -0400 (Tue, 25 Mar 2008)
New Revision: 7201
Modified:
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
Log:
http://jira.jboss.com/jira/browse/RF-2726
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2008-03-25 16:19:11 UTC (rev 7200)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2008-03-25 16:19:17 UTC (rev 7201)
@@ -29,6 +29,7 @@
import javax.el.MethodExpression;
import javax.faces.component.UIData;
+import javax.faces.component.ValueHolder;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.event.AbortProcessingException;
@@ -50,7 +51,7 @@
* @version $Revision: 1.5 $ $Date: 2007/03/01 22:37:50 $
*/
public abstract class UISuggestionBox extends UIData
- implements AjaxComponent, AjaxSource {
+ implements AjaxComponent, AjaxSource, ValueHolder {
private static final class SubmittedValue implements Serializable {
@@ -499,6 +500,11 @@
public void removeAjaxListener(final AjaxListener listener) {
removeFacesListener(listener);
}
+ //To support ValueHolder
+ public Object getLocalValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
/**
* Getter for styleClass.
18 years, 1 month
JBoss Rich Faces SVN: r7200 - trunk/ui/tree/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-25 12:19:11 -0400 (Tue, 25 Mar 2008)
New Revision: 7200
Modified:
trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
trunk/ui/tree/src/test/java/org/richfaces/component/TreeModelTest.java
Log:
http://jira.jboss.com/jira/browse/RF-2726
Modified: trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
===================================================================
--- trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2008-03-25 16:19:06 UTC (rev 7199)
+++ trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2008-03-25 16:19:11 UTC (rev 7200)
@@ -39,29 +39,29 @@
import javax.faces.event.PhaseId;
import javax.servlet.http.HttpServletResponse;
-import org.richfaces.event.DragEvent;
-import org.richfaces.event.DragListener;
-import org.richfaces.event.DropEvent;
-import org.richfaces.event.DropListener;
import org.ajax4jsf.resource.InternetResource;
import org.ajax4jsf.resource.InternetResourceBuilder;
import org.ajax4jsf.resource.ResourceBuilderImpl;
import org.ajax4jsf.resource.image.ImageInfo;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.ajax4jsf.tests.HtmlTestUtils;
import org.apache.commons.lang.StringUtils;
+import org.richfaces.component.state.events.ExpandAllCommandEvent;
+import org.richfaces.component.xml.XmlTreeDataBuilder;
+import org.richfaces.event.DragEvent;
+import org.richfaces.event.DragListener;
+import org.richfaces.event.DropEvent;
+import org.richfaces.event.DropListener;
import org.richfaces.event.NodeExpandedEvent;
import org.richfaces.event.NodeExpandedListener;
import org.richfaces.event.NodeSelectedEvent;
import org.richfaces.event.NodeSelectedListener;
-import org.richfaces.component.state.events.ExpandAllCommandEvent;
-import org.richfaces.component.xml.XmlTreeDataBuilder;
import org.xml.sax.InputSource;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlLink;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
/**
* Unit test for simple Component.
@@ -69,7 +69,7 @@
public class TreeComponentTest
extends AbstractAjax4JsfTestCase
{
- private static Set javaScripts = new HashSet();
+ private static Set<String> javaScripts = new HashSet<String>();
static {
javaScripts.add("org/richfaces/renderkit/html/scripts/json/json-dom.js");
@@ -226,26 +226,18 @@
}
public void testRenderScript() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
- for (Iterator it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
- String srcAttr = item.getSrcAttribute();
-
- if (StringUtils.isNotBlank(srcAttr)) {
- boolean found = false;
- for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
- String src = (String) srcIt.next();
-
- found = srcAttr.contains(src);
- if (found) {
- break;
- }
- }
-
- assertTrue(found);
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List<String> scriptSources = HtmlTestUtils.extractScriptSources(page);
+ for (String javascript : javaScripts) {
+ boolean found = false;
+ for (String script : scriptSources) {
+ if (script.indexOf(javascript) >= 0) {
+ found = true;
+ break;
+ }
}
+ assertTrue("Component script " + javascript + " is not found in the response", found);
}
}
Modified: trunk/ui/tree/src/test/java/org/richfaces/component/TreeModelTest.java
===================================================================
--- trunk/ui/tree/src/test/java/org/richfaces/component/TreeModelTest.java 2008-03-25 16:19:06 UTC (rev 7199)
+++ trunk/ui/tree/src/test/java/org/richfaces/component/TreeModelTest.java 2008-03-25 16:19:11 UTC (rev 7200)
@@ -112,10 +112,10 @@
}
}, null, null);
- model.setRowKey(new ListRowKey("testId:displayName"));
+ model.setRowKey(new ListRowKey<String>("testId:displayName"));
assertEquals("tree-demo", ((XmlNodeData) model.getRowData()).getText());
- model.setRowKey(new ListRowKey("testId:1:1"));
+ model.setRowKey(new ListRowKey<String>("testId:1:1"));
assertEquals(".xhtml", ((XmlNodeData) model.getRowData()).getText());
}
18 years, 1 month
JBoss Rich Faces SVN: r7199 - trunk/ui/datascroller/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-25 12:19:06 -0400 (Tue, 25 Mar 2008)
New Revision: 7199
Modified:
trunk/ui/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-2726
Modified: trunk/ui/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java
===================================================================
--- trunk/ui/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java 2008-03-25 16:19:02 UTC (rev 7198)
+++ trunk/ui/datascroller/src/test/java/org/richfaces/component/DatascrollerComponentTest.java 2008-03-25 16:19:06 UTC (rev 7199)
@@ -23,7 +23,6 @@
import java.util.ArrayList;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -44,19 +43,18 @@
import javax.faces.el.MethodNotFoundException;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.apache.commons.lang.StringUtils;
+import org.ajax4jsf.tests.HtmlTestUtils;
import org.richfaces.event.DataScrollerEvent;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
/**
* Unit test for Datascroller component.
*/
public class DatascrollerComponentTest extends AbstractAjax4JsfTestCase {
- private static Set javaScripts = new HashSet();
+ private static Set<String> javaScripts = new HashSet<String>();
static {
javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
@@ -293,7 +291,7 @@
public void testRenderStyle() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
- List links = page.getDocumentElement().getHtmlElementsByTagName("link");
+ List links = page.getDocumentHtmlElement().getHtmlElementsByTagName("link");
assertEquals(1, links.size());
HtmlElement link = (HtmlElement) links.get(0);
@@ -308,26 +306,16 @@
public void testRenderScript() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
- List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
-
- for (Iterator it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
- String srcAttr = item.getSrcAttribute();
-
- if (StringUtils.isNotBlank(srcAttr)) {
- boolean found = false;
- for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();)
- {
- String src = (String) srcIt.next();
-
- found = srcAttr.contains(src);
- if (found) {
- break;
- }
- }
-
- assertTrue(found);
+ List<String> scriptSources = HtmlTestUtils.extractScriptSources(page);
+ for (String javascript : javaScripts) {
+ boolean found = false;
+ for (String script : scriptSources) {
+ if (script.indexOf(javascript) >= 0) {
+ found = true;
+ break;
+ }
}
+ assertTrue("Component script " + javascript + " is not found in the response", found);
}
}
18 years, 1 month