JBoss Rich Faces SVN: r2357 - in trunk/framework: impl/src/main/java/org/ajax4jsf/resource and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-20 14:43:49 -0400 (Mon, 20 Aug 2007)
New Revision: 2357
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java
trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
Log:
EOFException deserializing short byte[] arrays of resource data fixed
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java 2007-08-20 17:22:13 UTC (rev 2356)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java 2007-08-20 18:43:49 UTC (rev 2357)
@@ -197,6 +197,7 @@
public static final String QUERY_STRING_BUILDING_ERROR = "QUERY_STRING_BUILDING_ERROR";
public static final String BUILD_RESOURCE_URI_INFO = "BUILD_RESOURCE_URI_INFO";
public static final String RESTORE_DATA_FROM_RESOURCE_URI_INFO = "RESTORE_DATA_FROM_RESOURCE_URI_INFO";
+ public static final String STREAM_CORRUPTED_ERROR = "STREAM_CORRUPTED_ERROR";
public static final String DESERIALIZE_DATA_INPUT_ERROR = "DESERIALIZE_DATA_INPUT_ERROR";
public static final String DATA_CLASS_NOT_FOUND_ERROR = "DATA_CLASS_NOT_FOUND_ERROR";
public static final String METHOD_NOT_IMPLEMENTED = "METHOD_NOT_IMPLEMENTED";
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java 2007-08-20 17:22:13 UTC (rev 2356)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java 2007-08-20 18:43:49 UTC (rev 2357)
@@ -35,6 +35,8 @@
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import java.util.zip.Deflater;
import java.util.zip.Inflater;
@@ -71,7 +73,10 @@
private static final Log log = LogFactory.getLog(ResourceBuilderImpl.class);
private static final String DATA_SEPARATOR = "/DATA/";
+ private static final String DATA_BYTES_SEPARATOR = "/DATB/";
+ private static final Pattern DATA_SEPARATOR_PATTERN = Pattern.compile("/DAT(A|B)/");
+
private static Map renderers;
private static ResourceRenderer defaultRenderer = new MimeRenderer(null);
@@ -263,30 +268,31 @@
return packageName.append("/").append(path).toString();
}
- public String getUri(InternetResource resource, FacesContext context, Object storeData) {
+ public String getUri(InternetResource resource, FacesContext context,
+ Object storeData) {
StringBuffer uri = new StringBuffer();// ResourceServlet.DEFAULT_SERVLET_PATH).append("/");
uri.append(resource.getKey());
// append serialized data as Base-64 encoded request string.
if (storeData != null) {
try {
- String encodedObjectData;
+ byte[] objectData;
if (storeData instanceof byte[]) {
- byte[] objectData = (byte[]) storeData;
- encodedObjectData = new String(encrypt(objectData), "ISO-8859-1");
+ objectData = (byte[]) storeData;
+ uri.append(DATA_BYTES_SEPARATOR);
} else {
- ByteArrayOutputStream dataSteram = new ByteArrayOutputStream(
- 1024);
- ObjectOutputStream objStream = new ObjectOutputStream(
- dataSteram);
- objStream.writeObject(storeData);
- objStream.flush();
- objStream.close();
- dataSteram.close();
- byte[] objectData = dataSteram.toByteArray();
- encodedObjectData = new String(encrypt(objectData), "ISO-8859-1");
+ ByteArrayOutputStream dataSteram = new ByteArrayOutputStream(
+ 1024);
+ ObjectOutputStream objStream = new ObjectOutputStream(
+ dataSteram);
+ objStream.writeObject(storeData);
+ objStream.flush();
+ objStream.close();
+ dataSteram.close();
+ objectData = dataSteram.toByteArray();
+ uri.append(DATA_SEPARATOR);
}
- uri.append(DATA_SEPARATOR);
- uri.append(encodedObjectData);
+ byte[] dataArray = encrypt(objectData);
+ uri.append(new String(dataArray, "ISO-8859-1"));
// / byte[] objectData = dataSteram.toByteArray();
// / uri.append("?").append(new
@@ -317,49 +323,62 @@
* @return
*/
public InternetResource getResourceForKey(String key)
- throws ResourceNotFoundException {
+ throws ResourceNotFoundException {
- int data = key.indexOf(DATA_SEPARATOR);
- if (data >= 0) {
- key = key.substring(0, data);
- }
- return getResource(key);
+ Matcher matcher = DATA_SEPARATOR_PATTERN.matcher(key);
+ if (matcher.find()) {
+ int data = matcher.start();
+ key = key.substring(0, data);
+ }
+
+ return getResource(key);
}
public Object getResourceDataForKey(String key) {
- Object data = null;
- String dataString = null;
- int dataStart = key.indexOf(DATA_SEPARATOR);
- if (dataStart >= 0) {
- dataString = key.substring(dataStart + DATA_SEPARATOR.length());
- }
- if (log.isDebugEnabled()) {
- log.debug(Messages.getMessage(
- Messages.RESTORE_DATA_FROM_RESOURCE_URI_INFO, key,
- dataString));
- }
- if (dataString != null) {
- // dataString =
- // dataString.substring(dataStart+ResourceServlet.DATA_PARAMETER.length()+1);
- byte[] objectArray = null;
- try {
- byte[] dataArray = dataString.getBytes("ISO-8859-1");
- objectArray = decrypt(dataArray);
+ Object data = null;
+ String dataString = null;
+ boolean serialized = true;
+ Matcher matcher = DATA_SEPARATOR_PATTERN.matcher(key);
+ if (matcher.find()) {
+ int dataStart = matcher.end();
+ dataString = key.substring(dataStart);
+ if ("B".equals(matcher.group(1))) {
+ serialized = false;
+ }
+ }
- ObjectInputStream in = new ObjectInputStream(
- new ByteArrayInputStream(objectArray));
- data = in.readObject();
- } catch (StreamCorruptedException e) {
- data = objectArray;
- } catch (IOException e) {
- log.error(Messages
- .getMessage(Messages.DESERIALIZE_DATA_INPUT_ERROR), e);
- } catch (ClassNotFoundException e) {
- log.error(Messages
- .getMessage(Messages.DATA_CLASS_NOT_FOUND_ERROR), e);
- }
- }
- return data;
+ if (log.isDebugEnabled()) {
+ log.debug(Messages.getMessage(
+ Messages.RESTORE_DATA_FROM_RESOURCE_URI_INFO, key,
+ dataString));
+ }
+ if (dataString != null) {
+ // dataString =
+ // dataString.substring(dataStart+ResourceServlet.DATA_PARAMETER.length()+1);
+ byte[] objectArray = null;
+ try {
+ byte[] dataArray = dataString.getBytes("ISO-8859-1");
+ objectArray = decrypt(dataArray);
+
+ if (serialized) {
+ ObjectInputStream in = new ObjectInputStream(
+ new ByteArrayInputStream(objectArray));
+ data = in.readObject();
+ } else {
+ data = objectArray;
+ }
+ } catch (StreamCorruptedException e) {
+ log.error(Messages
+ .getMessage(Messages.STREAM_CORRUPTED_ERROR), e);
+ } catch (IOException e) {
+ log.error(Messages
+ .getMessage(Messages.DESERIALIZE_DATA_INPUT_ERROR), e);
+ } catch (ClassNotFoundException e) {
+ log.error(Messages
+ .getMessage(Messages.DATA_CLASS_NOT_FOUND_ERROR), e);
+ }
+ }
+ return data;
}
public InternetResource getResource(String path)
Modified: trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
===================================================================
--- trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties 2007-08-20 17:22:13 UTC (rev 2356)
+++ trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties 2007-08-20 18:43:49 UTC (rev 2357)
@@ -145,6 +145,7 @@
QUERY_STRING_BUILDING_ERROR=Error building query string for store data
BUILD_RESOURCE_URI_INFO=Build URI for Resource with key [{0}] as \: {1}
RESTORE_DATA_FROM_RESOURCE_URI_INFO=Restore data object for Resource with key [{0}] from uri string \: {1}
+STREAM_CORRUPTED_ERROR=Stream corrupted error deserializing data
DESERIALIZE_DATA_INPUT_ERROR=Input error for deserialize data
DATA_CLASS_NOT_FOUND_ERROR=Data class for restore not found
METHOD_NOT_IMPLEMENTED=Method {0} not implemented
18 years, 8 months
JBoss Rich Faces SVN: r2356 - trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/images.
by richfaces-svn-commits@lists.jboss.org
Author: ishabalov
Date: 2007-08-20 13:22:13 -0400 (Mon, 20 Aug 2007)
New Revision: 2356
Modified:
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/images/TabStripeImage.java
Log:
Shorter URI encoding
Modified: trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/images/TabStripeImage.java
===================================================================
--- trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/images/TabStripeImage.java 2007-08-20 17:20:13 UTC (rev 2355)
+++ trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/images/TabStripeImage.java 2007-08-20 17:22:13 UTC (rev 2356)
@@ -35,6 +35,7 @@
import org.ajax4jsf.resource.Java2Dresource;
import org.ajax4jsf.resource.ResourceContext;
import org.ajax4jsf.util.HtmlColor;
+import org.ajax4jsf.util.Zipper;
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
@@ -65,7 +66,9 @@
return new Integer(HtmlColor.decode(
(String) defaultSkin.getParameter(context, colorParameterName)).getRGB());
}
- return new Integer(HtmlColor.decode(color).getRGB());
+ byte[] ret = new byte[3];
+ Zipper.zip(ret,HtmlColor.decode(color).getRGB(),0);
+ return ret;
}
protected Dimension getDimensions(ResourceContext resourceContext) {
@@ -86,7 +89,7 @@
graphics2D.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- Integer tabData = (Integer) restoreData(context);
+ Integer tabData = new Integer(Zipper.unzip((byte[])restoreData(context),0));
Dimension dimension = getDimensions(context);
Rectangle2D region = new Rectangle2D.Double(0, 1, dimension.getWidth(), dimension.getHeight() - 1);
18 years, 8 months
JBoss Rich Faces SVN: r2355 - in trunk/framework/impl/src/main/java/org: ajax4jsf/util and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ishabalov
Date: 2007-08-20 13:20:13 -0400 (Mon, 20 Aug 2007)
New Revision: 2355
Added:
trunk/framework/impl/src/main/java/org/ajax4jsf/util/Zipper.java
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
Log:
Shorter URI encoding
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java 2007-08-20 17:16:11 UTC (rev 2354)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java 2007-08-20 17:20:13 UTC (rev 2355)
@@ -263,15 +263,17 @@
return packageName.append("/").append(path).toString();
}
- public String getUri(InternetResource resource, FacesContext context,
- Object storeData) {
+ public String getUri(InternetResource resource, FacesContext context, Object storeData) {
StringBuffer uri = new StringBuffer();// ResourceServlet.DEFAULT_SERVLET_PATH).append("/");
uri.append(resource.getKey());
// append serialized data as Base-64 encoded request string.
if (storeData != null) {
try {
- byte[] objectData;
- if (!(storeData instanceof byte[])) {
+ String encodedObjectData;
+ if (storeData instanceof byte[]) {
+ byte[] objectData = (byte[]) storeData;
+ encodedObjectData = new String(encrypt(objectData), "ISO-8859-1");
+ } else {
ByteArrayOutputStream dataSteram = new ByteArrayOutputStream(
1024);
ObjectOutputStream objStream = new ObjectOutputStream(
@@ -280,13 +282,11 @@
objStream.flush();
objStream.close();
dataSteram.close();
- objectData = dataSteram.toByteArray();
- } else {
- objectData = (byte[]) storeData;
+ byte[] objectData = dataSteram.toByteArray();
+ encodedObjectData = new String(encrypt(objectData), "ISO-8859-1");
}
uri.append(DATA_SEPARATOR);
- byte[] dataArray = encrypt(objectData);
- uri.append(new String(dataArray, "ISO-8859-1"));
+ uri.append(encodedObjectData);
// / byte[] objectData = dataSteram.toByteArray();
// / uri.append("?").append(new
Added: trunk/framework/impl/src/main/java/org/ajax4jsf/util/Zipper.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/util/Zipper.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/util/Zipper.java 2007-08-20 17:20:13 UTC (rev 2355)
@@ -0,0 +1,16 @@
+package org.ajax4jsf.util;
+
+public class Zipper {
+ public static void zip(byte[] buf, int value, int offset) {
+ buf[offset] = (byte)(value & 0x0ff);
+ buf[offset+1] = (byte)((value & 0x0ff00)>>8);
+ buf[offset+2] = (byte)((value & 0x0ff0000)>>16);
+ }
+ public static int unzip(byte[] buf, int offset) {
+ int r0 = buf[offset]&0x0ff;
+ int r1 = (buf[offset+1]<<8)&0x0ff00;
+ int r2 = (buf[offset+2]<<16)&0x0ff0000;
+ int ret = r0 | r1 | r2;
+ return ret;
+ }
+}
Modified: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2007-08-20 17:16:11 UTC (rev 2354)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2007-08-20 17:20:13 UTC (rev 2355)
@@ -29,6 +29,7 @@
import java.awt.geom.Rectangle2D;
import java.io.Serializable;
import java.util.Date;
+import java.util.StringTokenizer;
import javax.faces.context.FacesContext;
@@ -37,6 +38,7 @@
import org.ajax4jsf.resource.Java2Dresource;
import org.ajax4jsf.resource.ResourceContext;
import org.ajax4jsf.util.HtmlColor;
+import org.ajax4jsf.util.Zipper;
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
@@ -138,7 +140,7 @@
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- Data dataToStore = (Data)resourceContext.getResourceData();
+ Data dataToStore = new Data((byte[])resourceContext.getResourceData());
if (dataToStore.headerBackgroundColor!=null && dataToStore.headerGradientColor!=null) {
Color baseColor = new Color(dataToStore.headerBackgroundColor.intValue());
Dimension dim =getDimensions(resourceContext);
@@ -164,9 +166,9 @@
protected Object getDataToStore(FacesContext context, Object data) {
if (baseColor == null) {
- return new Data(context);
+ return new Data(context).toByteArray();
} else {
- return new Data(context, baseColor, gradientColor);
+ return new Data(context, baseColor, gradientColor).toByteArray();
}
}
@@ -175,9 +177,15 @@
}
protected static class Data implements Serializable {
+ private static final String SEPARATOR = ".";
public Data() {
}
+
+ public Data(byte[] data) {
+ headerBackgroundColor = new Integer(Zipper.unzip(data,0));
+ headerGradientColor = new Integer(Zipper.unzip(data,3));
+ }
protected Data(FacesContext context) {
this(context, Skin.headerBackgroundColor, "headerGradientColor");
@@ -220,6 +228,12 @@
private static final long serialVersionUID = 1732700513743861250L;
protected Integer headerBackgroundColor;
protected Integer headerGradientColor;
+ public byte[] toByteArray() {
+ byte[] ret = new byte[6];
+ Zipper.zip(ret,headerBackgroundColor.intValue(),0);
+ Zipper.zip(ret,headerGradientColor.intValue(),3);
+ return ret;
+ }
}
}
18 years, 8 months
JBoss Rich Faces SVN: r2354 - in trunk: ui/dataTable/src/main/config/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-08-20 13:16:11 -0400 (Mon, 20 Aug 2007)
New Revision: 2354
Modified:
trunk/samples/pom.xml
trunk/ui/dataTable/src/main/config/component/colgroup.xml
trunk/ui/dataTable/src/main/config/component/subTable.xml
Log:
set samples default profile to tomcat6
Modified: trunk/samples/pom.xml
===================================================================
--- trunk/samples/pom.xml 2007-08-20 17:10:24 UTC (rev 2353)
+++ trunk/samples/pom.xml 2007-08-20 17:16:11 UTC (rev 2354)
@@ -195,7 +195,7 @@
<profile>
<id>tomcat5</id>
<activation>
- <activeByDefault>true</activeByDefault>
+ <activeByDefault>false</activeByDefault>
</activation>
<build>
<defaultGoal>jetty:run</defaultGoal>
@@ -249,6 +249,9 @@
</profile>
<profile>
<id>tomcat6</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
<build>
<defaultGoal>jetty:run</defaultGoal>
<plugins>
@@ -413,6 +416,6 @@
-->
<module>panelmenu-sample</module>
<module>rich-message-demo</module>
- <!--module>scrollable-grid-demo</module-->
+ <module>scrollableDataTableDemo</module>
</modules>
</project>
\ No newline at end of file
Modified: trunk/ui/dataTable/src/main/config/component/colgroup.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/colgroup.xml 2007-08-20 17:10:24 UTC (rev 2353)
+++ trunk/ui/dataTable/src/main/config/component/colgroup.xml 2007-08-20 17:16:11 UTC (rev 2354)
@@ -50,6 +50,12 @@
A comma-delimited list of CSS style classes that is applied to popup table rows. A space separated list of classes may also be specified for any individual row. The styles are applied, in turn, to each row in the table. For example, if the list has two elements, the first style class in the list is applied to the first row, the second to the second row, the first to the third row, the second to the fourth row, etc. In other words, we keep iterating through the list until we reach the end, and then we start at the beginning again
</description>
</property>
+ <property disabled="true" hidden="true">
+ <name>sortable</name>
+ <classname>boolean</classname>
+ <description></description>
+ <defaultvalue>true</defaultvalue>
+ </property>
<!--
<property>
<name>param</name>
Modified: trunk/ui/dataTable/src/main/config/component/subTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/subTable.xml 2007-08-20 17:10:24 UTC (rev 2353)
+++ trunk/ui/dataTable/src/main/config/component/subTable.xml 2007-08-20 17:16:11 UTC (rev 2354)
@@ -42,6 +42,13 @@
<description>
</description>
</property>
+ <property disabled="true" hidden="true">
+ <name>sortable</name>
+ <classname>boolean</classname>
+ <description></description>
+ <defaultvalue>true</defaultvalue>
+ </property>
+
<property>
<name>componentState</name>
<classname>java.lang.String</classname>
18 years, 8 months
JBoss Rich Faces SVN: r2353 - in trunk/ui/calendar/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-08-20 13:10:24 -0400 (Mon, 20 Aug 2007)
New Revision: 2353
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
RF-634 - fixed
added doCollapse function call when user resets selected date
fixed navigation bug
fixed wrong positioning in firefox
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss 2007-08-20 17:07:10 UTC (rev 2352)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss 2007-08-20 17:10:24 UTC (rev 2353)
@@ -41,7 +41,6 @@
}
.calendar_month{
- border-bottom : 1px solid;
vertical-align : middle;
text-align : center;
}
@@ -140,7 +139,6 @@
</u:selector>
<u:selector name=".calendar_month">
- <u:style name="border-bottom-color" skin="panelBorderColor"/>
<u:style name="background-color" skin="headerBackgroundColor"/>
<u:style name="font-size" skin="headerSizeFont"/>
<u:style name="font-family" skin="headerFamilyFont"/>
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-08-20 17:07:10 UTC (rev 2352)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-08-20 17:10:24 UTC (rev 2353)
@@ -2,21 +2,36 @@
window.LOG = {warn:function(){}};
}
+if(typeof Effect == 'undefined')
+ throw("calendar.js requires including script.aculo.us' effects.js library");
+
if (!Richfaces) Richfaces={};
Richfaces.Calendar={};
Richfaces.Calendar.setElementPosition = function(element, baseElement, jointPoint, direction, offset)
{
// parameters:
+ // baseElement: Dom element or {left:, top:, width:, height:};
// jointPoint: {x:,y:} or ('top-left','top-right','bottom'-left,'bottom-right')
// direction: ('top-left','top-right','bottom'-left,'bottom-right', 'auto')
// offset: {x:,y:}
var elementDim = Richfaces.Calendar.getOffsetDimensions(element);
- var baseElementDim = Richfaces.Calendar.getOffsetDimensions(baseElement);
+ var baseElementDim;
+ var baseOffset;
+
+ if (baseElement.left)
+ {
+ baseElementDim = {width: baseElement.width, height: baseElement.height};
+ baseOffset = [baseElement.left, baseElement.top];
+ } else
+ {
+ baseElementDim = Richfaces.Calendar.getOffsetDimensions(baseElement);
+ baseOffset = Position.cumulativeOffset(baseElement);
+ }
+
var windowRect = Richfaces.Calendar.getWindowViewport();
- var baseOffset = Position.cumulativeOffset(baseElement);
// jointPoint
var ox=baseOffset[0];
@@ -410,6 +425,8 @@
this.daysData = {startDate:null, days:[]};
this.days = [];
+ this.todayCellId = null;
+ this.todayCellColor = "";
var obj=$(id);
@@ -516,13 +533,15 @@
doExpand: function() {
if (!this.params.popup || this.isVisible) return;
- var field = $(this.INPUT_DATE_ID);
- if (field && field.value!=undefined)
+ var base = $(this.POPUP_ID)
+ var baseInput = base.firstChild;
+ var baseButton = baseInput.nextSibling;
+
+ if (baseInput && baseInput.value!=undefined)
{
- this.selectDate(field.value, true);
+ this.selectDate(baseInput.value, true);
}
- var base = $(this.POPUP_ID);
var e = $(this.id);
var iframe = $(this.IFRAME_ID);
@@ -531,8 +550,16 @@
/*this.setPopupEvents(e);
this.setPopupEvents(base);*/
+
+ //rect calculation
+ var offsetBase = Position.cumulativeOffset(base);
+ var offsetDimBase = Richfaces.Calendar.getOffsetDimensions(base);
+ var offsetDimButton = Richfaces.Calendar.getOffsetDimensions(baseButton);
+ var offsetDimInput = Richfaces.Calendar.getOffsetDimensions(baseInput);
+ var o = {left: offsetBase[0], top: offsetBase[1],
+ width: offsetDimBase.width, height: (offsetDimButton.height>offsetDimInput.height ? offsetDimButton.height : offsetDimInput.height)};
- Richfaces.Calendar.setElementPosition(e, base, this.params.jointPoint, this.params.direction);
+ Richfaces.Calendar.setElementPosition(e, o, this.params.jointPoint, this.params.direction);
if (Richfaces.browser.isIE6)
{
iframe.style.left = e.style.left;
@@ -851,7 +878,18 @@
var e;
var boundaryDatesModeFlag = (this.params.boundaryDatesMode == "scroll" || this.params.boundaryDatesMode == "select");
-
+
+ if (this.highlightEffect)
+ {
+ this.highlightEffect.cancel();
+ this.highlightEffect=null;
+ }
+ if (this.todayCellId)
+ {
+ $(this.todayCellId).style['backgroundColor'] = '';
+ this.todayCellId = null;
+ }
+
//var _d=new Date();
if (this.selectedDateElement) {
@@ -902,7 +940,17 @@
}
// TODO make some optimization with calendar_current class
- if (todayflag && dataobj._month==0 && dataobj.day==todaydate) e.add("calendar_current"); else e.remove("calendar_current");
+ if (todayflag && dataobj._month==0 && dataobj.day==todaydate)
+ {
+ this.todayCellId = element.id;
+ this.todayCellColor = Element.getStyle(element, 'background-color').parseColor();
+ e.add("calendar_current");
+ }
+ else
+ {
+ e.remove("calendar_current");
+ }
+
if (selectedflag && dataobj._month==0 && dataobj.day==selecteddate) {
this.selectedDateElement = element;
e.add("Selecteddayclass");
@@ -999,33 +1047,52 @@
this.currentDate = new Date(nowyear, nowmonth, 1);
}
- if (updateflag) if (noUpdate) this.render; else this.onUpdate();
+ if (updateflag)
+ {
+ if (noUpdate) this.render(); else this.onUpdate();
+ }
+ else
+ {
+ // highlight today
+ if (this.isVisible && this.todayCellId)
+ {
+ if (this.highlightEffect)
+ {
+ this.highlightEffect.cancel();
+ this.highlightEffect=null;
+ }
+ var e = $(this.todayCellId);
+ e.style['backgroundColor'] = '';
+ this.highlightEffect = new Effect.Highlight(e, {startcolor: this.todayCellColor, duration:0.3, transition: Effect.Transitions.sinoidal});
+ }
+ }
},
selectDate: function(date, noUpdate) {
+ var oldSelectedDate = this.selectedDate;
if (date)
{
if (typeof date=='string') date = Date.parseDate(date,this.params.datePattern, this.params.monthLabels, this.params.monthLabelsShort);
- if (date!=null)
+ /*if (date!=null)
{
if (this.selectedDate!=null && this.selectedDate.toLocaleDateString()==date.toLocaleDateString()) return;
this.selectedDate = date;
- }
- }
+ }*/
+ this.selectedDate = date;
+ } else this.selectedDate = null;
if (this.selectedDate!=null)
{
var d = new Date(this.selectedDate);
- d.setDate(1);
if (d.getMonth()==this.currentDate.getMonth() && d.getFullYear()==this.currentDate.getFullYear())
{
- if (d.getDate()==this.currentDate.getDate()) return;
// find cell and call onklick event
var e = $(this.DATE_ELEMENT_ID+(this.firstDateIndex + this.selectedDate.getDate()-1));
if (e) Richfaces.createEvent ('click', e).fire();
return;
} else {
// change currentDate and call this.onUpdate();
+ d.setDate(1);
this.currentDate = d;
if (noUpdate) this.render(); else this.onUpdate();
return;
@@ -1034,7 +1101,7 @@
else
{
if (this.selectedDateElement) Element.removeClassName(this.selectedDateElement, "Selecteddayclass");
- this.selectedDate=null;
+ if (oldSelectedDate!=null) if (noUpdate) this.render(); else this.onUpdate();
this.today(noUpdate);
}
},
@@ -1043,7 +1110,9 @@
{
if (!this.selectedDate) return;
this.selectedDate=null;
- if (this.params.popup && this.isVisible) this.render();
+ this.render();
+ if (this.params.popup) Richfaces.createEvent ('click', window.document).fire();
+
$(this.INPUT_DATE_ID).value="";
}
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-08-20 17:07:10 UTC (rev 2352)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-08-20 17:10:24 UTC (rev 2353)
@@ -9,7 +9,7 @@
baseclass="org.richfaces.renderkit.CalendarRendererBase"
component="org.richfaces.component.UICalendar">
<f:clientid var="clientId" />
- <h:scripts>new org.ajax4jsf.javascript.PrototypeScript(),new org.ajax4jsf.javascript.AjaxScript(),/org/richfaces/renderkit/html/scripts/events.js,/org/richfaces/renderkit/html/scripts/utils.js,/org/richfaces/renderkit/html/scripts/json/json-dom.js,/org/richfaces/renderkit/html/scripts/calendar.js</h:scripts>
+ <h:scripts>new org.ajax4jsf.javascript.PrototypeScript(),new org.ajax4jsf.javascript.AjaxScript(),/org/richfaces/renderkit/html/scripts/events.js,/org/richfaces/renderkit/html/scripts/utils.js,/org/richfaces/renderkit/html/scripts/json/json-dom.js,/org/richfaces/renderkit/html/scripts/scriptaculous/effects.js,/org/richfaces/renderkit/html/scripts/calendar.js</h:scripts>
<h:styles>/org/richfaces/renderkit/html/css/calendar.xcss</h:styles>
<div id="#{clientId}"
@@ -36,16 +36,16 @@
disabled: #{component.disabled},
<f:call name="writeSymbols" />,
firstWeekDay: #{this:getFirstWeekDay(context, component)},
- minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)},
+ minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)}
<jsp:scriptlet> /*<![CDATA[*/
if (component.getFacet("optionalHeader")!= null&& component.getFacet("optionalHeader").isRendered()){
/*]]>*/ </jsp:scriptlet>
- headerOptionalMarkup: [new E('b',{},
+ ,headerOptionalMarkup: [new E('b',{},
<jsp:scriptlet> /*<![CDATA[*/
writeMarkupScriptBody(context, component.getFacet("optionalHeader"), false);
/*]]>*/ </jsp:scriptlet>
- )],
+ )]
<jsp:scriptlet> /*<![CDATA[*/
}
/*]]>*/ </jsp:scriptlet>
@@ -53,11 +53,11 @@
<jsp:scriptlet> /*<![CDATA[*/
if (component.getFacet("optionalFooter")!= null&& component.getFacet("optionalFooter").isRendered()){
/*]]>*/ </jsp:scriptlet>
- footerOptionalMarkup: [new E('b',{},
+ ,footerOptionalMarkup: [new E('b',{},
<jsp:scriptlet> /*<![CDATA[*/
writeMarkupScriptBody(context, component.getFacet("optionalFooter"), false);
/*]]>*/ </jsp:scriptlet>
- )],
+ )]
<jsp:scriptlet> /*<![CDATA[*/
}
/*]]>*/ </jsp:scriptlet>
@@ -65,7 +65,7 @@
<jsp:scriptlet>/*<![CDATA[*/
if (component.getChildCount() != 0) {
/*]]>*/</jsp:scriptlet>
- dayListMarkup:
+ ,dayListMarkup:
<jsp:scriptlet>/*<![CDATA[*/
writeMarkupScriptBody(context, component, true);
}
18 years, 8 months
JBoss Rich Faces SVN: r2352 - trunk/ui/drag-drop/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-08-20 13:07:10 -0400 (Mon, 20 Aug 2007)
New Revision: 2352
Modified:
trunk/ui/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx
Log:
http://jira.jboss.com/jira/browse/RF-595 fixed
Modified: trunk/ui/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx
===================================================================
--- trunk/ui/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx 2007-08-20 15:17:50 UTC (rev 2351)
+++ trunk/ui/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx 2007-08-20 17:07:10 UTC (rev 2352)
@@ -29,15 +29,11 @@
<f:call name="encodeDnDParams" />
<script type="text/javascript">
- /*<![CDATA[*/
var elt = $("#{clientId}");
elt.markers = {};
elt.indicatorTemplates = {};
- /*]]>*/
<f:call name="encodeChildScripts" />
- /*<![CDATA[*/
createDragIndicator(elt, '#{component.attributes["acceptClass"]}', '#{component.attributes["rejectClass"]}');
- /*]]>*/
</script>
<vcp:body />
</div>
18 years, 8 months
JBoss Rich Faces SVN: r2351 - in trunk/test-applications/jsp/src/main: webapp/DropDownMenu and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-08-20 11:17:50 -0400 (Mon, 20 Aug 2007)
New Revision: 2351
Modified:
trunk/test-applications/jsp/src/main/java/ddMenu/DDMenu.java
trunk/test-applications/jsp/src/main/webapp/DropDownMenu/DDMenu.jsp
Log:
http://jira.jboss.com/jira/browse/RF-612
Modified: trunk/test-applications/jsp/src/main/java/ddMenu/DDMenu.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/ddMenu/DDMenu.java 2007-08-20 15:17:42 UTC (rev 2350)
+++ trunk/test-applications/jsp/src/main/java/ddMenu/DDMenu.java 2007-08-20 15:17:50 UTC (rev 2351)
@@ -4,20 +4,21 @@
public class DDMenu {
- private int hideDelay;
- private int showDelay;
- private int verticalOffset;
- private int horizontalOffset;
- private String event;
- private String direction = "";
- private String groupDirection;
- private String jointPoint = "";
- private String popupWidth = "";
- private String icon = null;
- private String iconFolder = null;
- private boolean rendered;
- private boolean disabled;
- private boolean check;
+ private int hideDelay;
+ private int showDelay;
+ private int verticalOffset;
+ private int horizontalOffset;
+ private String event;
+ private String direction = "";
+ private String groupDirection;
+ private String jointPoint = "";
+ private String popupWidth = "";
+ private String icon = null;
+ private String iconFolder = null;
+ private String selectMenu;
+ private boolean rendered;
+ private boolean disabled;
+ private boolean check;
public DDMenu() {
hideDelay = 0;
@@ -158,4 +159,12 @@
public void setEvent(String event) {
this.event = event;
}
+
+ public String getSelectMenu() {
+ return selectMenu;
+ }
+
+ public void setSelectMenu(String selectMenu) {
+ this.selectMenu = selectMenu;
+ }
}
Modified: trunk/test-applications/jsp/src/main/webapp/DropDownMenu/DDMenu.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/DropDownMenu/DDMenu.jsp 2007-08-20 15:17:42 UTC (rev 2350)
+++ trunk/test-applications/jsp/src/main/webapp/DropDownMenu/DDMenu.jsp 2007-08-20 15:17:50 UTC (rev 2351)
@@ -126,11 +126,11 @@
<h:outputText value="Item3" />
</rich:menuItem>
<rich:menuItem value="Item4">
- <select id="selectCar" name="selectCar" size="1">
- <option value="accord"><f:verbatim>Honda Accord</f:verbatim></option>
- <option value="4runner"><f:verbatim>Toyota 4Runner</f:verbatim></option>
- <option value="nissan-z"><f:verbatim>Nissan Z350</f:verbatim></option>
- </select>
+ <h:selectOneMenu value="#{dDMenu.selectMenu}">
+ <f:selectItem itemLabel="Honda Accord" itemValue="accord" />
+ <f:selectItem itemLabel="Toyota 4Runner" itemValue="4runner" />
+ <f:selectItem itemLabel="Nissan Z350" itemValue="nissan-z" />
+ </h:selectOneMenu>
</rich:menuItem>
<rich:menuSeparator />
<rich:menuItem icon="#{dDMenu.icon}">
18 years, 8 months
JBoss Rich Faces SVN: r2350 - in trunk/test-applications/facelets/src/main: webapp/DropDownMenu and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-08-20 11:17:42 -0400 (Mon, 20 Aug 2007)
New Revision: 2350
Modified:
trunk/test-applications/facelets/src/main/java/ddMenu/DDMenu.java
trunk/test-applications/facelets/src/main/webapp/DropDownMenu/DDMenu.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-612
Modified: trunk/test-applications/facelets/src/main/java/ddMenu/DDMenu.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/ddMenu/DDMenu.java 2007-08-20 15:09:38 UTC (rev 2349)
+++ trunk/test-applications/facelets/src/main/java/ddMenu/DDMenu.java 2007-08-20 15:17:42 UTC (rev 2350)
@@ -4,22 +4,24 @@
public class DDMenu {
- private int hideDelay;
- private int showDelay;
- private int verticalOffset;
- private int horizontalOffset;
- private String event;
- private String direction = "";
- private String groupDirection;
- private String jointPoint = "";
- private String popupWidth = "";
- private String icon = null;
- private String iconFolder = null;
- private boolean rendered;
- private boolean disabled;
- private boolean check;
+ private int hideDelay;
+ private int showDelay;
+ private int verticalOffset;
+ private int horizontalOffset;
+ private String event;
+ private String direction = "";
+ private String groupDirection;
+ private String jointPoint = "";
+ private String popupWidth = "";
+ private String icon = null;
+ private String iconFolder = null;
+ private String selectMenu;
+ private boolean rendered;
+ private boolean disabled;
+ private boolean check;
public DDMenu() {
+ selectMenu = "accord";
hideDelay = 0;
showDelay = 0;
verticalOffset = 0;
@@ -158,4 +160,12 @@
public void setEvent(String event) {
this.event = event;
}
+
+ public String getSelectMenu() {
+ return selectMenu;
+ }
+
+ public void setSelectMenu(String selectMenu) {
+ this.selectMenu = selectMenu;
+ }
}
Modified: trunk/test-applications/facelets/src/main/webapp/DropDownMenu/DDMenu.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/DropDownMenu/DDMenu.xhtml 2007-08-20 15:09:38 UTC (rev 2349)
+++ trunk/test-applications/facelets/src/main/webapp/DropDownMenu/DDMenu.xhtml 2007-08-20 15:17:42 UTC (rev 2350)
@@ -137,11 +137,11 @@
<h:outputText value="Item3" />
</rich:menuItem>
<rich:menuItem value="Item4">
- <select id="selectCar" name="selectCar" size="1">
- <option value="accord">Honda Accord</option>
- <option value="4runner">Toyota 4Runner</option>
- <option value="nissan-z">Nissan Z350</option>
- </select>
+ <h:selectOneMenu value="#{dDMenu.selectMenu}">
+ <f:selectItem itemLabel="Honda Accord" itemValue="accord" />
+ <f:selectItem itemLabel="Toyota 4Runner" itemValue="4runner" />
+ <f:selectItem itemLabel="Nissan Z350" itemValue="nissan-z" />
+ </h:selectOneMenu>
</rich:menuItem>
<rich:menuSeparator />
<rich:menuItem icon="#{dDMenu.icon}">
18 years, 8 months
JBoss Rich Faces SVN: r2349 - in trunk/ui/modal-panel/src/main: java/org/richfaces/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-08-20 11:09:38 -0400 (Mon, 20 Aug 2007)
New Revision: 2349
Modified:
trunk/ui/modal-panel/src/main/config/component/modalPanel.xml
trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
http://jira.jboss.com/jira/browse/RF-80 fixed
Modified: trunk/ui/modal-panel/src/main/config/component/modalPanel.xml
===================================================================
--- trunk/ui/modal-panel/src/main/config/component/modalPanel.xml 2007-08-20 14:59:35 UTC (rev 2348)
+++ trunk/ui/modal-panel/src/main/config/component/modalPanel.xml 2007-08-20 15:09:38 UTC (rev 2349)
@@ -63,14 +63,14 @@
<description>
Attribute defines width of component
</description>
- <defaultvalue>300</defaultvalue>
+ <defaultvalue>-1</defaultvalue>
</property>
<property>
<name>height</name>
<classname>int</classname>
<description>Attribute defines height of component
</description>
- <defaultvalue>200</defaultvalue>
+ <defaultvalue>-1</defaultvalue>
</property>
<property>
@@ -208,6 +208,14 @@
</description>
<defaultvalue><![CDATA["disable"]]></defaultvalue>
</property>
+ <property>
+ <name>autosized</name>
+ <classname>boolean</classname>
+ <description>
+ If 'true' modalPanel should be autosizeable
+ </description>
+ <defaultvalue>false</defaultvalue>
+ </property>
</component>
</components>
Modified: trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java
===================================================================
--- trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java 2007-08-20 14:59:35 UTC (rev 2348)
+++ trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java 2007-08-20 15:09:38 UTC (rev 2349)
@@ -61,9 +61,11 @@
public abstract boolean isResizeable();
public abstract boolean isMoveable();
+ public abstract boolean isAutosized();
public abstract void setResizeable(boolean resizeable);
public abstract void setMoveable(boolean moveable);
+ public abstract void setAutosized(boolean autosized);
public abstract String getLeft();
public abstract String getTop();
@@ -93,7 +95,7 @@
shadow = Integer.toString(SHADOW_DEPTH);
}
- String shadowStyle = "top: " + shadow + "; left: " + shadow + ";";
+ String shadowStyle = "top: " + shadow + "px; left: " + shadow + "px;";
FacesContext context = FacesContext.getCurrentInstance();
if (null == context)
Modified: trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
===================================================================
--- trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2007-08-20 14:59:35 UTC (rev 2348)
+++ trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2007-08-20 15:09:38 UTC (rev 2349)
@@ -45,6 +45,8 @@
//TODO nick - set sizeA to actual min value
private static final int sizeA = 10;
+ private static final int DEFAULT_WIDTH = 300;
+ private static final int DEFAULT_HEIGHT = 200;
private static final String STATE_OPTION_SUFFIX = "StateOption_";
@@ -85,14 +87,17 @@
//TODO nick - add messages
public void checkOptions(FacesContext context, UIModalPanel panel) {
+ if (panel.isAutosized() && panel.isResizeable()) {
+ throw new IllegalArgumentException();
+ }
if (panel.getMinHeight() != -1) {
if (panel.getMinHeight() < sizeA) {
throw new IllegalArgumentException();
}
- if (panel.getHeight() < panel.getMinHeight()) {
- panel.setHeight(panel.getMinHeight());
- }
+// if (panel.getHeight() < panel.getMinHeight()) {
+// panel.setHeight(panel.getMinHeight());
+// }
}
if (panel.getMinWidth() != -1) {
@@ -100,10 +105,10 @@
throw new IllegalArgumentException();
}
- if (panel.getWidth() < panel.getMinWidth()) {
- panel.setWidth(panel.getMinWidth());
- }
- }
+// if (panel.getWidth() < panel.getMinWidth()) {
+// panel.setWidth(panel.getMinWidth());
+// }
+ }
}
public void initializeResources(FacesContext context, UIModalPanel panel)
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-08-20 14:59:35 UTC (rev 2348)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-08-20 15:09:38 UTC (rev 2349)
@@ -471,7 +471,16 @@
var eContentDiv = $(this.contentDiv);
var eShadowDiv = $(this.shadowDiv);
- if (options.width) {
+ if (this.options.autosized) {
+ eContentDiv.style.overflow = "";
+ } else {
+ if (options.width && options.width == -1)
+ options.width = 300;
+ if (options.height && options.height == -1)
+ options.height = 200;
+ }
+
+ if (options.width && options.width != -1) {
if (this.minWidth > options.width) {
options.width = this.minWidth;
}
@@ -483,7 +492,7 @@
eShadowDiv.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
}
- if (options.height) {
+ if (options.height && options.height != -1) {
if (this.minHeight > options.height) {
options.height = this.minHeight;
}
@@ -495,34 +504,6 @@
eShadowDiv.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
}
- if (options.left) {
- var _left;
- if (options.left != "auto") {
- _left = parseInt(options.left, 10);
- } else {
- var cw = getSizeElement().clientWidth;
- if (RichFaces.navigatorType() == "OPERA")
- _left = (cw - eContentDiv.style.width.replace("px", "")) / 2;
- else
- _left = (cw - Richfaces.getComputedStyleSize(eContentDiv, "width")) / 2;
-
- }
-
- this.setLeft(_left);
- }
-
- if (options.top) {
- var _top;
- if (options.top != "auto") {
- _top = parseInt(options.top, 10);
- } else {
- var cw = getSizeElement().clientHeight;
- _top = (cw - Richfaces.getComputedStyleSize(eContentDiv, "height")) / 2;
- }
-
- this.setTop(_top);
- }
-
eCdiv.mpSet = true;
//Element.setStyle(this.dialogWindow.document.body, { "margin" : "0px 0px 0px 0px" });
@@ -578,6 +559,53 @@
Element.show(element);
+ if (options.left) {
+ var _left;
+ if (options.left != "auto") {
+ _left = parseInt(options.left, 10);
+ } else {
+ var cw = getSizeElement().clientWidth;
+ if (RichFaces.navigatorType() == "OPERA")
+ _left = (cw - eContentDiv.style.width.replace("px", "")) / 2;
+ else {
+ var _width = Richfaces.getComputedStyleSize(eContentDiv, "width");
+ if (isNaN(_width))
+ _width = eContentDiv.clientWidth;
+ _left = (cw - _width) / 2;
+ }
+
+ }
+
+ this.setLeft(_left);
+ }
+
+ if (options.top) {
+ var _top;
+ if (options.top != "auto") {
+ _top = parseInt(options.top, 10);
+ } else {
+ var cw = getSizeElement().clientHeight;
+ var _height = Richfaces.getComputedStyleSize(eContentDiv, "height");
+ if (isNaN(_height))
+ _height = eContentDiv.clientHeight;
+ _top = (cw - _height) / 2;
+ }
+
+ this.setTop(_top);
+ }
+
+ if (this.options.autosized) {
+ var cWidth = eContentDiv.clientWidth;
+ var cHeight = eContentDiv.clientHeight;
+
+ eShadowDiv.style.width = cWidth+"px";
+ eShadowDiv.style.height = cHeight+"px";
+ if (eIframe) {
+ eIframe.style.width = cWidth+"px";
+ eIframe.style.height = cHeight+"px";
+ }
+ }
+
this.doResizeOrMove(ModalPanel.Sizer.Diff.EMPTY);
for (var k = 0; k < this.borders.length; k++ ) {
Modified: trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-08-20 14:59:35 UTC (rev 2348)
+++ trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-08-20 15:09:38 UTC (rev 2349)
@@ -136,7 +136,9 @@
keepVisualState: #{component.keepVisualState},
showWhenRendered: #{component.showWhenRendered},
- selectBehavior: "#{component.tridentIVEngineSelectBehavior}"
+ selectBehavior: "#{component.tridentIVEngineSelectBehavior}",
+
+ autosized: #{component.autosized}
});
</script>
</div>
18 years, 8 months
JBoss Rich Faces SVN: r2348 - in trunk/test-applications/jsp/src/main: webapp/PanelMenu and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-08-20 10:59:35 -0400 (Mon, 20 Aug 2007)
New Revision: 2348
Modified:
trunk/test-applications/jsp/src/main/java/panelMenu/PanelMenu.java
trunk/test-applications/jsp/src/main/webapp/PanelMenu/PanelMenu.jsp
Log:
http://jira.jboss.com/jira/browse/RF-640
Modified: trunk/test-applications/jsp/src/main/java/panelMenu/PanelMenu.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/panelMenu/PanelMenu.java 2007-08-20 14:59:29 UTC (rev 2347)
+++ trunk/test-applications/jsp/src/main/java/panelMenu/PanelMenu.java 2007-08-20 14:59:35 UTC (rev 2348)
@@ -7,7 +7,6 @@
private Icon icon;
private String width;
private String mode;
- private String mode2;
private String align;
private String rendered;
private String iconItemPosition;
@@ -16,13 +15,13 @@
private String iconGroupTopPosition;
private String tabIndex;
private String expandMode;
+ private String inputText;
private boolean disabled;
private boolean expandSingle;
public PanelMenu() {
width = "500px";
mode = "none";
- mode2 = "none";
align = "";
rendered = "true";
disabled = false;
@@ -96,14 +95,6 @@
this.iconItemTopPosition = iconItemTopPosition;
}
- public String getMode2() {
- return mode2;
- }
-
- public void setMode2(String mode2) {
- this.mode2 = mode2;
- }
-
public String getMode() {
return mode;
}
@@ -127,4 +118,12 @@
public void setExpandMode(String expandMode) {
this.expandMode = expandMode;
}
+
+ public String getInputText() {
+ return inputText;
+ }
+
+ public void setInputText(String inputText) {
+ this.inputText = inputText;
+ }
}
Modified: trunk/test-applications/jsp/src/main/webapp/PanelMenu/PanelMenu.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/PanelMenu/PanelMenu.jsp 2007-08-20 14:59:29 UTC (rev 2347)
+++ trunk/test-applications/jsp/src/main/webapp/PanelMenu/PanelMenu.jsp 2007-08-20 14:59:35 UTC (rev 2348)
@@ -30,57 +30,57 @@
iconGroupPosition="#{panelMenu.iconGroupPosition}" iconGroupTopPosition="#{panelMenu.iconGroupTopPosition}"
iconItemPosition="#{panelMenu.iconItemPosition}" iconItemTopPosition="#{panelMenu.iconItemTopPosition}" styleClass="sPanel">
- <rich:panelMenuItem value="Item 1"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1"></rich:panelMenuItem>
<rich:panelMenuItem disabled="true" iconDisabled="/pics/ajax_stoped.gif">
<h:outputText value="Disabled Item" />
</rich:panelMenuItem>
- <rich:panelMenuItem value="Item Image">
+ <rich:panelMenuItem label="Item Image">
<h:graphicImage value="/pics/item.png"></h:graphicImage>
</rich:panelMenuItem>
<rich:panelMenuItem>
<h:outputText value="Item4" />
</rich:panelMenuItem>
- <rich:panelMenuItem value="CheckBox">
+ <rich:panelMenuItem label="CheckBox">
<h:selectBooleanCheckbox value="false"></h:selectBooleanCheckbox>
</rich:panelMenuItem>
<rich:panelMenuItem>
<h:outputText value="CheckBox 2"></h:outputText>
<h:selectBooleanCheckbox value="false"></h:selectBooleanCheckbox>
</rich:panelMenuItem>
- <rich:panelMenuItem value="Action" onmousedown="alert('OnMouseDown');"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Action" onmousedown="alert('OnMouseDown');"></rich:panelMenuItem>
<rich:panelMenuGroup label="Group 1 (align)" align="#{panelMenu.align}">
- <rich:panelMenuItem value="Item 1" disabled="true"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 1 (action)" onmousedown="alert('OnMouseDown');"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 2"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1" disabled="true"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1 (action)" onmousedown="alert('OnMouseDown');"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2"></rich:panelMenuItem>
<rich:panelMenuGroup label="Group 1_1 (align)" align="#{panelMenu.align}">
- <rich:panelMenuItem value="Imem 1_1">
- <h:inputText value="text"></h:inputText>
+ <rich:panelMenuItem label="Imem 1_1">
+ <h:inputText value="#{panelMenu.inputText}"></h:inputText>
</rich:panelMenuItem>
- <rich:panelMenuItem value="Item 1_2"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1_2"></rich:panelMenuItem>
<rich:panelMenuGroup label="Group 1_1_1 (align)" align="#{panelMenu.align}">
- <rich:panelMenuItem value="Item 1 (action)" onmousedown="alert('OnMouseDown');"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 2"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1 (action)" onmousedown="alert('OnMouseDown');"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2"></rich:panelMenuItem>
</rich:panelMenuGroup>
<rich:panelMenuGroup label="Group 1_1_2">
- <rich:panelMenuItem value="Item 1"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 2"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 3"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 4"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 3"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 4"></rich:panelMenuItem>
</rich:panelMenuGroup>
</rich:panelMenuGroup>
<rich:panelMenuGroup label="Group 1_2 (disabled, action)" disabled="true" onmousedown="alert('Disabled');">
- <rich:panelMenuItem value="Item 1_2_1"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1_2_1"></rich:panelMenuItem>
</rich:panelMenuGroup>
<rich:panelMenuGroup label="Group 1_3">
- <rich:panelMenuItem value="Item 1_3_1"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 1_3_1"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1_3_1"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1_3_1"></rich:panelMenuItem>
<rich:panelMenuGroup label="Group disabled" disabled="true">
</rich:panelMenuGroup>
@@ -88,20 +88,20 @@
</rich:panelMenuGroup>
- <rich:panelMenuGroup label="Group 2 (mode 2)" mode="#{panelMenu.mode2}">
- <rich:panelMenuItem value="Item 2_1"></rich:panelMenuItem>
+ <rich:panelMenuGroup label="Group 2">
+ <rich:panelMenuItem label="Item 2_1"></rich:panelMenuItem>
- <rich:panelMenuGroup label="Group 2_2 (mode 2)" mode="#{panelMenu.mode2}">
- <rich:panelMenuItem value="Item 1"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 2"></rich:panelMenuItem>
+ <rich:panelMenuGroup label="Group 2_2">
+ <rich:panelMenuItem label="Item 1"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2"></rich:panelMenuItem>
</rich:panelMenuGroup>
- <rich:panelMenuItem value="Item 1"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 2"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2"></rich:panelMenuItem>
</rich:panelMenuGroup>
- <rich:panelMenuGroup label="Group 3 (mode 2)" mode="#{panelMenu.mode2}">
- <rich:panelMenuItem value="Item 3_1">
+ <rich:panelMenuGroup label="Group 3">
+ <rich:panelMenuItem label="Item 3_1">
<f:verbatim>
<br />
text1 <br />
@@ -109,10 +109,10 @@
text3
</f:verbatim>
</rich:panelMenuItem>
- <rich:panelMenuItem value="Item 3_2">
+ <rich:panelMenuItem label="Item 3_2">
<h:graphicImage value="/pics/benq.jpg" width="150px" height="100px"></h:graphicImage>
</rich:panelMenuItem>
- <rich:panelMenuItem value="Item 3_3"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 3_3"></rich:panelMenuItem>
</rich:panelMenuGroup>
</rich:panelMenu>
@@ -133,49 +133,49 @@
<rich:panelMenuGroup label="Group 1 (tabIdex, my Image)" tabindex="#{panelMenu.tabIndex}" align="#{panelMenu.align}">
<rich:panelMenuGroup label="Group 1_1 (tabIndex)" tabindex="#{panelMenu.tabIndex}">
<rich:panelMenuGroup label="Group 1_1_1 (tabIndex)" tabindex="#{panelMenu.tabIndex}">
- <rich:panelMenuItem value="Item 1"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 2"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2"></rich:panelMenuItem>
</rich:panelMenuGroup>
</rich:panelMenuGroup>
<rich:panelMenuGroup label="Group 1_2 (tabIndex)" tabindex="#{panelMenu.tabIndex}">
<rich:panelMenuGroup label="Group 1_2_1 (tabIndex)" tabindex="#{panelMenu.tabIndex}">
- <rich:panelMenuItem value="Item (icon)" icon="#{icon.iconItem}"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item (iconDisabled)" iconDisabled="#{icon.iconHeader}"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item (icon)" disabled="true" icon="#{icon.iconItem}"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item (iconDisabled)" disabled="true" iconDisabled="#{icon.iconItem}"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (icon)" icon="#{icon.iconItem}"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (iconDisabled)" iconDisabled="#{icon.iconHeader}"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (icon)" disabled="true" icon="#{icon.iconItem}"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (iconDisabled)" disabled="true" iconDisabled="#{icon.iconItem}"></rich:panelMenuItem>
</rich:panelMenuGroup>
- <rich:panelMenuItem value="Item (icon)" icon="#{icon.iconItem}"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item (icon)" icon="#{icon.iconItem}"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item "></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (icon)" icon="#{icon.iconItem}"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (icon)" icon="#{icon.iconItem}"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item "></rich:panelMenuItem>
</rich:panelMenuGroup>
<rich:panelMenuGroup label="Group 1_3" align="#{panelMenu.align}" iconCollapsed="#{icon.iconCollapse}" iconExpanded="#{icon.iconExpand}"
iconDisabled="#{icon.disabled}">
- <rich:panelMenuItem value="Item 1"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 2"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 3"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 3"></rich:panelMenuItem>
</rich:panelMenuGroup>
<!-- triangleUp triangle triangleDown disc chevron chevronUp chevronDown grid -->
- <rich:panelMenuItem value="Item (disc)" icon="disc"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item (grid)" icon="grid"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (disc)" icon="disc"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (grid)" icon="grid"></rich:panelMenuItem>
<rich:panelMenuGroup label="Group" iconCollapsed="triangleDown" iconExpanded="triangleUp" iconDisabled="triangle">
<rich:panelMenuGroup label="Group" iconCollapsed="chevronDown" iconExpanded="chevronUp" iconDisabled="chevron">
- <rich:panelMenuItem value="Item (disc)" icon="disc"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item (grid)" iconDisabled="grid"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item (grid)" icon="grid"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item (disc)" iconDisabled="disc"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (disc)" icon="disc"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (grid)" iconDisabled="grid"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (grid)" icon="grid"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (disc)" iconDisabled="disc"></rich:panelMenuItem>
</rich:panelMenuGroup>
- <rich:panelMenuItem value="Item (icon)" icon="#{icon.iconItem}"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item (icon)" icon="#{icon.iconItem}"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item "></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (icon)" icon="#{icon.iconItem}"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item (icon)" icon="#{icon.iconItem}"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item "></rich:panelMenuItem>
</rich:panelMenuGroup>
<rich:panelMenuGroup label="Group 1_3" iconCollapsed="chevronDown" iconExpanded="chevronUp" iconDisabled="chevron">
- <rich:panelMenuItem value="Item 1"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 2"></rich:panelMenuItem>
- <rich:panelMenuItem value="Item 3"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2"></rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 3"></rich:panelMenuItem>
</rich:panelMenuGroup>
</rich:panelMenuGroup>
</rich:panelMenu>
@@ -209,14 +209,6 @@
<a4j:support event="onclick" reRender="panelMenuID,Mode2ID"></a4j:support>
</h:selectOneRadio>
- <h:outputText value="Mode 2"></h:outputText>
- <h:selectOneRadio value="#{panelMenu.mode2}" id="Mode2ID" onchange="submit();">
- <f:selectItem itemLabel="none" itemValue="none" />
- <f:selectItem itemLabel="ajax" itemValue="ajax" />
- <f:selectItem itemLabel="server" itemValue="server" />
- <a4j:support event="onclick" reRender="panelMenuID,Mode1ID"></a4j:support>
- </h:selectOneRadio>
-
<h:outputText value="Expand mode"></h:outputText>
<h:selectBooleanCheckbox value="#{panelMenu.expandMode}"></h:selectBooleanCheckbox>
18 years, 8 months