I had a free moment to look into this, but I'm having trouble reproducing
the same behavior.

I added the following code inside
DataGridView.configureColumnListPresentationModel():

var zzz:Object = list.getBeadByType(IListPresentationModel);
COMPILE::JS {
    console.log(zzz, zzz as DataGridColumnListPresentationModel);
}

If I build and run TourDeJewel, it prints "null null" to the debug console.
There's no difference between debug and release builds, so I guess I'm
doing something wrong.

Can you put together some simple code that will reproduce the issue?

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>


On Wed, Sep 2, 2020 at 9:27 AM Josh Tynjala <[email protected]>
wrote:

> In a release build, what gets returned by
> getBeadByType(IListPresentationModel) if you don't cast it with "as
> DataGridColumnListPresentationModel"? Is it the correct object? Or is it
> also null?
>
> --
> Josh Tynjala
> Bowler Hat LLC <https://bowlerhat.dev>
>
>
> On Wed, Sep 2, 2020 at 6:43 AM Carlos Rovira <[email protected]>
> wrote:
>
>> Hi,
>>
>> I did some more testing and it's not a timing issue.
>> I refactored the PM code to "beadsAdded" since is the right place to
>> configure it (or was retrieved from the beads array or it's created from
>> scratch).
>> Trying to use the "getBeadByType" line fails the same way, so the problem
>> is clearly a compiler issue, from my point of view.
>>
>> El mié., 2 sept. 2020 a las 14:17, Carlos Rovira (<
>> [email protected]>)
>> escribió:
>>
>> > Hi,
>> >
>> > I just committed a fix to solve an issue Piotr was getting in DataGrid.
>> >
>> > The issue only can be seen in release mode, in debug works, so it seems
>> a
>> > compiler bug so hope others like Greg or Josh with more knowledge in
>> that
>> > field can see what could be wrong, or if maybe it is just some issue in
>> the
>> > code.
>> >
>> > Problem is in DataGridView line 239:
>> >
>> > // var pm:DataGridColumnListPresentationModel =
>> > list.getBeadByType(IListPresentationModel) as
>> > DataGridColumnListPresentationModel;
>> > var pm:DataGridColumnListPresentationModel = list.presentationModel as
>> > DataGridColumnListPresentationModel;
>> > Commented line does not work, I need to refactor to the next one.
>> >
>> > in the commit I added missed coercions and need to make
>> > IDataGridColumnList implement "IListWithPresentationModel" (what I think
>> > is ok since that is needed for all column lists.
>> >
>> > So the problem is: Why can't I retrieve the bead from the list?
>> >
>> > I'm thinking this could be a timing issue, since the list needs to be
>> > added to the parent to process the beads and be able to retrieve the
>> one.
>> > I'll try one more test now trying to put some time out after addElement.
>> >
>> >
>> >
>> > ---------- Forwarded message ---------
>> > De: Piotr Zarzycki <[email protected]>
>> > Date: mié., 2 sept. 2020 a las 12:48
>> > Subject: Re: NPE in DataGridView - release build of application
>> > To: Apache Royale Development <[email protected]>
>> >
>> >
>> > I have sent you.
>> >
>> > śr., 2 wrz 2020 o 12:41 Carlos Rovira <[email protected]>
>> > napisał(a):
>> >
>> > > cool :)
>> > > yeah send me :)
>> > >
>> >
>> > --
>> > Carlos Rovira
>> > http://about.me/carlosrovira
>> >
>> >
>> >
>> >
>>
>> --
>> Carlos Rovira
>> http://about.me/carlosrovira
>>
>

Reply via email to