Closed Level0r0s closed 8 years ago
Browser's widget ModelGrid
is not focusable in nature. The widgets' interface is FAT due to various implementations of Platypus.js UI. There are browser and Java SE Swing widgets with the SAME API.
ModelGrid is a div
element with rich content. So, according to browsers' rules, you can't focus it unless its div have a tabindex
attribute. So, try native API: form.modelGrid.element. ...
function TControlerFocus()
{ this.value = {}; }
var modelGridFocus = new TControlerFocus();
function modelGridFirtsTabStop(el,inicio, o) {
if (el.tabIndex >-1) {
o.value = el;
return true;
}
else {
if (!inicio) {
// Check if children are tab stops
for (var i = 0, l = el.children.length; i < l; i++) {
if (modelGridFirtsTabStop(el.children[i],false,o)) {
return true;
}
}
}
else {
for (var i = 0, l = el.children.length; i < l; i++) {
if (el.children[i].tagName==='TABLE'){
if (modelGridFirtsTabStop(el.children[i],false,o)) {
return true;
}
}
}
}
}
}
------------------------------------------example use
modelGridFirtsTabStop(form.modelGrid.element,true, modelGridFocus) ;
modelGridFocus.value.focus();
Nice work.
ModelGrid.focus()
implemented now as well as onFocusGained
and onFocusLost
events.
Available in nighlty build (on branch master).
ModelGrid.focus() implemented no correct .
now ModelGrid.focus() set to <div class="grid-shel GGTPSL-CC"
incorrect red
ModelGrid.focus() set to <td classs="grid-cell grid-td-gwt-uid-32
correct green
example in http://palmsuporte.ddns.com.br:8084
Menu\ Cadastro\Departamento in inputSearch enter text VENDA[enter] use key UP and key DOWN to move in modelgrid use key [ESC] move to inputSearch enter other text COMPRA[enter]
ModelGrid.focus() set to First record
First cell is pretty good, but what if there are no rows in a grid?
Let's consider the following workflow: if grid is empty, entire div element will be focused, if there are cells in scrollable area, first cell of that area will be focused. If not, first cell in one of frozen areas will be focused.
Anyway, we will review your application and its focus related workflow.
my controler TControlerFocus is 100% funcional
Yes, it is. I mean, we will see, how focus related functionality of our widgets is used in an application.
No set focus to modelGrid.
form.modelGrid.focus();