Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
BBSJdev
Posts: 6,098
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange
Accepted Solution

Segment control call from javascript

[ Edited ]

Hi trying to remove an Option from a Segment control in QML file using Javascript but can't seem to get the argument correct.

Anyone have an example of this as I've tried searching for several hours now and examples non-existent.

 

The call I'm trying to do is:

 

   segControl.remove(segControl.optionSchedule);

 

where optionSchedule is the id of the Segment Control 'Option' element

 

Other functions work but this comes up with error;

 

  TypeError: Result of expression 'segControl.remove' [undefined] is not a function

 

Am I missing a typecast or is this function not supported?


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
BlackBerry Development Advisor (Retired)
danielrr5
Posts: 32
Registered: ‎05-09-2012
My Device: BB10
My Carrier: None

Re: Segment control call from javascript

Hi, 

 

Unfortunately remove() can't be called from QML/JavaScript as it is not Q_INVOKABLE so you'll have to call it from C++ instead.

 

Let me know if there is anything else I can do for you.

 

Cheers,

Daniel  

Please use plain text.
Developer
BBSJdev
Posts: 6,098
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Segment control call from javascript

OK, thanks. Still on that learning curve.


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
BlackBerry Development Advisor (Retired)
danielrr5
Posts: 32
Registered: ‎05-09-2012
My Device: BB10
My Carrier: None

Re: Segment control call from javascript

No problem. Does that fully answer your question? If so, can you mark a post as a solution. If not, how can we help?

Cheers,
Daniel
Please use plain text.