Re: [flexcoders] Re: Cannot access a property or method of a null object reference at mx.controls::Tree/::buildUpCollectionEvents()

2008-07-02 Thread Josh McDonald
You're right :)

But still no exception, it works fine under HF1 and HF3.

-Josh

On Thu, Jul 3, 2008 at 2:51 AM, Sergey Kovalyov <
[EMAIL PROTECTED]> wrote:

>  May be so. But I want to find relevant workaround. Unfortunately, I have
> no possibility to switch the platform.
>
> On Tue, Jul 1, 2008 at 4:08 PM, valdhor <[EMAIL PROTECTED]> wrote:
>
>>   I don't use Flex 2.0.1 (I use Flex 3).
>>
>> I ran your app in Flex 3 and it works fine - ie. no exception is thrown.
>>
>> Could this be a bug in Flex 2.0.1?
>> .
>>
>>
> 
>



-- 
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]


Re: [flexcoders] Re: Cannot access a property or method of a null object reference at mx.controls::Tree/::buildUpCollectionEvents()

2008-07-02 Thread Sergey Kovalyov
May be so. But I want to find relevant workaround. Unfortunately, I have no
possibility to switch the platform.

On Tue, Jul 1, 2008 at 4:08 PM, valdhor <[EMAIL PROTECTED]> wrote:

>   I don't use Flex 2.0.1 (I use Flex 3).
>
> I ran your app in Flex 3 and it works fine - ie. no exception is thrown.
>
> Could this be a bug in Flex 2.0.1?
> .
>
> 
>


Re: [flexcoders] Re: Cannot access a property or method of a null object reference at mx.controls::Tree/::buildUpCollectionEvents()

2008-07-02 Thread Sergey Kovalyov
Probably, you have not selected the first item before clicking on a button.
That's why new item has not been added. See this:

var parentXML : XML = XML(tree.selectedItem);
var newItemXML : XML = ;
tree.dataDescriptor.addChildAt(parentXML, newItemXML, parentXML.length());

On Wed, Jul 2, 2008 at 2:50 AM, Josh McDonald <[EMAIL PROTECTED]> wrote:

>   I'm not getting an exception, tried in 2.0.1HF1 and HF3. I'm not getting
> any change on screen though.
>
> On Tue, Jul 1, 2008 at 11:08 PM, valdhor <[EMAIL PROTECTED]> wrote:
>
>> I don't use Flex 2.0.1 (I use Flex 3).
>>
>> I ran your app in Flex 3 and it works fine  - ie. no exception is thrown.
>>
>> Could this be a bug in Flex 2.0.1?
>>
>>
> --
> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
>
> :: Josh 'G-Funk' McDonald
> :: 0437 221 380 :: [EMAIL PROTECTED]
>
> 
>


Re: [flexcoders] Re: Cannot access a property or method of a null object reference at mx.controls::Tree/::buildUpCollectionEvents()

2008-07-01 Thread Josh McDonald
I'm not getting an exception, tried in 2.0.1HF1 and HF3. I'm not getting any
change on screen though.

On Tue, Jul 1, 2008 at 11:08 PM, valdhor <[EMAIL PROTECTED]> wrote:

> I don't use Flex 2.0.1 (I use Flex 3).
>
> I ran your app in Flex 3 and it works fine  - ie. no exception is thrown.
>
> Could this be a bug in Flex 2.0.1?
>
>
-- 
"Therefore, send not to know For whom the bell tolls. It tolls for thee."

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]


Re: [flexcoders] Re: Cannot access a property or method of a null object reference?

2008-06-09 Thread Michael Schmalle
Is the gateway property defined?

Other than that... from the code you have shown, I don't have a clue. ;-)

Mike

On Mon, Jun 9, 2008 at 9:39 AM, xaero <[EMAIL PROTECTED]> wrote:

>   I add an Alert.show, and delete the CALL function, like this:
>
>
> var atClass:Object = new Object();
> atClass.atcls = ComboBox(event.target).selectedItem.data;
> Alert.show(atClass["atcls"],"ALERT");
> //gateway.call("cys.getStudents", new Responder(onResult, onFault),
> atClass); //line 51
>
> It can show the data of the item I selected!
>
> --- In flexcoders@yahoogroups.com , "Michael
> Schmalle"
> <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > From the look if it
> >
> > ;ComboBox(event.target).selectedItem
> >
> > seems to be where the null pointer is. Make sure you actually have a
> > selectedItem in the list.
> >
> > I have actually done this myself when testing and actually forgot to
> > 'select' an item before a service call.
> >
> > Mike
> >
>
>  
>



-- 
Teoti Graphix, LLC
http://www.teotigraphix.com

Teoti Graphix Blog
http://www.blog.teotigraphix.com

You can find more by solving the problem then by 'asking the question'.


RE: [flexcoders] Re: Cannot access a property or method of a null object reference

2007-02-19 Thread Steve Cox
If (dataProvider[i].hasOwnProperty("someValue") &&
dataProvider[i].someValue != null)
{
 
}
 
HTH
Steve
 
-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Nate Pearson
Sent: 17 February 2007 00:48
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Cannot access a property or method of a null
object reference
 
Does anyone know? This would help me immensely. 

--- In [EMAIL PROTECTED] 
ups.com, "napearson99" <[EMAIL PROTECTED]> wrote:
>
> What if the property.someValue does not exist? How do I check if the
> reference to dataprovider[i].someValue property is null?
> 
> my dataprovider is an arraycollection and holds different objects. 
> Some objects have .someValue property and some do not. When i try to
> step through it it doesn't like it when it expects a property but it
> is not there.
> 
> "ReferenceError: Error #1069: Property Desc not found on
> DragDrop_inlineComponent1 and there is no default value."
> 
> --- In [EMAIL PROTECTED] 
ups.com, "Paul DeCoursey"  wrote:
> >
> > if (dataprovider[i].someValue == null){
> > ...
> > }
> > 
> > --- In [EMAIL PROTECTED] 
ups.com, "napearson99"  wrote:
> > >
> > > I often get this error and I "usually" know why. Does anyone
know how
> > > to check for a null reference?
> > > 
> > > i.e.
> > > 
> > > if (dataprovider[i].someValue is null){
> > > dothis();
> > > }
> > > 
> > > Where dataprovider[i] does not have a someValue property. I bet
this
> > > is pretty simple and I just don't know the syntax. Thanks in
advance!
> > >
> >
>
 


RE: [flexcoders] Re: Cannot access a property or method of a null object reference

2007-02-16 Thread Gordon Smith
> Some objects have .someValue property and some do not. 
 
It sounds like the objects in your dataProvider are instances of various
non-dynamic classes, where some of the classes declare a someValue
property and others don't. 
 
Is this correct? If so, you don't ant to write code like
 
   if (dataProvider[i].someValue == null)
 
because you get a ReferenceError if you access a nonexistend property of
a non-dynamic class. You should only write this if your dataProvider
objects are dynamic.
 
Instead, try
 
   if (dataProvider[i].hasOwnProperty("someValue"))
 
- Gordon



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Nate Pearson
Sent: Friday, February 16, 2007 4:48 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Cannot access a property or method of a null
object reference



Does anyone know? This would help me immensely. 

--- In flexcoders@yahoogroups.com 
, "napearson99" <[EMAIL PROTECTED]> wrote:
>
> What if the property.someValue does not exist? How do I check if the
> reference to dataprovider[i].someValue property is null?
> 
> my dataprovider is an arraycollection and holds different objects. 
> Some objects have .someValue property and some do not. When i try to
> step through it it doesn't like it when it expects a property but it
> is not there.
> 
> "ReferenceError: Error #1069: Property Desc not found on
> DragDrop_inlineComponent1 and there is no default value."
> 
> --- In flexcoders@yahoogroups.com
 , "Paul DeCoursey"  wrote:
> >
> > if (dataprovider[i].someValue == null){
> > ...
> > }
> > 
> > --- In flexcoders@yahoogroups.com
 , "napearson99" 
wrote:
> > >
> > > I often get this error and I "usually" know why. Does anyone
know how
> > > to check for a null reference?
> > > 
> > > i.e.
> > > 
> > > if (dataprovider[i].someValue is null){
> > > dothis();
> > > }
> > > 
> > > Where dataprovider[i] does not have a someValue property. I bet
this
> > > is pretty simple and I just don't know the syntax. Thanks in
advance!
> > >
> >
>