Access properties for component added using solution model

Forum to discuss the new web client version of Servoy.

Access properties for component added using solution model

Postby steve1376656734 » Tue Aug 15, 2017 12:31 pm

Hi,

I have added a bootstrapcomponents-button to my form via the solution model using:

Code: Select all
var btnDownload = myForm.newWebComponent('btnDownload', 'bootstrapcomponents-button', x, y, width, height);

I now want to set some of the properties (such as styleClass, imageStyleClass etc.) but code completion does not show these as being available. I have tried to add a JSDoc tag to show the type for the component:

Code: Select all
/** @type {plugins.bootstrapcomponents-button} */
var btnDownload = myForm.newWebComponent('btnDownload', 'bootstrapcomponents-button', x, y, width, height);

This does not show any build markers for the type declaration but also does not bring up the properties in code completion.

Any ideas how I can get access to the properties (with code completion and without getting build markers).

Thanks
Steve
Steve
SAN Developer
steve1376656734
 
Posts: 177
Joined: Fri Aug 16, 2013 2:38 pm
Location: Lanzarote

Re: Access properties for component added using solution mod

Postby vschuurhof » Mon Sep 18, 2017 11:18 am

Web components other than our default ones are very generic as it could be anything. This means that Bootstrap components (but also other ones from the Web Packages Manager) can be manipulated by the generic "getWebComponent" function, but Servoy Developer has no knowlegde about its API and such. So in order to get properties, you have to use the generic function "getJSONProperty" of the component or "setJSONProperty" to set them.

So you will not get any build markers but also no code completion for these properties.
Vincent Schuurhof
Servoy
vschuurhof
 
Posts: 66
Joined: Tue Dec 14, 2010 12:00 pm

Re: Access properties for component added using solution mod

Postby paronne » Mon Sep 18, 2017 11:47 am

Check our reference guide https://wiki.servoy.com/display/DOCS/JS ... Name,value), this is an example of what Vincent just explained.
paronne
 
Posts: 85
Joined: Fri Nov 02, 2012 3:21 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 1 guest