Re: Problem with showOneAccordion

2007-04-04 Thread Adam Winer

panelAccordion is rather badly broken, last I checked.
See http://issues.apache.org/jira/browse/ADFFACES-398

And the renderer code for panelAccordion, panelRadio,
panelChoice... shudder.  Roughly speaking, everything
in org.apache.myfaces.trinidadinternal.renderkit.html.layout
needs to be rewritten.

-- Adam


On 3/28/07, Martin Marinschek [EMAIL PROTECTED] wrote:

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; ili.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



Re: Problem with showOneAccordion

2007-04-04 Thread Martin Marinschek

Ok, I see.

I've been spending some hours yesterday debugging through this thing,
and I don't know why, and don't know how, but obviously the right
stuff is being rendered out (I see the right responsewriter calls,
i.e. one call for an opened showOneDetail), but the client gets wrong
stuff in the PPR response (i.e. all closed showOneDetails).

Is there anything in between the call to the response writer and the
output that is sent to the client that I'm missing, or have I only
been to tired yesterday and mixed things up?

As an additional hint: the examples of panelAccordion (which are by
the way called showOneAccordion and showManyAccordion) from a while
ago (partially) work:

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

the current examples don't:

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

regards,

Martin


On 4/5/07, Adam Winer [EMAIL PROTECTED] wrote:

panelAccordion is rather badly broken, last I checked.
See http://issues.apache.org/jira/browse/ADFFACES-398

And the renderer code for panelAccordion, panelRadio,
panelChoice... shudder.  Roughly speaking, everything
in org.apache.myfaces.trinidadinternal.renderkit.html.layout
needs to be rewritten.

-- Adam


On 3/28/07, Martin Marinschek [EMAIL PROTECTED] wrote:
 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; ili.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





--

http://www.irian.at

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

Professional Support for Apache MyFaces


Problem with showOneAccordion

2007-03-28 Thread Martin Marinschek

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; ili.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


Re: Problem with showOneAccordion

2007-03-28 Thread Martin Marinschek

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; ili.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