You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2008/09/23 16:42:30 UTC
svn commit: r698195 [2/2] - in /myfaces/tobago/trunk:
core/src/main/java/org/apache/myfaces/tobago/taglib/component/
theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/
theme/scarborough/src/main/resources...
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml?rev=698195&r1=698194&r2=698195&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago.properties.xml Tue Sep 23 07:42:29 2008
@@ -105,7 +105,8 @@
<entry key="org.apache.myfaces.tobago.FileItemValidator.CONTENT_TYPE_detail">The given file is not content type of "{0}".</entry>
<entry key="org.apache.myfaces.tobago.FileItemValidator.SIZE_LIMIT">File size error</entry>
<entry key="org.apache.myfaces.tobago.FileItemValidator.SIZE_LIMIT_detail">The uploaded file exceeded the maximum size of {0} bytes.</entry>
-
+ <entry key="tobago.font3.widths">04050508080d0a030505060904050404080808080808080808080404090909080f090a0b0b0a090b0a03070a080b0a0c0a0c0b0a090a090f0909080404040508050808080808040808030307030d0808080805080408070b070708050305090b</entry>
+ <entry key="tobago.font2.widths">04050508080c09030505050804050404080808080808080808080404080808080e09090a0a09090b09030609080b090b090b0a090909090d0809080404040508050808070808040808030307030b08080808050704080709060706050305080b</entry>
<!-- Font metric for ArialMT plain 14 -->
<!-- The String contains all widths for char 32 to 127. Each pair of 2 chars is a hex value-->
<entry key="tobago.font.widths">04040508080c09030505050804050404080808080808080808080404080808080e09090a0a09090b0a040709080c0a0b090b0a09090a090d0909090404040708050808070808040808030307030c0808080805070408070a070707050405080b</entry>
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tab.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tab.js?rev=698195&r1=698194&r2=698195&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tab.js (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tab.js Tue Sep 23 07:42:29 2008
@@ -25,14 +25,17 @@
function tobago_nextTab(type, controlId, size) {
var hidden = document.getElementById(controlId
- + '::activeIndex' /* TabGroupRenderer.ACTIVE_INDEX_POSTFIX*/);
+ + '__activeIndex' /* TabGroupRenderer.ACTIVE_INDEX_POSTFIX*/);
var selectedIndex = 0;
if (hidden) {
selectedIndex = hidden.value * 1;
}
- for (i = selectedIndex+1; i < size; i++) {
- var tab = document.getElementById(controlId + '.' + i);
- if (tab) {
+ //LOG.error("Selected Index: " + selectedIndex);
+ for (i = selectedIndex + 1; i < size; i++) {
+ var tab = document.getElementById(controlId + Tobago.SUB_COMPONENT_SEP2 + selectedIndex + Tobago.SUB_COMPONENT_SEP2 + i);
+ //LOG.error("Search " + controlId + Tobago.SUB_COMPONENT_SEP2 + selectedIndex + Tobago.SUB_COMPONENT_SEP2 + i);
+ if (tab && tab.className.indexOf('tobago-tab-disabled') == -1) {
+ //LOG.error("Selected Index: " + selectedIndex);
selectedIndex = i;
break;
}
@@ -42,14 +45,15 @@
function tobago_previousTab(type, controlId, size) {
var hidden = document.getElementById(controlId
- + '::activeIndex' /* TabGroupRenderer.ACTIVE_INDEX_POSTFIX*/);
+ + '__activeIndex' /* TabGroupRenderer.ACTIVE_INDEX_POSTFIX*/);
var selectedIndex = 0;
if (hidden) {
selectedIndex = hidden.value;
- }
- for (i = selectedIndex-1; i >= 0; i--) {
- var tab = document.getElementById(controlId + '.' + i);
- if (tab) {
+ }
+
+ for (i = selectedIndex - 1; i >= 0; i--) {
+ var tab = document.getElementById(controlId + Tobago.SUB_COMPONENT_SEP2 + selectedIndex + Tobago.SUB_COMPONENT_SEP2 + i);
+ if (tab && tab.className.indexOf('tobago-tab-disabled') == -1) {
selectedIndex = i;
break;
}
@@ -59,18 +63,18 @@
function tobago_selectTab(controlId, selectedIndex, size) {
var hidden = document.getElementById(controlId
- + '::activeIndex' /* TabGroupRenderer.ACTIVE_INDEX_POSTFIX*/);
+ + '__activeIndex' /* TabGroupRenderer.ACTIVE_INDEX_POSTFIX*/);
if (hidden) {
hidden.value = selectedIndex;
}
for (i = 0; i < size; i++) {
- var tab = document.getElementById(controlId + '.' + i);
+ var tab = document.getElementById(controlId + Tobago.SUB_COMPONENT_SEP2 + i);
if (tab) {
if (i == selectedIndex) {
- tab.style.display='block';
+ tab.style.display = 'block';
} else {
- tab.style.display='none';
+ tab.style.display = 'none';
}
}
}
@@ -79,10 +83,10 @@
function tobago_requestTab(controlId, selectedIndex) {
var hidden = document.getElementById(controlId
- + '::activeIndex' /* TabGroupRenderer.ACTIVE_INDEX_POSTFIX*/);
+ + '__activeIndex' /* TabGroupRenderer.ACTIVE_INDEX_POSTFIX*/);
if (hidden) {
hidden.value = selectedIndex;
}
Tobago.submitAction(null /*todo: source*/, controlId);
-}
+}
\ No newline at end of file
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css?rev=698195&r1=698194&r2=698195&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css Tue Sep 23 07:42:29 2008
@@ -75,6 +75,16 @@
padding: 11px 11px;
}
+div.tobago-tabnavigationbar {
+ border-bottom-color: #DDEEFF;
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+ height: 25px;
+ top: 0px;
+ margin-right: 0px;
+ position: absolute;
+}
+
a:link.tab, a:visited.tab, a:active.tab {
font-family: arial, helvetica, sans-serif;
color: #000000;
Modified: myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java?rev=698195&r1=698194&r2=698195&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java Tue Sep 23 07:42:29 2008
@@ -171,13 +171,7 @@
}
writer.startElement(HtmlConstants.DIV, null);
writer.writeClassAttribute(className);
- attributes.put(ATTR_SUPPPRESS_TOOLBAR_CONTAINER, Boolean.TRUE);
- if (UIToolBar.LABEL_BOTTOM.equals(attributes.get(ATTR_LABEL_POSITION))) {
- attributes.put(ATTR_LABEL_POSITION, UIToolBar.LABEL_RIGHT);
- }
- if (UIToolBar.ICON_BIG.equals(attributes.get(ATTR_ICON_SIZE))) {
- attributes.put(ATTR_ICON_SIZE, UIToolBar.ICON_SMALL);
- }
+ toolbar.setRendererType("BoxToolBar");
RenderUtil.encode(facesContext, toolbar);
writer.endElement(HtmlConstants.DIV);
}
Added: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/tabNext.gif
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/tabNext.gif?rev=698195&view=auto
==============================================================================
Binary file - no diff available.
Propchange: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/tabNext.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/tabNextDisabled.gif
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/tabNextDisabled.gif?rev=698195&view=auto
==============================================================================
Binary file - no diff available.
Propchange: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/tabNextDisabled.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/tabPrev.gif
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/tabPrev.gif?rev=698195&view=auto
==============================================================================
Binary file - no diff available.
Propchange: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/tabPrev.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/tabPrevDisabled.gif
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/tabPrevDisabled.gif?rev=698195&view=auto
==============================================================================
Binary file - no diff available.
Propchange: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/image/tabPrevDisabled.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties?rev=698195&r1=698194&r2=698195&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties Tue Sep 23 07:42:29 2008
@@ -39,6 +39,8 @@
TabGroup.paddingHeight=22
TabGroup.paddingWidth=23
TabGroup.headerHeight=19
+TabGroup.tabLabelExtraWidth=20
+TabGroup.navigationBarWidth=60
Tab.paddingWidth=0
Tab.paddingHeight=0
Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css?rev=698195&r1=698194&r2=698195&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css Tue Sep 23 07:42:29 2008
@@ -151,6 +151,19 @@
box-sizing: border-box;
}
+div.tobago-tabnavigationbar {
+ border-right-color: transparent;
+ border-right-style: solid;
+ border-right-width: 1px;
+ border-bottom-color: #000000;
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+ height: 22px;
+ top: -4px;
+ margin-right: 6px;
+ position: absolute;
+}
+
a:link.tab, a:visited.tab, a:active.tab {
font-family: arial, helvetica, sans-serif;
font-size: 12px;
Modified: myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/util/RenderUtil.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/util/RenderUtil.java?rev=698195&r1=698194&r2=698195&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/util/RenderUtil.java (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/util/RenderUtil.java Tue Sep 23 07:42:29 2008
@@ -170,6 +170,31 @@
}
}
+ public static int calculateStringWidth2(FacesContext facesContext, UIComponent component, String text) {
+ int width = 0;
+ int defaultCharWidth = 0;
+ try {
+ defaultCharWidth = ThemeConfig.getValue(facesContext, component, "fontWidth");
+ } catch (NullPointerException e) {
+ LOG.warn("no value for \"fontWidth\" found in theme-config");
+ }
+
+ String fontWidths = ResourceManagerUtil.getProperty(facesContext, "tobago", "tobago.font2.widths");
+
+ for (char c : text.toCharArray()) {
+ int charWidth;
+ if (c >= 32 && c < 128) {
+ int begin = (c - 32) * 2;
+ charWidth = Integer.parseInt(fontWidths.substring(begin, begin + 2), 16);
+ } else {
+ charWidth = defaultCharWidth;
+ }
+ width += charWidth;
+ }
+
+ return width;
+ }
+
public static int calculateStringWidth(FacesContext facesContext, UIComponent component, String text) {
int width = 0;
int defaultCharWidth = 0;
Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js?rev=698195&r1=698194&r2=698195&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js Tue Sep 23 07:42:29 2008
@@ -18,22 +18,22 @@
Tobago.TabGroup = function(tabGroupId, activeIndex, size) {
this.tabGroupId = tabGroupId,
- this.activeIndex = activeIndex;
+ this.activeIndex = activeIndex * 1;
this.size = size;
- this.activeTabId = tabGroupId + '.' + activeIndex;
+ this.activeTabId = tabGroupId + Tobago.SUB_COMPONENT_SEP2 + activeIndex;
LOG.debug("activeTabId : " + this.activeTabId);
Tobago.element(this.tabGroupId).jsObject = this;
Tobago.addJsObject(this);
-// var htmlId = this.tabGroupId;
-//
-// var onComplete = function() {
-// LOG.debug("htmlId = " + htmlId);
-// var obj = document.getElementById(htmlId).jsObject;
-// LOG.debug("obj = " + typeof obj);
-// obj.onComplete.apply(obj, []);
-// };
+ // var htmlId = this.tabGroupId;
+ //
+ // var onComplete = function() {
+ // LOG.debug("htmlId = " + htmlId);
+ // var obj = document.getElementById(htmlId).jsObject;
+ // LOG.debug("obj = " + typeof obj);
+ // obj.onComplete.apply(obj, []);
+ // };
// this.options.onComplete = this.onComplete.bind(this);
@@ -47,35 +47,144 @@
};
Tobago.TabGroup.prototype.setUp = function() {
- LOG.debug("tabgroup id " + this.tabGroupId);
- LOG.debug("setup tabgroup " + this.activeTabId);
- LOG.debug("activeIndex " + this.activeIndex);
- var i = 0;
- var idPrefix = this.activeTabId + Tobago.SUB_COMPONENT_SEP;
-
-// var htmlId = this.tabGroupId;
- for (i = 0; i < this.size; i++) {
-
- var anchor = Tobago.element(idPrefix + i);
- if (anchor) {
- LOG.debug("observe tab " + anchor.id);
-// if (i != this.activeIndex) {
-// Event.observe(anchor, "click", this.reload.bindAsEventListener(this));
-// }
-
-// var onClick = function(event) {
-// LOG.debug("htmlId = " + htmlId);
-// var obj = document.getElementById(htmlId).jsObject;
-// LOG.debug("obj = " + obj);
-// LOG.debug("obj.reload = " + obj.reload);
-// obj.reload.call(obj, event);
-// };
+ LOG.debug("tabgroup id " + this.tabGroupId);
+ LOG.debug("setup tabgroup " + this.activeTabId);
+ LOG.debug("activeIndex " + this.activeIndex);
+ var i = 0;
+ var idPrefix = this.activeTabId + Tobago.SUB_COMPONENT_SEP2;
+
+ // var htmlId = this.tabGroupId;
+ for (i = 0; i < this.size; i++) {
+
+ var anchor = Tobago.element(idPrefix + i);
+ if (anchor) {
+ LOG.debug("observe tab " + anchor.id);
+ // if (i != this.activeIndex) {
+ // Event.observe(anchor, "click", this.reload.bindAsEventListener(this));
+ // }
+
+ // var onClick = function(event) {
+ // LOG.debug("htmlId = " + htmlId);
+ // var obj = document.getElementById(htmlId).jsObject;
+ // LOG.debug("obj = " + obj);
+ // LOG.debug("obj.reload = " + obj.reload);
+ // obj.reload.call(obj, event);
+ // };
-// Tobago.addEventListener(anchor, "click", onClick);
- Tobago.addBindEventListener(anchor, "click", this, "reloadWithAction");
+ // Tobago.addEventListener(anchor, "click", onClick);
+ Tobago.addBindEventListener(anchor, "click", this, "reloadWithAction");
+ }
+ /*var menu = Tobago.element(idPrefix + i + Tobago.SUB_COMPONENT_SEP2 + "menu");
+ if (menu) {
+ Tobago.addBindEventListener(menu, "click", this, "reload");
+ } else {
+ LOG.error("Menu not found " + idPrefix + i + Tobago.SUB_COMPONENT_SEP2 + "menu");
+ }*/
+ }
+ var next = Tobago.element(idPrefix + "next");
+ var previous = Tobago.element(idPrefix + "previous");
+ if (next) {
+ Tobago.addBindEventListener(next, "click", this, "next");
+ } //else {
+ //LOG.error("Next not found " + idPrefix + "next");
+ //}
+ if (previous) {
+ Tobago.addBindEventListener(previous, "click", this, "previous");
+ } //else {
+ //LOG.error("Previous not found " + idPrefix + "previous");
+ //}
+
+};
+
+Tobago.TabGroup.prototype.next = function(event) {
+ LOG.debug("Reload ");
+ if (event) {
+ var element = Tobago.element(event);
+ if (!element.id) {
+ element = element.parentElement;
+ }
+
+ if (element.className && element.className.indexOf("tobago-") != -1) {
+ //LOG.error(element.id);
+ var idPrefix = element.id.substring(0, element.id.lastIndexOf(Tobago.SUB_COMPONENT_SEP2) + Tobago.SUB_COMPONENT_SEP2.length);
+ //LOG.error(idPrefix);
+ for (i = this.activeIndex + 1; i < this.size; i++) {
+ var id = idPrefix + i;
+ var div = Tobago.element(id);
+ if (div) {
+ this.activeIndex = i;
+ break;
+ }
+ }
+ //this.activeIndex =
+ //LOG.error("Request tab with index " + this.activeIndex);
+
+ var hidden = Tobago.element(this.tabGroupId + Tobago.SUB_COMPONENT_SEP2 + "activeIndex");
+ if (hidden) {
+ hidden.value = this.activeIndex;
+ }
+ else {
+ LOG.warn("No hidden field for tabindex Id='" + this.tabGroupId + Tobago.SUB_COMPONENT_SEP2 + "activeIndex" + "'");
+ LOG.warn("aId = " + aId);
+ }
+ if (Tobago.Updater.hasTransport()) {
+ var id = idPrefix + this.activeIndex;
+ this.removeRelatedAcceleratorKeys(id.substring(0, id.lastIndexOf(Tobago.SUB_COMPONENT_SEP2) + Tobago.SUB_COMPONENT_SEP2.length));
+ Tobago.createOverlay(Tobago.element(this.tabGroupId));
+ Tobago.Updater.update(event.srcElement, this.tabGroupId, this.tabGroupId, this.options);
+ } else {
+ Tobago.submitAction2(event.srcElement, this.tabGroupId, null, null);
}
}
+ } else {
+ LOG.info("No reload Event");
+ }
+};
+
+Tobago.TabGroup.prototype.previous = function(event) {
+ LOG.debug("Reload ");
+ if (event) {
+ var element = Tobago.element(event);
+ if (!element.id) {
+ element = element.parentElement;
+ }
+ //LOG.debug(element.className);
+ if (element.className && element.className.indexOf("tobago") != -1) {
+ //LOG.error(element.id);
+ var idPrefix = element.id.substring(0, element.id.lastIndexOf(Tobago.SUB_COMPONENT_SEP2) + Tobago.SUB_COMPONENT_SEP2.length);
+ //LOG.error(idPrefix);
+ for (i = this.activeIndex - 1; i >= 0; i--) {
+ var id = idPrefix + i;
+ var div = Tobago.element(id);
+ if (div) {
+ this.activeIndex = i;
+ break;
+ }
+ }
+ //this.activeIndex =
+ //LOG.error("Request tab with index " + this.activeIndex);
+
+ var hidden = Tobago.element(this.tabGroupId + Tobago.SUB_COMPONENT_SEP2 + "activeIndex");
+ if (hidden) {
+ hidden.value = this.activeIndex;
+ }
+ else {
+ LOG.warn("No hidden field for tabindex Id='" + this.tabGroupId + Tobago.SUB_COMPONENT_SEP2 + "activeIndex" + "'");
+ LOG.warn("aId = " + aId);
+ }
+ if (Tobago.Updater.hasTransport()) {
+ var id = idPrefix + this.activeIndex;
+ this.removeRelatedAcceleratorKeys(id.substring(0, id.lastIndexOf(Tobago.SUB_COMPONENT_SEP2) + Tobago.SUB_COMPONENT_SEP2.length));
+ Tobago.createOverlay(Tobago.element(this.tabGroupId));
+ Tobago.Updater.update(event.srcElement, this.tabGroupId, this.tabGroupId, this.options);
+ } else {
+ Tobago.submitAction2(event.srcElement, this.tabGroupId, null, null);
+ }
+ }
+ } else {
+ LOG.info("No reload Event");
+ }
};
@@ -89,19 +198,19 @@
//LOG.debug(element.className);
if (element.className && element.className.indexOf("tobago-tab-link") != -1) {
var aId = Tobago.findAnchestorWithTagName(element, 'span').id;
- this.activeIndex = aId.substring(aId.lastIndexOf(Tobago.SUB_COMPONENT_SEP) + Tobago.SUB_COMPONENT_SEP.length);
+ this.activeIndex = aId.substring(aId.lastIndexOf(Tobago.SUB_COMPONENT_SEP2) + Tobago.SUB_COMPONENT_SEP2.length);
LOG.debug("Request tab with index " + this.activeIndex);
- var hidden = Tobago.element(this.tabGroupId + Tobago.SUB_COMPONENT_SEP + "activeIndex");
+ var hidden = Tobago.element(this.tabGroupId + Tobago.SUB_COMPONENT_SEP2 + "activeIndex");
if (hidden) {
hidden.value = this.activeIndex;
}
else {
- LOG.warn("No hidden field for tabindex Id='" + this.tabGroupId + Tobago.SUB_COMPONENT_SEP + "activeIndex" + "'");
+ LOG.warn("No hidden field for tabindex Id='" + this.tabGroupId + Tobago.SUB_COMPONENT_SEP2 + "activeIndex" + "'");
LOG.warn("aId = " + aId);
}
if (Tobago.Transport.hasTransport()) {
- this.removeRelatedAcceleratorKeys(aId.substring(0, aId.lastIndexOf(Tobago.SUB_COMPONENT_SEP) + Tobago.SUB_COMPONENT_SEP.length));
+ this.removeRelatedAcceleratorKeys(aId.substring(0, aId.lastIndexOf(Tobago.SUB_COMPONENT_SEP2) + Tobago.SUB_COMPONENT_SEP2.length));
Tobago.createOverlay(Tobago.element(this.tabGroupId));
Tobago.Updater.update(event.srcElement, this.tabGroupId, this.tabGroupId, this.options);
} else {
Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=698195&r1=698194&r2=698195&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Tue Sep 23 07:42:29 2008
@@ -61,6 +61,11 @@
*/
SUB_COMPONENT_SEP: "::",
+ /**
+ * Tobago's subComponent separator constant
+ */
+ SUB_COMPONENT_SEP2: "__",
+
EMPTY_HREF: window.all ? "#" : "javascript:;",
/**