1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
function initDetail(){
if(document.getElementById('detail')){
var s_context = "#{facesContext.externalContext.requestContextPath}";
var dataServiceURL = s_context + "/weblet";
var store = new Ext.data.Store({
// load using script tags for cross domain, if the data in on the same domain as
// this page, an HttpProxy would be better
proxy: new Ext.data.HttpProxy({
url: dataServiceURL+"?service=detailWeblet"
}),
// create reader that reads the Topic records
reader: new Ext.data.JsonReader(
{root: 'result', id: 'code'},
[
{name: 'code', mapping: 'code'},
{name: 'label', mapping: 'label'}
]
)
});
store.load();
//declaration de la combobox
combo = new Ext.form.ComboBox({
store: store,
displayField:'label',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Veuillez selectionner un detail',
selectOnFocus:true,
width: 500,
maxHeight : 200,
applyTo: 'detail'
});
}
if(boolDetail == 'true'){
combo.setValue(textDetail);
combo.fireEvent('select');
}
};
plus bas dans ma page ma combo remplace le champ :
<input autocomplete="off" onchange="recupValueInputD();" class="x-form-text x-form-field x-form-empty-field" id="detail" type="text"/> |
Partager