get Focused widget / table

View: New views
5 Messages — Rating Filter:   Alert me  

get Focused widget / table

by Daniel Hirtzbruch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello,

I got a qx.ui.tabview.Page which contains several tables (currently two of
them, might soon be more). Now I got some actions (envoked by
button-execution) which are the same for all tables but I don't want to add
one button per action per table. Is there a way to get the currently focused
table widget in the current tab-page? I thought about adding a property
which contains a kind of identifier and is set whenever a table is focused
but I don't think this is nice. Isn't there a method like "isFocused"? There
is one in #qx.ui.core.FocusHandler~isFocused, but I don't know if this one
can be used for my problem?

Well, I'm sure one of you can help me ;-)

Thanks in advance,
Daniel
--
View this message in context: http://n2.nabble.com/get-Focused-widget-table-tp3934981p3934981.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: get Focused widget / table

by Matthew Gregory :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There are several solutions, I presume you only have one table per tab?
If so you can call tabview.getSelection() to return an *array*
containing the currently active tab, and then just get your table from
there.

page1.setUserData("table", table1);
page2.setUserData("table", table2);

...

var activeTable = tabview.getSelection()[0].getUserData("table");

HTH, MAtt

Daniel Hirtzbruch wrote:

> Hello,
>
> I got a qx.ui.tabview.Page which contains several tables (currently two of
> them, might soon be more). Now I got some actions (envoked by
> button-execution) which are the same for all tables but I don't want to add
> one button per action per table. Is there a way to get the currently focused
> table widget in the current tab-page? I thought about adding a property
> which contains a kind of identifier and is set whenever a table is focused
> but I don't think this is nice. Isn't there a method like "isFocused"? There
> is one in #qx.ui.core.FocusHandler~isFocused, but I don't know if this one
> can be used for my problem?
>
> Well, I'm sure one of you can help me ;-)
>
> Thanks in advance,
> Daniel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: get Focused widget / table

by Daniel Hirtzbruch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thank you much for your hint - that's what I'm already doing on tabs where
I've only got one table. In this special case I have two tables on one tab,
therefore I need to know which table widget was active / focused before
button execution. I tried the FocusManager, but as I would have realized if
I'd thought about it - the "getFocusedWidget"-method does only catch the
button which is executed...

I'll try using a property which I set to the current active table on focus -
this way I can get the last active table. Or do you have another idea?



Noggin182 wrote:

>
> There are several solutions, I presume you only have one table per tab?
> If so you can call tabview.getSelection() to return an *array*
> containing the currently active tab, and then just get your table from
> there.
>
> page1.setUserData("table", table1);
> page2.setUserData("table", table2);
>
> ...
>
> var activeTable = tabview.getSelection()[0].getUserData("table");
>
> HTH, MAtt
>

--
View this message in context: http://n2.nabble.com/get-Focused-widget-table-tp3934981p3937877.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: get Focused widget / table

by Matthew Gregory :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Not that I can think of. You could though just reuse the same user data
rather than create a new property?

Daniel Hirtzbruch wrote:

> Thank you much for your hint - that's what I'm already doing on tabs where
> I've only got one table. In this special case I have two tables on one tab,
> therefore I need to know which table widget was active / focused before
> button execution. I tried the FocusManager, but as I would have realized if
> I'd thought about it - the "getFocusedWidget"-method does only catch the
> button which is executed...
>
> I'll try using a property which I set to the current active table on focus -
> this way I can get the last active table. Or do you have another idea?
>
>
>
> Noggin182 wrote:
>> There are several solutions, I presume you only have one table per tab?
>> If so you can call tabview.getSelection() to return an *array*
>> containing the currently active tab, and then just get your table from
>> there.
>>
>> page1.setUserData("table", table1);
>> page2.setUserData("table", table2);
>>
>> ...
>>
>> var activeTable = tabview.getSelection()[0].getUserData("table");
>>
>> HTH, MAtt
>>
>


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: get Focused widget / table

by Daniel Hirtzbruch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Well, this is what I did now. Simply added an event to change the userData
whenever one of those tables is focused.

Thank you for your help.
Daniel



Noggin182 wrote:
>
> Not that I can think of. You could though just reuse the same user data
> rather than create a new property?
>

--
View this message in context: http://n2.nabble.com/get-Focused-widget-table-tp3934981p3938517.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel