cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <baskar.gan...@wipro.com>
Subject RE: eval function does not work
Date Wed, 30 Mar 2005 18:12:10 GMT

Hi Daniel,

Thanks for your reply.

I am using cocoon 2.1.5 and I am facing a typical problem in this.

eval( '"temp" + cocoon.session.getAttribute("object").getId()' );

The above mentioned one works fine.

But the problem is when iam getting the following expression
"temp" + cocoon.session.getAttribute("object").getId()
>From the database like

Var defaultExpression = testMethod.getdefaultExpression();//expr wil get
the 					above mentioned expression from
the database.

Now if I give eval( ' defaultExpression ' )  it s not evaluating and
Returns me simply "temp" +
cocoon.session.getAttribute("object").getId().

I tried giving
Var expr = "'" + testMethod.getdefaultExpression() + "'";
eval(expr);

But no use.

Please suggest me a solution for this.

Regards,
Baskar

-----Original Message-----
From: Daniel McOrmond [mailto:dmcormond@gmail.com]
Sent: Thursday, March 24, 2005 10:55 PM
To: users@cocoon.apache.org
Subject: Re: eval function does not work

Hi Baskar,

That seems odd. What version of Cocoon are you using?

Try breaking things down to an easier level, and see if you can
isolate where the problem is. It sounds like you might have too many
quotes around your expression. So for example, try calling:

eval( '"temp" + cocoon.session.getAttribute("object").getId()' );

..and see if that works. Even better, just try an eval( '1+2' ) and
see what you get.

HTH,

-Daniel


On Thu, 24 Mar 2005 22:24:15 +0530, baskar.ganesh@wipro.com
<baskar.ganesh@wipro.com> wrote:
>
> Hi Daniel,
>
> Thanks for your reply.
>
> The following is the code snippet I am using
>
> Var defaultExpression = testMethod.getdefaultExpression();
>
> The function testMethod.getdefaultExpression() returns you an
expression
> like "temp" + cocoon.session.getAttribute("object").getId()
>
> var expression = eval(defaultExpression);
>
> If we print the expression we are getting as " "temp" +
> cocoon.session.getAttribute("object").getId()"
>
> Regards,
> Baskar.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




Confidentiality Notice

The information contained in this electronic message and any attachments to this message are
intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information.
If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com
immediately
and destroy all copies of this message and any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message