You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2012/06/06 17:52:00 UTC
svn commit: r1346957 - in /myfaces/tobago/trunk:
tobago-example/tobago-example-test/src/main/webapp/script/
tobago-example/tobago-example-test/src/main/webapp/tc/selectOneChoice/
tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfac...
Author: lofwyr
Date: Wed Jun 6 15:51:59 2012
New Revision: 1346957
URL: http://svn.apache.org/viewvc?rev=1346957&view=rev
Log:
TOBAGO-1151: Define default values for preferredWidth for tc:selectOneChoice has been successfully created.
Added:
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectOneChoice/selectOneChoice-layout.xhtml
Modified:
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js
myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js?rev=1346957&r1=1346956&r2=1346957&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/script/tobago-assert.js Wed Jun 6 15:51:59 2012
@@ -21,43 +21,43 @@
var TobagoAssert = {
- assertLeft: function(elementOrId, left) {
+ assertLeft:function (elementOrId, left) {
var element = TobagoAssert.jQueryElement(elementOrId);
var offsetLeft = element.offset().left;
if (offsetLeft != left) {
- LOG.error("The element '" + element.tagName + "' with id='" + element.id + "' has wrong left: expected=" + left
- + " actual=" + offsetLeft);
+ LOG.error("The element '" + element.get(0).tagName + "' with id='" + element.attr("id")
+ + "' has wrong left: expected=" + left + " actual=" + offsetLeft);
}
},
- assertTop: function(elementOrId, top) {
+ assertTop:function (elementOrId, top) {
var element = TobagoAssert.jQueryElement(elementOrId);
var offsetTop = element.offset().top;
if (offsetTop != top) {
- LOG.error("The element '" + element.tagName + "' with id='" + element.id + "' has wrong top: expected=" + top
- + " actual=" + offsetTop);
+ LOG.error("The element '" + element.get(0).tagName + "' with id='" + element.attr("id")
+ + "' has wrong top: expected=" + top + " actual=" + offsetTop);
}
},
- assertWidth: function(elementOrId, width) {
- var element = TobagoAssert.jQueryElement(elementOrId).get(0);
- var offsetWidth = element.offsetWidth;
+ assertWidth:function (elementOrId, width) {
+ var element = TobagoAssert.jQueryElement(elementOrId);
+ var offsetWidth = element.get(0).offsetWidth;
if (offsetWidth != width) {
- LOG.error("The element '" + element.tagName + "' with id='" + element.id + "' has wrong width: expected=" + width
- + " actual=" + offsetWidth);
+ LOG.error("The element '" + element.get(0).tagName + "' with id='" + element.attr("id")
+ + "' has wrong width: expected=" + width + " actual=" + offsetWidth);
}
},
- assertHeight: function(elementOrId, height) {
- var element = TobagoAssert.jQueryElement(elementOrId).get(0);
- var offsetHeight = element.offsetHeight;
+ assertHeight:function (elementOrId, height) {
+ var element = TobagoAssert.jQueryElement(elementOrId);
+ var offsetHeight = element.get(0).offsetHeight;
if (offsetHeight != height) {
- LOG.error("The element '" + element.tagName + "' with id='" + element.id + "' has wrong height: expected="
- + height + " actual=" + offsetHeight);
+ LOG.error("The element '" + element.get(0).tagName + "' with id='" + element.attr("id")
+ + "' has wrong height: expected=" + height + " actual=" + offsetHeight);
}
},
- assertLayout: function(elementOrId, left, top, width, height) {
+ assertLayout:function (elementOrId, left, top, width, height) {
var element = TobagoAssert.jQueryElement(elementOrId);
TobagoAssert.assertLeft(element, left);
TobagoAssert.assertTop(element, top);
@@ -65,14 +65,14 @@ var TobagoAssert = {
TobagoAssert.assertHeight(element, height);
},
- assertAbsence: function(id) {
+ assertAbsence:function (id) {
var element = document.getElementById(id);
if (element != null) {
LOG.error("The element with id=" + id + " was found, but should not!");
}
},
- assertAttribute: function(elementOrId, attribute, expected) {
+ assertAttribute:function (elementOrId, attribute, expected) {
var element = TobagoAssert.jQueryElement(elementOrId);
if (element.attr(attribute) != expected) {
LOG.error("The attribute '" + attribute + "' of element with id=" + element.attr('id')
@@ -80,7 +80,7 @@ var TobagoAssert = {
}
},
- assertContent: function(elementOrId, expected) {
+ assertContent:function (elementOrId, expected) {
var element = TobagoAssert.jQueryElement(elementOrId);
if (element.html() != expected) {
LOG.error("The content of element with id=" + element.attr('id')
@@ -91,7 +91,7 @@ var TobagoAssert = {
/**
* Util to get an jQuery object from a plain id string (unescaped) or a jQuery object.
*/
- jQueryElement: function(elementOrId) {
+ jQueryElement:function (elementOrId) {
var element;
if (typeof elementOrId == "string") {
element = jQuery(Tobago.Utils.escapeClientId(elementOrId));
Added: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectOneChoice/selectOneChoice-layout.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectOneChoice/selectOneChoice-layout.xhtml?rev=1346957&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectOneChoice/selectOneChoice-layout.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/tc/selectOneChoice/selectOneChoice-layout.xhtml Wed Jun 6 15:51:59 2012
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<f:view
+ xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:tx="http://myfaces.apache.org/tobago/extension"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <tc:page id="page">
+ <tc:gridLayoutConstraint width="700px" height="600px"/>
+ <f:facet name="layout">
+ <tc:gridLayout columns="auto;auto" rows="auto;auto"/>
+ </f:facet>
+
+ <tc:label value="tc"/>
+ <tc:label value="tx"/>
+
+ <tc:selectOneChoice value="a" id="s1">
+ <tc:selectItem itemValue="a" itemLabel="A Value"/>
+ <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
+ </tc:selectOneChoice>
+ <tx:selectOneChoice value="b" label="normal" fieldId="s2">
+ <tc:selectItem itemValue="a" itemLabel="A Value"/>
+ <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
+ </tx:selectOneChoice>
+
+ <tc:script file="script/tobago-assert.js"/>
+
+ <tc:script onload="TobagoAssert.assertLayout('page:s1', 0, 25, 200, 20);"/>
+ <tc:script onload="TobagoAssert.assertLayout('page:s2', 0, 30, 320, 20);"/>
+
+ </tc:page>
+</f:view>
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties?rev=1346957&r1=1346956&r2=1346957&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties Wed Jun 6 15:51:59 2012
@@ -139,7 +139,7 @@ Panel.minimumWidth=0
Panel.minimumHeight=0
Popup.preferredHeight=100
-Popup.preferredWidth=100
+Popup.preferredWidth=200
Progress.preferredHeight=25
Progress.css.border-left-width=2
@@ -158,6 +158,7 @@ SelectManyListbox.minimumHeight=33
SelectManyListbox.preferredHeight=71
SelectOneChoice.height=25
+SelectOneChoice.preferredWidth=200
SelectOneListbox.minimumHeight=33
SelectOneListbox.preferredHeight=71