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

Web and WebWorks Development

Reply
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: To show any other url instead of my own url which I used to play the video in a html5 app for 7.0 OS mobiles

I'm taking a bit of a guess here, but from what I can gather this would be the part where you inject a link to a video:

 

  str +=  "<div class='ui-list-item'>"+ "link: " + "<a href=\""+ channel['link']+"\">Start video</a> </div>";

In order for a link (i.e. <a></a>) to open in a child browser (intead of invoking the BlackBerry browser application separately), you need to add the target="_blank" property. So the above could would turn into:

 

  str +=  "<div class='ui-list-item'>"+ "link: " + "<a target="_blank" href=\""+ channel['link']+"\">Start video</a> </div>";

There may be other sections within your code where you are creating links that you want to open in a child browser, but the above should give you an idea of how to go forward with that.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: To show any other url instead of my own url which I used to play the video in a html5 app for 7.0 OS mobiles

Thank You Oros   very much let me update  you by implementing your code      .  

Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: To show any other url instead of my own url which I used to play the video in a html5 app for 7.0 OS mobiles

Yes when I have replaced    

 

 

"str += "<div class='ui-list-item'>"+  "<a href=\""+ channel['link']+"\">"+"</a>"+" </div>";"

 

 

with 

 

 

"str +=  "<div class='ui-list-item'>"+ "link: " + "<a target="_blank" href=\""+ channel['link']+"\">Start video</a> </div>";"

 

 

Iam      seeing the output without langauges list  and showing only      as below:

 

 

Please Select your Derired Language"

 

 

   

 

                                          <-- Back

 

but before that  my output is as image 2    showing langauges list     

 

07052013146[1].jpg

 

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: To show any other url instead of my own url which I used to play the video in a html5 app for 7.0 OS mobiles

Are you certain that was the only change you've made? I'm not sure where the languages screen gets created, but adding a parameter to <a> elements shouldn't really affect whether another list will display elements or not.

If you remove the target="_blank" code, and only that code, does your list reappear as expected?

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: To show any other url instead of my own url which I used to play the video in a html5 app for 7.0 OS mobiles

Oros the language screen gets created at  "ui-list-item " only   .

 

 

We have to findout where  exactly the browser page opens i.e where the link is clicked   and put your code.

 

 

Please help me in that.

 

 

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: To show any other url instead of my own url which I used to play the video in a html5 app for 7.0 OS mobiles

Hi there, the code I noted wouldn't be triggered onclick, but it is simply a property of the <a> element that gets clicked.

 

The best recommendation I can make to track that down is to build your WebWorks application with Web Inspector enabled. By enabling Web Inspector, you can investigate each element in your document. This will allow you to, on the device, navigate to the page that contains the links / buttons that launch the video URL. Once those are displayed, then in Web Inspector you can browse the DOM elements to find out exactly what those are to narrow down where they're being created. There is a good overview of Web Inspector here:

https://developer.blackberry.com/html5/documentation/web_inspector_overview_1553586_11.html

 

Again, as I'm understanding, you have <a> elements and the target="_blank" property needs to be added to those elements during creation as noted in my previous post. With that property, the native browser will not be invoked, instead the URL will open in a card, inside your application, that displays the content.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.
Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: To show any other url instead of my own url which I used to play the video in a html5 app for 7.0 OS mobiles

Yes thank you orios for your continous support.

 

 

I have followed   

 

https://developer.blackberry.com/html5/documentation/web_inspector_overview_1553586_11.html

 

when I try to enable the web inspector in the comand prompt iams eeing the following error

 

 


C:\Program Files\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5>bbwp C:\apps
\YuppTV.zip -d -o C:\apps\packaged
[INFO] Parsing command line options
[INFO] Parsing bbwp.properties
[INFO] Validating application archive
[ERROR] Invalid application archive - failed to find config.xml

 

 

My app name or Folder name is YuppTV     here and the zipped folder is  called YuppTV.zip

 

Please guide me where Iam wrong exactly.

 

I have config.xml then why it is saying invalid  application archive.

 

 

Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: To show any other url instead of my own url which I used to play the video in a html5 app for 7.0 OS mobiles

Again when I copied all the contenst of my app folder and zip it and name dorectly as "YuppTV.zip" 

 

It is working and   I got the following message

 

 

C:\Program Files\Research In Motion\BlackBerry WebWorks SDK 2.3.1.5>
bbwp C:\Applications\YuppTV.zip -d -o C:\apps\packaged
[INFO] Parsing command line options
[INFO] Parsing bbwp.properties
[INFO] Validating application archive
[INFO] Parsing config.xml
[WARNING] Failed to find the <author> element
[INFO] Populating application source
[INFO] Compiling BlackBerry WebWorks application
[INFO] Generating output files
[INFO] BlackBerry WebWorks application packaging complete

 

 

I have tested on the simulator or the emulator  and finding the ip address now and the porting number.

 

 

Trying to test on the device too    

Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: To show any other url instead of my own url which I used to play the video in a html5 app for 7.0 OS mobiles

But when I  installed it on the device and trying to open the App It is saying"   

 

 

Error startting App:  Module "App" attempts to access a secure  API "

 

 

Do I need  to sign the App again  on command  prompt.

 

 

 

Developer
Posts: 672
Registered: ‎12-04-2012
My Device: BlackBerry 8520
My Carrier: Airtel

Re: To show any other url instead of my own url which I used to play the video in a html5 app for 7.0 OS mobiles

This is becoming complex as I have already signed the app called "YuppTv"  which is in other path with the Blackberry webworks SDk on the ripple.

 

 

If I disturb it again  my  webworks     packager gets disturbed.