Hi again,

I've looked at the combined code for CorePanelAccordion and
UIXShowDetail and their renderers and I wonder why the code for doing
the disclosure/closure is spreaded out so much. Wouldn't it be better
to handle this in the detail and the parent components, and in the
renderer only do the rendering of the component? That should be
possible with the event system, right?


regards,

Martin



On 3/29/07, Martin Marinschek <[EMAIL PROTECTED]> wrote:
Hi *,

can anyone of the Trinidad core developers do me a favour and look at:

http://example.irian.at/trinidad-demo-20070328/faces/components/showOneAccordion.jspx

do you think the behaviour is what a user expects? I would not think
so... When I click on Panel 1 and then on Panel 2, I would suspect
Panel 2 to be opened afterwards, but it isn't.

I've added the following code to CorePanelAccordion to make this work again:

    @Override
    public void queueEvent(FacesEvent event) {
        super.queueEvent(event);

        // Deliver to the default ChartDrillDownEvent
        if (event instanceof DisclosureEvent)
        {
          List li = this.getChildren();

          for(int i=0; i<li.size(); i++) {
            UIComponent comp = (UIComponent) li.get(i);
            if(comp instanceof UIXShowDetail) {
                ((UIXShowDetail) comp).setDisclosed(false);
            }
          }
        }
    }

but - this code will need to be restricted to take events only of
direct children, and only for showOneAccordions. Apart from this -
would you think this is the right approach for a fix?

regards,

Martin

--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Reply via email to