diff --git a/org.adempiere.install/install.console.app.launch b/org.adempiere.install/install.console.app.launch index 7f2a7c6ecb..2c1863dc01 100644 --- a/org.adempiere.install/install.console.app.launch +++ b/org.adempiere.install/install.console.app.launch @@ -20,8 +20,8 @@ - - + + diff --git a/org.adempiere.sdk-feature/adempiere.rmap b/org.adempiere.sdk-feature/adempiere.rmap index 5a362716b3..a8fa93e7f4 100644 --- a/org.adempiere.sdk-feature/adempiere.rmap +++ b/org.adempiere.sdk-feature/adempiere.rmap @@ -28,6 +28,15 @@ + + + + + + + + + @@ -122,7 +131,15 @@ + + + + + + + + diff --git a/org.adempiere.server-feature/feature.xml b/org.adempiere.server-feature/feature.xml index e95943a252..72733a90c3 100644 --- a/org.adempiere.server-feature/feature.xml +++ b/org.adempiere.server-feature/feature.xml @@ -50,6 +50,10 @@ id="org.adempiere.base" version="0.0.0"/> + + - - + + diff --git a/org.adempiere.server-feature/server.product.launch b/org.adempiere.server-feature/server.product.launch index 530fe8f959..deb3559e23 100644 --- a/org.adempiere.server-feature/server.product.launch +++ b/org.adempiere.server-feature/server.product.launch @@ -24,8 +24,8 @@ - - + + diff --git a/org.adempiere.ui.zk-feature/feature.xml b/org.adempiere.ui.zk-feature/feature.xml index 511c9dcc1a..174dcf204e 100644 --- a/org.adempiere.ui.zk-feature/feature.xml +++ b/org.adempiere.ui.zk-feature/feature.xml @@ -26,11 +26,4 @@ install-size="0" version="3.1.0.qualifier"/> - - diff --git a/org.adempiere.ui.zk/META-INF/MANIFEST.MF b/org.adempiere.ui.zk/META-INF/MANIFEST.MF index 21fd156bad..fe7338a887 100644 --- a/org.adempiere.ui.zk/META-INF/MANIFEST.MF +++ b/org.adempiere.ui.zk/META-INF/MANIFEST.MF @@ -91,9 +91,18 @@ Export-Package: fi.jawsy.jawwa.zk.atmosphere, web.js.zkforge.mold Require-Bundle: org.adempiere.base;bundle-version="3.1.0", org.adempiere.ui;bundle-version="3.1.0", - org.zkoss.zk.library;bundle-version="7.0.0" + org.idempiere.zk.extra;bundle-version="1.0.0", + zcommon;bundle-version="8.0.0", + zel;bundle-version="8.0.0", + zhtml;bundle-version="8.0.0", + zk;bundle-version="8.0.0", + zkbind;bundle-version="8.0.0", + zkplus;bundle-version="8.0.0", + zul;bundle-version="8.0.0", + zweb;bundle-version="8.0.0", + org.junit;bundle-version="4.11.0", + org.apache.commons.io;bundle-version="1.4.0" Bundle-Activator: org.adempiere.webui.WebUIActivator Eclipse-ExtensibleAPI: true -Eclipse-RegisterBuddy: org.zkoss.zk.library Web-ContextPath: webui Service-Component: OSGI-INF/reportviewerprovider.xml, OSGI-INF/defaultinfofactory.xml, OSGI-INF/defaulteditorfactory.xml, OSGI-INF/jrviewerprovider.xml, OSGI-INF/resourcefinder.xml, OSGI-INF/defaultpaymentformfactory.xml, OSGI-INF/processfactory.xml, OSGI-INF/defaultprintshippinglabel.xml, OSGI-INF/defaultcreatefromfactory.xml, OSGI-INF/defaultformfactory.xml, OSGI-INF/feedbackservice.xml, OSGI-INF/zulgadgetfactory.xml, OSGI-INF/jfgchartrenderer.xml diff --git a/org.adempiere.ui.zk/WEB-INF/cwr/js/zk/utl.js b/org.adempiere.ui.zk/WEB-INF/cwr/js/zk/utl.js deleted file mode 100644 index 6253b33dac..0000000000 --- a/org.adempiere.ui.zk/WEB-INF/cwr/js/zk/utl.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var c={lt:"<",gt:">",amp:"&",quot:'"'},f={};for(var b in c){f[c[b]]=b}function g(k){var i=k.indexOf("//");if(i>0){i=k.indexOf("/",i+2);if(i>0){return k.substring(i)}}}function a(o,m){o.push(m);for(var i=m.frames,n=0,k=i.length;n0||k>0?m>k?j:i:o}zUtl={isChar:function(j,i){return(i.digit&&j>="0"&&j<="9")||(i.upper&&j>="A"&&j<="Z")||(i.lower&&j>="a"&&j<="z")||(i.whitespace&&(j==" "||j=="\t"||j=="\n"||j=="\r"))||i[j]},parseMap:function(r,n,j){var k={};if(r){var i=r.split(n||",");if(j){var m=[],u=new RegExp(j,"g"),q="",s,l;while((s=i.shift())!==undefined){if((l=(q+=s).match(u))&&l.length!=1){if(q){m.push(q)}q=""}else{q+=n}}i=m}for(var p=i.length;p--;){var q=i[p].trim(),o=q.indexOf("=");if(o!=-1){k[q.substring(0,o)]=q.substring(o+1,q.length).trim()}}}return k},encodeXML:function(t,i){t=t!=null?String(t):"";var u=t.length,o=i&&i.pre,m=o||(i&&i.multiline),l=i?i.maxlength:0;if(!m&&l&&u>l){var r=l;while(r>0&&t.charAt(r-1)==" "){--r}i.maxlength=0;return zUtl.encodeXML(t.substring(0,r)+"...",i)}var s=[],p=0,q;if(m||o){for(var r=0;r\n");p=r+1}else{if(o&&(n==" "||n=="\t")){s.push(t.substring(p,r)," ");if(n=="\t"){s.push("   ")}p=r+1}}}}}else{for(var r=0;r=0){var r=i.charAt(p+1)=="#"?String.fromCharCode(i.charAt(p+2).toLowerCase()=="x"?parseInt(i.substring(p+3,m),16):parseInt(i.substring(p+2,m),10)):c[i.substring(p+1,m)];if(r){q+=i.substring(o,p)+r;o=(p=m)+1}}}}return !o?i:o',i0:'',now:jq.now,today:function(i){var o=new Date(),m=0,k=0,l=0,n=0;if(typeof i=="string"){var j=i.toLowerCase();if(j.indexOf("h")>=0||j.indexOf("k")>=0){m=o.getHours()}if(i.indexOf("m")>=0){k=o.getMinutes()}if(i.indexOf("s")>=0){l=o.getSeconds()}if(i.indexOf("S")>=0){n=o.getMilliseconds()}}else{if(i){return o}}return new Date(o.getFullYear(),o.getMonth(),o.getDate(),m,k,l,n)},isAncestor:function(i,j){if(!i){return true}for(;j;j=j.getParent?j.getParent():j.parent){if(i==j){return true}}return false},progressbox:function(z,l,D,G,i){if(D&&zk.Page.contained.length){for(var I=zk.Page.contained.length,H=zk.Page.contained[--I];H;H=zk.Page.contained[--I]){if(!H._applyMask){H._applyMask=new zk.eff.Mask({id:H.uuid+"-mask",message:l,anchor:H.$n()})}}return}if(i&&i.busy){zk.busy++;jq.focusOut()}var r=jq.innerX(),q=jq.innerY(),E=' style="left:'+r+"px;top:"+q+'px"',k=z+"-t",F=z+"-m",s='
'+l+"
";if(G){s+='
'}jq(document.body).append(s+"
");var J=jq(z,zk),B=J[0],K=jq(k,zk),t=K[0],C=t.style;if(D){var w=K.css("z-index");if(w=="auto"){w=1}B.z_mask=new zk.eff.FullMask({mask:jq(F,zk)[0],zIndex:w-1})}if(D&&K.length){C.left=jq.px((jq.innerWidth()-t.offsetWidth)/2+r);C.top=jq.px((jq.innerHeight()-t.offsetHeight)/2+q)}else{var o=zk.progPos;if(o){var j,u,A=jq.innerWidth(),v=jq.innerHeight(),L=A-zk(t).offsetWidth(),p=v-zk(t).offsetHeight();if(o.indexOf("mouse")>=0){var m=zk.currentPointer;j=m[0]+10;u=m[1]+10}else{if(o.indexOf("left")>=0){j=r}else{if(o.indexOf("right")>=0){j=r+L-1}else{if(o.indexOf("center")>=0){j=r+L/2}else{j=0}}}if(o.indexOf("top")>=0){u=q}else{if(o.indexOf("bottom")>=0){u=q+p-1}else{if(o.indexOf("center")>=0){u=q+p/2}else{u=0}}}j=j=0?m.substring(0,l):m,k=g(location.href);l=k.indexOf("#");if(l>=0){k=k.substring(0,l)}if(k!=i){return}}location.reload()}}},frames:function(i){var j=[];a(j,i);return j},intsToString:function(m){if(!m){return""}var n=[];for(var l=0,i=m.length;l=0?p.substring(m,l):p.substring(m)).trim();if(n.length==0){if(l<0){break}o.push(i)}else{o.push(zk.parseInt(n))}if(l<0){break}m=l+1}return o},mapToString:function(m,j,l){j=j||"=";l=l||" ";var k=[];for(var i in m){k.push(l,i,j,m[i])}k[0]="";return k.join("")},appendAttr:function(i,k,j){return k||j?" "+i+'="'+k+'"':""},fireSized:function(j,k){if(zUtl.isImageLoading()||zk.clientinfo){var i=arguments.callee;setTimeout(function(){return i(j,k)},20);return}j=h(j);if(!(k<0)){zWatch.fireDown("beforeSize",j,null,k>0)}zWatch.fireDown("onFitSize",j,{reverse:true});zWatch.fireDown("onSize",j)},fireShown:function(i,j){zWatch.fireDown("onShow",i);zUtl.fireSized(i,j)},loadImage:function(i){if(!e[i]){e[i]=true;d(i)}},isImageLoading:function(){for(var url in iMap){var img=iMap[url];if(img.complete){try{delete e[url];}catch(err){}try{delete iMap[url];}catch(err){}}}for(var i in e){return true}return false}};var e={};var iMap={};function d(j){var i=new Image(),k=function(){try{delete e[j];}catch(err){}try{delete iMap[j];}catch(err){}};i.onerror=i.onload=k;i.src=j}})(); \ No newline at end of file diff --git a/org.adempiere.ui.zk/WEB-INF/cwr/js/zk/utl.src.js b/org.adempiere.ui.zk/WEB-INF/cwr/js/zk/utl.src.js deleted file mode 100644 index 10dc460cf6..0000000000 --- a/org.adempiere.ui.zk/WEB-INF/cwr/js/zk/utl.src.js +++ /dev/null @@ -1,654 +0,0 @@ -/* util.js - - Purpose: - - Description: - - History: - Tue Sep 30 09:02:06 2008, Created by tomyeh - -Copyright (C) 2008 Potix Corporation. All Rights Reserved. - -This program is distributed under LGPL Version 2.1 in the hope that -it will be useful, but WITHOUT ANY WARRANTY. -*/ -(function () { - var _decs = {lt: '<', gt: '>', amp: '&', quot: '"'}, - _encs = {}; - for (var v in _decs) - _encs[_decs[v]] = v; - - function _pathname(url) { - var j = url.indexOf('//'); - if (j > 0) { - j = url.indexOf('/', j + 2); - if (j > 0) return url.substring(j); - } - } - - function _frames(ary, w) { - //Note: the access of frames is allowed for any window (even if it connects other website) - ary.push(w); - for (var fs = w.frames, j = 0, l = fs.length; j < l; ++j) - _frames(ary, fs[j]); - } - /* Returns the onSize target of the given widget. - * The following code is dirty since it checks _hflexsz (which is implementation) - * FUTRE: consider to have zk.Widget.beforeSize to clean up _hflexsz and - * this method considers only if _hflex is min - */ - function _onSizeTarget(wgt) { - var r1 = wgt, p1 = r1, - j1 = -1; - for (; p1 && p1._hflex == 'min'; p1 = p1.parent) { - delete p1._hflexsz; - r1 = p1; - ++j1; - if (p1.ignoreFlexSize_('w')) //p1 will not affect its parent's flex size - break; - } - - var r2 = wgt, p2 = r2, - j2 = -1; - for (; p2 && p2._vflex == 'min'; p2 = p2.parent) { - delete p2._vflexsz; - r2 = p2; - ++j2; - if (p2.ignoreFlexSize_('h')) //p2 will not affect its parent's flex size - break; - } - return j1 > 0 || j2 > 0 ? j1 > j2 ? r1 : r2: wgt; - } - -/** @class zUtl - * @import zk.Widget - * @import zk.xml.Utl - * The basic utilties. - *

For more utilities, refer to {@link Utl}. - */ -zUtl = { //static methods - //Character - /** - * Returns whether the character is according to its opts. - * @param char cc the character - * @param Map opts the options. - - - - - - - - - - - - - - -
Allowed Options -
Name - Allowed Values - Description -
digit - true, false - Specifies the character is digit only. -
upper - true, false - Specifies the character is upper case only. -
lower - true, false - Specifies the character is lower case only. -
whitespace - true, false - Specifies the character is whitespace only. -
opts[cc] - true, false - Specifies the character is allowed only. -
- * @return boolean - */ - isChar: function (cc, opts) { - return (opts.digit && cc >= '0' && cc <= '9') - || (opts.upper && cc >= 'A' && cc <= 'Z') - || (opts.lower && cc >= 'a' && cc <= 'z') - || (opts.whitespace && (cc == ' ' || cc == '\t' || cc == '\n' || cc == '\r')) - || opts[cc]; - }, - - //HTML/XML - /** Parses the specifie text into a map. - * For example - *


-zUtl.parseMap("a=b,c=d");
-zUtl.parseMap("a='b c',c=de", ',', "'\"");
-
- * @param String text the text to parse - * @param String separator the separator. If omitted, ',' - * is assumed - * @param String quote the quote to handle. Ignored if omitted. - * @return Map the map - */ - parseMap: function (text, separator, quote) { - var map = {}; - if (text) { - var ps = text.split(separator || ','); - if (quote) { - var tmp = [], - re = new RegExp(quote, 'g'), - key = '', t, pair; - while((t = ps.shift()) !== undefined) { - if ((pair = (key += t).match(re)) && pair.length != 1) { - if (key) - tmp.push(key); - key = ''; - } else - key += separator; - } - ps = tmp; - } - for (var len = ps.length; len--;) { - var key = ps[len].trim(), - index = key.indexOf('='); - if (index != -1) - map[key.substring(0, index)] = key.substring(index + 1, key.length).trim(); - } - } - return map; - }, - - /** Encodes the string to a valid XML string. - * Refer to {@link Utl} for more XML utilities. - * @param String txt the text to encode - * @param Map opts [optional] the options. Allowd value: - *
    - *
  • pre - whether to replace whitespace with &nbsp;
  • - *
  • multiline - whether to replace linefeed with <br/>
  • - *
  • maxlength - the maximal allowed length of the text
  • - *
- * @return String the encoded text. - */ - encodeXML: function (txt, opts) { - txt = txt != null ? String(txt):''; - var tl = txt.length, - pre = opts && opts.pre, - multiline = pre || (opts && opts.multiline), - maxlength = opts ? opts.maxlength : 0; - - if (!multiline && maxlength && tl > maxlength) { - var j = maxlength; - while (j > 0 && txt.charAt(j - 1) == ' ') - --j; - opts.maxlength = 0; //no limit - return zUtl.encodeXML(txt.substring(0, j) + '...', opts); - } - - var out = [], k = 0, enc; - if (multiline || pre) - for (var j = 0; j < tl; ++j) { - var cc = txt.charAt(j); - if (enc = _encs[cc]) { - out.push(txt.substring(k, j), '&', enc, ';'); - k = j + 1; - } else if (multiline && cc == '\n') { - out.push(txt.substring(k, j), '
\n'); - k = j + 1; - } else if (pre && (cc == ' ' || cc == '\t')) { - out.push(txt.substring(k, j), ' '); - if (cc == '\t') - out.push('   '); - k = j + 1; - } - } - else - for (var j = 0; j < tl; ++j) - if (enc = _encs[txt.charAt(j)]) { - out.push(txt.substring(k, j), '&', enc, ';'); - k = j + 1; - } - - if (!k) return txt; - if (k < tl) - out.push(txt.substring(k)); - return out.join(''); - }, - /** Decodes the XML string into a normal string. - * For example, &lt; is convert to < - * @param String txt the text to decode - * @return String the decoded string - */ - decodeXML: function (txt) { - var out = ''; - if (!txt) return out; - - var k = 0, tl = txt.length; - for (var j = 0; j < tl; ++j) { - var cc = txt.charAt(j); - if (cc == '&') { - var l = txt.indexOf(';', j + 1); - if (l >= 0) { - var dec = txt.charAt(j + 1) == '#' ? - String.fromCharCode(txt.charAt(j + 2).toLowerCase() == 'x' ? - parseInt(txt.substring(j + 3, l), 16): - parseInt(txt.substring(j + 2, l), 10)): - _decs[txt.substring(j + 1, l)]; - if (dec) { - out += txt.substring(k, j) + dec; - k = (j = l) + 1; - } - } - } - } - return !k ? txt: - k < tl ? out + txt.substring(k): out; - }, - - /** A shortcut of ' cellpadding="0" cellspacing="0" border="0"'. - * @type String - */ - cellps0: ' cellpadding="0" cellspacing="0" border="0"', - /** A shortcut of '<img style="height:0;width:0"/>'. - * @type String - */ - img0: '', - /** A shortcut of '<i style="height:0;width:0"/>'. - * @type String - */ - i0: '', - - /** Returns a long value representing the current time (unit: miliseconds). - * @return long - * @deprecated As of release 5.0.6, replaced with jq.now(). - */ - now: jq.now, - /** Returns today. - * @param boolean full if true, returns the full time, - * else only returns year, month, and day. - * If omitted, false is assumed - * @return Date - */ - /** Returns today. - * @param String fmt the time format, such as HH:mm:ss.SSS - * If a time element such as seconds not specified in the format, it will - * be considered as 0. For example, if the format is "HH:mm", then - * the returned object will be today, this hour and this minute, but - * the second and milliseconds will be zero. - * @return Date - * @since 5.0.6 - */ - today: function (fmt) { - var d = new Date(), hr = 0, min = 0, sec = 0, msec = 0; - if (typeof fmt == 'string') { - var fmt0 = fmt.toLowerCase(); - if (fmt0.indexOf('h') >= 0 || fmt0.indexOf('k') >= 0) hr = d.getHours(); - if (fmt.indexOf('m') >= 0) min = d.getMinutes(); - if (fmt.indexOf('s') >= 0) sec = d.getSeconds(); - if (fmt.indexOf('S') >= 0) msec = d.getMilliseconds(); - } else if (fmt) - return d; - return new Date(d.getFullYear(), d.getMonth(), d.getDate(), - hr, min, sec, msec); - }, - - /** Returns if one is ancestor of the other. - * It assumes the object has either a method called getParent - * or a field called parent. - * A typical example is used to test the widgets ({@link Widget}). - * - *

Notice that, if you want to test DOM elements, please use - * {@link jq#isAncestor} instead. - * - * @param Object p the parent. This method return true if p is null - or p is the same as c - * @param Object c the child - * @return boolean - * @see jq#isAncestor - */ - isAncestor: function (p, c) { - if (!p) return true; - for (; c; c = c.getParent ? c.getParent(): c.parent) - if (p == c) - return true; - return false; - }, - - //progress// - /** Creates a message box to indicate something is being processed - * @param String id the ID of the DOM element being created - * @param String msg the message to shown - * @param boolean mask whether to show sem-transparent mask to prevent - * the user from accessing it. - * @param String icon the CSS class used to shown an icon in the box. - * Ignored if not specified. - * @see #destroyProgressbox - */ - progressbox: function (id, msg, mask, icon, _opts) { - if (mask && zk.Page.contained.length) { - for (var c = zk.Page.contained.length, e = zk.Page.contained[--c]; e; e = zk.Page.contained[--c]) { - if (!e._applyMask) - e._applyMask = new zk.eff.Mask({ - id: e.uuid + '-mask', - message: msg, - anchor: e.$n() - }); - } - return; - } - - if (_opts && _opts.busy) { - zk.busy++; - jq.focusOut(); //Bug 2912533 - } - - var x = jq.innerX(), y = jq.innerY(), - style = ' style="left:'+x+'px;top:'+y+'px"', - idtxt = id + '-t', - idmsk = id + '-m', - html = '

' - +msg+'
'; - if (icon) - html += '
'; - jq(document.body).append(html + ''); - - var $n = jq(id, zk), - n = $n[0], - $txt = jq(idtxt, zk), - txt = $txt[0], - st = txt.style; - if (mask) { - // old IE will get the auto value by default. - var zIndex = $txt.css('z-index'); - if (zIndex == 'auto') - zIndex = 1; - n.z_mask = new zk.eff.FullMask({ - mask: jq(idmsk, zk)[0], - zIndex: zIndex - 1 - }); - } - - if (mask && $txt.length) { //center - st.left = jq.px((jq.innerWidth() - txt.offsetWidth) / 2 + x); - st.top = jq.px((jq.innerHeight() - txt.offsetHeight) / 2 + y); - } else { - var pos = zk.progPos; - if (pos) { - var left, - top, - width = jq.innerWidth(), - height = jq.innerHeight(), - wdgap = width - zk(txt).offsetWidth(), - hghgap = height - zk(txt).offsetHeight(); - - if (pos.indexOf('mouse') >= 0) { - var offset = zk.currentPointer; - left = offset[0] + 10; - top = offset[1] + 10; - } else { - if (pos.indexOf('left') >= 0) left = x; - else if (pos.indexOf('right') >= 0) left = x + wdgap -1; - else if (pos.indexOf('center') >= 0) left = x + wdgap / 2; - else left = 0; - - if (pos.indexOf('top') >= 0) top = y; - else if (pos.indexOf('bottom') >= 0) top = y + hghgap - 1; - else if (pos.indexOf('center') >= 0) top = y + hghgap / 2; - else top = 0; - - left = left < x ? x : left; - top = top < y ? y : top; - } - st.left = jq.px(left); - st.top = jq.px(top); - } - } - - $n.zk.cleanVisibility(); - }, - /** Removes the message box created by {@link #progressbox}. - * @param String id the ID of the DOM element of the message box - */ - destroyProgressbox: function (id, _opts) { - if (_opts && _opts.busy && --zk.busy < 0) - zk.busy = 0; - var $n = jq(id, zk), n; - if ($n.length) { - if (n = $n[0].z_mask) n.destroy(); - $n.remove(); - } - - for (var c = zk.Page.contained.length, e = zk.Page.contained[--c]; e; e = zk.Page.contained[--c]) - if (e._applyMask) { - e._applyMask.destroy(); - e._applyMask = null; - } - }, - - //HTTP// - /** Navigates to the specified URL. - * @param String url the URL to go to - * @param Map opts [optional] the options. Allowed values: - *
    - *
  • target - the name of the target browser window. The same browswer - * window is assumed if omitted. You can use any value allowed in - * the target attribute of the HTML FORM tag, such as _self, _blank, - * _parent and _top.
  • - *
  • overwrite - whether load a new page in the current browser window. - * If true, the new page replaces the previous page's position in the history list.
  • - *
- */ - go: function (url, opts) { - opts = opts || {}; - if (opts.target) { - open(url, opts.target); - } else if (opts.overwrite) { - location.replace(url ? url: location.href); - } else { - if (url) { - location.href = url; - - var j = url.indexOf('#'); - //bug 3363687, only if '#" exist, has to reload() - if(j < 0) - return; - - var un = j >= 0 ? url.substring(0, j): url, - pn = _pathname(location.href); - - j = pn.indexOf('#'); - if (j >= 0) pn = pn.substring(0, j); - if (pn != un) - return; - //fall thru (bug 2882149) - } - location.reload(); - } - }, - - /** Returns all descendant frames of the given window. - *

To retrieve all, invoke zUtl.frames(top). - * Notice: w is included in the returned array. - * If you want to exclude it, invoke zUtl.frames(w).$remove(w). - * @param Window w the browser window - * @return Array - * @since 5.0.4 - */ - frames: function (w) { - var ary = []; - _frames(ary, w); - return ary; - }, - - /** Converts an integer array to a string (separated by comma). - * @param int[] ary the integer array to convert. - * If null, an empty string is returned. - * @return String - * @see #stringToInts - */ - intsToString: function (ary) { - if (!ary) return ''; - - var sb = []; - for (var j = 0, k = ary.length; j < k; ++j) - sb.push(ary[j]); - return sb.join(); - }, - /** Converts a string separated by comma to an array of integers. - * @see #intsToString - * @param String text the string to convert. - * If null, null is returned. - * @param int defaultValue the default value used if the value - * is not specified. For example, zUtl.stringToInts("1,,3", 2) returns [1, 2, 3]. - * @return int[] - */ - stringToInts: function (text, defaultValue) { - if (text == null) - return null; - - var list = []; - for (var j = 0;;) { - var k = text.indexOf(',', j), - s = (k >= 0 ? text.substring(j, k): text.substring(j)).trim(); - if (s.length == 0) { - if (k < 0) break; - list.push(defaultValue); - } else - list.push(zk.parseInt(s)); - - if (k < 0) break; - j = k + 1; - } - return list; - }, - /** Converts a map to a string - * @see #intsToString - * @param Map map the map to convert - * @param String assign the symbol for assignment. If omitted, '=' is assumed. - * @param String separator the symbol for separator. If omitted, ',' is assumed. - * @return String - */ - mapToString: function (map, assign, separator) { - assign = assign || '='; - separator = separator || ' '; - var out = []; - for (var v in map) - out.push(separator, v, assign, map[v]); - out[0] = ''; - return out.join(''); - }, - /** Appends an attribute. - * Notice that the attribute won't be appended if val is empty or false. - * In other words, it is equivalent to
- * val ? ' ' + nm + '="' + val + '"': "". - *

If you want to generate the attribute no matter what val is, use - * {@link #appendAttr(String, Object, boolean)}. - * @param String nm the name of the attribute - * @param Object val the value of the attribute - * @since 5.0.3 - */ - /** Appends an attribute. - * Notice that the attribute won't be appended. - * @param String nm the name of the attribute - * @param Object val the value of the attribute - * @param boolean force whether to append attribute no matter what value it is. - * If false (or omitted), it is the same as {@link #appendAttr(String, Object)}. - * @since 5.0.3 - */ - appendAttr: function (nm, val, force) { - return val || force ? ' ' + nm + '="' + val + '"': ''; - }, - /** Fires beforeSize, onFitSize and onSize - * @param Widget wgt the widget which the zWatch event will be fired against. - * @param int bfsz the beforeSize mode: - *

    - *
  • 0 (null/undefined/false): beforeSize sent normally.
  • - *
  • -1: beforeSize won't be sent.
  • - *
  • 1: beforeSize will be sent with an additional cleanup option, - * which will clean up the cached minimal size (if flex=min).
  • - *
- * @since 5.0.8 - */ - fireSized: function (wgt, bfsz) { - if (zUtl.isImageLoading() || zk.clientinfo) { - var f = arguments.callee; - setTimeout(function () { - return f(wgt, bfsz); - }, 20); - return; - } - wgt = _onSizeTarget(wgt); - if (!(bfsz < 0)) //don't use >= (because bfsz might be undefined) - zWatch.fireDown('beforeSize', wgt, null, bfsz > 0); - zWatch.fireDown('onFitSize', wgt, {reverse: true}); - zWatch.fireDown('onSize', wgt); - }, - /** Fires onBeforeSize, onShow, onFitSize, and onSize - * @param Widget wgt the widget which the zWatch event will be fired against. - * @param int bfsz the beforeSize mode: - *
    - *
  • 0 (null/undefined/false): beforeSize sent normally.
  • - *
  • -1: beforeSize won't be sent.
  • - *
  • 1: beforeSize will be sent with an additional cleanup option, - * which will clean up the cached minimal size (if flex=min).
  • - *
- * @since 5.0.8 - */ - fireShown: function (wgt, bfsz) { - zWatch.fireDown('onShow', wgt); - zUtl.fireSized(wgt, bfsz); - }, - /** - * Loads an image before ZK client engine to calculate the widget's layout. - * @param String url the loading image's localation - * @since 6.0.0 - */ - loadImage: function (url) { - if (!_imgMap[url]) { - _imgMap[url] = true; - _loadImage(url); - } - }, - /** - * Checks whether all the loading images are finish. - * @see #loadImage - * @since 6.0.0 - */ - isImageLoading: function () { - for (var url in _imgObjectMap) { - var img = _imgObjectMap[url]; - if (img.complete) { - try { - delete _imgMap[url]; - } catch (err) {} - try { - delete _imgObjectMap[url]; - } catch (err) {} - } - } - for (var n in _imgMap) { - return true; - } - return false; - } -}; - -var _imgMap = {}; -var _imgObjectMap = {}; -function _loadImage(url) { - var img = new Image(), - f = function () { - try { - delete _imgMap[url]; - } catch (err) {} - try { - delete _imgObjectMap[url]; - } catch (err) {} - }; - _imgObjectMap[url]=img; - img.onerror = img.onload = img.onabort = f; - img.src = url; -} -})(); diff --git a/org.adempiere.ui.zk/WEB-INF/override-web.xml b/org.adempiere.ui.zk/WEB-INF/override-web.xml new file mode 100644 index 0000000000..6c8c48e3f8 --- /dev/null +++ b/org.adempiere.ui.zk/WEB-INF/override-web.xml @@ -0,0 +1,37 @@ + + + + + + + ZK loader for ZUML pages + zkLoader + + org.adempiere.webui.session.WebUIServlet + + + + update-uri + /zkau + + + compress + false + + 1 + + + zkLoader + *.zul + + + zkLoader + *.zhtml + + + diff --git a/org.adempiere.ui.zk/WEB-INF/src/metainfo/tld/config.xml b/org.adempiere.ui.zk/WEB-INF/src/metainfo/tld/config.xml index 30167039f0..e94a568a19 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/metainfo/tld/config.xml +++ b/org.adempiere.ui.zk/WEB-INF/src/metainfo/tld/config.xml @@ -1,6 +1,7 @@ + org.adempiere.ui.zk org.adempiere.webui.AdempiereWebUI 1.0.0 diff --git a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml index 8b26228bbf..e138fad282 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml +++ b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml @@ -35,7 +35,7 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI). - + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereIdGenerator.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereIdGenerator.java index 7f8b91f0a7..af5e1b108f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereIdGenerator.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereIdGenerator.java @@ -52,7 +52,7 @@ public class AdempiereIdGenerator implements IdGenerator { boolean useIdSpace = true; if (Util.isEmpty(uuid)) { useIdSpace = false; - String attribute = comp.getWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME); + String attribute = comp.getClientAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME); if (!Util.isEmpty(attribute)) { String widgetName = getWidgetName(comp.getWidgetClass()); uuid = widgetName+"0"+attribute; @@ -156,7 +156,7 @@ public class AdempiereIdGenerator implements IdGenerator { } if (Util.isEmpty(id)) { - String attribute = comp.getWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME); + String attribute = comp.getClientAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME); if (attribute != null && attribute.length() > 0) { String widgetName = getWidgetName(comp.getWidgetClass()); locatorBuilder.append("@") @@ -171,7 +171,7 @@ public class AdempiereIdGenerator implements IdGenerator { Component parent = comp.getParent(); while(parent != null) { if (Util.isEmpty(id) || (parent instanceof IdSpace)) { - String parentLocator = parent.getWidgetAttribute(ZK_LOCATOR_ATTRIBUTE); + String parentLocator = parent.getClientAttribute(ZK_LOCATOR_ATTRIBUTE); if (parentLocator != null && parentLocator.trim().length() > 0) { locatorBuilder.insert(0, parentLocator+ " "); break; @@ -180,6 +180,6 @@ public class AdempiereIdGenerator implements IdGenerator { parent = parent.getParent(); } - comp.setWidgetAttribute(ZK_LOCATOR_ATTRIBUTE, locatorBuilder.toString()); + comp.setClientAttribute(ZK_LOCATOR_ATTRIBUTE, locatorBuilder.toString()); } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/FedexLabelWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/FedexLabelWindow.java index 287e284296..feee381617 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/FedexLabelWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/FedexLabelWindow.java @@ -22,6 +22,8 @@ import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.ListboxFactory; import org.adempiere.webui.component.VerticalBox; import org.adempiere.webui.component.Window; +import org.adempiere.webui.util.ZKUpdateUtil; +import org.apache.ecs.xhtml.center; import org.compiere.model.MAttachmentEntry; import org.compiere.util.CLogger; import org.zkoss.util.media.AMedia; @@ -62,7 +64,7 @@ public class FedexLabelWindow extends Window implements EventListener private void init() { this.setBorder("normal"); - this.setWidth("730px"); + ZKUpdateUtil.setWidth(this, "730px"); VerticalBox box = new VerticalBox(); this.appendChild(box); lbx = ListboxFactory.newDropdownListbox(); @@ -75,8 +77,8 @@ public class FedexLabelWindow extends Window implements EventListener box.appendChild(new Separator()); content = new Iframe(); - content.setHeight("500px"); - content.setWidth("700px"); + ZKUpdateUtil.setHeight(content, "500px"); + ZKUpdateUtil.setWidth(content, "700px"); content.setId("content"); content.setName(content.getUuid()); box.appendChild(content); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/LabelAppletWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/LabelAppletWindow.java index 0151d1f361..263f70461d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/LabelAppletWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/LabelAppletWindow.java @@ -18,6 +18,7 @@ import java.util.logging.Level; import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.component.Window; +import org.adempiere.webui.util.ZKUpdateUtil; import org.compiere.model.MArchive; import org.compiere.util.CLogger; import org.compiere.util.Env; @@ -50,8 +51,8 @@ public class LabelAppletWindow extends Window implements EventListener Applet applet = new Applet(); applet.setCode("PrintLabelApplet.class"); applet.setArchive("labelapplet.jar"); - applet.setWidth("0"); - applet.setHeight("0"); + ZKUpdateUtil.setWidth(applet, "0"); + ZKUpdateUtil.setHeight(applet, "0"); applet.setParam("size", list.size() + ""); for(int i = 0; i < list.size(); i++) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/UPSHtmlLabelWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/UPSHtmlLabelWindow.java index bcf5fed0d4..7f13e4dea8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/UPSHtmlLabelWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/UPSHtmlLabelWindow.java @@ -27,6 +27,7 @@ import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.ListboxFactory; import org.adempiere.webui.component.VerticalBox; import org.adempiere.webui.component.Window; +import org.adempiere.webui.util.ZKUpdateUtil; import org.compiere.model.MAttachmentEntry; import org.compiere.util.CLogger; import org.zkoss.util.media.AMedia; @@ -70,7 +71,7 @@ public class UPSHtmlLabelWindow extends Window implements EventListener private void init() { this.setBorder("normal"); - this.setWidth("730px"); + ZKUpdateUtil.setWidth(this, "730px"); VerticalBox box = new VerticalBox(); this.appendChild(box); html = ListboxFactory.newDropdownListbox(); @@ -82,8 +83,8 @@ public class UPSHtmlLabelWindow extends Window implements EventListener box.appendChild(html); box.appendChild(new Separator()); content = new Iframe(); - content.setHeight("500px"); - content.setWidth("700px"); + ZKUpdateUtil.setHeight(content, "500px"); + ZKUpdateUtil.setWidth(content, "700px"); content.setId("content"); content.setName(content.getUuid()); box.appendChild(content); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/UiLifeCycleListener.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/UiLifeCycleListener.java index 5940bb7f57..67ee6f61b9 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/UiLifeCycleListener.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/UiLifeCycleListener.java @@ -16,6 +16,7 @@ package org.adempiere.webui; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Desktop; import org.zkoss.zk.ui.Page; +import org.zkoss.zk.ui.ShadowElement; import org.zkoss.zk.ui.util.UiLifeCycle; /** @@ -67,4 +68,16 @@ public class UiLifeCycleListener implements UiLifeCycle { public void afterPageDetached(Page page, Desktop prevdesktop) { } + @Override + public void afterShadowAttached(ShadowElement arg0, Component arg1) { + // TODO Auto-generated method stub + + } + + @Override + public void afterShadowDetached(ShadowElement arg0, Component arg1) { + // TODO Auto-generated method stub + + } + } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/ValuePreference.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/ValuePreference.java index 2abd2c52ef..13f32af59f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/ValuePreference.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/ValuePreference.java @@ -34,6 +34,7 @@ import org.adempiere.webui.component.Rows; import org.adempiere.webui.component.Textbox; import org.adempiere.webui.component.Window; import org.adempiere.webui.component.ZkCssHelper; +import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.FDialog; import org.compiere.model.GridField; import org.compiere.model.MRole; @@ -311,15 +312,15 @@ public class ValuePreference extends Window implements EventListener cbInfowindow.setChecked(true); // setPanel.appendChild(setLayout); - setPanel.setHflex("1"); + ZKUpdateUtil.setHflex(setPanel, "1"); fAttribute.setReadonly(true); fValue.setReadonly(true); Vbox box = new Vbox(); - box.setWidth("100%"); - box.setHeight("100%"); + ZKUpdateUtil.setWidth(box, "100%"); + ZKUpdateUtil.setHeight(box, "100%"); box.setParent(this); - box.setHflex("1"); + ZKUpdateUtil.setHflex(box, "1"); box.appendChild(setPanel); Rows rows = new Rows(); @@ -331,7 +332,7 @@ public class ValuePreference extends Window implements EventListener div.appendChild(lAttribute); row.appendCellChild(div, 1); row.appendCellChild(fAttribute, 4); - fAttribute.setWidth("96%"); + ZKUpdateUtil.setWidth(fAttribute, "96%"); row.appendCellChild(lAttributeValue, 1); rows.appendChild(row); @@ -341,7 +342,7 @@ public class ValuePreference extends Window implements EventListener div.appendChild(lValue); row.appendCellChild(div, 1); row.appendCellChild(fValue, 4); - fValue.setWidth("96%"); + ZKUpdateUtil.setWidth(fValue, "96%"); row.appendCellChild(lValueValue, 1); rows.appendChild(row); @@ -382,7 +383,7 @@ public class ValuePreference extends Window implements EventListener // Separator separator = new Separator(); - separator.setHeight("10px"); + ZKUpdateUtil.setHeight(separator, "10px"); box.appendChild(separator); box.appendChild(confirmPanel); @@ -390,7 +391,7 @@ public class ValuePreference extends Window implements EventListener setLayout.makeNoStrip(); setLayout.setOddRowSclass("even"); - this.setWidth("500px"); + ZKUpdateUtil.setWidth(this, "500px"); this.setSizable(true); } // jbInit diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/WLogin.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/WLogin.java index f9592495d3..ac3a08cde4 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/WLogin.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/WLogin.java @@ -22,6 +22,7 @@ import javax.servlet.ServletRequest; import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.part.AbstractUIPart; import org.adempiere.webui.theme.ThemeManager; +import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.LoginWindow; import org.zkoss.web.servlet.Servlets; import org.zkoss.zhtml.Text; @@ -76,7 +77,7 @@ public class WLogin extends AbstractUIPart div.appendChild(new Text(msg)); browserWarningWindow.appendChild(div); browserWarningWindow.setPosition("top,right"); - browserWarningWindow.setWidth("550px"); + ZKUpdateUtil.setWidth(browserWarningWindow, "550px"); browserWarningWindow.setPage(page); browserWarningWindow.doOverlapped(); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java index 2b816d8dcc..933d77b5b6 100755 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/acct/WAcctViewer.java @@ -50,6 +50,7 @@ import org.adempiere.webui.event.DialogEvents; import org.adempiere.webui.panel.InfoPanel; import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.theme.ThemeManager; +import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.FDialog; import org.compiere.model.MAcctSchema; import org.compiere.model.MAcctSchemaElement; @@ -250,11 +251,11 @@ public class WAcctViewer extends Window implements EventListener private void init() throws Exception { // Selection Panel - selectionPanel.setHflex("1"); + ZKUpdateUtil.setHflex(selectionPanel, "1"); // Accounting Schema Grid grid = new Grid(); - grid.setHflex("1"); + ZKUpdateUtil.setHflex(grid, "1"); grid.setSclass("grid-layout"); selectionPanel.appendChild(grid); @@ -262,10 +263,10 @@ public class WAcctViewer extends Window implements EventListener Columns columns = new Columns(); grid.appendChild(columns); Column column = new Column(); - column.setWidth("30%"); + ZKUpdateUtil.setWidth(column, "30%"); columns.appendChild(column); column = new Column(); - column.setWidth("60%"); + ZKUpdateUtil.setWidth(column, "60%"); columns.appendChild(column); Rows rows = grid.newRows(); @@ -277,7 +278,7 @@ public class WAcctViewer extends Window implements EventListener Row row = rows.newRow(); row.appendChild(lacctSchema); row.appendChild(selAcctSchema); - selAcctSchema.setHflex("1"); + ZKUpdateUtil.setHflex(selAcctSchema, "1"); selDocument.setLabel(Msg.getMsg(Env.getCtx(), "SelectDocument")); selDocument.addEventListener(Events.ON_CHECK, this); @@ -301,7 +302,7 @@ public class WAcctViewer extends Window implements EventListener row = rows.newRow(); row.appendChild(lpostingType); row.appendChild(selPostingType); - selPostingType.setHflex("1"); + ZKUpdateUtil.setHflex(selPostingType, "1"); // Date @@ -325,7 +326,7 @@ public class WAcctViewer extends Window implements EventListener row = rows.newRow(); row.appendChild(lOrg); row.appendChild(selOrg); - selOrg.setHflex("1"); + ZKUpdateUtil.setHflex(selOrg, "1"); // Account @@ -384,7 +385,7 @@ public class WAcctViewer extends Window implements EventListener displayQty.setLabel(Msg.getMsg(Env.getCtx(), "DisplayQty")); displayQty.addEventListener(Events.ON_CHECK, this); - displayPanel.setWidth("100%"); + ZKUpdateUtil.setWidth(displayPanel, "100%"); displayPanel.appendChild(displayDocumentInfo); displayPanel.appendChild(displaySourceAmt); displayPanel.appendChild(displayQty); @@ -392,15 +393,15 @@ public class WAcctViewer extends Window implements EventListener grid = new Grid(); grid.setSclass("grid-layout"); - grid.setHflex("1"); + ZKUpdateUtil.setHflex(grid, "1"); displayPanel.appendChild(grid); columns = new Columns(); grid.appendChild(columns); column = new Column(); - column.setWidth("70%"); + ZKUpdateUtil.setWidth(column, "70%"); columns.appendChild(column); column = new Column(); - column.setWidth("30%"); + ZKUpdateUtil.setWidth(column, "30%"); columns.appendChild(column); rows = grid.newRows(); @@ -408,35 +409,35 @@ public class WAcctViewer extends Window implements EventListener lSort.setValue(Msg.getMsg(Env.getCtx(), "SortBy")); lGroup.setValue(Msg.getMsg(Env.getCtx(), "GroupBy")); row.appendChild(lSort); - lSort.setHflex("1"); + ZKUpdateUtil.setHflex(lSort, "1"); row.appendChild(lGroup); row = rows.newRow(); sortBy1.setMold("select"); sortBy1.setRows(1); row.appendChild(sortBy1); - sortBy1.setHflex("1"); + ZKUpdateUtil.setHflex(sortBy1, "1"); row.appendChild(group1); row = rows.newRow(); sortBy2.setMold("select"); sortBy2.setRows(1); row.appendChild(sortBy2); - sortBy2.setHflex("1"); + ZKUpdateUtil.setHflex(sortBy2, "1"); row.appendChild(group2); row = rows.newRow(); sortBy3.setMold("select"); sortBy3.setRows(1); row.appendChild(sortBy3); - sortBy3.setHflex("1"); + ZKUpdateUtil.setHflex(sortBy3, "1"); row.appendChild(group3); row = rows.newRow(); sortBy4.setMold("select"); sortBy4.setRows(1); row.appendChild(sortBy4); - sortBy4.setHflex("1"); + ZKUpdateUtil.setHflex(sortBy4, "1"); row.appendChild(group4); //"images/InfoAccount16.png" @@ -452,15 +453,15 @@ public class WAcctViewer extends Window implements EventListener groupSelection.appendChild(selectionPanel); Hlayout boxQueryPanel = new Hlayout(); - boxQueryPanel.setHflex("3"); + ZKUpdateUtil.setHflex(boxQueryPanel, "3"); boxQueryPanel.appendChild(groupSelection); - groupSelection.setHflex("2"); + ZKUpdateUtil.setHflex(groupSelection, "2"); Separator separator = new Separator(); separator.setOrient("vertical"); boxQueryPanel.appendChild(separator); boxQueryPanel.appendChild(groupDisplay); - groupDisplay.setHflex("1"); + ZKUpdateUtil.setHflex(groupDisplay, "1"); // South Panel @@ -489,11 +490,11 @@ public class WAcctViewer extends Window implements EventListener bExport.addEventListener(Events.ON_CLICK, this); bExport.setVisible(false); - southPanel.setHflex("5"); + ZKUpdateUtil.setHflex(southPanel, "5"); Grid southLeftGrid = new Grid(); southLeftGrid.setSclass("grid-layout"); southPanel.appendChild(southLeftGrid); - southLeftGrid.setHflex("4"); + ZKUpdateUtil.setHflex(southLeftGrid, "4"); rows = southLeftGrid.newRows(); Row southLeft = rows.newRow(); Hlayout repostLayout = new Hlayout(); @@ -501,12 +502,12 @@ public class WAcctViewer extends Window implements EventListener repostLayout.appendChild(bRePost); repostLayout.appendChild(new Separator()); repostLayout.appendChild(forcePost); - repostLayout.setVflex("1"); + ZKUpdateUtil.setVflex(repostLayout, "1"); southLeft.appendChild(statusLine); Grid southRight = new Grid(); southRight.setSclass("grid-layout"); - southRight.setHflex("1"); + ZKUpdateUtil.setHflex(southRight, "1"); southPanel.appendChild(southRight); Panel southRightPanel = new Panel(); southRightPanel.appendChild(bZoom); // Elaine 2009/07/29 @@ -521,27 +522,27 @@ public class WAcctViewer extends Window implements EventListener resultPanel = new Borderlayout(); resultPanel.setStyle("position: absolute"); - resultPanel.setWidth("99%"); - resultPanel.setHeight("99%"); + ZKUpdateUtil.setWidth(resultPanel, "99%"); + ZKUpdateUtil.setHeight(resultPanel, "99%"); result.appendChild(resultPanel); Center resultCenter = new Center(); resultPanel.appendChild(resultCenter); - table.setHflex("1"); - table.setVflex(true); - table.setHeight("99%"); + ZKUpdateUtil.setHflex(table, "1"); + ZKUpdateUtil.setVflex(table, true); + //ZKUpdateUtil.setHeight(table, "99%"); table.setStyle("position: absolute;"); resultCenter.appendChild(table); - table.setHflex("1"); - table.setVflex("1"); + ZKUpdateUtil.setHflex(table, "1"); + //ZKUpdateUtil.setVflex(table, "1"); table.addEventListener(Events.ON_DOUBLE_CLICK, this); pagingPanel = new South(); resultPanel.appendChild(pagingPanel); pagingPanel.appendChild(paging); - result.setHflex("1"); - result.setHeight("100%"); + ZKUpdateUtil.setHflex(result, "1"); + ZKUpdateUtil.setHeight(result, "100%"); result.setStyle("position: relative"); paging.addEventListener("onPaging", this); @@ -550,7 +551,7 @@ public class WAcctViewer extends Window implements EventListener // Query Tab - query.setHflex("1"); + ZKUpdateUtil.setHflex(query, "1"); query.appendChild(boxQueryPanel); // Tabbox @@ -564,35 +565,35 @@ public class WAcctViewer extends Window implements EventListener tabs.appendChild(tabQuery); tabs.appendChild(tabResult); - tabpanels.setHflex("1"); + ZKUpdateUtil.setHflex(tabpanels, "1"); tabpanels.appendChild(query); tabpanels.appendChild(result); - tabbedPane.setHflex("1"); - tabbedPane.setVflex("1"); + ZKUpdateUtil.setHflex(tabbedPane, "1"); + ZKUpdateUtil.setVflex(tabbedPane, "1"); tabbedPane.appendChild(tabs); tabbedPane.appendChild(tabpanels); Borderlayout layout = new Borderlayout(); layout.setParent(this); - layout.setHeight("100%"); - layout.setWidth("100%"); + ZKUpdateUtil.setHeight(layout, "100%"); + ZKUpdateUtil.setWidth(layout, "100%"); layout.setStyle("background-color: transparent; margin: 0; position: absolute; padding: 0;"); Center center = new Center(); center.setParent(layout); center.setStyle("background-color: transparent; padding: 2px;"); tabbedPane.setParent(center); - tabbedPane.setHflex("1"); - tabbedPane.setVflex("1"); + ZKUpdateUtil.setHflex(tabbedPane, "1"); + ZKUpdateUtil.setVflex(tabbedPane, "1"); South south = new South(); south.setParent(layout); south.setStyle("background-color: transparent"); - south.setHeight("36px"); + ZKUpdateUtil.setHeight(south, "36px"); southPanel.setParent(south); - southPanel.setVflex("1"); - southPanel.setHflex("1"); + ZKUpdateUtil.setVflex(southPanel, "1"); + ZKUpdateUtil.setHflex(southPanel, "1"); this.setTitle(Msg.getMsg(Env.getCtx(), TITLE)); this.setClosable(true); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java index bd4a8ff879..6475d2c5c0 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADSortTab.java @@ -37,6 +37,7 @@ import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.SimpleListModel; import org.adempiere.webui.factory.ButtonFactory; import org.adempiere.webui.theme.ThemeManager; +import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.FDialog; import org.compiere.model.GridTab; import org.compiere.model.MRole; @@ -91,7 +92,7 @@ public class ADSortTab extends Panel implements IADTabpanel this.gridTab = gridTab; m_AD_Table_ID = gridTab.getAD_Table_ID(); - this.setVflex("true"); + ZKUpdateUtil.setVflex(this, "true"); } // ADSortTab /** Logger */ @@ -265,8 +266,8 @@ public class ADSortTab extends Panel implements IADTabpanel noLabel.setValue("No"); yesLabel.setValue("Yes"); - yesList.setVflex(true); - noList.setVflex(true); + ZKUpdateUtil.setVflex(yesList, true); + ZKUpdateUtil.setVflex(noList, true); setId(AdempiereIdGenerator.escapeId(gridTab.getName())); @@ -345,16 +346,16 @@ public class ADSortTab extends Panel implements IADTabpanel listHeader.setParent(listHead); Hlayout hlayout = new Hlayout(); - hlayout.setVflex("true"); - hlayout.setHflex("true"); + ZKUpdateUtil.setVflex(hlayout, "true"); + ZKUpdateUtil.setHflex(hlayout, "true"); hlayout.setStyle("margin: auto;"); appendChild(hlayout); - noList.setHflex("1"); - noList.setVflex(true); + ZKUpdateUtil.setHflex(noList, "1"); + ZKUpdateUtil.setVflex(noList, true); hlayout.appendChild(noList); - yesList.setVflex(true); - yesList.setHflex("1"); + ZKUpdateUtil.setVflex(yesList, true); + ZKUpdateUtil.setHflex(yesList, "1"); hlayout.appendChild(yesList); addEventListener(ON_ACTIVATE_EVENT, new EventListener() { @@ -964,7 +965,7 @@ public class ADSortTab extends Panel implements IADTabpanel @Override public void setDetailPaneMode(boolean detailMode) { this.detailPaneMode = detailMode; - this.setVflex("true"); + ZKUpdateUtil.setVflex(this, "true"); } public boolean isDetailPaneMode() { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index 7f082df202..603444a5ba 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -55,6 +55,7 @@ import org.adempiere.webui.panel.HelpController; import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.util.GridTabDataBinder; import org.adempiere.webui.util.TreeUtils; +import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.FDialog; import org.compiere.model.DataStatusEvent; import org.compiere.model.DataStatusListener; @@ -131,7 +132,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer /** * */ - private static final long serialVersionUID = -6108216899210485771L; + private static final long serialVersionUID = -3728896318124756192L; private static final String ON_SAVE_OPEN_PREFERENCE_EVENT = "onSaveOpenPreference"; @@ -203,8 +204,6 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer public static final String ON_TOGGLE_EVENT = "onToggle"; - private static final String DEFAULT_PANEL_WIDTH = "300px"; - private static enum SouthEvent { SLIDE(), OPEN(), @@ -238,11 +237,11 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer { LayoutUtils.addSclass("adtab-content", this); - this.setWidth("100%"); + ZKUpdateUtil.setWidth(this, "100%"); form = new Grid(); - form.setHflex("1"); - form.setHeight(null); + ZKUpdateUtil.setHflex(form, "1"); + ZKUpdateUtil.setHeight(form, null); form.setVflex(false); form.setSclass("grid-layout adwindow-form"); form.setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "form"); @@ -300,7 +299,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer int maxHeight = browserHeight - topmarginpx; if (prefHeight <= maxHeight) { height = Integer.toString(prefHeight) + "px"; - formContainer.getSouth().setHeight(height); + ZKUpdateUtil.setHeight(formContainer.getSouth(), height); } } catch (Exception e) { // just ignore exception is harmless here, consequence is just not setting height so it will assume the default of theme @@ -362,7 +361,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer treePanel = new ADTreePanel(windowNo, gridTab.getTabNo()); West west = new West(); west.appendChild(treePanel); - west.setWidth(widthTreePanel()); + ZKUpdateUtil.setWidth(west, "300px"); west.setCollapsible(true); west.setSplittable(true); west.setAutoscroll(true); @@ -372,8 +371,8 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer Vlayout div = new Vlayout(); div.appendChild(form); center.appendChild(div); - div.setVflex("1"); - div.setHflex("1"); + ZKUpdateUtil.setVflex(div, "1"); + ZKUpdateUtil.setHflex(div, "1"); div.setSclass("adtab-form"); div.setStyle("overflow-y: visible;"); div.setSpacing("0px"); @@ -389,8 +388,8 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer div.setSclass("adtab-form"); div.appendChild(form); div.setStyle("overflow-y: visible;"); - div.setVflex("1"); - div.setWidth("100%"); + ZKUpdateUtil.setVflex(div, "1"); + ZKUpdateUtil.setWidth(div, "100%"); div.setSpacing("0px"); Borderlayout layout = new Borderlayout(); @@ -432,7 +431,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer for (int h=0;h 0 && adTabId > 0) { - width = Env.getPreference(Env.getCtx(), windowId, adTabId+"|TreePanel.Width", false); - } - if (Util.isEmpty(width)) { - width = DEFAULT_PANEL_WIDTH; - } - return width; - } private void navigateTo(DefaultTreeNode value) { MTreeNode treeNode = value.getData(); // We Have a TreeNode @@ -1404,7 +1391,13 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer SimpleTreeModel model = (SimpleTreeModel)(TreeModel) treePanel.getTree().getModel(); if (treePanel.getTree().getSelectedItem() != null) { - DefaultTreeNode treeNode = treePanel.getTree().getSelectedItem().getValue(); + Treeitem treeItem = treePanel.getTree().getSelectedItem(); + if (!treeItem.isLoaded()){ + return; + } + + DefaultTreeNode treeNode = treeItem.getValue(); + MTreeNode data = (MTreeNode) treeNode.getData(); if (data.getNode_ID() == recordId) { int[] path = model.getPath(treeNode); @@ -1574,7 +1567,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer } else { attachDetailPane(); } - this.setVflex("true"); + ZKUpdateUtil.setVflex(this, "true"); listPanel.setDetailPaneMode(detailPaneMode); } } @@ -1754,43 +1747,31 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer if (formContainer.getSouth() != null) { if (formContainer.getSouth().isVisible() && formContainer.getSouth().isOpen()) { String height = formContainer.getSouth().getHeight(); - if (! Util.isEmpty(height)) - savePreference("DetailPane.Height", height); + if (! Util.isEmpty(height)) { + int windowId = getGridTab().getAD_Window_ID(); + int adTabId = getGridTab().getAD_Tab_ID(); + if (windowId > 0 && adTabId > 0) { + Query query = new Query(Env.getCtx(), MTable.get(Env.getCtx(), I_AD_Preference.Table_ID), "AD_Window_ID=? AND Attribute=? AND AD_User_ID=? AND AD_Process_ID IS NULL AND PreferenceFor = 'W'", null); + int userId = Env.getAD_User_ID(Env.getCtx()); + MPreference preference = query.setOnlyActiveRecords(true) + .setApplyAccessFilter(true) + .setParameters(windowId, adTabId+"|DetailPane.Height", userId) + .first(); + if (preference == null || preference.getAD_Preference_ID() <= 0) { + preference = new MPreference(Env.getCtx(), 0, null); + preference.setAD_Window_ID(windowId); + preference.set_ValueOfColumn("AD_User_ID", userId); // required set_Value for System=0 user + preference.setAttribute(adTabId+"|DetailPane.Height"); + } + preference.setValue(height); + preference.saveEx(); + //update current context + Env.getCtx().setProperty("P"+windowId+"|"+adTabId+"|DetailPane.Height", height); + } + } } } - - if (treePanel != null && formContainer.getWest() != null) { - if (formContainer.getWest().isVisible() && formContainer.getWest().isOpen()) { - String width = formContainer.getWest().getWidth(); - if (! Util.isEmpty(width)) - savePreference("TreePanel.Width", width); - } - } - super.onPageDetached(page); } - void savePreference(String attribute, String value) - { - int windowId = getGridTab().getAD_Window_ID(); - int adTabId = getGridTab().getAD_Tab_ID(); - if (windowId > 0 && adTabId > 0) { - Query query = new Query(Env.getCtx(), MTable.get(Env.getCtx(), I_AD_Preference.Table_ID), "AD_Window_ID=? AND Attribute=? AND AD_User_ID=? AND AD_Process_ID IS NULL AND PreferenceFor = 'W'", null); - int userId = Env.getAD_User_ID(Env.getCtx()); - MPreference preference = query.setOnlyActiveRecords(true) - .setApplyAccessFilter(true) - .setParameters(windowId, adTabId+"|"+attribute, userId) - .first(); - if (preference == null || preference.getAD_Preference_ID() <= 0) { - preference = new MPreference(Env.getCtx(), 0, null); - preference.setAD_Window_ID(windowId); - preference.set_ValueOfColumn("AD_User_ID", userId); // required set_Value for System=0 user - preference.setAttribute(adTabId+"|"+attribute); - } - preference.setValue(value); - preference.saveEx(); - //update current context - Env.getCtx().setProperty("P"+windowId+"|"+adTabId+"|"+attribute, value); - } - } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTreePanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTreePanel.java index 035ee11515..5a7f9d6b16 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTreePanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTreePanel.java @@ -19,6 +19,7 @@ import org.adempiere.webui.component.SimpleTreeModel; import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.panel.TreeSearchPanel; import org.adempiere.webui.util.TreeUtils; +import org.adempiere.webui.util.ZKUpdateUtil; import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; @@ -83,13 +84,13 @@ public class ADTreePanel extends Panel implements EventListener private void init() { setWidgetAttribute(AdempiereWebUI.WIDGET_INSTANCE_NAME, "treepanel"); - this.setWidth("100%"); - this.setHeight("100%"); + ZKUpdateUtil.setWidth(this, "100%"); + ZKUpdateUtil.setHeight(this, "100%"); tree = new Tree(); tree.setMultiple(false); - tree.setWidth("100%"); - tree.setVflex(true); + ZKUpdateUtil.setWidth(tree, "100%"); + ZKUpdateUtil.setVflex(tree, true); tree.setPageSize(-1); // Due to bug in the new paging functionality tree.setStyle("border: none"); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowContent.java index f4376f8a63..8165f55ed2 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowContent.java @@ -33,6 +33,7 @@ import org.adempiere.webui.panel.IHelpContext; import org.adempiere.webui.panel.ITabOnCloseHandler; import org.adempiere.webui.part.WindowContainer; import org.adempiere.webui.session.SessionManager; +import org.adempiere.webui.util.ZKUpdateUtil; import org.compiere.model.X_AD_CtxHelp; import org.compiere.util.CLogger; import org.zkoss.zk.au.out.AuScript; @@ -90,7 +91,7 @@ public class ADWindowContent extends AbstractADWindowContent Div div = new Div(); div.setStyle("height: 100%; width: 100%"); north.appendChild(div); - north.setVflex("0"); + ZKUpdateUtil.setVflex(north, "0"); toolbar.setParent(div); toolbar.setWindowNo(getWindowNo()); breadCrumb = new BreadCrumb(getWindowNo()); @@ -143,8 +144,8 @@ public class ADWindowContent extends AbstractADWindowContent contentArea = new Div(); contentArea.setParent(layout); - contentArea.setVflex("1"); - contentArea.setHflex("1"); + ZKUpdateUtil.setVflex(contentArea, "1"); + ZKUpdateUtil.setHflex(contentArea, "1"); contentArea.setStyle("overflow: auto;"); adTabbox.createPart(contentArea); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java index d45793a28d..637da5c865 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADWindowToolbar.java @@ -34,6 +34,7 @@ import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.event.ToolbarListener; import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.theme.ThemeManager; +import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.FDialog; import org.compiere.model.GridTab; import org.compiere.model.MRole; @@ -264,7 +265,7 @@ public class ADWindowToolbar extends FToolbar implements EventListener configureKeyMap(); - setWidth("100%"); + ZKUpdateUtil.setWidth(this, "100%"); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index f576621a09..979bae9f83 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -70,6 +70,7 @@ import org.adempiere.webui.panel.action.ReportAction; import org.adempiere.webui.part.AbstractUIPart; import org.adempiere.webui.part.ITabOnSelectHandler; import org.adempiere.webui.session.SessionManager; +import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.CustomizeGridViewDialog; import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.FindWindow; @@ -752,8 +753,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements findWindow.setTitle(null); findWindow.setBorder("none"); findWindow.setStyle("position: absolute; border-bottom: 2px solid #484848; padding: 2px; background-color: #fff;"); - findWindow.setWidth("100%"); - findWindow.setHeight("60%"); + ZKUpdateUtil.setWidth(findWindow, "100%"); + ZKUpdateUtil.setHeight(findWindow, "60%"); findWindow.setZindex(1000); findWindow.setSizable(false); findWindow.setContentStyle("background-color: #fff; width: 99%; margin: auto;"); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/BreadCrumb.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/BreadCrumb.java index d5fb79fa6d..a13afca44b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/BreadCrumb.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/BreadCrumb.java @@ -29,6 +29,7 @@ import org.adempiere.webui.component.ZkCssHelper; import org.adempiere.webui.event.ToolbarListener; import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.theme.ThemeManager; +import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.WRecordInfo; import org.compiere.model.DataStatusEvent; import org.compiere.model.MRole; @@ -96,7 +97,7 @@ public class BreadCrumb extends Div implements EventListener { layout.setPack("start"); layout.setAlign("center"); this.appendChild(layout); - layout.setHeight("100%"); + ZKUpdateUtil.setHeight(layout, "100%"); layout.setStyle("float: left"); this.setVisible(false); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java index fccf1fea02..d11d81c5b5 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java @@ -27,6 +27,7 @@ import java.util.logging.Level; import org.adempiere.util.Callback; import org.adempiere.webui.component.ADTabListModel; import org.adempiere.webui.component.ADTabListModel.ADTabLabel; +import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.FDialog; import org.compiere.model.DataStatusEvent; import org.compiere.model.DataStatusListener; @@ -257,8 +258,8 @@ public class CompositeADTabbox extends AbstractADTabbox protected Component doCreatePart(Component parent) { layout = new Vlayout(); - layout.setHeight("100%"); - layout.setWidth("100%"); + ZKUpdateUtil.setHeight(layout, "100%"); + ZKUpdateUtil.setWidth(layout, "100%"); layout.setStyle("position: relative"); if (parent != null) { layout.setParent(parent); @@ -408,7 +409,7 @@ public class CompositeADTabbox extends AbstractADTabbox headerTab.setDetailPane(createDetailPane()); } else tabPanel.setVisible(false); - headerTab.getDetailPane().setHflex("1"); + ZKUpdateUtil.setHflex(headerTab.getDetailPane(), "1"); headerTab.getDetailPane().addADTabpanel(tabPanel, tabLabel); tabPanel.setDetailPaneMode(true); headerTab.getDetailPane().setVflex("true"); @@ -418,8 +419,8 @@ public class CompositeADTabbox extends AbstractADTabbox headerTab.getDetailPane().setVflex("true"); } HtmlBasedComponent htmlComponent = (HtmlBasedComponent) tabPanel; - htmlComponent.setVflex("1"); - htmlComponent.setWidth("100%"); + ZKUpdateUtil.setVflex(htmlComponent, "1"); + ZKUpdateUtil.setWidth(htmlComponent, "100%"); tabPanel.getGridTab().addDataStatusListener(new SyncDataStatusListener(tabPanel)); } @@ -544,7 +545,7 @@ public class CompositeADTabbox extends AbstractADTabbox } detailPane.setAttribute("detailpane.tablist", list); - detailPane.setVflex("true"); + ZKUpdateUtil.setVflex(detailPane, "true"); if (headerTab.getDetailPane() == null) { headerTab.setDetailPane(detailPane); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java index 81670707e8..06b63068ed 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/DetailPane.java @@ -23,6 +23,7 @@ import org.adempiere.webui.component.ToolBarButton; import org.adempiere.webui.component.Window; import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.theme.ThemeManager; +import org.adempiere.webui.util.ZKUpdateUtil; import org.compiere.model.MToolBarButton; import org.compiere.util.Env; import org.compiere.util.Msg; @@ -126,7 +127,7 @@ public class DetailPane extends Panel implements EventListener, IdSpace { }); tabbox.setSclass("adwindow-detailpane-tabbox"); tabbox.setTabscroll(true); - tabbox.setWidth("100%"); + ZKUpdateUtil.setWidth(tabbox, "100%"); createPopup(); @@ -264,7 +265,7 @@ public class DetailPane extends Panel implements EventListener, IdSpace { Tabpanels tabpanels = tabbox.getTabpanels(); if (tabpanels == null) { tabpanels = new Tabpanels(); - tabpanels.setWidth("100%"); + ZKUpdateUtil.setWidth(tabpanels, "100%"); tabbox.appendChild(tabpanels); } Tabpanel tp = new Tabpanel(); @@ -396,7 +397,7 @@ public class DetailPane extends Panel implements EventListener, IdSpace { toolbar.appendChild(messageContainer); toolbar.setSclass("adwindow-detailpane-toolbar"); - toolbar.setVflex("0"); + ZKUpdateUtil.setVflex(toolbar, "0"); messageContainers.put(tabLabel.AD_Tab_ID, messageContainer); tabPanel.setAttribute("AD_Tab_ID", tabLabel.AD_Tab_ID); @@ -600,7 +601,7 @@ public class DetailPane extends Panel implements EventListener, IdSpace { private void createPopup() { msgPopupCnt = new Div(); - msgPopupCnt.setVflex("1"); + ZKUpdateUtil.setVflex(msgPopupCnt, "1"); msgPopup = new Window(); @@ -609,7 +610,7 @@ public class DetailPane extends Panel implements EventListener, IdSpace { msgPopup.setClosable(true); msgPopup.setSizable(true); msgPopup.setContentStyle("overflow: auto"); - msgPopup.setWidth("500px"); + ZKUpdateUtil.setWidth(msgPopup, "500px"); msgPopup.appendChild(msgPopupCnt); msgPopup.setPage(SessionManager.getAppDesktop().getComponent().getPage()); msgPopup.setShadow(true); @@ -638,8 +639,10 @@ public class DetailPane extends Panel implements EventListener, IdSpace { */ @Override public void setVflex(String flex) { + if (getHeight() != null) + setHeight(null); super.setVflex(flex); - tabbox.setVflex(flex); + ZKUpdateUtil.setVflex(tabbox, flex); } /** diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java index d6ab2010d1..605ebc9161 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java @@ -38,6 +38,7 @@ import org.adempiere.webui.event.ContextMenuListener; import org.adempiere.webui.panel.HelpController; import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.util.GridTabDataBinder; +import org.adempiere.webui.util.ZKUpdateUtil; import org.compiere.model.GridField; import org.compiere.model.GridTab; import org.compiere.util.DisplayType; @@ -513,7 +514,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt } } div.setStyle(divStyle); - div.setWidth("100%"); + ZKUpdateUtil.setWidth(div, "100%"); div.setAttribute("columnName", gridPanelFields[i].getColumnName()); div.addEventListener(Events.ON_CLICK, rowListener); div.addEventListener(Events.ON_DOUBLE_CLICK, rowListener); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java index 8723226617..e9148b169f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridView.java @@ -34,6 +34,7 @@ import org.adempiere.webui.component.NumberBox; import org.adempiere.webui.component.Rows; import org.adempiere.webui.editor.WEditor; import org.adempiere.webui.util.SortComparator; +import org.adempiere.webui.util.ZKUpdateUtil; import org.compiere.model.GridField; import org.compiere.model.GridTab; import org.compiere.model.GridTable; @@ -150,10 +151,10 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi setId("gridView"); createListbox(); - this.setHflex("1"); + ZKUpdateUtil.setHflex(this, "1"); gridFooter = new Div(); - gridFooter.setVflex("0"); + ZKUpdateUtil.setVflex(gridFooter, "0"); //default paging size if (AEnv.isTablet()) @@ -175,7 +176,7 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi appendChild(listbox); appendChild(gridFooter); - this.setVflex("true"); + ZKUpdateUtil.setVflex(this, "true"); setStyle(HEADER_GRID_STYLE); gridFooter.setStyle(HEADER_GRID_STYLE); @@ -187,8 +188,8 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi protected void createListbox() { listbox = new Grid(); listbox.setSizedByContent(false); - listbox.setVflex("1"); - listbox.setHflex("1"); + ZKUpdateUtil.setVflex(listbox, "1"); + ZKUpdateUtil.setHflex(listbox, "1"); listbox.setSclass("adtab-grid"); listbox.setEmptyMessage(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Processing"))); } @@ -465,7 +466,7 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi } org.zkoss.zul.Column selection = new Column(); - selection.setWidth("22px"); + ZKUpdateUtil.setWidth(selection, "22px"); try{ selection.setSort("none"); } catch (Exception e) {} @@ -477,7 +478,7 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi columns.appendChild(selection); org.zkoss.zul.Column indicator = new Column(); - indicator.setWidth("22px"); + ZKUpdateUtil.setWidth(indicator, "22px"); try { indicator.setSort("none"); } catch (Exception e) {} @@ -509,24 +510,24 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi column.setLabel(gridField[i].getHeader()); if (columnWidthMap != null && columnWidthMap.get(gridField[i].getAD_Field_ID()) != null && !columnWidthMap.get(gridField[i].getAD_Field_ID()).equals("")) { - column.setWidth(columnWidthMap.get(gridField[i].getAD_Field_ID())); + ZKUpdateUtil.setWidth(column, columnWidthMap.get(gridField[i].getAD_Field_ID())); } else { if (gridField[i].getDisplayType()==DisplayType.YesNo) { if (i > 0) { - column.setHflex("min"); + ZKUpdateUtil.setHflex(column, "min"); } else { int estimatedWidth=60; int headerWidth = (gridField[i].getHeader().length()+2) * 8; if (headerWidth > estimatedWidth) estimatedWidth = headerWidth; - column.setWidth(estimatedWidth+"px"); + ZKUpdateUtil.setWidth(column, estimatedWidth+"px"); } } else if (DisplayType.isNumeric(gridField[i].getDisplayType()) && "Line".equals(gridField[i].getColumnName())) { //special treatment for line if (i > 0) - column.setHflex("min"); + ZKUpdateUtil.setHflex(column, "min"); else - column.setWidth("60px"); + ZKUpdateUtil.setWidth(column, "60px"); } else { int estimatedWidth = 0; if (DisplayType.isNumeric(gridField[i].getDisplayType())) @@ -548,17 +549,17 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi if (DisplayType.isLookup(gridField[i].getDisplayType())) { if (headerWidth > MIN_COMBOBOX_WIDTH) - column.setHflex("min"); + ZKUpdateUtil.setHflex(column, "min"); } else if (DisplayType.isNumeric(gridField[i].getDisplayType())) { if (headerWidth > MIN_NUMERIC_COL_WIDTH) - column.setHflex("min"); + ZKUpdateUtil.setHflex(column, "min"); } else if (!DisplayType.isText(gridField[i].getDisplayType())) { if (headerWidth > MIN_COLUMN_WIDTH) - column.setHflex("min"); + ZKUpdateUtil.setHflex(column, "min"); } } @@ -568,7 +569,7 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi estimatedWidth = MAX_COLUMN_WIDTH; else if ( estimatedWidth < MIN_COLUMN_WIDTH) estimatedWidth = MIN_COLUMN_WIDTH; - column.setWidth(Integer.toString(estimatedWidth) + "px"); + ZKUpdateUtil.setWidth(column, Integer.toString(estimatedWidth) + "px"); } } } @@ -1164,7 +1165,7 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi Component firstChild = parent.getFirstChild(); if ( gridFooter.getParent() != firstChild ) { firstChild.appendChild(gridFooter); - gridFooter.setHflex("0"); + ZKUpdateUtil.setHflex(gridFooter, "0"); gridFooter.setSclass("adwindow-detailpane-adtab-grid-south"); } break; @@ -1177,7 +1178,7 @@ public class GridView extends Vbox implements EventListener, IdSpace, IFi else { if (gridFooter.getParent() != this) { - gridFooter.setHflex("1"); + ZKUpdateUtil.setHflex(gridFooter, "1"); gridFooter.setSclass("adtab-grid-south"); appendChild(gridFooter); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ProcessButtonPopup.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ProcessButtonPopup.java index b9d64b9dc7..af244390e7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ProcessButtonPopup.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ProcessButtonPopup.java @@ -6,6 +6,7 @@ package org.adempiere.webui.adwindow; import java.util.List; import org.adempiere.webui.component.Window; +import org.adempiere.webui.util.ZKUpdateUtil; import org.zkoss.zul.Button; import org.zkoss.zul.Vbox; @@ -23,11 +24,11 @@ public class ProcessButtonPopup extends Window { public void render(List