• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Retrieving Combobox Selected Value Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Retrieving Combobox Selected Value Problem

    In Valence 3.2, I would retrieve multiple values from various dropdowns for extra params. e.g. customer, product, class, etc. In Valence 4, using Architect, I can get the value from the combobox I'm on. How do I retrieve selected values from previous dropdowns? See code below. Thanks.

    This used to work. Does not work on Valence 4.
    Code:
    var svline = Ext.ComponentQuery.query('#TB_LINE')[0];
    Here's how I'm trying to use it now. It brings in tons of data and all I want is the selected item on a combobox. I'm trying to get the customer from a previous dropdown.
    Code:
    onCSPRODUCTSelect: function(combo, records, eOpts) {
                        var svprod = combo.getValue();
                        var svcust = Ext.ComponentQuery.query('#CSCUST')[0];
                        var store = Ext.StoreMgr.get('Coder');
                        store.getProxy().setExtraParam("CUCUS", svcust);
                        store.getProxy().setExtraParam("CSPRODUCT", svprod);
                        store.load();
    I found my problem. I was not putting this in the correct place. Thanks.
    Last edited by JosephHarriman; 08-22-2016, 08:26 AM.

  • #2
    Glad you found the problem. Just in case others are wondering why, when doing a component query, it just gets you the actual component and not its value:

    In the example below, the variable svcust would contain a reference to the component that has the itemId of CSCUST. To get the field component's actual value you would want to call that component's "getValue" method.

    Code:
    var svcust = Ext.ComponentQuery.query('#CSCUST')[0],
         svCustValue;
    
    if (!Ext.isEmpty(svcust)){
        //get the field's value
        //
        svCustValue = svcust.getValue();
    }
    Last edited by robert.swanson; 08-22-2016, 09:53 AM.

    Comment

    Working...
    X