wrapMethodWithArguments is not behaving as documented

Forum to discuss the new web client version of Servoy.

wrapMethodWithArguments is not behaving as documented

Postby bodnarescu.diana » Wed Feb 28, 2024 6:53 pm

Hello,

https://wiki.servoy.com/display/DOCS/SolutionModel#SolutionModel-wrapMethodWithArguments(method,args)
In the sample of the documentation of method wrapMethodWithArguments(method, args) it says that i can send my arguments as items of an array:
Code: Select all
solutionModel.wrapMethodWithArguments(method, [null, quotedString])

What I noticed is that i cannot reach any arguments this way, in the method my arguments are null.

It only works if i send it as a value of a property of an object:
Code: Select all
solutionModel.wrapMethodWithArguments(method, [null, {prop: quotedString}])

this way in the method i indeed get, as my second argument, the object.

Am I using it wrong or does the documentation of this method need updating?
Or I am thinking now that maybe it depends on the webcomponent where the method is used as a handler? I use it on a bootstrapcomponents-label.

Thank you,
Diana
Diana Bodnarescu
Servoy Valued Professional
Freelance Servoy Developer
bodnarescu.diana
 
Posts: 25
Joined: Tue Mar 29, 2016 10:43 am

Re: wrapMethodWithArguments is not behaving as documented

Postby bodnarescu.diana » Wed Feb 28, 2024 6:57 pm

I found the answer, in the documentation: string arguments have to be quoted, they are interpreted before the method is called.
:)
Diana Bodnarescu
Servoy Valued Professional
Freelance Servoy Developer
bodnarescu.diana
 
Posts: 25
Joined: Tue Mar 29, 2016 10:43 am


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 25 guests

cron