Hybrid View

  1. #1
    Ext GWT Premium Member
    Join Date
    Nov 2011
    Posts
    2
    Vote Rating
    0
    ibetts03 is on a distinguished road

      0  

    Default Unanswered: Combobox hidden value question

    Unanswered: Combobox hidden value question


    I have the following combobox:
    states.add(StaticData.getStates());
    cState = new ComboBox<State>();
    cState.setEmptyText("Select a state...");
    cState.setDisplayField("statename");
    cState.setValueField("abbr");
    cState.setWidth(150);
    cState.setFieldLabel("State");
    cState.addSelectionChangedListener(new SelectionChangedListener<State> ()
    {
    @Override
    public void selectionChanged(SelectionChangedEvent<State> se)
    {


    Window.alert("State = " + cState.getRawValue());



    }
    });
    cState.setEditable(false);
    cState.setVisible(false);
    cState.hide();
    cState.setStore(states);
    cState.setTypeAhead(true);
    cState.setTriggerAction(TriggerAction.ALL);
    right.add(cState);
    My model is:
    public State(String abbr, String statename) {
    set("abbr", abbr);
    set("statename", statename);
    }

    I can load the store, display the data - however the selected value is not the one in the valuefield - it is the one in the displayfield. I need to be able to access the valuefield (abbreviation) to store it in the database...and I need to keep the displayfield as the text name as well. Does gxt handle name-value pairs? I have tried several variations and none has worked yet.

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Nov 2010
    Posts
    209
    Answers
    4
    Vote Rating
    -2
    Ersmarker has a little shameless behaviour in the past

      0  

    Default


    You can use
    se.getSelectedItem(); from the selection event
    or cState.getSelection()

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi