Return-Path: Delivered-To: apmail-pivot-user-archive@www.apache.org Received: (qmail 17443 invoked from network); 17 Dec 2010 19:50:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Dec 2010 19:50:27 -0000 Received: (qmail 28598 invoked by uid 500); 17 Dec 2010 19:50:27 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 28509 invoked by uid 500); 17 Dec 2010 19:50:27 -0000 Mailing-List: contact user-help@pivot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@pivot.apache.org Delivered-To: mailing list user@pivot.apache.org Received: (qmail 28498 invoked by uid 99); 17 Dec 2010 19:50:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Dec 2010 19:50:27 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cbartlett.x@gmail.com designates 209.85.215.43 as permitted sender) Received: from [209.85.215.43] (HELO mail-ew0-f43.google.com) (209.85.215.43) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Dec 2010 19:50:21 +0000 Received: by ewy22 with SMTP id 22so650813ewy.16 for ; Fri, 17 Dec 2010 11:49:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=FQvtEz9ijqX03OBSvAElWHfq0+gAF4yq//5Aou5C0NI=; b=kwIQCWtdT7Y5gV5VAAmXYzdchOtC6nYj3k+/GbKUvA585me7s+WpNg21jgQryEuELN /p7dO0KLYwJCfqiDF9XE/CGpqki93C8BlJYl37GzzpBp/uSsTHHGnUEMnVmiHSWZknCG 2NLWID53oGrtC4msS3vcEhgVYSwek/Ldn7Bmg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=uJmadvB8sZWcyaAHsiENaMpeUJwpmB8xOh3zjKdGi+qgMK+qZ7EkmI3GeDFdmfZVAY j029eUiJQVyzUqwSkz5f/1n6Dts0DJfRglEKUiZPR8t0KUYvoD+uB33Kc+YSGf4h+PMm lv/70ootJ01Q5A+cpLtbFDBBy3of3zdJU7NjY= MIME-Version: 1.0 Received: by 10.213.32.6 with SMTP id a6mr2754534ebd.31.1292615395885; Fri, 17 Dec 2010 11:49:55 -0800 (PST) Received: by 10.14.124.140 with HTTP; Fri, 17 Dec 2010 11:49:55 -0800 (PST) In-Reply-To: References: Date: Sat, 18 Dec 2010 02:49:55 +0700 Message-ID: Subject: Re: Accordion setSelectedIndex issue From: Chris Bartlett To: user@pivot.apache.org Content-Type: multipart/alternative; boundary=0015174c108c80c1850497a07965 --0015174c108c80c1850497a07965 Content-Type: text/plain; charset=ISO-8859-1 I am not in a position to be able to see how this manifests, but it sounds like it could be this issue https://issues.apache.org/jira/browse/PIVOT-572 If so, you might be able to hack together a workaround using a CardPane and maintaining 2 Accordions. The card pane would show the one that is in a good visual state while you populate the empty one, then toggle the CardPane's selection to the newly populated one, and clear the first accordion ready for the next set of changes. A very clunky double-buffering effect... Or if you want to take a look into the issue itself, you'll probably need http://svn.apache.org/repos/asf/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java http://svn.apache.org/repos/asf/pivot/trunk/wtk/src/org/apache/pivot/wtk/Accordion.java Chris On 18 December 2010 01:10, Eugene Kondrashev wrote: > Hi > > I faced with issue while refreshing my accordion view. > > Let say I have one accordion and one button refreshing accordions data and > setting index. > > > nextCompanyButton.getButtonPressListeners().add(new > ButtonPressListener() { > > @Override > public void buttonPressed(Button button) { > companiesAccordion.getPanels().remove(0, > companiesAccordion.getPanels().getLength()); > > CompanyViewController companyView = > UIComponents.companyView(); > companyView.load(new BeanAdapter(new Company())); > Accordion.setLabel(companyView, "T1"); > companiesAccordion.getPanels().add(companyView); > companyView = UIComponents.companyView(); > companyView.load(new BeanAdapter(new Company())); > Accordion.setLabel(companyView, "T2"); > companiesAccordion.getPanels().add(companyView); > companiesAccordion.setSelectedIndex(1); > } > }); > > As you can see, i'm removing all the panels and initing them from the > scrach. > So when i'm setting selection index to 0 it is ok no artifacts appears, but > if it is 1 accrodion is flipping. I mean the accordion area is getting blank > for a second or half and then is back to normal with right panel selected. > Seems like that half a second perion selection transition is done. But there > is no animation on screen. > > So finally, I need to refresh my accordion and set correct panel index. Can > you tell me how can i do that without that flipping affect? > Perhaps I can turn off that selection animation while refresh or something? > > Thanks, Eugene > --0015174c108c80c1850497a07965 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I am not in a position to be able to see how this manifests, but it so= unds like it could be this issue =A0https://issues.apache.org/jira/browse/PIVOT-572

If so, you might be able to hack together a workaround = using a CardPane and maintaining 2 Accordions. =A0The card pane would show = the one that is in a good visual state while you populate the empty one, th= en toggle the CardPane's selection to the newly populated one, and clea= r the first accordion ready for the next set of changes. =A0A very clunky d= ouble-buffering effect...=A0

Or if you want to take a look into the issue itself, yo= u'll probably need

Chr= is

On 18 December 2010 01:10, = Eugene Kondrashev <eugene.kondrashev@gmail.com> wrote:
Hi

I faced with issue while refreshing my accordion view= .

Let say I have one accordion and one button refr= eshing accordions data and setting index.


=A0=A0 =A0 =A0 =A0nextCompanyButton.getButtonPressListeners(= ).add(new ButtonPressListener() {

=A0=A0 =A0 =A0 = =A0 =A0 =A0@Override
=A0=A0 =A0 =A0 =A0 =A0 =A0public void button= Pressed(Button button) {
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0companiesAccordion.getPanels().remove(0, = companiesAccordion.getPanels().getLength());

=A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0CompanyViewController companyView =3D UIComp= onents.companyView();
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0companyVi= ew.load(new BeanAdapter(new Company()));
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Accordion.setLabel(companyView, &quo= t;T1");
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0companiesAccordion= .getPanels().add(companyView);
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= companyView =3D UIComponents.companyView();
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0companyView.load(new BeanAdapter(new Comp= any()));
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Accordion.setLabel(com= panyView, "T2");
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0comp= aniesAccordion.getPanels().add(companyView);
=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0companiesAccordion.setSelectedIndex(= 1);
=A0=A0 =A0 =A0 =A0 =A0 =A0}
=A0=A0 =A0 =A0 =A0});

As you can see, i'm removing all th= e panels and initing them from the scrach.
So when i'm setting selection index to 0 it is ok no artifacts app= ears, but if it is 1 accrodion is flipping. I mean the accordion area is ge= tting blank for a second or half and then is back to normal with right pane= l selected. Seems like that half a second perion selection transition is do= ne. But there is no animation on screen.

So finally, I need to refresh my accordion and set corr= ect panel index. Can you tell me how can i do that without that flipping af= fect?
Perhaps I can turn off that selection animation while refre= sh or something?

Thanks, Eugene

--0015174c108c80c1850497a07965--