Re: [qooxdoo-devel] Is it possible to add another object to the converter for a singlevalue-binding?

2016-04-15 Thread LoneSurvivor
While writing the post, I got an idea: would it be a proper way, to create a
wrapping class for the value to bind which contains the method so it can be
called in converter?

My Real-World-example which is working (with Date instead of int, sorry for
the confusion):

qx.Class.define("mkss.data.DateWrapper", {
extend: qx.core.Object,
properties: {
date: {
check: "Date"
}
},
construct: function (date, format) {
this.base(arguments);
this.setDate(date);
this.dateFormat = new qx.util.format.DateFormat(format);
},
members: {
getFormattedDate: function () {
return this.dateFormat.format(this.getDate());
}
}
});

The gameData-object I'm using next has a date-property like this:

qx.Class.define("mkss.data.GameData",
{
extend: qx.core.Object,
properties: {
date: {
check: "Date",
init: new mkss.data.DateWrapper(new Date("1980-01-01"),
"d.M.y"),
event: "changeDate"
}, ...
 }
});

And in the displaying widget the binding happens like this:

var lblDate = new qx.ui.basic.Label();
this.bind("gameData.date", lblDate, "value", {
converter: function (data) {  
return data.getFormattedDate();
}
});
this.add(lblDate);

Would you think this is a way to go?



--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Is-it-possible-to-add-another-object-to-the-converter-for-a-singlevalue-binding-tp7588266p7588267.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] Is it possible to add another object to the converter for a singlevalue-binding?

2016-04-15 Thread LoneSurvivor
Okay, there is at least one more fallacy. If I add a method like the
following to the DateWrapper to increase the date by x days, the
label-binding wouldn't call the converter because the wrong key is listened.
But if I am setting the binding-key to gameData.date.date, the converter
would run but fail because the data-value is the date-property itself which
has no getFormattedDate-function...

The changed DateWrapper-class for completeness:

qx.Class.define("mkss.data.DateWrapper", {
extend: qx.core.Object,
properties: {
date: {
check: "Date",
event: "changeDate"
}
},
construct: function (date, format) {
this.base(arguments);
this.setDate(date);
this.dateFormat = new qx.util.format.DateFormat(format);
this._intDateFormat = new qx.util.format.DateFormat("-MM-dd");
},
members: {
getFormattedDate: function () {
return this.dateFormat.format(this.getDate());
},
addDays: function (incDays) {
// found here: http://jsfiddle.net/sparebytes/XrWzq/

var tmpDate = new Date(this.getDate());
tmpDate.setDate(this.getDate().getDate() + incDays);
this.setDate(tmpDate);
}
}
});



--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Is-it-possible-to-add-another-object-to-the-converter-for-a-singlevalue-binding-tp7588266p7588269.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] Scrollbars not showing in Chrome Version 49.0.2623.112 m

2016-04-15 Thread Werner Thie
Hello John

done, https://github.com/qooxdoo/qooxdoo/issues/202

Thxs, Werner

On 4/13/16 9:51 PM, John Spackman wrote:
> Hi Werner
>
> It looks like a bug to me - the issue is that the yellow bars on the side are 
> where the native scroll bars go, but on Chrome & Safari they do not appear.  
> This works as expected on Firefox and IE11.
>
> Please can you create an issue on github so that we can track it?
>
> Regards
> John
>
>
>
>
> On 13/04/2016, 18:15, "qooxdoo Development 
>  on behalf of Werner Thie" 
>  
> wrote:
>
>> Hi all
>>
>> most obvious in Playground, no scrollbars visible at all, minimal demo code
>>
>>// create scroll container
>>var scroller = new qx.ui.container.Scroll().set({
>>  width: 300,
>>  height: 200,
>>  backgroundColor: 'yellow'
>>});
>>
>>// add a widget which is larger than the container
>>scroller.add(new qx.ui.core.Widget().set({
>>  width: 600,
>>  minWidth: 600,
>>  height: 400,
>>  minHeight: 400,
>>  backgroundColor: 'green'
>>}));
>>
>>this.getRoot().add(scroller);
>>
>>from API docs with colored containers only shows the lower right square
>> as white, so
>> somehow the scrollbars are deducted from the container area, but never
>> shown.
>>
>> Is this a known bug?
>>
>> Thxs, Werner
>>
>> --
>> Find and fix application performance issues faster with Applications Manager
>> Applications Manager provides deep performance insights into multiple tiers 
>> of
>> your business applications. It resolves application problems quickly and
>> reduces your MTTR. Get your free trial!
>> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>> ___
>> qooxdoo-devel mailing list
>> qooxdoo-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


[qooxdoo-devel] Is it possible to add another object to the converter for a singlevalue-binding?

2016-04-15 Thread LoneSurvivor
Hi everybody,

is it possible, to pass or use another object from outside inside of the
converter-method used in a singlevalue-binding?

For e.g. I have this code:

 var someObjectFromOutside = new CoolObject();

 var lblInfo = new qx.ui.basic.Label();
 this.bind("propertyObject.intValue", lblInfo, "value", {
 converter: function (data) {
 return someObjectFromOutside.method(data);
 }
 });

I'd like to manipulate the data-value by using the method of an an external
object from outside instead of creating and destoying it every time inside
the converter is called.

Is that possible and if, how can it be done?

Thank you all and greetings
LoneSurvivor



--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Is-it-possible-to-add-another-object-to-the-converter-for-a-singlevalue-binding-tp7588266.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] Is it possible to add another object to the converter for a singlevalue-binding?

2016-04-15 Thread LoneSurvivor
Finally I found a working solution. I'm not sure if I like that way but it
works and its not that much more code.

Following is the wrapper-class. It contains a new property which is set as
the formatted date-string:

qx.Class.define("mkss.data.DateWrapper", {
extend: qx.core.Object,
properties: {
date: {
check: "Date",
apply: "_applyDate"
},
formattedDateString: {
check: "String",
event: "changeFormattedString"
}
},
construct: function (date, format) {
this.base(arguments);
this.dateFormat = new qx.util.format.DateFormat(format);
this.setDate(date);
},
members: {
_applyDate : function() {
this.setFormattedDateString(this._getFormattedDate());
},
_getFormattedDate: function () {
return this.dateFormat.format(this.getDate());
},
addDays: function (incDays) {
// found here: http://jsfiddle.net/sparebytes/XrWzq/
var tmpDate = new Date(this.getDate());
tmpDate.setDate(this.getDate().getDate() + incDays);
this.setDate(tmpDate);
}
}
});

This new property now is bound to the label which no longer needs to access
the format-method because everything is done in the wrapper.

var lblDate = new qx.ui.basic.Label();
this.bind("gameData.date.formattedDateString", lblDate, "value", {
converter: function (data) {
return "Datum: " + data;
}
});
this.add(lblDate);

Now in a loop by my manager-object I did not show here, the addDays-method
is called incrementally which updates the formatted value in the bound
label.

If anybody knows a better way, please let me know.

Thank you again and have a good night
LoneSurvivor



--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Is-it-possible-to-add-another-object-to-the-converter-for-a-singlevalue-binding-tp7588266p7588271.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] Is it possible to add another object to the converter for a singlevalue-binding?

2016-04-15 Thread John Spackman
I think that would work (although it's hard to be sure without a working 
example) but you could solve the initial problem with a closure.

 John


> On 15 Apr 2016, at 20:44, LoneSurvivor  wrote:
> 
> While writing the post, I got an idea: would it be a proper way, to create a
> wrapping class for the value to bind which contains the method so it can be
> called in converter?
> 
> My Real-World-example which is working (with Date instead of int, sorry for
> the confusion):
> 
> qx.Class.define("mkss.data.DateWrapper", {
>extend: qx.core.Object,
>properties: {
>date: {
>check: "Date"
>}
>},
>construct: function (date, format) {
>this.base(arguments);
>this.setDate(date);
>this.dateFormat = new qx.util.format.DateFormat(format);
>},
>members: {
>getFormattedDate: function () {
>return this.dateFormat.format(this.getDate());
>}
>}
> });
> 
> The gameData-object I'm using next has a date-property like this:
> 
> qx.Class.define("mkss.data.GameData",
> {
>extend: qx.core.Object,
>properties: {
>date: {
>check: "Date",
>init: new mkss.data.DateWrapper(new Date("1980-01-01"),
> "d.M.y"),
>event: "changeDate"
>}, ...
> }
> });
> 
> And in the displaying widget the binding happens like this:
> 
>var lblDate = new qx.ui.basic.Label();
>this.bind("gameData.date", lblDate, "value", {
>converter: function (data) {  
>return data.getFormattedDate();
>}
>});
>this.add(lblDate);
> 
> Would you think this is a way to go?
> 
> 
> 
> --
> View this message in context: 
> http://qooxdoo.678.n2.nabble.com/Is-it-possible-to-add-another-object-to-the-converter-for-a-singlevalue-binding-tp7588266p7588267.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
> 
> --
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel