Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Override toString of a function/json/object

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,078 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,078 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

16-02-2016

Hi everyone,

for some reasons I am not able to override the toString function using prototype.toString = function(){}...

I made it work using a different name like toDisplayString(), but it is not convenient to have another function name for the result wanted...

here's how my object look like :

I would like to have function toDisplayString named toString instead. But using Tasks.prototype.toString = function(){} doesn't seem to be working...

is anyone aware of any issue regarding toString override within LiveCycle?

Thanks for your time

Replies

Avatar

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
_Bruce_Robertson
MVP

18-02-2016

Hi,

I don't understand why but you can't override the toString() or the valueOf(), I've ended up doing the same sort of thing as you with a slightly different name, but means you can't handle objects in a generic way, and it's made it very hard to port some JavaScript libraries across.

It does seem you can override both in Reader DC ... but I guess that wont help for some years to come.

Bruce

Avatar

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,078 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile

Avatar
Springboard
MVP
Magus069
MVP

Likes

143 likes

Total Posts

1,078 posts

Correct Reply

155 solutions
Top badges earned
Springboard
Validate 1
Ignite 3
Ignite 1
Establish
View profile
Magus069
MVP

18-02-2016

Thanks for answering my question.

Really appreciated!