cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
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" +

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

But no use.

Please suggest me a solution for this.


-----Original Message-----
From: Daniel McOrmond []
Sent: Thursday, March 24, 2005 10:55 PM
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.



On Thu, 24 Mar 2005 22:24:15 +0530,
<> 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
> 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:
For additional commands, e-mail:

Confidentiality Notice

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message