JBoss Rich Faces SVN: r6578 - trunk/framework/impl/src/main/java/org/ajax4jsf/context.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-05 18:13:02 -0500 (Wed, 05 Mar 2008)
New Revision: 6578
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
Log:
http://jira.jboss.com/jira/browse/RF-2404
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-03-05 20:26:30 UTC (rev 6577)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-03-05 23:13:02 UTC (rev 6578)
@@ -34,6 +34,8 @@
import java.util.Set;
import java.util.regex.Pattern;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
import javax.faces.application.Application;
@@ -62,6 +64,7 @@
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.ajax4jsf.resource.InternetResourceBuilder;
import org.ajax4jsf.resource.ResourceNotFoundException;
+import org.ajax4jsf.util.ELUtils;
import org.ajax4jsf.webapp.BaseFilter;
import org.ajax4jsf.webapp.FilterServletResponseWrapper;
import org.apache.commons.logging.Log;
@@ -85,6 +88,11 @@
//as they have their own advanced styling
private static final Pattern USER_AGENTS = Pattern.compile(" AppleWebKit/|^Opera/| Opera ");
+ private static final String INIT_PARAMETER_PREFIX = "_init_parameter_";
+
+ //Object to put into application map as a value of cached parameter if it is null
+ private static final Object NULL = new Object();
+
private static final Log log = LogFactory.getLog(AjaxContext.class);
private static ComponentInvoker invoker;
@@ -418,15 +426,15 @@
boolean useStdControlsSkinning = false;
- String stdControlsSkinning = externalContext.getInitParameter(InternetResourceBuilder.STD_CONTROLS_SKINNING_PARAM);
- if (stdControlsSkinning != null && stdControlsSkinning.length() != 0) {
+ String stdControlsSkinning = getInitParameterValue(context, InternetResourceBuilder.STD_CONTROLS_SKINNING_PARAM);
+ if (stdControlsSkinning != null) {
useStdControlsSkinning = InternetResourceBuilder.ENABLE.equals(stdControlsSkinning);
}
boolean useStdControlsSkinningClasses = true;
- String stdControlsSkinningClasses = externalContext.getInitParameter(InternetResourceBuilder.STD_CONTROLS_SKINNING_CLASSES_PARAM);
- if (stdControlsSkinningClasses != null && stdControlsSkinningClasses.length() != 0) {
+ String stdControlsSkinningClasses = getInitParameterValue(context, InternetResourceBuilder.STD_CONTROLS_SKINNING_CLASSES_PARAM);
+ if (stdControlsSkinningClasses != null) {
useStdControlsSkinningClasses = InternetResourceBuilder.ENABLE.equals(stdControlsSkinningClasses);
}
@@ -890,4 +898,55 @@
return true;
}
}
+
+ private String evaluate(FacesContext context, Object parameterValue) {
+ if (parameterValue == NULL || parameterValue == null) {
+ return null;
+ } else if (parameterValue instanceof ValueExpression) {
+ ValueExpression expression = (ValueExpression) parameterValue;
+
+ return (String) expression.getValue(context.getELContext());
+ } else {
+ return parameterValue.toString();
+ }
+ }
+
+ private String getInitParameterValue(FacesContext context, String parameterName) {
+
+ String key = INIT_PARAMETER_PREFIX + parameterName;
+
+ ExternalContext externalContext = context.getExternalContext();
+ Map<String, Object> applicationMap = externalContext.getApplicationMap();
+ Object mutex = externalContext.getRequest();
+ Object parameterValue = null;
+
+ synchronized (mutex) {
+ parameterValue = applicationMap.get(key);
+
+ if (parameterValue == null) {
+
+ String initParameter = externalContext.getInitParameter(parameterName);
+ if (initParameter != null) {
+
+ if (ELUtils.isValueReference(initParameter)) {
+ Application application = context.getApplication();
+ ExpressionFactory expressionFactory = application.getExpressionFactory();
+
+ parameterValue = expressionFactory.createValueExpression(context.getELContext(),
+ initParameter,
+ String.class);
+ } else {
+ parameterValue = initParameter;
+ }
+
+ } else {
+ parameterValue = NULL;
+ }
+
+ applicationMap.put(key, parameterValue);
+ }
+ }
+
+ return evaluate(context, parameterValue);
+ }
}
16 years, 10 months
JBoss Rich Faces SVN: r6577 - in trunk/ui/tree/src/main: java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-05 15:26:30 -0500 (Wed, 05 Mar 2008)
New Revision: 6577
Modified:
trunk/ui/tree/src/main/config/component/treeNode.xml
trunk/ui/tree/src/main/java/org/richfaces/component/UITreeNode.java
Log:
http://jira.jboss.com/jira/browse/RF-765
http://jira.jboss.com/jira/browse/RF-2315
Modified: trunk/ui/tree/src/main/config/component/treeNode.xml
===================================================================
--- trunk/ui/tree/src/main/config/component/treeNode.xml 2008-03-05 19:29:04 UTC (rev 6576)
+++ trunk/ui/tree/src/main/config/component/treeNode.xml 2008-03-05 20:26:30 UTC (rev 6577)
@@ -186,6 +186,23 @@
Data to be processed after a drop event
</description>
<defaultvalue>getUITree().getDropValue()</defaultvalue>
+ </property>
+
+ <property>
+ <name>timeout</name>
+ <classname>int</classname>
+ <description>timeout in ms.</description>
+ <defaultvalue>getDefaultTimeout()</defaultvalue>
+ </property>
+ <property>
+ <name>reRender</name>
+ <classname>java.lang.Object</classname>
+ <description>
+ Id['s] (in format of call UIComponent.findComponent()) of components,
+ rendered in case of AjaxRequest caused by this component.
+ Can be single id, comma-separated list of Id's, or EL Expression with array or Collection
+ </description>
+ <defaultvalue>getDefaultReRender()</defaultvalue>
</property>
&html_events;
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/UITreeNode.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/component/UITreeNode.java 2008-03-05 19:29:04 UTC (rev 6576)
+++ trunk/ui/tree/src/main/java/org/richfaces/component/UITreeNode.java 2008-03-05 20:26:30 UTC (rev 6577)
@@ -304,11 +304,12 @@
}
public Object saveState(FacesContext context) {
- Object[] state = new Object[4];
+ Object[] state = new Object[5];
state[0] = super.saveState(context);
state[1] = this.dragType;
state[2] = this.acceptedTypes;
state[3] = this.dragIndicator;
+ state[4] = this.reRender;
return state;
}
@@ -319,6 +320,7 @@
this.dragType = (String) _state[1];
this.acceptedTypes = _state[2];
this.dragIndicator = (String) _state[3];
+ this.reRender = (Object) _state[4];
}
public void setDragIndicator(String dragIndicator) {
@@ -420,6 +422,22 @@
return tree.getOndropend();
}
+ protected int getDefaultTimeout() {
+ UITree tree = getUITree();
+ if (tree == null) {
+ return 0;
+ }
+ return tree.getTimeout();
+ }
+
+ protected Object getDefaultReRender() {
+ UITree tree = getUITree();
+ if (tree == null) {
+ return null;
+ }
+ return tree.getReRender();
+ }
+
/**
* if "true", submits ONLY one field/link, instead of all form controls
* Setter for ajaxSingle
16 years, 10 months
JBoss Rich Faces SVN: r6576 - in trunk/ui/modal-panel/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-05 14:29:04 -0500 (Wed, 05 Mar 2008)
New Revision: 6576
Modified:
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2118
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2008-03-05 18:43:31 UTC (rev 6575)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2008-03-05 19:29:04 UTC (rev 6576)
@@ -29,6 +29,9 @@
margin: 0;
padding: 0;
background-color: inherit;
+ width: 1px;
+ height: 1px;
+ z-index: 9;
}
.dr-mpnl-resizer {
Modified: trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-03-05 18:43:31 UTC (rev 6575)
+++ trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-03-05 19:29:04 UTC (rev 6576)
@@ -53,7 +53,7 @@
<a href="#" class="dr-mpnl-pnl-a" id="#{clientId}FirstHref">_</a>
</div>
- <div id="#{clientId}CDiv" class="dr-mpnl-panel rich-mpnl_panel" style="width: 1px; height: 1px; z-index: 2;">
+ <div id="#{clientId}CDiv" class="dr-mpnl-panel rich-mpnl_panel" >
<jsp:scriptlet>
<![CDATA[
16 years, 10 months
JBoss Rich Faces SVN: r6575 - trunk/ui/dataTable/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-03-05 13:43:31 -0500 (Wed, 05 Mar 2008)
New Revision: 6575
Added:
trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
Modified:
trunk/ui/dataTable/src/main/config/component/column.xml
Log:
RF-1741
Modified: trunk/ui/dataTable/src/main/config/component/column.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/column.xml 2008-03-05 18:40:11 UTC (rev 6574)
+++ trunk/ui/dataTable/src/main/config/component/column.xml 2008-03-05 18:43:31 UTC (rev 6575)
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd"
+[
+<!ENTITY attributes SYSTEM "columnAttributes.ent">
+]
+>
<components>
<component>
<name>org.richfaces.Column</name>
@@ -29,123 +33,6 @@
<taghandler>
<classname>org.richfaces.taglib.ColumnTagHandler</classname>
</taghandler>
- &ui_component_attributes;
- &html_universal_attributes;
- <property disabled="true">
- <name>header</name>
- </property>
- <property disabled="true">
- <name>footer</name>
- </property>
- <property>
- <name>colspan</name>
- <classname>int</classname>
- <description>Corresponds to the HTML colspan attribute</description>
- </property>
- <property>
- <name>rowspan</name>
- <classname>int</classname>
- <description>Corresponds to the HTML rowspan attribute</description>
- </property>
- <property>
- <name>breakBefore</name>
- <classname>boolean</classname>
- <description>if "true" next column begins from the first row</description>
- </property>
- <property>
- <name>headerClass</name>
- <classname>java.lang.String</classname>
- <description>Space-separated list of CSS style class(es) that are be applied to any header generated for this table</description>
- <defaultvalue>""</defaultvalue>
- </property>
- <property>
- <name>footerClass</name>
- <classname>java.lang.String</classname>
- <description>Space-separated list of CSS style class(es) that are be applied to any footer generated for this table</description>
- <defaultvalue>""</defaultvalue>
- </property>
- <property>
- <name>width</name>
- <classname>java.lang.String</classname>
- <description>
- Attribute defines width of column.
- </description>
- </property>
-
- <property>
- <name>sortable</name>
- <classname>boolean</classname>
- <description>Boolean attribute. If "true" it's possible to sort the column content after click on the header.
- Default value is "true"
- </description>
- <defaultvalue>true</defaultvalue>
- </property>
- <property>
- <name>sortExpression</name>
- <classname>java.lang.String</classname>
- <description>DEPRECATED(use sortBy)Attribute defines a bean property which is used for sorting of a column</description>
- </property>
- <property>
- <name>sortBy</name>
- <classname>java.lang.String</classname>
- <description>Attribute defines a bean property which is used for sorting of a column</description>
- </property>
- <property>
- <name>sortOrder</name>
- <classname>org.richfaces.model.Ordering</classname>
- <description>SortOrder is an enumeration of the possible sort orderings.</description>
- <defaultvalue>Ordering.UNSORTED</defaultvalue>
- </property>
- <property>
- <name>comparator</name>
- <classname>java.util.Comparator</classname>
- <description></description>
- </property>
- <property>
- <name>selfSorted</name>
- <classname>boolean</classname>
- <description></description>
- <defaultvalue>true</defaultvalue>
- </property>
-
- <property elonly="true">
- <name>filterExpression</name>
- <classname>boolean</classname>
- <description>Attribute defines a bean property which is used for filtering of a column</description>
- </property>
- <property elonly="true">
- <name>filterMethod</name>
- <classname>javax.el.MethodExpression</classname>
- <methodargs>java.lang.Object</methodargs>
- <returntype>boolean</returntype>
- <description></description>
- </property>
- <property elonly="true">
- <name>filterBy</name>
- <classname>java.lang.Object</classname>
- <description></description>
- </property>
- <property>
- <name>filterValue</name>
- <classname>java.lang.String</classname>
- <description></description>
- </property>
-
- <!--
- <property>
- <name>param</name>
- <classname>java.lang.String</classname>
- <description>
- </description>
- <defaultvalue>"default"</defaultvalue>
- </property>
- -->
-
- <property>
- <name>filterEvent</name>
- <classname>java.lang.String</classname>
- <description>Event for filter input that forces the filtration (default = onchange)</description>
- <defaultvalue>"onchange"</defaultvalue>
- </property>
+ &attributes;
</component>
</components>
Added: trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
===================================================================
--- trunk/ui/dataTable/src/main/config/component/columnAttributes.ent (rev 0)
+++ trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2008-03-05 18:43:31 UTC (rev 6575)
@@ -0,0 +1,107 @@
+&ui_component_attributes;
+&html_universal_attributes;
+<property disabled="true">
+ <name>header</name>
+</property>
+<property disabled="true">
+ <name>footer</name>
+</property>
+<property>
+ <name>colspan</name>
+ <classname>int</classname>
+ <description>Corresponds to the HTML colspan attribute</description>
+</property>
+<property>
+ <name>rowspan</name>
+ <classname>int</classname>
+ <description>Corresponds to the HTML rowspan attribute</description>
+</property>
+<property>
+ <name>breakBefore</name>
+ <classname>boolean</classname>
+ <description>if "true" next column begins from the first row</description>
+</property>
+<property>
+ <name>headerClass</name>
+ <classname>java.lang.String</classname>
+ <description>Space-separated list of CSS style class(es) that are be applied to any header generated for this table</description>
+ <defaultvalue>""</defaultvalue>
+</property>
+<property>
+ <name>footerClass</name>
+ <classname>java.lang.String</classname>
+ <description>Space-separated list of CSS style class(es) that are be applied to any footer generated for this table</description>
+ <defaultvalue>""</defaultvalue>
+</property>
+<property>
+ <name>width</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Attribute defines width of column.
+ </description>
+</property>
+
+<property>
+ <name>sortable</name>
+ <classname>boolean</classname>
+ <description>Boolean attribute. If "true" it's possible to sort the column content after click on the header.
+ Default value is "true"
+ </description>
+ <defaultvalue>true</defaultvalue>
+</property>
+<property>
+ <name>sortExpression</name>
+ <classname>java.lang.String</classname>
+ <description>DEPRECATED(use sortBy)Attribute defines a bean property which is used for sorting of a column</description>
+</property>
+<property>
+ <name>sortBy</name>
+ <classname>java.lang.String</classname>
+ <description>Attribute defines a bean property which is used for sorting of a column</description>
+</property>
+<property>
+ <name>sortOrder</name>
+ <classname>org.richfaces.model.Ordering</classname>
+ <description>SortOrder is an enumeration of the possible sort orderings.</description>
+ <defaultvalue>Ordering.UNSORTED</defaultvalue>
+</property>
+<property>
+ <name>comparator</name>
+ <classname>java.util.Comparator</classname>
+ <description></description>
+</property>
+<property>
+ <name>selfSorted</name>
+ <classname>boolean</classname>
+ <description></description>
+ <defaultvalue>true</defaultvalue>
+</property>
+
+<property elonly="true">
+ <name>filterExpression</name>
+ <classname>boolean</classname>
+ <description>Attribute defines a bean property which is used for filtering of a column</description>
+</property>
+<property elonly="true">
+ <name>filterMethod</name>
+ <classname>javax.el.MethodExpression</classname>
+ <methodargs>java.lang.Object</methodargs>
+ <returntype>boolean</returntype>
+ <description></description>
+</property>
+<property elonly="true">
+ <name>filterBy</name>
+ <classname>java.lang.Object</classname>
+ <description></description>
+</property>
+<property>
+ <name>filterValue</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+</property>
+<property>
+ <name>filterEvent</name>
+ <classname>java.lang.String</classname>
+ <description>Event for filter input that forces the filtration (default = onchange)</description>
+ <defaultvalue>"onchange"</defaultvalue>
+</property>
16 years, 10 months
JBoss Rich Faces SVN: r6574 - trunk/docs/faq/en/src/main/docbook/module.
by richfaces-svn-commits@lists.jboss.org
Author: vsukhov
Date: 2008-03-05 13:40:11 -0500 (Wed, 05 Mar 2008)
New Revision: 6574
Modified:
trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
Log:
http://jira.jboss.com/jira/browse/RF-2156
I've added more details about table cells rerendering into FAQ
Modified: trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
===================================================================
--- trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-03-05 18:12:24 UTC (rev 6573)
+++ trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-03-05 18:40:11 UTC (rev 6574)
@@ -1803,4 +1803,47 @@
inputText.getFacets().put("a4jsupport", ajaxSupport);
]]></programlisting>
</section>
+ <section>
+ <?dbhtml filename="HighlightRowDataTable.html"?>
+ <title>How to ReRender table cells with ajax support?</title>
+ <para>In order to ReRender table cells with ajax support you must set exact id values for a all updatable components,
+ and point this id's in the reRender parameters.</para>
+
+ <note>
+ <title>Note:</title>
+ <para>The value of <emphasis><property>"reRender"</property></emphasis>
+ attribute of the <emphasis role="bold"><property><a4j:support></property></emphasis> tag defines which part(s)
+ of our page is (are) to be updated. In this case, the only part of the page to update is the
+ <emphasis role="bold"><property><h:outputText></property></emphasis> tag because its ID value matches to the value of <emphasis><property>"reRender"</property></emphasis>
+ attribute.
+ As you see, it's not difficult to update multiple elements on the page, only list their IDs as the value of "reRender" .</para>
+ </note>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:column>
+ <f:facet name="header">
+ <h:outputText value="Input1"/>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="#{Controller.totalInput1}"/>
+ </f:facet>
+ <h:inputText id="input1" value="#{entry.input1}" >
+ <a4j:support actionListener="{Controller.updateEntry}"event="onblur" reRender="output1">
+ </a4j:support>
+ </h:inputText>
+</rich:column>
+<rich:column>
+ <f:facet name="header">
+ <h:outputText value="Value2"/>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="#{Controller.totalOutput1}"/>
+ </f:facet>
+ <h:outputText id="output1" value="#{entry.output1}" >
+ </h:outputText>
+</rich:column>
+...]]></programlisting>
+ </section>
</chapter>
16 years, 10 months
JBoss Rich Faces SVN: r6573 - in trunk/ui/menu-components/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-05 13:12:24 -0500 (Wed, 05 Mar 2008)
New Revision: 6573
Modified:
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1650
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2008-03-05 17:42:54 UTC (rev 6572)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2008-03-05 18:12:24 UTC (rev 6573)
@@ -58,6 +58,7 @@
Object itemStyle = parentMenu.getAttributes().get("itemStyle");
Object disabledItemClass = parentMenu.getAttributes().get("disabledItemClass");
Object disabledItemStyle = parentMenu.getAttributes().get("disabledItemStyle");
+ Object selectItemClass = parentMenu.getAttributes().get("selectItemClass");
if (null == itemClass) {
itemClass = "";
@@ -71,6 +72,9 @@
if (null == disabledItemStyle) {
disabledItemStyle = "";
}
+ if (null == selectItemClass) {
+ selectItemClass = "";
+ }
if (menuGroup.isDisabled()) {
variables.setVariable("menuGroupClass", "dr-menu-item dr-menu-item-disabled rich-menu-group rich-menu-group-disabled " +
@@ -84,12 +88,16 @@
} else {
variables.setVariable("menuGroupClass", "dr-menu-item dr-menu-item-enabled rich-menu-group " +
itemClass + " " + menuGroup.getStyleClass());
+ variables.setVariable("menuGroupHoverClass", "this.className='dr-menu-item dr-menu-item-enabled rich-menu-group " +
+ itemClass + " " + selectItemClass + " " + menuGroup.getStyleClass() + "'");
variables.setVariable("menuGroupStyle",
itemStyle + "; " + menuGroup.getStyle());
variables.setVariable("menuGroupMouseMove", menuGroup.getAttributes().get("onmousemove"));
variables.setVariable("menuGroupItemIconClass", "rich-menu-item-icon-enabled");
variables.setVariable("menuGroupItemLabelClass", "rich-menu-item-label");
variables.setVariable("menuGroupItemFolderClass", "rich-menu-item-folder");
+ variables.setVariable("onmouseoutInlineStyles", processInlineStyles(context, menuGroup, false));
+ variables.setVariable("onmouseoverInlineStyles", processInlineStyles(context, menuGroup, true));
}
}
@@ -144,4 +152,42 @@
throw new FacesException( "Parent menu for menu group (id="
+ menuGroup.getClientId(context) + ") has not been found.");
}
+
+ protected String processInlineStyles(FacesContext context,
+ UIMenuGroup menuGroup, boolean isOnmouseover) {
+
+ StringBuffer buffer = new StringBuffer();
+ Object style = menuGroup.getAttributes().get("style");
+ Object selectStyle = menuGroup.getAttributes().get("selectStyle");
+
+ UIComponent parentMenu = getParentMenu(context, menuGroup);
+ Object selectItemStyle = parentMenu.getAttributes().get("selectItemStyle");
+ Object itemStyle = parentMenu.getAttributes().get("itemStyle");
+
+ if (null == selectStyle) {
+ selectStyle = "";
+ }
+ if (null == selectItemStyle) {
+ selectItemStyle = "";
+ }
+ if (null == itemStyle) {
+ itemStyle = "";
+ }
+
+ selectStyle = itemStyle + "; " + selectItemStyle + "; " + selectStyle;
+
+ buffer.append("$('ref" + menuGroup.getClientId(context) + "').style.cssText='");
+
+ if (null != style) {
+ buffer.append(style.toString() + "; ");
+ }
+
+ if (isOnmouseover) {
+ buffer.append(selectStyle.toString() + ";';");
+ } else {
+ buffer.append(itemStyle.toString() + ";';");
+ }
+
+ return buffer.toString();
+ }
}
Modified: trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
===================================================================
--- trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2008-03-05 17:42:54 UTC (rev 6572)
+++ trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2008-03-05 18:12:24 UTC (rev 6573)
@@ -25,8 +25,10 @@
<div id="ref#{clientId}"
class="#{menuGroupClass}"
- style="#{component.attributes['style']}"
- onmousemove="#{menuGroupMouseMove}">
+ style="#{menuGroupStyle}"
+ onmousemove="#{menuGroupMouseMove}"
+ onmouseout="this.className='#{menuGroupClass}'; #{onmouseoutInlineStyles}"
+ onmouseover="#{menuGroupHoverClass}; #{onmouseoverInlineStyles}" >
<span id="ref#{clientId}:icon"
class="dr-menu-icon #{menuGroupItemIconClass} #{component.attributes['iconClass']}">
16 years, 10 months
JBoss Rich Faces SVN: r6572 - Plan/3.2.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-03-05 12:42:54 -0500 (Wed, 05 Mar 2008)
New Revision: 6572
Modified:
trunk/test-applications/qa/Test Plan/3.2.0/TestPlan-RF-3.2.0.doc
Log:
Modified: trunk/test-applications/qa/Test Plan/3.2.0/TestPlan-RF-3.2.0.doc
===================================================================
(Binary files differ)
16 years, 10 months
JBoss Rich Faces SVN: r6571 - in trunk/ui/suggestionbox/src: main/java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2008-03-05 11:56:15 -0500 (Wed, 05 Mar 2008)
New Revision: 6571
Modified:
trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-1774
Modified: trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-03-05 16:48:58 UTC (rev 6570)
+++ trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-03-05 16:56:15 UTC (rev 6571)
@@ -354,7 +354,7 @@
</property>
<property>
<name>selectedObjects</name>
- <classname>java.lang.Object</classname>
+ <classname>javax.el.ValueExpression</classname>
</property>
</component>
</components>
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-05 16:48:58 UTC (rev 6570)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2008-03-05 16:56:15 UTC (rev 6571)
@@ -22,10 +22,12 @@
package org.richfaces.component;
import java.util.Collection;
+import java.util.HashMap;
import java.util.Map;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
+import javax.faces.component.UIComponent;
import javax.faces.component.UIData;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
@@ -106,9 +108,9 @@
public abstract Object getData();
- public abstract Object getSelectedObjects();
+ public abstract ValueExpression getSelectedObjects();
- public abstract void setSelectedObjects(Object so);
+ public abstract void setSelectedObjects(ValueExpression so);
@@ -310,8 +312,8 @@
public final void broadcast(final FacesEvent event)
throws AbortProcessingException {
super.broadcast(event);
- if (event instanceof AjaxEvent) {
- FacesContext context = getFacesContext();
+ FacesContext context = getFacesContext();
+ if (event instanceof AjaxEvent) {
AjaxRendererUtils.addRegionsFromComponent(this, context);
AjaxRendererUtils.addRegionByName(context, this, this.getId());
setSubmitted(true);
@@ -320,9 +322,19 @@
.renderSubmittedAjaxRegion(context, true);
}
} else if (event instanceof SelectSuggestionEvent) {
- setValue(null);
+ setValue(null);
}
+
}
+ private Object getElementFromMap(Object selection){
+ //TODO Add more than one Object support.
+ HashMap<Object, Object> data = (HashMap<Object, Object>) getData();
+ if(data!=null){
+ return data.get(selection);
+ }else{
+ return null;
+ }
+ }
public void queueEvent(FacesEvent event) {
if (event instanceof SelectSuggestionEvent) {
@@ -349,12 +361,20 @@
setRowNumber(Integer.parseInt(rowValue)+getFirst());
setupValue(context);
queueEvent(new SelectSuggestionEvent(this));
+
} else {
setRowNumber(-1);
}
- Object selectedObject = requestParameterMap.get(clientId+"_hiddenFetchValue");
- setSelectedObjects(selectedObject);
- super.processDecodes(context);
+
+ Object selectedObject = context.getExternalContext().getRequestParameterMap().get(getClientId(context)+"_hiddenFetchValue");
+ /*TODO set selected from Map to bean property or put it ot Listener.
+ ValueExpression ve = getSelectedObjects();
+ if(ve!=null){
+ ve.setValue(context.getELContext(), getElementFromMap(selectedObject));
+ setSelectedObjects(ve);
+ }
+ */
+ super.processDecodes(context);
}
public void setupValue(FacesContext context) {
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-05 16:48:58 UTC (rev 6570)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-05 16:56:15 UTC (rev 6571)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -145,7 +146,8 @@
((UISuggestionBox) component).setSubmitedValue(elementValue);
component.queueEvent(new AjaxSuggestionEvent(component,
elementValue));
- }
+ }
+
}
/**
@@ -169,15 +171,7 @@
context, component);
}
- protected void writeExplicitMarkup(ResponseWriter writer,
- UISuggestionBox suggestionBox) {
- String forAttribute = suggestionBox.getFor();
- if (forAttribute != null && forAttribute.length() > 0) {
-
- }
- }
-
/**
* Encode end.
*
@@ -285,9 +279,9 @@
suggestionBox.setupValue(context);
body.encode(getTemplateContext(context, suggestionBox));
- Object[] values = ((Collection) suggestionBox.getValue()).toArray();
- // Object hiddenFetchValue = suggestionBox.getHiddenFetchValue();
+ Object[] values = ((Collection) suggestionBox.getValue()).toArray();
Collection data = new ArrayList();
+ HashMap<Object,Object> dataToStore = new HashMap<Object,Object>();
for (int i = 0; i < values.length; i++) {
String var = (String) suggestionBox.getAttributes().get("var");
@@ -295,12 +289,15 @@
.put(var, values[i]);
if (suggestionBox.getHiddenFetchValue() != null) {
data.add(suggestionBox.getHiddenFetchValue());
+ dataToStore.put(suggestionBox.getHiddenFetchValue(), values[i]);
} else {
data.add(suggestionBox.getFetchValue());
+ dataToStore.put(suggestionBox.getFetchValue(), values[i]);
}
+
}
- suggestionBox.setData(data);
+ suggestionBox.setData(dataToStore);
// Replace rendered area ID from component to suggestion table
suggestionBox.setRowIndex(-1);
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
@@ -877,4 +874,5 @@
return "dr-sb-int rich-sb-int " + entryClass + " " + rowClass;
}
+
}
Modified: trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java
===================================================================
--- trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2008-03-05 16:48:58 UTC (rev 6570)
+++ trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2008-03-05 16:56:15 UTC (rev 6571)
@@ -118,6 +118,12 @@
HtmlElement iframe = page.getHtmlElementById(sb.getClientId(facesContext) + "_iframe");
assertNotNull(iframe);
assertEquals("iframe", iframe.getNodeName());
+ HtmlElement input_select = page.getHtmlElementById(sb.getClientId(facesContext)+"_selection");
+ assertNotNull(input_select);
+ assertSame("input", input_select.getNodeName());
+ HtmlElement input_fetchValue = page.getHtmlElementById(sb.getClientId(facesContext)+"_hiddenFetchValue");
+ assertNotNull(input_fetchValue);
+ assertSame("input", input_fetchValue.getNodeName());
}
/**
16 years, 10 months
JBoss Rich Faces SVN: r6570 - management/design/inplaceInput/design.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-03-05 11:48:58 -0500 (Wed, 05 Mar 2008)
New Revision: 6570
Modified:
management/design/inplaceInput/design/inplaceInput.html
Log:
Modified: management/design/inplaceInput/design/inplaceInput.html
===================================================================
--- management/design/inplaceInput/design/inplaceInput.html 2008-03-05 15:20:39 UTC (rev 6569)
+++ management/design/inplaceInput/design/inplaceInput.html 2008-03-05 16:48:58 UTC (rev 6570)
@@ -12,6 +12,8 @@
.is_default_state{white-space : nowrap; background-color : #f1f1f1/*editorBackgroundColor*/; border-bottom : 1px dashed #000000/*generalTextColor*/; padding-left : 3px; padding-right : 3px;}
+.is_default_text{white-space : nowrap;}
+
.is_changed_state{background-image:url(images/mark_changed.gif); background-position : top left; background-repeat : no-repeat;}
.is_edit_state{position : relative; width : 100px;}
@@ -52,7 +54,7 @@
<fieldset><legend>Default State</legend><br><br>
<div style="width : 300px;">
Fresh off his victory in the Florida primary, Sen. John McCain is poised to take another big prize. Former
- <span class="is_default_state"><a href="#"><span style="width : 1px; height : 1px; position : relative"></span></a>New York</span> Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
+ <span class="is_default_state"><a href="#"><span style="width : 1px; height : 1px; position : relative"></span></a><span class="is_default_text">New York</span><img src="images/spacer.gif" width="100" height="1" alt="" border="0"></span> Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
</div>
</fieldset>
@@ -98,7 +100,7 @@
<fieldset><legend>Changed State</legend><br><br>
<div style="width : 300px;">
Fresh off his victory in the Florida primary, Sen. John McCain is poised to take another big prize. Former
- <span class="is_default_state is_changed_state"><a href="#"><span style="width : 1px; height : 1px; position : relative"></span></a>New York</span> Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
+ <span class="is_default_state is_changed_state"><a href="#"><span style="width : 1px; height : 1px; position : relative"></span></a><span class="is_default_text">New York</span><img src="images/spacer.gif" width="100" height="1" alt="" border="0"></span> Mayor Rudy Giuliani plans to drop out and endorse McCain, two GOP sources said. That would give McCain added momentum heading into a debate Wednesday and next week's Super Tuesday contests
</div>
</fieldset>
16 years, 10 months
JBoss Rich Faces SVN: r6569 - Plan/3.2.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-03-05 10:20:39 -0500 (Wed, 05 Mar 2008)
New Revision: 6569
Modified:
trunk/test-applications/qa/Test Plan/3.2.0/TestPlan-RF-3.2.0.doc
Log:
Modified: trunk/test-applications/qa/Test Plan/3.2.0/TestPlan-RF-3.2.0.doc
===================================================================
(Binary files differ)
16 years, 10 months