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: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Webview: <input type="color"/> - change. Works on Z10 but not Q10

[ Edited ]

If you create a new cascades project only containing a webview with the following code inside, it will detect the color change on a Z10 but not a Q10. I'm trying to find a solution detect change on a Q10. Any ideas?

 

<!DOCTYPE HTML>

<html>

<head>

    <script src="jquery.js"></script>

</head>

<body>

<br/><input type="color"/>

<script>

  $('input').change(function() {

    alert("This shows on Z10 but not Q10");

  });

</script>

</body>

</html>

 

_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Developer
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Webview: <input type="color"/> - change. Works on Z10 but not Q10

Phil - dunb answer

 

Have you tried an onclick or onsubmit for the HTML?

 

There are other ways to trap it but those are the most obvious

 

e.g.

 

<input type="color" onclick="stupidtest" />

 

What you then need is to inspect the input in Chrome's debug (from Amsterdam) (easiest way)

 

Give is a specific easy to find fake value - #ABCDEF is good for example

 

Find that (not always easy) and you have your target

 

The last bit can be a little complicated as you may need an ID wrap

 

I'm not gonna go thru that one here as its complicated - PM / mail me if you get lost

 

Good Q though - points on their way!




Click the like button if you find my posts useful!
Developer
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Webview: <input type="color"/> - change. Works on Z10 but not Q10

You would think on submit would work but no luck with that either.

One thing that almost worked is .blur

.blur would trigger when you choose a color or submit but if you change a colour it fires then change again it will no longer fire, until you close and reopen.

$('input').change(function() {
alert("This shows on Z10 but not Q10");
});
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Developer
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Webview: <input type="color"/> - change. Works on Z10 but not Q10

Oh yeah also I wish I could use Chrome debug but I don't think it's possible when your app is native running a web view to have chrome inspect that web view.

How amazing would it be if you could though.
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Developer
Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Webview: <input type="color"/> - change. Works on Z10 but not Q10

[ Edited ]
Actually maybe it is possible, I just found that there is a web settings object you can attach to a web view with an attribute for webinspector. http://developer.blackberry.com/cascades/reference/bb__cascades__websettings.html
_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Developer
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Webview: <input type="color"/> - change. Works on Z10 but not Q10

Phil

 

Just gimme some a div

 

You have full DOM in Cascades, don't you?

 

While the answer may be a bit complex I'm sure I can rough it up for you quickly

 

I'm going for a pint now so gimme the basics (like the colour picker)

 

 




Click the like button if you find my posts useful!
Developer
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: Webview: <input type="color"/> - change. Works on Z10 but not Q10

Oh - PM or email it back?




Click the like button if you find my posts useful!