You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by mark goldin <ma...@gmail.com> on 2013/12/04 00:22:16 UTC

TileGroup and ensureElementIsVisible

I am testing a programmatic scrolling of TileGroup. Either I am doing
something wrong or there is  bug here. I am providing code for testing.
When you run it you will see rows of buttons and a scroller. Click on
button 1 and start tabbing. When it reaches button 4 and you tab again it
will go to button 5 which is in the next row that is not fully shown but no
scrolling will occur. Going to the next button (number 6) will scroll it
up. But it should have scrolled it when a focus was moved to the number 5.
Hope, it's clear.

<?xml version="1.0"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx" height="80"
   >
<fx:Script>
<![CDATA[
import mx.core.ILayoutElement;
import mx.core.IVisualElement;
private function init():void
{
for (var i:int=0;i<tl.numElements;i++)
{
var element:ILayoutElement = tl.getElementAt(i);
element.addEventListener(KeyboardEvent.KEY_DOWN, onFocusOut, false, 0,
true);
}
}
private function onFocusOut(event:KeyboardEvent):void
{
if (event.keyCode == 9)
ensureVisible(event.target as Button);
}
private function ensureVisible(target:Button):void
{
trace(target.label);
scroller.ensureElementIsVisible(target as IVisualElement);
}
]]>
</fx:Script>
<s:Scroller height="100%" id="scroller">
<s:VGroup height="100%">
<s:TileGroup horizontalGap="1" verticalGap="1" creationComplete="init()"
 requestedColumnCount="4" id="tl">
<s:Button label="1" width="50" height="50" />
<s:Button label="2" width="50" height="50" />
<s:Button label="3" width="50" height="50" />
<s:Button label="4" width="50" height="50" />
<s:Button label="5" width="50" height="50" />
<s:Button label="6" width="50" height="50" />
<s:Button label="7" width="50" height="50" />
<s:Button label="8" width="50" height="50" />
<s:Button label="9" width="50" height="50" />
</s:TileGroup>
</s:VGroup>
</s:Scroller>
</s:Application>

Thanks

Re: TileGroup and ensureElementIsVisible

Posted by mark goldin <ma...@gmail.com>.
4.11


On Wed, Dec 4, 2013 at 3:43 AM, Devesh Mishra <De...@mastek.com>wrote:

> Can you please confirm me what sdk version you are using? I am using 4.1
> and getting an error with the sample code which you have shared.
>
> i.e. Call to a possibly undefined method ensureElementIsVisible through a
> reference with static type spark.components:Scroller
>
> -----Original Message-----
> From: mark goldin [mailto:markzolotoy@gmail.com]
> Sent: 04 December 2013 05:44
> To: users
> Subject: Re: TileGroup and ensureElementIsVisible
>
> Well, I wanted someone else to confirm the bug.
>
>
> On Tue, Dec 3, 2013 at 5:25 PM, Justin Mclean <justin@classsoftware.com
> >wrote:
>
> > Hi,
> >
> > Might be better to raise this in JIRA.
> >
> > Thanks,
> > Justin
> >
> MASTEK LTD.
> In the US, we're called MAJESCOMASTEK
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Opinions expressed in this e-mail are those of the individual and not that
> of Mastek Limited, unless specifically indicated to that effect. Mastek
> Limited does not accept any responsibility or liability for it. This e-mail
> and attachments (if any) transmitted with it are confidential and/or
> privileged and solely for the use of the intended person or entity to which
> it is addressed. Any review, re-transmission, dissemination or other use of
> or taking of any action in reliance upon this information by persons or
> entities other than the intended recipient is prohibited. This e-mail and
> its attachments have been scanned for the presence of computer viruses. It
> is the responsibility of the recipient to run the virus check on e-mails
> and attachments before opening them. If you have received this e-mail in
> error, kindly delete this e-mail from desktop and server.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>

RE: TileGroup and ensureElementIsVisible

Posted by Devesh Mishra <De...@mastek.com>.
Can you please confirm me what sdk version you are using? I am using 4.1 and getting an error with the sample code which you have shared.

i.e. Call to a possibly undefined method ensureElementIsVisible through a reference with static type spark.components:Scroller

-----Original Message-----
From: mark goldin [mailto:markzolotoy@gmail.com] 
Sent: 04 December 2013 05:44
To: users
Subject: Re: TileGroup and ensureElementIsVisible

Well, I wanted someone else to confirm the bug.


On Tue, Dec 3, 2013 at 5:25 PM, Justin Mclean <ju...@classsoftware.com>wrote:

> Hi,
>
> Might be better to raise this in JIRA.
>
> Thanks,
> Justin
>
MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Re: TileGroup and ensureElementIsVisible

Posted by mark goldin <ma...@gmail.com>.
Well, I wanted someone else to confirm the bug.


On Tue, Dec 3, 2013 at 5:25 PM, Justin Mclean <ju...@classsoftware.com>wrote:

> Hi,
>
> Might be better to raise this in JIRA.
>
> Thanks,
> Justin
>

Re: TileGroup and ensureElementIsVisible

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

Might be better to raise this in JIRA.

Thanks,
Justin