JBoss Rich Faces SVN: r6608 - in trunk: ui/componentControl/src/main/config/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vsukhov
Date: 2008-03-06 13:26:15 -0500 (Thu, 06 Mar 2008)
New Revision: 6608
Modified:
trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
trunk/ui/componentControl/src/main/config/component/componentControl.xml
Log:
http://jira.jboss.com/jira/browse/RF-2061 I've added useful information from:
-How to use jsFunction with JSON
-How to DynamicColumns
-RichFacesWithTrinidad
to FAQ.
http://jira.jboss.com/jira/browse/RF-2221
I've changed the description for disableDefault attribute in componentControl
Modified: trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
===================================================================
--- trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-03-06 17:05:50 UTC (rev 6607)
+++ trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-03-06 18:26:15 UTC (rev 6608)
@@ -1846,4 +1846,452 @@
</rich:column>
...]]></programlisting>
</section>
+ <section>
+ <?dbhtml filename="HighlightRowDataTable.html"?>
+ <title>How to use jsFunction with JSON?</title>
+ <para>There is some main cases to use jsFunction and JSON. An example use case: </para>
+
+ <para>A user want to create device in a circuit diagram.</para>
+ <itemizedlist>
+ <listitem>
+ He drags and drops it from the toolbox in our embedded Javascript(!) graphical editor. But first only a "please wait"-ModalPanel is shown.
+ </listitem>
+ <listitem>
+ With JSFunction we come to the SessionBean and from there to the DB to fetch some Data for drawing the device in the Editor.
+ </listitem>
+ <listitem>
+ When the answer comes back, we asked the user with a modal panel to give a name to the device.
+ </listitem>
+ <listitem>
+ After he clicks OK, the model panel disappears (and the please wait model panel shows up again) and another JSFunction call goes over the SessionBean to the DB to create the device data there.
+ </listitem>
+ <listitem>
+ When the answer comes back, a JSON-String is created with all data for drawing the device (for example the given name) and the Editor is advised to draw it (and the please wait modal panel disappears again).
+ </listitem>
+ </itemizedlist>
+ <para>Here you can see the example of creating the JSONExporter, where you can put any dataclass.</para>
+ <note>
+ <para>JSON exporter class, knows what data of the data class you need directly in Javascript.</para>
+ </note>
+ <para> Here an example for such an exporter class: </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.json.JSONException;
+ import org.richfaces.json.JSONObject;
+public class SomeDataToJSON implements DataToJSON {
+ public String toJSON(Object obj)
+ {
+ SomeData data = (SomeData) obj;
+ JSONObject dataToJSON = new JSONObject();
+ try
+ {
+ dataToJSON.put("ID", data.getObjPhysName());
+ dataToJSON.put("name", data.getName());
+ dataToJSON.put("width", data.getWidth());
+ dataToJSON.put("height", data.getHeight());
+ }
+ catch (JSONException e)
+ {
+ //TODO Approriate exception handling
+ e.printStackTrace();
+ }
+ return dataToJSON.toString();
+ }
+ }
+ ]]></programlisting>
+ <para>As you can see, the SimpleJSON library build the JSON-String for you (integrated in Richfaces).
+ Sometimes you have to add some brackets or something else.</para>
+ <para>Here your Javascript code.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[var jsonString = executeObjectCreation("test", "anotherParam");
+var myObject = eval(jsonString);
+
+var name = myObject.name;
+...]]></programlisting>
+ <!--para>You can use jsFunction to call the jsonTest backing bean that generates some random data in a JSON-String.
+ That JSON-String is then passed to the updateFields method, which evaluates it and populates some html tags with its content. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+ xmlns:a4j="http://richfaces.org/a4j">
+ <ui:define name="content">
+ <script lang="javascript" >
+ function updateFields(data){
+ var myObj = eval("("+ data +")");
+ document.getElementById('cpty').innerHTML = myObj.cpty;
+ document.getElementById('exposure').innerHTML = myObj.exposure;
+ document.getElementById('limit').innerHTML = myObj.limit;
+ }
+ </script>
+ <a4j:form>
+ <a4j:jsFunction name="testJsFunc" action="#{jsonTest.actionMethod}" data="#{jsonTest.jsonData}" ajaxSingle="true"
+ ignoreDupResponses="true" eventQueue="foo" oncomplete="updateFields(data);" >
+ <a4j:actionparam name="Param1" assignTo="#{jsonTest.cptyParam}"/>
+ </a4j:jsFunction>
+ </a4j:form>
+ <table>
+ <tr>
+ <td>
+ <a href="#" onclick="testJsFunc('VALUE1')">Set for VALUE1</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <a href="#" onclick="testJsFunc('VALUE2')">Set for VALUE2</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <a href="#" onclick="testJsFunc('VALUE3')">Set for VALUE3</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <a href="#" onclick="testJsFunc('VALUE4')">Set for VALUE4</a>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <th>Counterparty</th>
+ <th>Exposure</th>
+ <th>Limit</th>
+ </tr>
+ <tr>
+ <th>
+ <h:outputText id="cpty" value=""/>
+ </th>
+ <th>
+ <h:outputText id="exposure" value=""/>
+ </th>
+ <th>
+ <h:outputText id="limit" value=""/>
+ </th>
+ </tr>
+ </table>
+ </ui:define>
+</ui:composition>
+...]]></programlisting>
+ <para>If you are not familiar with the annotations,
+ they are from the Seam framework and can be removed and replaced with a managed bean definition in faces-config.xml.</para>
+ <programlisting role="JAVA"><![CDATA[import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.json.JSONException;
+import org.richfaces.json.JSONObject;
+
+@Name("jsonTest")
+(a)Scope(ScopeType.EVENT)
+public class JsonTest {
+
+ public String cptyParam;
+
+ public String jsonData;
+
+ public String actionMethod(){
+ Random rand = new Random(System.currentTimeMillis());
+
+ Map<String,String> data = new HashMap<String,String>();
+ data.put("cpty", cptyParam);
+ data.put("exposure", ""+(rand.nextFloat()*10) );
+ data.put("limit", ""+(rand.nextInt(50)));
+
+ jsonData = toJSON(data);
+
+ return null;
+ }
+
+ public String toJSON(Map<String,String> data){
+
+ JSONObject dataToJSON = new JSONObject();
+ try{
+ dataToJSON.put("cpty", data.get("cpty"));
+ dataToJSON.put("exposure", data.get("exposure"));
+ dataToJSON.put("limit", data.get("limit"));
+ }
+ catch (JSONException e){
+ //TODO Approriate exception handling
+ e.printStackTrace();
+ }
+ return dataToJSON.toString();
+ }
+
+ public String getCptyParam() {
+ return cptyParam;
+ }
+
+ public void setCptyParam(String aCptyParam) {
+ cptyParam = aCptyParam;
+ }
+
+ public String getJsonData() {
+ return jsonData;
+ }
+
+ public void setJsonData(String aJsonData) {
+ jsonData = aJsonData;
+ }
+}
+...]]></programlisting-->
+ </section>
+ <section>
+ <?dbhtml filename="HighlightRowDataTable.html"?>
+ <title>How to DynamicColumns?</title>
+ <para>In order to create DynamicColumns you can use the rendered attribute of the rich:column. </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<ui:composition template="/WEB-INF/layout/template.xhtml">
+ <ui:define name="body">
+ <h2>Table</h2>
+ <h:form>
+ <rich:dataTable id="aTable" onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
+ onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" value="#{trb.tableData}" var="row">
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column colspan="2">
+ Testing
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <f:facet name="footer">
+ <rich:columnGroup>
+ <rich:column colspan="2">
+ Footer
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <rich:column rendered="#{trb.cellRendered['value1']}">
+ <f:facet name="header">
+
+ <s:div>
+ value1 <h:commandLink value="x" action="#{trb.hideColumn('value1')}"/>
+ </s:div>
+ </f:facet>
+ #{row.value1}
+ </rich:column>
+
+ </rich:dataTable>
+ Generate new table values:
+ <h:commandButton value="generate" action="#{trb.createData}"/>
+ </h:form>
+
+ <h:form>
+ Select which columns are rendered.
+ <br/>
+ <h:selectBooleanCheckbox title="value1" value="#{trb.cellRendered['value1']}"/>
+ <br/>
+ <h:commandButton value="Apply" action="rerender"/>
+ </h:form>
+ </ui:define>
+</ui:composition>
+...]]></programlisting>
+ <para>Here you can see the JAVA code.</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[
+public class TableBackingRendered implements Serializable{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Random rand = new Random(System.currentTimeMillis());
+ private List<TableItem> tableData;
+ private Map<String,Boolean> cellRendered = new HashMap<String,Boolean>();
+ public TableBackingRendered(){
+ createData();
+ allCellsRendered();
+ }
+ public String createData(){
+ int count = rand.nextInt(25)+1;
+ tableData = new ArrayList<TableItem>(count);
+ for(int i=0; i<count; i++){
+ tableData.add( new TableItem(
+ "value1_" +i,
+ ));
+ }
+ return null;
+ }
+ public String allCellsRendered(){
+ cellRendered.put("value1", Boolean.TRUE);
+ return null;
+ }
+ public String hideColumn(final String columnToHide){
+ cellRendered.put(columnToHide, Boolean.FALSE);
+ return null;
+ }
+ public List<TableItem> getTableData() {
+ return tableData;
+ }
+ public Map<String, Boolean> getCellRendered() {
+ return cellRendered;
+ }
+ public void setCellRendered(Map<String, Boolean> cellRendered) {
+ this.cellRendered = cellRendered;
+ }
+ public void setTableData(List<TableItem> tableData) {
+ this.tableData = tableData;
+ }
+}
+...]]></programlisting>
+ <!--para>Another solution when you are dealing with a significant amount of rows, if you are using facelets you can use c:forEach (jslt).</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...<rich:dataTable value="report.rows" var="row">
+<f:facet name="header">
+ <rich:columnGroup>
+ <c:forEach var="col" items="#{report.columns}/>
+ <h:outputText value="#{col.label}"/>
+ </c:forEach>
+ </rich:columnGroup>
+</f:facet>
+ <c:forEach var="cell" items="#{report.columns}" varStatus="col">
+ <h:outputText value="#{rowCol.index?.cells.value}"/>
+ </c:forEach>
+</rich:dataTable>
+...]]></programlisting-->
+ </section>
+ <section>
+ <?dbhtml filename="HighlightRowDataTable.html"?>
+ <title>RichFacesWithTrinidad?</title>
+ <para>Here is a stripped down version of web.xml that integrates Richfaces and Trinidad.</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[
+<?xml version="1.0" ?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
+ version="2.5">
+
+ <!-- Ajax4jsf -->
+ <context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>blueSky</param-value>
+ </context-param>
+
+ <!-- Seam -->
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+
+ <!-- Facelets -->
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- JSF -->
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.xhtml</url-pattern>
+ </servlet-mapping>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+
+ <!-- Trinidad - as suggested by a4j-trinidad example-->
+ <context-param>
+ <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param>
+ <filter>
+ <filter-name>Trinidad</filter-name>
+ <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>Trinidad</filter-name>
+ <url-pattern>*.xhtml</url-pattern>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+ <context-param>
+ <param-name>org.apache.myfaces.trinidad.CACHE_VIEW_ROOT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <servlet>
+ <servlet-name>Trinidad Resources</servlet-name>
+ <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Trinidad Resources</servlet-name>
+ <url-pattern>/adf/*</url-pattern>
+ </servlet-mapping>
+
+ <!-- Security -->
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Secure Content</web-resource-name>
+ <url-pattern>*.xhtml</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>AuthorizedUser</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>The Restricted Zone</realm-name>
+ </login-config>
+ <security-role>
+ <description>The role required to access restricted content</description>
+ <role-name>AuthorizedUser</role-name>
+ </security-role>
+
+ <!-- Welcome files -->
+ <welcome-file-list>
+ <welcome-file>index.xhtml</welcome-file>
+ </welcome-file-list>
+
+</web-app>
+]]></programlisting>
+ </section>
</chapter>
Modified: trunk/ui/componentControl/src/main/config/component/componentControl.xml
===================================================================
--- trunk/ui/componentControl/src/main/config/component/componentControl.xml 2008-03-06 17:05:50 UTC (rev 6607)
+++ trunk/ui/componentControl/src/main/config/component/componentControl.xml 2008-03-06 18:26:15 UTC (rev 6608)
@@ -35,7 +35,7 @@
<name>disableDefault</name>
<classname>boolean</classname>
<description>
- If "true", it is used to avoid a problem with form submit and modalPanel showing
+ Disable default action for target event ( append "return false;" to javascript )
</description>
</property>
<property>
16 years, 10 months
JBoss Rich Faces SVN: r6607 - trunk/samples/simpleTogglePanel-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: vbaranov
Date: 2008-03-06 12:05:50 -0500 (Thu, 06 Mar 2008)
New Revision: 6607
Modified:
trunk/samples/simpleTogglePanel-sample/src/main/webapp/pages/pageRF_2195.jsp
Log:
Update test for jira issue
http://jira.jboss.com/jira/browse/RF-2299
Modified: trunk/samples/simpleTogglePanel-sample/src/main/webapp/pages/pageRF_2195.jsp
===================================================================
--- trunk/samples/simpleTogglePanel-sample/src/main/webapp/pages/pageRF_2195.jsp 2008-03-06 16:39:11 UTC (rev 6606)
+++ trunk/samples/simpleTogglePanel-sample/src/main/webapp/pages/pageRF_2195.jsp 2008-03-06 17:05:50 UTC (rev 6607)
@@ -15,6 +15,7 @@
</stp:simpleTogglePanel>
<h:outputText value="#{simpleBean.property}" id="out"/>
</h:form>
+ <a4j:log popup="false"/>
</f:view>
</body>
</html>
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r6606 - in trunk/ui/inplaceInput/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-06 11:39:11 -0500 (Thu, 06 Mar 2008)
New Revision: 6606
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-06 16:08:28 UTC (rev 6605)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-06 16:39:11 UTC (rev 6606)
@@ -182,10 +182,16 @@
this.changeState(Richfaces.InplaceInput.STATES[1]);
var inputSize = this.setInputWidth(textSize);
+ var coordsVal = Richfaces.InplaceInput.getElemXY(this.inplaceInput);
+ var coordsStrut = Richfaces.InplaceInput.getElemXY(this.strut);
+
this.tabber.hide();
this.inplaceInput.className = this.classes.COMPONENT.EDITABLE;
this.setStrutWidth(textSize);
+ this.tempValueKeeper.style.left = 0 + "px";
+ this.tempValueKeeper.style.top = (coordsVal.top - coordsStrut.top) + "px";
+
this.tempValueKeeper.show();
if (this.bar) {
@@ -200,7 +206,7 @@
setStrutWidth : function(textSize) {
this.tempValueKeeper.show();
- this.strut.style.width = textSize + "px";
+ this.strut.style.width = "100px";
this.strut.show();
},
@@ -429,4 +435,15 @@
//FIXME
oTextbox.setSelectionRange(iStart, iEnd);
}
+};
+
+Richfaces.InplaceInput.getElemXY = function(elem) {
+ var x = elem.offsetLeft;
+ var y = elem.offsetTop;
+
+ for (var parent = elem.offsetParent; parent; parent = parent.offsetParent) {
+ x += parent.offsetLeft;
+ y += parent.offsetTop;
+ }
+ return {left: x, top: y};
};
\ No newline at end of file
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-06 16:08:28 UTC (rev 6605)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-06 16:39:11 UTC (rev 6606)
@@ -63,7 +63,7 @@
<img id="#{clientId}strut" src="#{spacer}" class="rich-inplace-input-strut"/>
<input id='#{clientId}tempValue'
class='rich-inplace-field'
- style='display:none;'
+ style='display:none;position:absolute;'
type='text'
maxlength='#{component.attributes["inputMaxLength"]}'
autocomplete="off"
16 years, 10 months
JBoss Rich Faces SVN: r6605 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-03-06 11:08:28 -0500 (Thu, 06 Mar 2008)
New Revision: 6605
Modified:
trunk/docs/userguide/en/src/main/docbook/included/progressBar.xml
Log:
http://jira.jboss.com/jira/browse/RF-1690
Some sentences were amended.
Modified: trunk/docs/userguide/en/src/main/docbook/included/progressBar.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/progressBar.xml 2008-03-06 16:06:40 UTC (rev 6604)
+++ trunk/docs/userguide/en/src/main/docbook/included/progressBar.xml 2008-03-06 16:08:28 UTC (rev 6605)
@@ -47,15 +47,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:progressBar value="#{bean.incValue}" enabled="#{bean.enabled}" id="progrs" action="#{bean.action}" >
- <f:facet name="initial">
- <h:outputText value="Process not started"></h:outputText>
- </f:facet>
- <f:facet name="complete">
- <h:outputText value="Process completed"></h:outputText>
- </f:facet>
- <h:outputText value="{value}%" ></h:outputText>
- </rich:progressBar>
+<progressBar:progressBar value="#{bean.incValue1}"/>
...]]></programlisting>
</section>
<section>
@@ -75,20 +67,6 @@
As it was mentioned above, the <emphasis role="bold"><property><rich:progressBar></property> </emphasis>
component displays the status of the ongoing process. The component has a number of key attributes.
</para>
- <para>
- The <emphasis><property> "label"</property></emphasis> attribute is responsible for displaying informational
- data on the progress bar, if it's not displayed using children components.
- If this attribute is not set and the children components are not used either, no textual information
- regarding ongoing process will be indicated.
- In order to indicate the current status you need to pass the value to this attribute. Please see an example.
- </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
-<rich:progressBar value="#{bean.incValue}" id="progrs" label="{value}%" >
-</rich:progressBar>
-...]]></programlisting>
<para>
The <emphasis><property>"value"</property></emphasis> attribute sets the current value of the process. Status of the process is calculated basing on <property> "value"</property> attribute.
</para>
@@ -107,11 +85,9 @@
</para>
<programlisting role="XML"><![CDATA[...
-<rich:progressBar value="#{bean.incValue}" enabled="#{bean.enabled}" id="progrs"
+<rich:progressBar value="#{bean.incValue}"
minValue="50"
- maxValue="400">
- <h:outputText value="{value}%" ></h:outputText>
-</rich:progressBar>
+ maxValue="400"/>
...]]> </programlisting>
<para> The <emphasis><property>"interval"</property></emphasis>attribute defines the frequency of status polling. Polling is active while the component is operational. </para>
<para>
@@ -119,12 +95,8 @@
</para>
<programlisting role="XML"><![CDATA[...
-<rich:progressBar value="#{bean.incValue}" enabled="#{bean.enabled}" id="progrs"
- nterval="900" >
- . . .
-</rich:progressBar>
+<rich:progressBar value="#{bean.incValue}" " id="progrs" interval="900"/>
...]]> </programlisting>
-
<para> The <emphasis><property>"parameters"</property></emphasis>attribute allows to send some
dynamical data to the component which is displayed in the informational part.
Parameters can be passed through <emphasis><property>"parameters"</property></emphasis> attribute, or from component control.</para>
@@ -132,42 +104,56 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<rich:progressBar ... progressVar="progress" parameters="param1:'1'" >
+<rich:progressBar progressVar="progress" parameters="param1:'1'" >
<h:outputText="{param1} task #{progress} %"/>
</rich:progressBar>
...]]> </programlisting>
- <para>
- The component can also employ the following facets to display the <property> "initial"</property> and <property> "complete"</property> states of the process:
+ <para>
+ The <emphasis><property> "label"</property></emphasis> attribute is responsible for displaying informational
+ data on the progress bar, if it's not displayed using children components.
+ If this attribute is not set and the children components are not used either, no textual information
+ regarding ongoing process will be indicated.
+ In order to indicate the current status you need to pass the value to this attribute. Please see an example.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
</para>
+ <programlisting role="XML"><![CDATA[...
+<rich:progressBar value="#{bean.incValue}" id="progrs" label="{value}%" >
+</rich:progressBar>
+...]]></programlisting>
+
+ <para> In order to display textual and numerical information on the progress bar (as it was said above this can be aslo performed using <emphasis><property> "label"</property></emphasis> attribute ) you can also use this code:
+ </para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<f:facet name="initial">
- <h:outputText value="Process not started" />
-</f:facet>
-...]]></programlisting>
+<h:outputText value="{value}%" ></h:outputText>
+...]]></programlisting>
+
<para>
- and
+ The component can also employ <emphasis><property> "initial"</property></emphasis> and <emphasis><property> "complete"</property></emphasis>
+ facets to display the states of the process: <emphasis><property> "initial"</property></emphasis> facet is displayed when the progress value is less or equal to <emphasis><property> "minValue"</property></emphasis>
+ , and the <emphasis><property> "complete"</property></emphasis> facet is shown when the value is greater or equal to <emphasis><property> "maxValue"</property></emphasis>. Please see an example below.
</para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<f:facet name="complete">
- <h:outputText value="Process completed" />
-</f:facet>
+<progressBar:progressBar value="#{bean.incValue1}" >
+ <f:facet name="initial">
+ <h:outputText value="Process not started"></h:outputText>
+ </f:facet>
+ <f:facet name="complete">
+ <h:outputText value="Process completed"></h:outputText>
+ </f:facet>
+</progressBar:progressBar>
...]]> </programlisting>
- <para> However, the usage of these facets is optional. If you omit them nothing will be displayed. </para>
-
- <para> In order to display textual and numerical information on the progress bar (as it was said above this can be aslo performed using <emphasis><property> "label"</property></emphasis> attribute ) you need to use this code: </para>
- <para>
- <emphasis role="bold">Example:</emphasis>
+ <para> However, the usage of these facets is optional. If you omit them nothing will be displayed.
</para>
- <programlisting role="XML"><![CDATA[...
-<h:outputText value="{value}%" ></h:outputText>
-...]]></programlisting>
- <para>The <emphasis role="bold"><property><rich:progressBar></property> </emphasis> component can be used in two modes: Ajax (default) and Client. In order to define the mode you need to use <emphasis><property>"mode"</property></emphasis> attribute. </para>
+ <para>The <emphasis role="bold"><property><rich:progressBar></property> </emphasis> component can be used in two modes: Ajax (default) and Client. In order to define the mode you need to use <emphasis><property>"mode"</property></emphasis> attribute.
+ </para>
<itemizedlist>
<listitem>
<para><property>Ajax</property> - polling is activated when the component is enabled to check its value. </para>
16 years, 10 months
JBoss Rich Faces SVN: r6604 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-03-06 11:06:40 -0500 (Thu, 06 Mar 2008)
New Revision: 6604
Modified:
trunk/docs/userguide/en/src/main/docbook/included/pickList.desc.xml
Log:
http://jira.jboss.com/jira/browse/RF-2174
Functionality and language were checked.
Modified: trunk/docs/userguide/en/src/main/docbook/included/pickList.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/pickList.desc.xml 2008-03-06 16:05:49 UTC (rev 6603)
+++ trunk/docs/userguide/en/src/main/docbook/included/pickList.desc.xml 2008-03-06 16:06:40 UTC (rev 6604)
@@ -9,7 +9,7 @@
<title>Description</title>
<para>The <emphasis role="bold">
<property><rich:pickList></property>
- </emphasis> component is used for moving chosen items from one list into another.
+ </emphasis> component is used for moving selected item(s) from one list into another.
</para>
<figure>
<title><emphasis role="bold">
16 years, 10 months
JBoss Rich Faces SVN: r6603 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-03-06 11:05:49 -0500 (Thu, 06 Mar 2008)
New Revision: 6603
Modified:
trunk/docs/userguide/en/src/main/docbook/included/pickList.xml
Log:
http://jira.jboss.com/jira/browse/RF-2174
Description was rewritten.
Modified: trunk/docs/userguide/en/src/main/docbook/included/pickList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/pickList.xml 2008-03-06 15:48:45 UTC (rev 6602)
+++ trunk/docs/userguide/en/src/main/docbook/included/pickList.xml 2008-03-06 16:05:49 UTC (rev 6603)
@@ -140,15 +140,15 @@
...]]></programlisting>
<para>
- A <property>move controls set</property> could be defined with
+ Lables of <property>move controls</property> can be defined with
<emphasis>
<property> "copyAllControlLabel"</property></emphasis>, <emphasis>
- <property> "copyControlLabel"</property></emphasis>, <emphasis>
- <property> "removeControlLabel"</property></emphasis>, <emphasis>
- <property> "removeAllControlLabel"</property>
- </emphasis> attributes.
-
- </para>
+ <property> "copyControlLabel"</property></emphasis>,
+ <emphasis> <property> "removeControlLabel"</property></emphasis>,
+ <emphasis> <property> "removeAllControlLabel"</property></emphasis> attributes.
+ If you want not to display labels on the buttons of move controls you need to set
+ <emphasis> <property> "showButtonsLabel"</property></emphasis> to<property> "false"</property>.
+ </para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
@@ -160,7 +160,14 @@
<f:selectItems value="#{pickBean.testList}"/>
</rich:pickList>
...]]></programlisting>
+
+ <para>
+ <emphasis> <property> "switchByClick"</property></emphasis> provides an option to copy and remove a list item by one click,
+ default the value of this attribute is <property> "false"</property> , and you need a double click to copy, remove a list item.
+ </para>
+
+
<!-- ordering control set-->
<table>
@@ -184,7 +191,7 @@
else select the active row. All other selections are cleared</entry>
</row>
<row>
- <entry>D</entry>
+ <entry>CTRL+A</entry>
<entry>Selects all elements inside the list if some active element is
already present in a list</entry>
</row>
@@ -519,7 +526,7 @@
<section>
<title>Definition of Custom Style Classes</title>
- <para>On the screenshot there are classes names that define styles for component elements.</para>
+ <para>The following picture illustrates how CSS classes define styles for component elements.</para>
<figure>
16 years, 10 months
JBoss Rich Faces SVN: r6602 - trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/html/images.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-03-06 10:48:45 -0500 (Thu, 06 Mar 2008)
New Revision: 6602
Modified:
trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/html/images/ColorUtils.java
Log:
http://jira.jboss.com/jira/browse/RF-2403 fix
Modified: trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/html/images/ColorUtils.java
===================================================================
--- trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/html/images/ColorUtils.java 2008-03-06 14:36:00 UTC (rev 6601)
+++ trunk/ui/progressBAR/src/main/java/org/richfaces/renderkit/html/images/ColorUtils.java 2008-03-06 15:48:45 UTC (rev 6602)
@@ -171,9 +171,14 @@
+ "Difference parameter should be floating-point values between -1 and 1");
}
- float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null);
- float brightness = Math.min(1.0f, Math.max(0.0f, hsb[2] + difference));
- return new Color(Color.HSBtoRGB(hsb[0], hsb[1], brightness));
+ Color retVal = null;
+ if (c != null) {
+ float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), null);
+ float brightness = Math.min(1.0f, Math.max(0.0f, hsb[2] + difference));
+ retVal = new Color(Color.HSBtoRGB(hsb[0], hsb[1], brightness));
+ }
+
+ return retVal;
}
/**
@@ -199,9 +204,14 @@
+ "Difference parameter should be floating-point values between -1 and 1");
}
- float[] hsl = RGBtoHSL(c.getRed(), c.getGreen(), c.getBlue());
- float lightness = Math.min(1.0f, Math.max(0.0f, hsl[2] + difference));
- return HSLtoRGB(hsl[0], hsl[1], lightness);
+ Color retVal = null;
+ if (c != null) {
+ float[] hsl = RGBtoHSL(c.getRed(), c.getGreen(), c.getBlue());
+ float lightness = Math.min(1.0f, Math.max(0.0f, hsl[2] + difference));
+ retVal = HSLtoRGB(hsl[0], hsl[1], lightness);
+ }
+
+ return retVal;
}
/**
16 years, 10 months
JBoss Rich Faces SVN: r6601 - management/design/standardComponent.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-06 09:36:00 -0500 (Thu, 06 Mar 2008)
New Revision: 6601
Modified:
management/design/standardComponent/Func-Spec-StdControls.doc
Log:
Modified: management/design/standardComponent/Func-Spec-StdControls.doc
===================================================================
(Binary files differ)
16 years, 10 months
JBoss Rich Faces SVN: r6600 - management/design/standardComponent.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-06 09:34:22 -0500 (Thu, 06 Mar 2008)
New Revision: 6600
Modified:
management/design/standardComponent/Func-Spec-StdControls.doc
Log:
Modified: management/design/standardComponent/Func-Spec-StdControls.doc
===================================================================
(Binary files differ)
16 years, 10 months
JBoss Rich Faces SVN: r6599 - in trunk/docs/userguide/en/src/main: resources/images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-03-06 08:47:35 -0500 (Thu, 06 Mar 2008)
New Revision: 6599
Added:
trunk/docs/userguide/en/src/main/resources/images/panel_CS1.png
trunk/docs/userguide/en/src/main/resources/images/panel_CS2.png
Modified:
trunk/docs/userguide/en/src/main/docbook/included/panel.xml
Log:
RF-1052 - corrected code and updated screens for panel
Modified: trunk/docs/userguide/en/src/main/docbook/included/panel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panel.xml 2008-03-06 13:36:41 UTC (rev 6598)
+++ trunk/docs/userguide/en/src/main/docbook/included/panel.xml 2008-03-06 13:47:35 UTC (rev 6599)
@@ -283,7 +283,7 @@
</mediaobject>
</figure>
- <table>
+ <table id="tab_cn11">
<title>Classes names that define a component appearance</title>
<tgroup cols="2">
<thead>
@@ -308,45 +308,62 @@
</tbody>
</tgroup>
</table>
- <para>In order to redefine styles for all <emphasis role="bold">
- <property><rich:panel></property>
- </emphasis> components on a page using CSS, it's enough to create classes with the
- same names and define necessary properties in them.</para>
-
- <para>To change styles of particular <emphasis role="bold">
- <property><rich:panel></property>
- </emphasis> components, define your own style classes in the corresponding <emphasis
- role="bold">
- <property><rich:panel></property>
- </emphasis>attribute.</para>
- <para>CSS code piece used on a page:</para>
+ <para>In order to redefine styles for all <emphasis role="bold"><property><rich:panel></property></emphasis> components on a page using CSS, it's enough to create classes with the
+ same names (possible classes could be found in the table <link linkend="tab_cn11">above</link>) and define necessary properties in them. An example is placed below:</para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="CSS"><![CDATA[...
- .rich-panel-header{
- background-color:#F99;
- }
- .myClass{
- font-style:italic;
- }
+.rich-panel-body{
+ background-color: #ebf3fd;
+}
...
]]></programlisting>
- <para>Hence, a header class is redefined for all <property>panels</property> (its color changed)
- of this page and body class is extended with the custom style properties (font-style) for this
- particular <property>panel</property>. As a result, the <property>panel</property> with a
- header redefined color and a text style in body is got.</para>
+
+ <para>This is a result:</para>
+
<figure>
- <title><emphasis role="bold">
- <property><rich:panel></property></emphasis> with redefined header and body text style</title>
-
+ <title>Redefinition styles with predefined classes</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/panel4.png"/>
+ <imagedata fileref="images/panel_CS1.png"/>
</imageobject>
</mediaobject>
</figure>
+
+ <para>In the example a body background color was changed.</para>
+ <para>Also it’s possible to change styles of particular <emphasis role="bold"><property><rich:panel></property></emphasis> component. In this case you should create own style classes and use them in corresponding <emphasis role="bold"
+ ><property><rich:panel></property></emphasis> <emphasis><property>styleClass</property></emphasis> attributes. An example is placed below:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[...
+.myClass{
+ text-align: justify;
+}
+...]]></programlisting>
+ <para>The <emphasis><property>"bodyClass"</property></emphasis> attribute for <emphasis role="bold"
+ ><property><rich:panel> </property></emphasis> is defined as it’s shown in the example below:</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="CSS"><![CDATA[<h:panel... bodyClass="myClass"/>
+]]></programlisting>
+
+ <para>This is a result:</para>
+
+ <figure>
+ <title>Redefinition styles with own classes and <emphasis><property>styleClass</property></emphasis> attributes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/panel_CS2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>As it could be seen on the picture above, text align of body was changed.</para>
</section>
<section>
<title>Relevant Resources Links</title>
Added: trunk/docs/userguide/en/src/main/resources/images/panel_CS1.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/panel_CS1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/userguide/en/src/main/resources/images/panel_CS2.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/panel_CS2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 10 months