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
New Developer
Posts: 26
Registered: ‎05-20-2012
My Device: Dev Alpha B, C and Playbook
My Carrier: PLAY

Image list - removing loading bar and dynamical creation of grid list

Hi guys, i have two issues. First:

 

I have created a dynamical image list by bbui, but under the list appeared a strange bar "LOADING" and i have no idea why it is there and how to remove it.

 

Second:

 

I am trying to create a grid list dynamically, but i have a problem. Here is my code:

 

          config.ondomready = function (element, id, params) {
              if (id == 'item') {
                  // Create grid list
var grid = document.createElement('div');
grid.setAttribute('data-bb-type','grid-layout');
grid.setAttribute('data-bb-style','square');
grid.setAttribute('data-bb-header-style','solid');
grid.setAttribute('data-bb-header-justify','left');
// Create group
var group = document.createElement('div');
group.setAttribute('data-bb-type','group');
group.setAttribute('data-bb-title','Uniwersytet Śląski w Katowicach');
grid.appendChild(group);

// Create row
var row = document.createElement('div');
row.setAttribute('data-bb-type','row');
row.setAttribute('data-bb-columns','1');
row.setAttribute('id','artykul');
group.appendChild(row);

// Create Item
var item2 = document.createElement('div');
        item2.setAttribute('data-bb-type', 'item');
        item2.setAttribute('id', "obrazItem");
        item2.innerHTML = params.tresc2;
        if (params.img) item2.setAttribute('data-bb-img', params.img);
        if (!params.img) item2.setAttribute('data-bb-img', 'images/uslogo2.png');
row.appendChild(item2);

grid = bb.grid.style(grid);
document.getElementById('gridContainer').appendChild(grid);
                            } 
              
          };

 The problem is that i recieve an error: "Uncaught TypeError: Object #<Object> has no method 'style'". When i remove line with 

bb.grid.style(grid);

then my grid list has no styling and there is no image. What's wrong?

 

 

Thanks for help!

 

 

New Developer
Posts: 26
Registered: ‎05-20-2012
My Device: Dev Alpha B, C and Playbook
My Carrier: PLAY

Re: Image list - removing loading bar and dynamical creation of grid list

[ Edited ]

First issue is solved by removing jquery.mobile from head.. I have no idead why : D

But now appeared another problem (last, i promise) - I want to invoke onclick facebook share in browser. But i receive: "Uncaught TypeError: Object [object Object] has no method 'invokeTargetPicker' ". Here's my code:

                <script>
            function invokeFacebook() {
                blackberry.invoke.card.invokeTargetPicker({
                    target: "Facebook",
                    action: "bb.action.SHARE",
                    uri : 'http://google.com',
                    target_type: ["APPLICATION", "VIEWER", "CARD"]
                },"Shared Remote URL", onSuccess, onError);
            }
            function onSuccess() { alert('test'); }
            function onError(error) { alert(error); }
        </script>


<div data-bb-type="action" data-bb-style="button" data-bb-overflow="true" data-bb-img="fb.png" onclick="invokeFacebook();">Share!</div>

 And yes, i included into config.xml 

 <feature id="blackberry.invoke.card" />
  <feature id="blackberry.invoke" required="true" version="1.0.0.0"/>
  <feature id="blackberry.io" required="true" version="1.0.0.0" />

 

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

Re: Image list - removing loading bar and dynamical creation of grid list

Hi there,

 

Just to confirm, are you using the latest version of the WebWorks SDK? What does your <script> element look like for including the webworks.js file? Where does the <script> appear in your code?

 

There is another way to invoke Facebook share directly through the invoke APIs that may be of use, found here:

https://github.com/blackberry/BB10-WebWorks-Samples/blob/master/invoke/invoker/invocations.js#L50

 

I'm not seeing any issues with your code off the top of my head, but I'll do my best to help narrow it down.


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.