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
Posts: 1,670
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone
Accepted Solution

Cascades JavaScript in QML

I'm already using many functions in my apps

 

now I wanted to do some String operations like

text.substring(10, text.length)

but it doesn't work

 

do I have to import something into my QML ?

 

I expected that JavaScript standard libraries would be there auto-magically inside Cascades QML

If not: what's the best js file to include providing standard functions and compatible to Apache 2 License ?

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 219
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: Cascades JavaScript in QML

Yes, I posted about JS split or substring don't working! But in final release or OS if I test that JS code in my app, any other apps can't executed, reboot needed, I thinking problem in JS engine, may be JS engine or something else is down for all apps and reboot needed for fix that. Problem 10.0.6 .671 And If I execute any app I see only BlackBerry logo on black background and after few seconds I receive RTOS type message "Application did not open a window within the allotted time and has been slayed", but maybe primary OS processes need to be self reloaded, if something is down.

Developer
Posts: 219
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: Cascades JavaScript in QML

first SDK release give only errors like "can't find variable "split"" or similar.

 

Developer
Posts: 219
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: Cascades JavaScript in QML

after reboot I found in debug console "

TypeError: Result of expression 'myresponse.split' [undefined] is not a function."

Developer
Posts: 1,670
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Cascades JavaScript in QML

I already found all these debug messages

 

thats why I'm asking what does it mean "JavaScript in QML / Cascades"

any standard library supported ?

a import statement needed ?

or to use own js library ? and if: which is best to use and compatible to apache license ?

 

(from my point it doesn't make sense to have to use individual js libs - would be much better to have one default included)

 

so: who knows the answer ????

 

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 219
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: Cascades JavaScript in QML

Ekke try using analog in C++
Developer
Posts: 1,670
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Cascades JavaScript in QML

thats not the question ;-)

 

of course I can do all in C++ and call from QML

but I'm interested into the answer of my question which parts of JavaScript are supported inside QML

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 1,670
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Cascades JavaScript in QML

will close this thread because discussion on this topic now is here

 

http://supportforums.blackberry.com/t5/Cascades-Development/global-JavaScript-support-inside-QML/td-...

 

ekke

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner http://vimeo.com/ekkescorner/videos
bb10-development: http://appbus.org Twitter: @ekkescorner