You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2020/06/22 09:32:22 UTC

[GitHub] [royale-asjs] pashminakazi opened a new issue #871: Uncaught TypeError: Cannot read property 'toString' of null (HelloWorld.js:106)

pashminakazi opened a new issue #871:
URL: https://github.com/apache/royale-asjs/issues/871


   Select Date and click save button then validateFormOnServer function will be called.In that function we are doing
   ```
   var date1:String = cc_AthrzDate.value.toString();
   var date2:String = cc_CanclDate.value.toString();
   ```
   cc_AthrzDate is mx:DateField.
   cc_AthrzDate.value.toString(); is throwing exception because **cc_AthrzDate.value** is null
   
   Please check this example
   ![image](https://user-images.githubusercontent.com/42200979/85272082-21e4f000-b495-11ea-9409-c6fd0df6363f.png)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] aharui commented on issue #871: Uncaught TypeError: Cannot read property 'toString' of null (HelloWorld.js:106)

Posted by GitBox <gi...@apache.org>.
aharui commented on issue #871:
URL: https://github.com/apache/royale-asjs/issues/871#issuecomment-647584929


   Is the value property implemented on DateField?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] pashminakazi commented on issue #871: Uncaught TypeError: Cannot read property 'toString' of null (HelloWorld.js:106)

Posted by GitBox <gi...@apache.org>.
pashminakazi commented on issue #871:
URL: https://github.com/apache/royale-asjs/issues/871#issuecomment-647636632


   In Flex comboBase is implementing get value like :
   ```
   public function get value():Object
       {
           if (_editable)
               return text;
   
           var item:Object = selectedItem;
   
           if (item == null || typeof(item) != "object")
               return item;
   
           // Note: the explicit comparison with null is important, because otherwise when
           // the data is zero, the label will be returned.  See bug 183294 for an example.
           return item.data != null ? item.data : item.label;
       }
   ```
   
   _editable is used in get value but get and set editable is not implemented in Royale,Here's the code for get and set editable in Flex
   ```
   private var _editable:Boolean = false;
   
       /**
        *  @private
        */
       mx_internal var editableChanged:Boolean = true;
   
       [Bindable("editableChanged")]
       [Inspectable(category="General", defaultValue="false")]
   public function get editable():Boolean
       {
           return _editable;
       }
   
       /**
        *  @private
        */
       public function set editable(value:Boolean):void
       {
           _editable = value;
           editableChanged = true;
   
           invalidateProperties();
   
           dispatchEvent(new Event("editableChanged"));
       }
   ```
   
   This is using invalidateProperties() which is UIComponent property and not implemented in UIComponent


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] aharui commented on issue #871: Uncaught TypeError: Cannot read property 'toString' of null (HelloWorld.js:106)

Posted by GitBox <gi...@apache.org>.
aharui commented on issue #871:
URL: https://github.com/apache/royale-asjs/issues/871#issuecomment-653385210


   What does the simple test case look like?  Maybe the `value` is getting read before the `selectedDate` is set.  Or maybe your code is just setting the `text` property at startup and not the `selectedDate` property.  The current mx:DateField emulation does not currently parse the `text` property.
   
   Debug into the DateField and see what the various properties are.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] pashminakazi commented on issue #871: Uncaught TypeError: Cannot read property 'toString' of null (HelloWorld.js:106)

Posted by GitBox <gi...@apache.org>.
pashminakazi commented on issue #871:
URL: https://github.com/apache/royale-asjs/issues/871#issuecomment-653152344


   I override value getter and return selectedDate,now value is not null but value is now undefined for
   var date1:String = cc_AthrzDate.value.toString();
   var date2:String = cc_CanclDate.value.toString();
   
   Please check this setup
   
   Project Details are :
   https://paste.apache.org/cpo8y
   Test case is available on VDI.
   Go to sales from Select in Menu
   Go to Carriage/Freight -> Contractor from Setups in Menu
   File : com/dbz/modules/INV/dbzCarriageContractorSetup.mxml
   
   Click on New button by default there is some date selected for cc_AthrzDate and cc_CanclDate,these both are MaskedDateField
   when i type code and name which is compulsory to enter and i click save button the exception thrown : 
   ![image](https://user-images.githubusercontent.com/42200979/86395139-33aa6c80-bcb9-11ea-9648-6acd2840ae4d.png)
   
   when i re-select the date and click save button then this exception go away
   
   when i re-selectiing date and click save button,i setted breakpoint to check the value
   ![image](https://user-images.githubusercontent.com/42200979/86395264-68b6bf00-bcb9-11ea-9c8d-1546db89dcee.png)
   
   So why the value for date is undefined for the first time although it is already selected by default.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] pashminakazi commented on issue #871: Uncaught TypeError: Cannot read property 'toString' of null (HelloWorld.js:106)

Posted by GitBox <gi...@apache.org>.
pashminakazi commented on issue #871:
URL: https://github.com/apache/royale-asjs/issues/871#issuecomment-647625443


   mx:DateField is extends ComboBase which has a property **value**
   ```
   public function get value():Object
   {
        return null;	
   }
   ```
   it is returning null value


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] aharui commented on issue #871: Uncaught TypeError: Cannot read property 'toString' of null (HelloWorld.js:106)

Posted by GitBox <gi...@apache.org>.
aharui commented on issue #871:
URL: https://github.com/apache/royale-asjs/issues/871#issuecomment-647629119


   Try implementing the value property in DateField.  You can check the Flex code to see what it returns.  It probably returns selectedDate.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] aharui commented on issue #871: Uncaught TypeError: Cannot read property 'toString' of null (HelloWorld.js:106)

Posted by GitBox <gi...@apache.org>.
aharui commented on issue #871:
URL: https://github.com/apache/royale-asjs/issues/871#issuecomment-647643270


   I would not worry about ComboBase/ComboBox.  I would see what DateField does or should do.  If it does nothing, then is DateField's selectedItem going to return selectedDate?  It might be simpler to just override the value getter in DateField and have it return selectedDate.  The main goal of emulation is to return the right value and less to try to get all of old Flex SDK code to run.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] aharui commented on issue #871: Uncaught TypeError: Cannot read property 'toString' of null (HelloWorld.js:106)

Posted by GitBox <gi...@apache.org>.
aharui commented on issue #871:
URL: https://github.com/apache/royale-asjs/issues/871#issuecomment-653154595


   That's your custom code so you will have to debug it and determine the problem.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [royale-asjs] pashminakazi commented on issue #871: Uncaught TypeError: Cannot read property 'toString' of null (HelloWorld.js:106)

Posted by GitBox <gi...@apache.org>.
pashminakazi commented on issue #871:
URL: https://github.com/apache/royale-asjs/issues/871#issuecomment-653159626


   This problem is also occurred with simple mx:Datefield,can u please tell
   me,which property is used for selecting Date by default in mx:DateField
   because in simple test case when i click save button this exception thrown
   that value is undefined for mx:Datefield
   but in that case there is no date selected by default but in my application
   date is already selected by default and i have to reselect it
   
   which property should i use for mx:Datefield to select any date by default
   so i can check this issue on mx:Datefield
   
   On Thu, Jul 2, 2020 at 11:18 PM aharui <no...@github.com> wrote:
   
   > That's your custom code so you will have to debug it and determine the
   > problem.
   >
   > —
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/royale-asjs/issues/871#issuecomment-653154595>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AKB67E3D7CSYCFIYAEMG5F3RZTFQ7ANCNFSM4OEM2D2Q>
   > .
   >
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org