cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Eklund <nik...@curalia.se>
Subject Re: JXTemplate introspection problem - PLEASE HELP
Date Fri, 18 Jun 2004 10:19:45 GMT
H.vanderLinden@MI.unimaas.nl wrote:

<snip />
> flowscript:
> 
> function works() {
>  someValue = "correctTest";
> 
>  CorrectClass obj = new Packages.mypackage.CorrectClass();
>  obj.setValue(someValue);
>  print("correct class: " + obj.getFormattedValue()) -> correctTest
> 
>  var viewdata = {obj : obj};
>  cocoon.sendPage("myTemplate", viewdata); -> <p>correctTest</p>
> }
> 
> function doesNotWork() {
>  someValue = "correctTest";
> 
>  FaultyClass obj2 = new Packages.mypackage.FaultyClass();
>  obj2.setValue(someValue);
>  print("faulty class: " + obj.getFormattedValue()) -> correctTest}
                             ^^^
This might not be the problem, but your FaultyClass could be faulty if 
you used cut'n'paste from your actual code. The line above uses 
obj.getFormattedValue() and not obj2.getFormattedValue() which could 
give the illusion that your FaultyClass is correct even if it isn't, if 
obj is global.

Regards,
  Niklas

>  var viewdata = {obj : obj2};
>  cocoon.sendPage("myTemplate", viewdata); -> <p></p>
> }
> 
> Anyone?
> 
> Thanks.
> 
> Bye,
> 
> Helma van der Linden

Mime
View raw message