Hi Romeryto!

Your code is difficult to read. What is this?

Combo box1 = Municipios (Cities)
Combo = box2 Postos (Locations)

What you have to do is:

1. Create your ServiceDefTarget
2. Create your RecordDef
3. Create your 'PostoStore'
4. Create your 'StatusComboBoxStore'

Now the question is, what are you showing  in your ComboBox? ID or a Name? I
hope the Name and not the ID. If so, then take this as an example:

// record definition
        final RecordDef recordDef = new RecordDef(
                new FieldDef[]{
                        new StringFieldDef( "createdDate" ),
                        new StringFieldDef( "statusName" ),
                        new StringFieldDef( "number" ),
                        new StringFieldDef( "description" ),
                        new StringFieldDef( "comment" )
                }
        );

// setting combo box status where comboName is the name defined in the
RecordDef
statusComboBox = new SimpleStore( new String[]{ "comboID", "comboName" },
new String[][]{} );


statusComboBox.setFieldLabel( "My Combobox Name" );
statusComboBox.setEditable( false );
statusComboBox.setStore( comboName );
statusComboBox..setHiddenName( "comboName" );
statusComboBox.setName( "comboName" );
statusComboBox.setDisplayField( "comboName" );
statusComboBox.setMode( ComboBox.LOCAL );
statusComboBox.setTriggerAction( ComboBox.ALL );
statusComboBox..setEmptyText( "Select..." );
statusComboBox.setWidth( 190 );

This is just a code snippet. I hope it helps!

Dariusz



2008/9/25 Romeryto Lira <[EMAIL PROTECTED]>

> How to resolve this problem?
>
> --------------------------------------------------------------------------------------------------
> "Se um dia tiver que escolher entre o mundo e o amor... Lembre-se:
> Se escolher o mundo, ficará sem o amor, mas se escolher o amor,
> com ele conquistará o mundo." (Albert Einstein)
> ╔════════════════════════════════════════╗
>   ROMERYTO VIEIRA LIRA
>   Bacharelando em Ciência da Computação - UFCG
>   Membro do SegHidro2 - LSD - http://seghidro.lsd.ufcg.edu.br
>   Membro do Grupo de Suporte Guardians - www.lcc.ufcg.edu.br
>   Página Pessoal: http://romeryto.googlepages.com
>   Blog: http://olhartecnologico.blogspot.com
> ╚════════════════════════════════════════╝
>
> Pensou em imprimir este e-mail? Isto é mesmo necessário? Poupe o meio
> ambiente.
>
> ----------------------------------------------------------------------------------------------------------------------------
>
>
> 2008/9/23 Romeryto Lira <[EMAIL PROTECTED]>
>
>> I have a structure with combo-box, and those combo-box
>> has the following form:
>>
>> Municipios is Cities in english.
>>
>> public Store createMunicipiosStore() {
>>         Object[][] municipios = this.getMunicipiosDoBD();
>>
>>         //id_municipio,id_subbacia,id_bacia,nome_municipio
>>         final Store municipiosStore = new SimpleStore(new String[] {
>>                 MUNICIPIO_ID, SUBBACIA_ID, BACIA_ID, NOME_MUNICIPIO },
>>                 municipios);
>>         municipiosStore.load();
>>         return municipiosStore;
>>     }
>>
>>
>> The data are stored in an array of Object. And there Listeners to link
>> filter and a combo-box from another.
>> In this case:
>> Combo box1 = Municipios (Cities)
>> Combo = box2 Postos (Locations)
>>
>> But the filtering is being done in the style starswith(similar the String
>> API), it is as if he were a starswith in the code of the object.
>>
>> type, if the code (ID) of the minicipio(City) is (1) in the list of posts
>> will also appear that the posts have counties with codes 10, 11, 12 etc.
>>
>>     public Store createPostoStore() {
>>     Object[][] postos = this.getPostosDoBD();
>>         final Store postosStore = new SimpleStore(new String[] { POSTO_ID,
>>                 MUNICIPIO_ID, SUBBACIA_ID, BACIA_ID, NOME_POSTO },
>> postos);
>>         postosStore.load();
>>         return postosStore;
>>
>>     }
>>
>>     public Store createMunicipiosStore() {
>>         Object[][] municipios = this.getMunicipiosDoBD();
>>
>>         //id_municipio,id_subbacia,id_bacia,nome_municipio
>>         final Store municipiosStore = new SimpleStore(new String[] {
>>                 MUNICIPIO_ID, SUBBACIA_ID, BACIA_ID, NOME_MUNICIPIO },
>>                 municipios);
>>         municipiosStore.load();
>>         return municipiosStore;
>>     }
>>
>>
>> And the listener to link and filter is:
>>
>>     CBMunicipio.addListener(this.createListenerAdapter(CBPostoDoMunicipio,
>>                 postoDoMunicipioStore, MUNICIPIO_ID));
>>
>>     public ComboBoxListenerAdapter createListenerAdapter(
>>             final ComboBox combBox, final Store store, final String id) {
>>         ComboBoxListenerAdapter listener = new ComboBoxListenerAdapter() {
>>             public void onSelect(ComboBox comboBox, Record record, int
>> index) {
>>                 combBox.setValue("");
>>                 store.filter(id, comboBox.getValue());
>>             }
>>         };
>>         return listener;
>>     }
>>
>>
>> The codes (IDS) of both minicipios(City) as the postos(locations) are
>> integers.
>>
>> Thank you for the attention.
>>
>> --------------------------------------------------------------------------------------------------
>> "Se um dia tiver que escolher entre o mundo e o amor... Lembre-se:
>> Se escolher o mundo, ficará sem o amor, mas se escolher o amor,
>> com ele conquistará o mundo." (Albert Einstein)
>> ╔════════════════════════════════════════╗
>> ROMERYTO VIEIRA LIRA
>> Bacharelando em Ciência da Computação - UFCG
>> Membro do SegHidro2 - LSD - http://seghidro.lsd.ufcg.edu.br
>> Membro do Grupo de Suporte Guardians - www.lcc.ufcg.edu.br
>> Página Pessoal: http://romeryto.googlepages.com
>> Blog: http://olhartecnologico.blogspot.com
>> ╚════════════════════════════════════════╝
>>
>> Pensou em imprimir este e-mail? Isto é mesmo necessário? Poupe o meio
>> ambiente.
>>
>> ----------------------------------------------------------------------------------------------------------------------------
>>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to