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:[EMAIL PROTECTED]
Sent: Thursday, March 24, 2005 10:55 PM
To: [email protected]
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, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




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 [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to