Migration Ext.Net1.x to Ext.Net 2.x - SelectBox .getValue() method undefined ?

  1. #1

    Migration Ext.Net1.x to Ext.Net 2.x - SelectBox .getValue() method undefined ?

    Hi,
    I am migrating our Application from Ext .Net 1.x to Ext .Net 2.2.

    Basically I have a SelectBox and a javascript part that retrieve the SelectBox value. Everything is properly working on Ext .Net 1.x but in Ext .Net 2.2 the js method mySelectBox.getValue() is undefined.

    Here my SelectBox:
                                    <ext:SelectBox
                                        ID="cboYears"  
                                        runat="server" 
                                        HiddenName="RecurringSystem"
                                        Editable="false"
                                        AllowBlank="false"
                                        Width="70"
                                        ListWidth="60">
    
                                        <Listeners>
                                            <Select Handler="#{dsCalendar}.load();" />
                                        </Listeners>
    
                                    </ext:SelectBox>
    Here my js
                var getSelectedYear = function () {
                    debugger;
                    var value = cboYears.getValue();
                    if (!value) {
    ...
                    }
                   return parseInt(value);
                };
    And of course, when is getSelectedYear executed? Here:
    <ext:Store ID="dsCalendar" runat="server" RemoteSort="true" AutoLoad="true">
    ...
                <Parameters>
                    <ext:StoreParameter  Name="year" Value="getSelectedYear()" Mode="Raw" />
                    <ext:StoreParameter Name="locationId" Value="getSelectedLocation()" Mode="Raw" />
                </Parameters>
    ...
    You can see the issue I am experiencing into attached screenshot.



    UPDATE: Sorry, after some spent in investigation I discovered that I should use App.cboYears.getValue() ...
    Attached Thumbnails Click image for larger version. 

Name:	Error.png 
Views:	11 
Size:	33.6 KB 
ID:	6217   Click image for larger version. 

Name:	Error1.png 
Views:	11 
Size:	20.0 KB 
ID:	6218  
    Last edited by MarzioPat; May 15, 2013 at 10:08 AM.
  2. #2
    Hello,

    Please try prefixing the client-side .id of the component with "App.".

    Example

    App.cboYears.getValue()
    Geoffrey McGill
    Founder

Similar Threads

  1. TableLayout 2 bugs in Ext.Net1.x
    By devil in forum 1.x Help
    Replies: 2
    Last Post: Dec 03, 2012, 3:30 AM
  2. Replies: 5
    Last Post: Nov 26, 2012, 2:33 PM
  3. Replies: 4
    Last Post: Oct 24, 2011, 3:34 AM
  4. a problem with ext.net1.0 examples
    By hefeilixin in forum 1.x Help
    Replies: 1
    Last Post: Aug 26, 2010, 9:00 AM
  5. ext.net1.0 how to use BoxComponent
    By hefeilixin in forum 1.x Help
    Replies: 3
    Last Post: Aug 23, 2010, 2:45 AM

Posting Permissions