You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Kokavecz András <ko...@nextent.hu> on 2011/07/25 13:22:43 UTC

[Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Hi,

I'm trying to user Trinidad charts and I have problems with th
chartDrillDown listener and also with the binding of the chart component to
an UIComponent.

1.)
If I use a JSPX page with jsp:root and f:view tags, so withOUT Facelets it
all works fine...the chartDrillDown fires up.

2.)
If inside ui:composition tags, so WITH facelets the problem is, that the API
tries to look up the chartDrillDownListener as a property not as a
MethodExpression.

This is also the case with bindig the tr:chart element to an UIComponent.

I debugged the class UIXChart, as the event travels throught its
"broadcast(FacesEvent event)" method.

// Deliver to the default ChartDrillDownEvent
if (event instanceof ChartDrillDownEvent) {
broadcastToMethodExpression(event, getChartDrillDownListener());
}
super.broadcast(event);


In case of FACELETS the getChartDrillDownListener() method tries to call
getProperty() for UIXComponentBase and exits with a
PropertyNotFoundException.
Any suggestions?
Thanks in advance...

Andrew Kokavecz

Re: [Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Posted by Kokavecz András <ko...@nextent.hu>.
Hi Max,

I added my comment on the mentioned JIRA issue:
https://issues.apache.org/jira/browse/TRINIDAD-1813?focusedCommentId=13072381#comment-13072381

Andrew



2011/7/28 Max Starets <ma...@oracle.com>

> Manuel,
>
> The issue is that the old 1.1.x Facelets engine and Facelets engine in JSF
> 2.0 just write out XML declaration to the rendered output. If the framework
> is generating Ajax response, it will be writing its own XML document with
> its own XML declaration, which will produce an invalid XML document. I am
> not all sure that this was happening for Andrew, but it was worth trying
> (since he seemed to have problems only with Facelets).
>
> Starting with JSF 2.1, component frameworks are able to specify an output
> mode for Facelets that suppresses output of XML declaration and other XML
> instructions (like CDATA). Once Trinidad is upgraded to use JSF 2.1, this
> problem will be solved.
>
> Max
>
>
> On 7/28/2011 10:14 AM, Manuel Hartl wrote:
>
>> Hi Max,
>>
>> can you please explain why this is important?
>>
>> Regards,
>>     Manuel.
>>
>>
>>  Also, if you problem only shows up only with Facelets, make sure that
>>> the XHTML file does not have XML declaration on the top.
>>>
>>> Max
>>>
>>> On 7/28/2011 9:41 AM, Max Starets wrote:
>>>
>>>> Andrew,
>>>>
>>>> I am wondering if it's related to TRINIDAD-2107, which has now been
>>>> fixed.
>>>>
>>>> I would try two things to see if it is a similar issue:
>>>>
>>>> 1) Set debug-output to false in trinidad-config.xml. That will
>>>> disable comments in the generated HTML.
>>>> 2) Set org.apache.myfaces.**trinidadinternal.PPR_OVER_JSF_**AJAX
>>>> context
>>>> parameter to "off" in web.xml. That will make Trinidad use its old
>>>> (legacy) PPR support instead of Ajax support from JSF2.
>>>>
>>>> Max
>>>>
>>>> On 7/28/2011 4:39 AM, Kokavecz András wrote:
>>>>
>>>>> Hi Max,
>>>>>
>>>>> I'm sorry to bother you with another issue, but this is also about
>>>>> Facelets and also an important bug.
>>>>> I found an open issue for this, but I made my own comment:
>>>>> https://issues.apache.org/**jira/browse/TRINIDAD-1813?**
>>>>> focusedCommentId=13072252#**comment-13072252<https://issues.apache.org/jira/browse/TRINIDAD-1813?focusedCommentId=13072252#comment-13072252>
>>>>>
>>>>>
>>>>> I have used IceFaces 1.8.2 before and PartialSubmit feature and
>>>>> Facelets worked fine.
>>>>>
>>>>> I'd like to use Trinidad tr:chart on my project, so my only solution
>>>>> now is to skip Faceletes.
>>>>> Any suggestions for this?
>>>>>
>>>>> Thanks in advance!
>>>>> Andrew Kokavecz
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Kokavecz András
>>>>> Nextent Informatika Zrt.
>>>>> http://www.nextent.hu<http://**www.nextent.hu/<http://www.nextent.hu/>
>>>>> >
>>>>> 1134 Budapest Váci út 45.
>>>>> Mobil: +36 30 584-0419
>>>>>
>>>>>
>>


-- 
Kokavecz András
Nextent Informatika Zrt.
http://www.nextent.hu
1134 Budapest Váci út 45.
Mobil: +36 30 584-0419

Re: [Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Posted by Max Starets <ma...@oracle.com>.
Manuel,

The issue is that the old 1.1.x Facelets engine and Facelets engine in 
JSF 2.0 just write out XML declaration to the rendered output. If the 
framework is generating Ajax response, it will be writing its own XML 
document with its own XML declaration, which will produce an invalid XML 
document. I am not all sure that this was happening for Andrew, but it 
was worth trying (since he seemed to have problems only with Facelets).

Starting with JSF 2.1, component frameworks are able to specify an 
output mode for Facelets that suppresses output of XML declaration and 
other XML instructions (like CDATA). Once Trinidad is upgraded to use 
JSF 2.1, this problem will be solved.

Max

On 7/28/2011 10:14 AM, Manuel Hartl wrote:
> Hi Max,
>
> can you please explain why this is important?
>
> Regards,
>      Manuel.
>
>
>> Also, if you problem only shows up only with Facelets, make sure that
>> the XHTML file does not have XML declaration on the top.
>>
>> Max
>>
>> On 7/28/2011 9:41 AM, Max Starets wrote:
>>> Andrew,
>>>
>>> I am wondering if it's related to TRINIDAD-2107, which has now been
>>> fixed.
>>>
>>> I would try two things to see if it is a similar issue:
>>>
>>> 1) Set debug-output to false in trinidad-config.xml. That will
>>> disable comments in the generated HTML.
>>> 2) Set org.apache.myfaces.trinidadinternal.PPR_OVER_JSF_AJAX context
>>> parameter to "off" in web.xml. That will make Trinidad use its old
>>> (legacy) PPR support instead of Ajax support from JSF2.
>>>
>>> Max
>>>
>>> On 7/28/2011 4:39 AM, Kokavecz András wrote:
>>>> Hi Max,
>>>>
>>>> I'm sorry to bother you with another issue, but this is also about
>>>> Facelets and also an important bug.
>>>> I found an open issue for this, but I made my own comment:
>>>> https://issues.apache.org/jira/browse/TRINIDAD-1813?focusedCommentId=13072252#comment-13072252
>>>>
>>>>
>>>> I have used IceFaces 1.8.2 before and PartialSubmit feature and
>>>> Facelets worked fine.
>>>>
>>>> I'd like to use Trinidad tr:chart on my project, so my only solution
>>>> now is to skip Faceletes.
>>>> Any suggestions for this?
>>>>
>>>> Thanks in advance!
>>>> Andrew Kokavecz
>>>>
>>>>
>>>>
>>>> -- 
>>>> Kokavecz András
>>>> Nextent Informatika Zrt.
>>>> http://www.nextent.hu<http://www.nextent.hu/>
>>>> 1134 Budapest Váci út 45.
>>>> Mobil: +36 30 584-0419
>>>>
>

Re: [Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Posted by Max Starets <ma...@oracle.com>.
Andrew,

Could you attach your test case to TRINIDAD-1813 to make sure we do not 
miss anything?

Max

On 7/28/2011 10:23 AM, Kokavecz András wrote:
> Hi Max,
>
> The context param 
> (org.apache.myfaces.trinidadinternal.PPR_OVER_JSF_AJAX) setting to 
> "off" solved the problem.
> So, I guess I'm using the old-fashioned PPR now.
> I wonder what are the limitations for this...
>
> But anyway, thank you very much!
>
> I appreciate your support work!
>
> Bye,
> Andrew Kokavecz
>
>
>
> 2011/7/28 Manuel Hartl <hartl@flexsecure.de <ma...@flexsecure.de>>
>
>     Hi Max,
>
>     can you please explain why this is important?
>
>     Regards,
>        Manuel.
>
>
>     > Also, if you problem only shows up only with Facelets, make sure
>     that
>     > the XHTML file does not have XML declaration on the top.
>     >
>     > Max
>     >
>     > On 7/28/2011 9:41 AM, Max Starets wrote:
>     >> Andrew,
>     >>
>     >> I am wondering if it's related to TRINIDAD-2107, which has now been
>     >> fixed.
>     >>
>     >> I would try two things to see if it is a similar issue:
>     >>
>     >> 1) Set debug-output to false in trinidad-config.xml. That will
>     >> disable comments in the generated HTML.
>     >> 2) Set org.apache.myfaces.trinidadinternal.PPR_OVER_JSF_AJAX
>     context
>     >> parameter to "off" in web.xml. That will make Trinidad use its old
>     >> (legacy) PPR support instead of Ajax support from JSF2.
>     >>
>     >> Max
>     >>
>     >> On 7/28/2011 4:39 AM, Kokavecz András wrote:
>     >>> Hi Max,
>     >>>
>     >>> I'm sorry to bother you with another issue, but this is also about
>     >>> Facelets and also an important bug.
>     >>> I found an open issue for this, but I made my own comment:
>     >>>
>     https://issues.apache.org/jira/browse/TRINIDAD-1813?focusedCommentId=13072252#comment-13072252
>     >>>
>     >>>
>     >>> I have used IceFaces 1.8.2 before and PartialSubmit feature and
>     >>> Facelets worked fine.
>     >>>
>     >>> I'd like to use Trinidad tr:chart on my project, so my only
>     solution
>     >>> now is to skip Faceletes.
>     >>> Any suggestions for this?
>     >>>
>     >>> Thanks in advance!
>     >>> Andrew Kokavecz
>     >>>
>     >>>
>     >>>
>     >>> --
>     >>> Kokavecz András
>     >>> Nextent Informatika Zrt.
>     >>> http://www.nextent.hu <http://www.nextent.hu/>
>     >>> 1134 Budapest Váci út 45.
>     >>> Mobil: +36 30 584-0419
>     >>>
>     >>
>
>
>     --
>     Dipl. Inform. Manuel Hartl
>     Software Architect
>
>     FlexSecure-Logo    KobilGroup-Logo
>
>     FlexSecure GmbH
>     Industriestr. 12
>     D - 64297 Darmstadt
>     Tel: +49 (0) 6151 501 23-18
>     Fax: +49 (0) 6151 501 23-19
>
>     E-Mail: hartl@flexsecure.de <ma...@flexsecure.de>
>     Internet: www.flexsecure.de <http://www.flexsecure.de>
>
>     Geschäftsführer:
>     Erwin Stallenberger, Markus Ruppert
>
>     Amtsgericht Darmstadt HRB 8036
>     Umsatzsteuernummer: DE 214745269
>
>
>
>
> -- 
> Kokavecz András
> Nextent Informatika Zrt.
> http://www.nextent.hu <http://www.nextent.hu/>
> 1134 Budapest Váci út 45.
> Mobil: +36 30 584-0419
>

Re: [Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Posted by Kokavecz András <ko...@nextent.hu>.
Hi Max,

The context param
(org.apache.myfaces.trinidadinternal.PPR_OVER_JSF_AJAX) setting to "off"
solved the problem.
So, I guess I'm using the old-fashioned PPR now.
I wonder what are the limitations for this...

But anyway, thank you very much!

I appreciate your support work!

Bye,
Andrew Kokavecz



2011/7/28 Manuel Hartl <ha...@flexsecure.de>

> Hi Max,
>
> can you please explain why this is important?
>
> Regards,
>    Manuel.
>
>
> > Also, if you problem only shows up only with Facelets, make sure that
> > the XHTML file does not have XML declaration on the top.
> >
> > Max
> >
> > On 7/28/2011 9:41 AM, Max Starets wrote:
> >> Andrew,
> >>
> >> I am wondering if it's related to TRINIDAD-2107, which has now been
> >> fixed.
> >>
> >> I would try two things to see if it is a similar issue:
> >>
> >> 1) Set debug-output to false in trinidad-config.xml. That will
> >> disable comments in the generated HTML.
> >> 2) Set org.apache.myfaces.trinidadinternal.PPR_OVER_JSF_AJAX context
> >> parameter to "off" in web.xml. That will make Trinidad use its old
> >> (legacy) PPR support instead of Ajax support from JSF2.
> >>
> >> Max
> >>
> >> On 7/28/2011 4:39 AM, Kokavecz András wrote:
> >>> Hi Max,
> >>>
> >>> I'm sorry to bother you with another issue, but this is also about
> >>> Facelets and also an important bug.
> >>> I found an open issue for this, but I made my own comment:
> >>>
> https://issues.apache.org/jira/browse/TRINIDAD-1813?focusedCommentId=13072252#comment-13072252
> >>>
> >>>
> >>> I have used IceFaces 1.8.2 before and PartialSubmit feature and
> >>> Facelets worked fine.
> >>>
> >>> I'd like to use Trinidad tr:chart on my project, so my only solution
> >>> now is to skip Faceletes.
> >>> Any suggestions for this?
> >>>
> >>> Thanks in advance!
> >>> Andrew Kokavecz
> >>>
> >>>
> >>>
> >>> --
> >>> Kokavecz András
> >>> Nextent Informatika Zrt.
> >>> http://www.nextent.hu <http://www.nextent.hu/>
> >>> 1134 Budapest Váci út 45.
> >>> Mobil: +36 30 584-0419
> >>>
> >>
>
>
> --
> Dipl. Inform. Manuel Hartl
> Software Architect
>
> FlexSecure-Logo    KobilGroup-Logo
>
> FlexSecure GmbH
> Industriestr. 12
> D - 64297 Darmstadt
> Tel: +49 (0) 6151 501 23-18
> Fax: +49 (0) 6151 501 23-19
>
> E-Mail: hartl@flexsecure.de
> Internet: www.flexsecure.de
>
> Geschäftsführer:
> Erwin Stallenberger, Markus Ruppert
>
> Amtsgericht Darmstadt HRB 8036
> Umsatzsteuernummer: DE 214745269
>
>


-- 
Kokavecz András
Nextent Informatika Zrt.
http://www.nextent.hu
1134 Budapest Váci út 45.
Mobil: +36 30 584-0419

Re: [Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Posted by Manuel Hartl <ha...@flexsecure.de>.
Hi Max,

can you please explain why this is important?

Regards,
    Manuel.


> Also, if you problem only shows up only with Facelets, make sure that
> the XHTML file does not have XML declaration on the top.
>
> Max
>
> On 7/28/2011 9:41 AM, Max Starets wrote:
>> Andrew,
>>
>> I am wondering if it's related to TRINIDAD-2107, which has now been
>> fixed.
>>
>> I would try two things to see if it is a similar issue:
>>
>> 1) Set debug-output to false in trinidad-config.xml. That will
>> disable comments in the generated HTML.
>> 2) Set org.apache.myfaces.trinidadinternal.PPR_OVER_JSF_AJAX context
>> parameter to "off" in web.xml. That will make Trinidad use its old
>> (legacy) PPR support instead of Ajax support from JSF2.
>>
>> Max
>>
>> On 7/28/2011 4:39 AM, Kokavecz András wrote:
>>> Hi Max,
>>>
>>> I'm sorry to bother you with another issue, but this is also about
>>> Facelets and also an important bug.
>>> I found an open issue for this, but I made my own comment:
>>> https://issues.apache.org/jira/browse/TRINIDAD-1813?focusedCommentId=13072252#comment-13072252
>>>
>>>
>>> I have used IceFaces 1.8.2 before and PartialSubmit feature and
>>> Facelets worked fine.
>>>
>>> I'd like to use Trinidad tr:chart on my project, so my only solution
>>> now is to skip Faceletes.
>>> Any suggestions for this?
>>>
>>> Thanks in advance!
>>> Andrew Kokavecz
>>>
>>>
>>>
>>> -- 
>>> Kokavecz András
>>> Nextent Informatika Zrt.
>>> http://www.nextent.hu <http://www.nextent.hu/>
>>> 1134 Budapest Váci út 45.
>>> Mobil: +36 30 584-0419
>>>
>>


-- 
Dipl. Inform. Manuel Hartl
Software Architect

FlexSecure-Logo    KobilGroup-Logo

FlexSecure GmbH
Industriestr. 12
D - 64297 Darmstadt
Tel: +49 (0) 6151 501 23-18
Fax: +49 (0) 6151 501 23-19

E-Mail: hartl@flexsecure.de
Internet: www.flexsecure.de

Geschäftsführer:
Erwin Stallenberger, Markus Ruppert

Amtsgericht Darmstadt HRB 8036
Umsatzsteuernummer: DE 214745269


Re: [Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Posted by Max Starets <ma...@oracle.com>.
Also, if you problem only shows up only with Facelets, make sure that 
the XHTML file does not have XML declaration on the top.

Max

On 7/28/2011 9:41 AM, Max Starets wrote:
> Andrew,
>
> I am wondering if it's related to TRINIDAD-2107, which has now been 
> fixed.
>
> I would try two things to see if it is a similar issue:
>
> 1) Set debug-output to false in trinidad-config.xml. That will disable 
> comments in the generated HTML.
> 2) Set org.apache.myfaces.trinidadinternal.PPR_OVER_JSF_AJAX context 
> parameter to "off" in web.xml. That will make Trinidad use its old 
> (legacy) PPR support instead of Ajax support from JSF2.
>
> Max
>
> On 7/28/2011 4:39 AM, Kokavecz András wrote:
>> Hi Max,
>>
>> I'm sorry to bother you with another issue, but this is also about 
>> Facelets and also an important bug.
>> I found an open issue for this, but I made my own comment:
>> https://issues.apache.org/jira/browse/TRINIDAD-1813?focusedCommentId=13072252#comment-13072252 
>>
>>
>> I have used IceFaces 1.8.2 before and PartialSubmit feature and 
>> Facelets worked fine.
>>
>> I'd like to use Trinidad tr:chart on my project, so my only solution 
>> now is to skip Faceletes.
>> Any suggestions for this?
>>
>> Thanks in advance!
>> Andrew Kokavecz
>>
>>
>>
>> -- 
>> Kokavecz András
>> Nextent Informatika Zrt.
>> http://www.nextent.hu <http://www.nextent.hu/>
>> 1134 Budapest Váci út 45.
>> Mobil: +36 30 584-0419
>>
>

Re: [Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Posted by Max Starets <ma...@oracle.com>.
Andrew,

I am wondering if it's related to TRINIDAD-2107, which has now been fixed.

I would try two things to see if it is a similar issue:

1) Set debug-output to false in trinidad-config.xml. That will disable 
comments in the generated HTML.
2) Set org.apache.myfaces.trinidadinternal.PPR_OVER_JSF_AJAX context 
parameter to "off" in web.xml. That will make Trinidad use its old 
(legacy) PPR support instead of Ajax support from JSF2.

Max

On 7/28/2011 4:39 AM, Kokavecz András wrote:
> Hi Max,
>
> I'm sorry to bother you with another issue, but this is also about 
> Facelets and also an important bug.
> I found an open issue for this, but I made my own comment:
> https://issues.apache.org/jira/browse/TRINIDAD-1813?focusedCommentId=13072252#comment-13072252
>
> I have used IceFaces 1.8.2 before and PartialSubmit feature and 
> Facelets worked fine.
>
> I'd like to use Trinidad tr:chart on my project, so my only solution 
> now is to skip Faceletes.
> Any suggestions for this?
>
> Thanks in advance!
> Andrew Kokavecz
>
>
>
> -- 
> Kokavecz András
> Nextent Informatika Zrt.
> http://www.nextent.hu <http://www.nextent.hu/>
> 1134 Budapest Váci út 45.
> Mobil: +36 30 584-0419
>

Re: [Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Posted by Kokavecz András <ko...@nextent.hu>.
Hi Max,

I'm sorry to bother you with another issue, but this is also about Facelets
and also an important bug.
I found an open issue for this, but I made my own comment:
https://issues.apache.org/jira/browse/TRINIDAD-1813?focusedCommentId=13072252#comment-13072252

I have used IceFaces 1.8.2 before and PartialSubmit feature and Facelets
worked fine.

I'd like to use Trinidad tr:chart on my project, so my only solution now is
to skip Faceletes.
Any suggestions for this?

Thanks in advance!
Andrew Kokavecz



-- 
Kokavecz András
Nextent Informatika Zrt.
http://www.nextent.hu
1134 Budapest Váci út 45.
Mobil: +36 30 584-0419

Re: [Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Posted by Kokavecz András <ko...@nextent.hu>.
Hi Max,

The issue is here:
https://issues.apache.org/jira/browse/TRINIDAD-2123?focusedCommentId=13071123

Andrew



2011/7/26 Max Starets <ma...@oracle.com>

> **
> Andrew,
>
> Rather than patching TrinidadComponentHandler, the better idea is to
> either modify CoreChart (to implement getChartDrillDownListeners()) or
> create a separate handler for the chart, where createMetaRuleset() would
> be overridden. Once you file a jira issue, we will try to provide a fix as
> soon as possible.
>
> Max
>
>
> On 7/26/2011 4:14 AM, Kokavecz András wrote:
>
> Hi Max,
>
>  Thanks for your quick reply!
> I found this "protected MetaRuleset createMetaRuleset(Class type)" method
> in the trinidad-impl.jar TrinidadComponentHandler class.
> This class should be patched?
>
>  What is your standard way for doing this?
> I file this issue in JIRA and wait.
> When and in which release this supposed to appear?
>
>  Thanks,
> Andrew Kokavecz
> Budapest, Hungary
> Nextent Informatics
>
>
>
> 2011/7/25 Max Starets <ma...@oracle.com>
>
>>  Hey Andrew,
>>
>> The problem is that the Facelets engine does not know it is dealing with a
>> MethodExpression.
>>
>> One way to fix it would be to override  createMetaRuleset() in the newly
>> created chart tag along these lines:
>>
>> protected MetaRuleset createMetaRuleset(Class type)
>> {
>>     MetaRuleset m = super.createMetaRuleset(type);
>>     m.addRule(new MethodRule("chartDrillDownListener", null, new Class[]
>> {ChartDrillDownEvent.class}));
>>     return m;
>> }
>>
>> Another way would be to implement getChartDrillDownListeners() on
>> CoreChart, so that TrinidadListenersTagRule can add a rule automatically.
>>
>> Both ways involve making changes to Trinidad code. Could you file a JIRA
>> issue for this?
>>
>> Thanks,
>>  Max
>>
>>
>> On 7/25/2011 7:22 AM, Kokavecz András wrote:
>>
>> Hi,
>>
>> I'm trying to user Trinidad charts and I have problems with th
>> chartDrillDown listener and also with the binding of the chart component to
>> an UIComponent.
>>
>> 1.)
>> If I use a JSPX page with jsp:root and f:view tags, so withOUT Facelets it
>> all works fine...the chartDrillDown fires up.
>>
>> 2.)
>> If inside ui:composition tags, so WITH facelets the problem is, that the API
>> tries to look up the chartDrillDownListener as a property not as a
>> MethodExpression.
>>
>> This is also the case with bindig the tr:chart element to an UIComponent.
>>
>> I debugged the class UIXChart, as the event travels throught its
>> "broadcast(FacesEvent event)" method.
>>
>> // Deliver to the default ChartDrillDownEvent
>> if (event instanceof ChartDrillDownEvent) {
>> broadcastToMethodExpression(event, getChartDrillDownListener());
>> }
>> super.broadcast(event);
>>
>>
>> In case of FACELETS the getChartDrillDownListener() method tries to call
>> getProperty() for UIXComponentBase and exits with a
>> PropertyNotFoundException.
>> Any suggestions?
>> Thanks in advance...
>>
>> Andrew Kokavecz
>>
>>
>>
>
>
> --
>  Kokavecz András
> Nextent Informatika Zrt.
> 1134 Budapest Váci út 45.
> Mobil: +36 30 584-0419
>
>


-- 
Kokavecz András
Nextent Informatika Zrt.
1134 Budapest Váci út 45.
Mobil: +36 30 584-0419

Re: [Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Posted by Max Starets <ma...@oracle.com>.
Andrew,

Rather than patching TrinidadComponentHandler, the better idea is to 
either modify CoreChart (to implement getChartDrillDownListeners()) or 
create a separate handler for the chart, where createMetaRuleset() would 
be overridden. Once you file a jira issue, we will try to provide a fix 
as soon as possible.

Max

On 7/26/2011 4:14 AM, Kokavecz András wrote:
> Hi Max,
>
> Thanks for your quick reply!
> I found this "protected MetaRuleset createMetaRuleset(Class type)" 
> method in the trinidad-impl.jar TrinidadComponentHandler class.
> This class should be patched?
>
> What is your standard way for doing this?
> I file this issue in JIRA and wait.
> When and in which release this supposed to appear?
>
> Thanks,
> Andrew Kokavecz
> Budapest, Hungary
> Nextent Informatics
>
>
>
> 2011/7/25 Max Starets <max.starets@oracle.com 
> <ma...@oracle.com>>
>
>     Hey Andrew,
>
>     The problem is that the Facelets engine does not know it is
>     dealing with a MethodExpression.
>
>     One way to fix it would be to override  createMetaRuleset() in the
>     newly created chart tag along these lines:
>
>     protected MetaRuleset createMetaRuleset(Class type)
>     {
>         MetaRuleset m = super.createMetaRuleset(type);
>         m.addRule(new MethodRule("chartDrillDownListener", null, new
>     Class[]|{ChartDrillDownEvent|.class}));
>         return m;
>     }
>
>     Another way would be to implement getChartDrillDownListeners() on
>     CoreChart, so that TrinidadListenersTagRule can add a rule
>     automatically.
>
>     Both ways involve making changes to Trinidad code. Could you file
>     a JIRA issue for this?
>
>     Thanks,
>     Max
>
>
>     On 7/25/2011 7:22 AM, Kokavecz András wrote:
>>     Hi,
>>
>>     I'm trying to user Trinidad charts and I have problems with th
>>     chartDrillDown listener and also with the binding of the chart component to
>>     an UIComponent.
>>
>>     1.)
>>     If I use a JSPX page with jsp:root and f:view tags, so withOUT Facelets it
>>     all works fine...the chartDrillDown fires up.
>>
>>     2.)
>>     If inside ui:composition tags, so WITH facelets the problem is, that the API
>>     tries to look up the chartDrillDownListener as a property not as a
>>     MethodExpression.
>>
>>     This is also the case with bindig the tr:chart element to an UIComponent.
>>
>>     I debugged the class UIXChart, as the event travels throught its
>>     "broadcast(FacesEvent event)" method.
>>
>>     // Deliver to the default ChartDrillDownEvent
>>     if (event instanceof ChartDrillDownEvent) {
>>     broadcastToMethodExpression(event, getChartDrillDownListener());
>>     }
>>     super.broadcast(event);
>>
>>
>>     In case of FACELETS the getChartDrillDownListener() method tries to call
>>     getProperty() for UIXComponentBase and exits with a
>>     PropertyNotFoundException.
>>     Any suggestions?
>>     Thanks in advance...
>>
>>     Andrew Kokavecz
>>
>
>
>
>
> -- 
> Kokavecz András
> Nextent Informatika Zrt.
> 1134 Budapest Váci út 45.
> Mobil: +36 30 584-0419
>

Re: [Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Posted by Kokavecz András <ko...@nextent.hu>.
Hi Max,

Thanks for your quick reply!
I found this "protected MetaRuleset createMetaRuleset(Class type)" method in
the trinidad-impl.jar TrinidadComponentHandler class.
This class should be patched?

What is your standard way for doing this?
I file this issue in JIRA and wait.
When and in which release this supposed to appear?

Thanks,
Andrew Kokavecz
Budapest, Hungary
Nextent Informatics



2011/7/25 Max Starets <ma...@oracle.com>

> **
> Hey Andrew,
>
> The problem is that the Facelets engine does not know it is dealing with a
> MethodExpression.
>
> One way to fix it would be to override  createMetaRuleset() in the newly
> created chart tag along these lines:
>
> protected MetaRuleset createMetaRuleset(Class type)
> {
>     MetaRuleset m = super.createMetaRuleset(type);
>     m.addRule(new MethodRule("chartDrillDownListener", null, new Class[]
> {ChartDrillDownEvent.class}));
>     return m;
> }
>
> Another way would be to implement getChartDrillDownListeners() on
> CoreChart, so that TrinidadListenersTagRule can add a rule automatically.
>
> Both ways involve making changes to Trinidad code. Could you file a JIRA
> issue for this?
>
> Thanks,
> Max
>
>
> On 7/25/2011 7:22 AM, Kokavecz András wrote:
>
> Hi,
>
> I'm trying to user Trinidad charts and I have problems with th
> chartDrillDown listener and also with the binding of the chart component to
> an UIComponent.
>
> 1.)
> If I use a JSPX page with jsp:root and f:view tags, so withOUT Facelets it
> all works fine...the chartDrillDown fires up.
>
> 2.)
> If inside ui:composition tags, so WITH facelets the problem is, that the API
> tries to look up the chartDrillDownListener as a property not as a
> MethodExpression.
>
> This is also the case with bindig the tr:chart element to an UIComponent.
>
> I debugged the class UIXChart, as the event travels throught its
> "broadcast(FacesEvent event)" method.
>
> // Deliver to the default ChartDrillDownEvent
> if (event instanceof ChartDrillDownEvent) {
> broadcastToMethodExpression(event, getChartDrillDownListener());
> }
> super.broadcast(event);
>
>
> In case of FACELETS the getChartDrillDownListener() method tries to call
> getProperty() for UIXComponentBase and exits with a
> PropertyNotFoundException.
> Any suggestions?
> Thanks in advance...
>
> Andrew Kokavecz
>
>
>


-- 
Kokavecz András
Nextent Informatika Zrt.
1134 Budapest Váci út 45.
Mobil: +36 30 584-0419

Re: [Trinidad] Trinidad 2.0.0 chart tag with Facelets and component binding

Posted by Max Starets <ma...@oracle.com>.
Hey Andrew,

The problem is that the Facelets engine does not know it is dealing with 
a MethodExpression.

One way to fix it would be to override  createMetaRuleset() in the newly 
created chart tag along these lines:

protected MetaRuleset createMetaRuleset(Class type)
{
     MetaRuleset m = super.createMetaRuleset(type);
     m.addRule(new MethodRule("chartDrillDownListener", null, new 
Class[]|{ChartDrillDownEvent|.class}));
     return m;
}

Another way would be to implement getChartDrillDownListeners() on 
CoreChart, so that TrinidadListenersTagRule can add a rule automatically.

Both ways involve making changes to Trinidad code. Could you file a JIRA 
issue for this?

Thanks,
Max

On 7/25/2011 7:22 AM, Kokavecz András wrote:
> Hi,
>
> I'm trying to user Trinidad charts and I have problems with th
> chartDrillDown listener and also with the binding of the chart component to
> an UIComponent.
>
> 1.)
> If I use a JSPX page with jsp:root and f:view tags, so withOUT Facelets it
> all works fine...the chartDrillDown fires up.
>
> 2.)
> If inside ui:composition tags, so WITH facelets the problem is, that the API
> tries to look up the chartDrillDownListener as a property not as a
> MethodExpression.
>
> This is also the case with bindig the tr:chart element to an UIComponent.
>
> I debugged the class UIXChart, as the event travels throught its
> "broadcast(FacesEvent event)" method.
>
> // Deliver to the default ChartDrillDownEvent
> if (event instanceof ChartDrillDownEvent) {
> broadcastToMethodExpression(event, getChartDrillDownListener());
> }
> super.broadcast(event);
>
>
> In case of FACELETS the getChartDrillDownListener() method tries to call
> getProperty() for UIXComponentBase and exits with a
> PropertyNotFoundException.
> Any suggestions?
> Thanks in advance...
>
> Andrew Kokavecz
>