Re: [qooxdoo-devel] History with Tabs

2010-10-25 Thread Andy Fuchs
On 25.10.10 17:00, "Alexander Steitz"  wrote:

> Hi Marcus,

Hi Paul,:-)

>> Just a short follow-upon this. To me this looks more or less like a bug
>> or a  design-flaw, or is there any purpose on having several tabs selected
>> inside  one tabview?
> Neither a bug nor a design-flaw :)
> 
> The change of the selection handling is good documented here:
> 
> http://qooxdoo.org/documentation/1.1/ui_selection

Ah... since I migrated from 0.8.3 to 1.2. I've never got to this
documentation :-/

> Quick summary: The goal was to harmonize the API.

Wouldn't it have been nicer to allow both - Objects OR Arrays? To me it
still looks more logical to pass a single object to a single-selection
enabled object instead of an array

But anyway... thanks for the hint. Your insights are much appreciated.

best 

andy


> 
> Regards,
>   Alex




--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] History with Tabs

2010-10-25 Thread Alexander Steitz
Hi Marcus,

> Just a short follow-upon this. To me this looks more or less like a bug
> or a  design-flaw, or is there any purpose on having several tabs selected
> inside  one tabview?
Neither a bug nor a design-flaw :)

The change of the selection handling is good documented here:

http://qooxdoo.org/documentation/1.1/ui_selection

Quick summary: The goal was to harmonize the API.

Regards,
  Alex

--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] History with Tabs

2010-10-25 Thread Andy Fuchs
Just a short follow-upon this. To me this looks more or less like a bug or a
design-flaw, or is there any purpose on having several tabs selected inside
one tabview?

a.


On 25.10.10 14:38, "Andy Fuchs"  wrote:

> OK - I found the culprit:
> 
> it seems in 0.8.3 'setSelection' accepted a single object,
> 
> this.tabView.setSelection( item 1);
> 
> while in 1.2.1 it expects an array of items
> 
> this.tabView.setSelection( [item1] );
> 
> a.
> 
> 
> On 25.10.10 10:45, "Andy Fuchs"  wrote:
> 
>> Please ignore the previous mail... accidentaly hit the Enter key...
>> 
>> Hi friends,
>> 
>> I have a UI with a couple of tabs. When the user clicks a tab, I want it to
>> add to the browser's history. Likewise, if the user navigates using the
>> browser navigation, I want the tabs to get selected correctly.
>> 
>> Here's what I did: (basically directly from the documentation)
>> 
>> I added a 'changeSelection' listener to the tabview:
>> 
>> this.tabView.addListener("changeSelection",
>> this._doUpdateHistoryWhenTabChanges, this);
>> 
>> 
>> and a 'request' listener to the history:
>> 
>> qx.bom.History.getInstance().addListener("request",
>> this._doUpdateTabWhenHistoryChanges, this);
>> 
>> 
>> Here's the implementation:
>> 
>> _doUpdateHistoryWhenTabChanges : function(e)
>> {
>>  var tabIdx = this.tabView.indexOf(e.getData()[0]);
>> qx.bom.History.getInstance().addToHistory(x.Application.TAB_NAMES[tabIdx]);
>> },
>> 
>> _doUpdateTabWhenHistoryChanges : function(e)
>> {
>> var state = e.getData()[0];
>> var tabIdx = 0;
>> var c = this.tabView.getChildren();
>> 
>> if (state) {
>> tabIdx = x.Application.TAB_NAMES.indexOf(state);
>> }
>> if (c[tabIdx] != undefined)
>> this.tabView.setSelection(c[tabIdx]);
>> }
>> 
>> This used to work in 0.8.3, but now that I migrated to 1.2.1 it doesn't
>> work. 
>> 
>> As soon as a tab is clicked, '_doUpdateHistoryWhenTabChanges ' is called,
>> which then adds to the history and calls: '_doUpdateTabWhenHistoryChanges ',
>> which then calls again '_doUpdateHistoryWhenTabChanges ' from a qooxdoo
>> timer, etc...
>> 
>> Could someone lead me into the right direction how this is supposed to work?
>> 
>> thx
>> 
>> andy
>> 
>> 
>> 
>> 
>> 
->>
-
>> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
>> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
>> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
>> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
>> http://p.sf.net/sfu/nokia-dev2dev
>> ___
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>> 
> 
> 
> 
> 
> --
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> ___
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 




--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] History with Tabs

2010-10-25 Thread Andy Fuchs
OK - I found the culprit:

it seems in 0.8.3 'setSelection' accepted a single object,

this.tabView.setSelection( item 1);

while in 1.2.1 it expects an array of items

this.tabView.setSelection( [item1] );

a.


On 25.10.10 10:45, "Andy Fuchs"  wrote:

> Please ignore the previous mail... accidentaly hit the Enter key...
> 
> Hi friends,
> 
> I have a UI with a couple of tabs. When the user clicks a tab, I want it to
> add to the browser's history. Likewise, if the user navigates using the
> browser navigation, I want the tabs to get selected correctly.
> 
> Here's what I did: (basically directly from the documentation)
> 
> I added a 'changeSelection' listener to the tabview:
> 
> this.tabView.addListener("changeSelection",
> this._doUpdateHistoryWhenTabChanges, this);
> 
> 
> and a 'request' listener to the history:
> 
> qx.bom.History.getInstance().addListener("request",
> this._doUpdateTabWhenHistoryChanges, this);
> 
> 
> Here's the implementation:
> 
> _doUpdateHistoryWhenTabChanges : function(e)
> {
>  var tabIdx = this.tabView.indexOf(e.getData()[0]);
> qx.bom.History.getInstance().addToHistory(x.Application.TAB_NAMES[tabIdx]);
> },
> 
> _doUpdateTabWhenHistoryChanges : function(e)
> {
> var state = e.getData()[0];
> var tabIdx = 0;
> var c = this.tabView.getChildren();
> 
> if (state) {
> tabIdx = x.Application.TAB_NAMES.indexOf(state);
> }
> if (c[tabIdx] != undefined)
> this.tabView.setSelection(c[tabIdx]);
> }
> 
> This used to work in 0.8.3, but now that I migrated to 1.2.1 it doesn't
> work. 
> 
> As soon as a tab is clicked, '_doUpdateHistoryWhenTabChanges ' is called,
> which then adds to the history and calls: '_doUpdateTabWhenHistoryChanges ',
> which then calls again '_doUpdateHistoryWhenTabChanges ' from a qooxdoo
> timer, etc...
> 
> Could someone lead me into the right direction how this is supposed to work?
> 
> thx
> 
> andy
> 
> 
> 
> 
> --
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> ___
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 




--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


[qooxdoo-devel] History with Tabs

2010-10-25 Thread Andy Fuchs
Please ignore the previous mail... accidentaly hit the Enter key...

Hi friends,

I have a UI with a couple of tabs. When the user clicks a tab, I want it to
add to the browser's history. Likewise, if the user navigates using the
browser navigation, I want the tabs to get selected correctly.

Here's what I did: (basically directly from the documentation)

I added a 'changeSelection' listener to the tabview:

this.tabView.addListener("changeSelection",
this._doUpdateHistoryWhenTabChanges, this);


and a 'request' listener to the history:

qx.bom.History.getInstance().addListener("request",
this._doUpdateTabWhenHistoryChanges, this);


Here's the implementation:

_doUpdateHistoryWhenTabChanges : function(e)
{
 var tabIdx = this.tabView.indexOf(e.getData()[0]);
qx.bom.History.getInstance().addToHistory(x.Application.TAB_NAMES[tabIdx]);
},

_doUpdateTabWhenHistoryChanges : function(e)
{
var state = e.getData()[0];
var tabIdx = 0;
var c = this.tabView.getChildren();

if (state) {
tabIdx = x.Application.TAB_NAMES.indexOf(state);
}
if (c[tabIdx] != undefined)
this.tabView.setSelection(c[tabIdx]);
}

This used to work in 0.8.3, but now that I migrated to 1.2.1 it doesn't
work. 

As soon as a tab is clicked, '_doUpdateHistoryWhenTabChanges ' is called,
which then adds to the history and calls: '_doUpdateTabWhenHistoryChanges ',
which then calls again '_doUpdateHistoryWhenTabChanges ' from a qooxdoo
timer, etc...

Could someone lead me into the right direction how this is supposed to work?

thx

andy




--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


[qooxdoo-devel] History with Tabs

2010-10-25 Thread Andy Fuchs
Hi friends,

I have a UI with a couple of tabs. When the user clicks a tab, I want it to
add to the browser's history. Likewise, if the user navigates using the
browser navigation, I want the tabs to get selected correctly.

Here's what I did: (basically directly from the documentation)

I added a 'changeSelection' listener to the tabview:

this.tabView.addListener("changeSelection",
this._doUpdateHistoryWhenTabChanges, this);


and a 'request' listener to the history:

qx.bom.History.getInstance().addListener("request",
this._doUpdateTabWhenHistoryChanges, this);

Now when I call:



_doUpdateHistoryWhenTabChanges : function(e)
{
 var tabIdx = this.tabView.indexOf(e.getData()[0]);
qx.bom.History.getInstance().addToHistory(x.Application.TAB_NAMES[tabIdx]);
},

_doUpdateTabWhenHistoryChanges : function(e)
{
var state = e.getData()[0];
var tabIdx = 0;
var c = this.tabView.getChildren();

if (state) {
tabIdx = x.Application.TAB_NAMES.indexOf(state);
}
if (c[tabIdx] != undefined)
this.tabView.setSelection(c[tabIdx]);
}

This used to work in 0.8.3, but now that I migrated to 1.2.1 it doesn't
work. 

Could someone lead me into the right direction how this is supposed to work?




--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel