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
Highlighted
Contributor
Posts: 21
Registered: ‎07-24-2012
My Device: torch 9800
My Carrier: movistar

Scroll in BB SO 5.0 navigation mode focus

 

I have the following problem, some divs in html when you click expand, but OS 5.0 does not take focus. Implement the following to fix it:

 

1) In config.xml
 
<rim:navigation mode="focus" />
 
2) In the html
 
<select id="info_divisiones" x-blackberry-onup="scroll();" x-blackberry-ondown="scroll();" onmouseover="highlight(this);" onmouseout="unhighlight(this);">
        <option value="0" selected="selected">Primera        </option><option value="1">Intermedia        </option><option value="2">Quinta        </option><option value="3">Sexta        </option><option value="4">Séptima        </option></select>

<div class="ui-accordion ui-widget ui-helper-reset" id="accordion">
<h3 class="remove primera" id="1" x-blackberry-focusable="true" x-blackberry-onup="scroll(this);" x-blackberry-ondown="scroll(this);" onmouseover="highlight(this);" onmouseout="unhighlight(this);">Desarrollo</h3>
<div><p>content</p></div>
<h3 class="remove" id="2" x-blackberry-focusable="true" x-blackberry-onup="scroll(this);" x-blackberry-ondown="scroll(this);" onmouseover="highlight(this);" onmouseout="unhighlight(this);">Titulo 2</h3>
<div><p>content</p></div>
<h3 class="remove ultima" id="3" x-blackberry-focusable="true" x-blackberry-onup="scroll(this);" x-blackberry-ondown="scroll(this);" onmouseover="highlight(this);" onmouseout="unhighlight(this);">Titulo 3</h3>
<div><p>content</p></div>
</div>   
<button id='info_inicio' class='button small naranja' x-blackberry-focusable='true' x-blackberry-onUp='scroll(this);' x-blackberry-onDown='scroll(this);' onmouseover='highlight(this);' onmouseout='unhighlight(this);'>Inicio</button>
 
3) In the js
 
    function highlight(e) {
          e.setAttribute("style", "background-color: #FFA305;");
       }
 
       function unhighlight(e) {
           e.setAttribute("style", "");
       }    
 
    function scroll(e){
        var lastFocusId = parseInt(blackberry.focus.getFocus());
        alert('focus '+lastFocusId);
        var direccion     = parseInt(blackberry.focus.getDirection());
        alert('direccion '+direccion);
        var id            = e.getAttribute('id');
        alert('id '+id);
        var className     = e.getAttribute('class');
        alert('className '+className);
    }

 
But to get to the alert('id '+id) crash. What can be the problem?