pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger and Beth Whitcomb <RogerandB...@rbwhitcomb.com>
Subject Re: Remove component from Accordion
Date Sun, 08 Jan 2012 07:57:07 GMT
Yes, I think the code you cited is only disallowing the removal of the
accordion panels themselves, not the subcomponents under them.

~Roger

On 1/7/12 11:51 PM, Brendan cheng wrote:
> I found a way to remove component. it is from getPanels() of Accordion.
>
> ------------------------------------------------------------------------
> From: ccp999@hotmail.com
> To: user@pivot.apache.org
> Subject: Remove component from Accordion
> Date: Sun, 8 Jan 2012 03:43:17 +0000
>
> Hi,
>
> I was trying to remove a component from an Accordion but failed.
> After a trace, I found your code in Accordion class as
>
> @Override
>
> public Sequence<Component> remove(int index, int count) {
>
> for (int i = index, n = index + count; i < n; i++) {
>
> Component component = get(i);
>
>
> if (panels.indexOf(component) >= 0) {
>
> throw new UnsupportedOperationException();
>
> }
>
> }
>
>
> // Call the base method to remove the components
>
> return super.remove(index, count);
>
> }
>
>
> which if the component index to be removed is greater than or equal to
> zero will throw a UnsupportedOperationException.
>
> Is that mean, we can't remove component from accordion or it is a bug?
>
>
> Regards,
>
>
> Brendan
>

Mime
View raw message