I checked out the bug/presentationmodel branch, rebuilt royale-asjs, and then built and ran a release build of TourDeJewel. I am seeing the correct console.log() output, and I'm not getting any runtime exceptions.
Tried building with both the normal SDK and with Maven. Same result. Both good. -- Josh Tynjala Bowler Hat LLC <https://bowlerhat.dev> On Thu, Sep 3, 2020 at 2:27 AM Carlos Rovira <[email protected]> wrote: > Hi Josh, > > it seems that my latest changes to solve the problem is making no behaving > as before. > So I created a branch to get the fail again. > > You can checkout the branch: "bug/presentationmodel" to reproduce the > problem. > You'll see how debug works, but release fails. > > The changes done in the branch are 2: > > 1.- In "IDataGridColumnList" remove again interface " > IListWithPresentationModel" > 2.- change the use in DataGridView to avoid using "beadsAdded": > > (_listArea as IParent).addElement(list as IChild); > > var pm:DataGridColumnListPresentationModel = list.getBeadByType( > IListPresentationModel) as DataGridColumnListPresentationModel; > var zzz:Object = list.getBeadByType(IListPresentationModel); > COMPILE::JS { > console.log(zzz, zzz as DataGridColumnListPresentationModel); > } > pm.rowHeight = _presentationModel.rowHeight; > pm.variableRowHeight = false; > pm.align = list.columnInfo.align; > > columnLists.push(list); > > js code created for DataGridView is: > > this.org_apache_royale_jewel_beads_views_DataGridView__listArea.addElement > (list); > var /** @type {Object} */ pm = list.getBeadByType(org.apache.royale.jewel. > supportClasses.list.IListPresentationModel); > var /** @type {Object} */ zzz = list.getBeadByType(org.apache.royale.jewel. > supportClasses.list.IListPresentationModel); > console.log(zzz, zzz); > pm.rowHeight = this. > org_apache_royale_jewel_beads_views_DataGridView__presentationModel. > rowHeight; > pm.variableRowHeight = false; > pm.align = list.columnInfo.align; > this.columnLists.push(list); > > a) In DEBUG mode I get the logs of zzz, zzz right with the instances > > org.apache.royale.jewel.beads.models.DataGridColumnListPresentationModel > {disposed_: > false, onDisposeCallbacks_: undefined, eventTargetListeners_: > g…g.e…s.ListenerMap, actualEventTarget_: > org.a…e.r…e.j…l.b…s.m…s.DataGridColumnListPresentationModel, > parentEventTarget_: null, …} > org.apache.royale.jewel.beads.models.DataGridColumnListPresentationModel > {disposed_: > false, onDisposeCallbacks_: undefined, eventTargetListeners_: > g…g.e…s.ListenerMap, actualEventTarget_: > org.a…e.r…e.j…l.b…s.m…s.DataGridColumnListPresentationModel, > parentEventTarget_: null, …} > , > org.apache.royale.jewel.beads.models.DataGridColumnListPresentationModel > {disposed_: > false, onDisposeCallbacks_: undefined, eventTargetListeners_: > g…g.e…s.ListenerMap, actualEventTarget_: > org.a…e.r…e.j…l.b…s.m…s.DataGridColumnListPresentationModel, > parentEventTarget_: null, …} > org.apache.royale.jewel.beads.models.DataGridColumnListPresentationModel > {disposed_: > false, onDisposeCallbacks_: undefined, eventTargetListeners_: > g…g.e…s.ListenerMap, actualEventTarget_: > org.a…e.r…e.j…l.b…s.m…s.DataGridColumnListPresentationModel, > parentEventTarget_: null, …} > > b) In RELEASE it fails with this error: > > DataGridView.as:244 null null > DataGridView.as:246 Uncaught TypeError: Cannot set property 'rowHeight' of > null > at yo (DataGridView.as:246) > at wo.G.m (DataGridView.as:134) > at ul.G.addBead (ElementWrapper.as:270) > at ul.Yk.addBead (HTMLElementWrapper.js:43) > at ul.G.addBead (UIBase.js:372) > at cl (loadBeadFromValuesManager.js:41) > at ul.G.loadBeads (UIBase.as:1415) > at ul.G.addedToParent (UIBase.as:1398) > at ul.G.addedToParent (GroupBase.js:58) > at ul.tl.addedToParent (Group.js:67) > > > El mié., 2 sept. 2020 a las 21:16, Josh Tynjala (< > [email protected]>) > escribió: > > > I don't think that this code is compiled incorrectly. I think that we > > haven't found the proper code to reproduce your original issue. As best I > > can tell, the list.presentationModel getter is where the > > IListPresentationModel is created, so returning null is the correct > > behavior for getBeadByType() in this particular code. Clearly, this is > not > > the right way to reproduce the issue that you described (which involved > the > > release build not behaving the same as the debug build), so I need your > > help to find out how to reproduce it. > > > > -- > > Josh Tynjala > > Bowler Hat LLC <https://bowlerhat.dev> > > > > > > On Wed, Sep 2, 2020 at 12:01 PM Carlos Rovira <[email protected]> > > wrote: > > > > > Hi Josh, > > > > > > If I change that function to this code: > > > > > > /** > > > * @private > > > */ > > > protected function > configureColumnListPresentationModel(event:Event):void > > > { > > > var list:IDataGridColumnList = event.target as IDataGridColumnList; > > > var zzz:Object = (list as > IStrand).getBeadByType(IListPresentationModel); > > > COMPILE::JS { > > > console.log(zzz, zzz as DataGridColumnListPresentationModel); > > > } > > > //var pm:DataGridColumnListPresentationModel = > > > list.getBeadByType(IListPresentationModel) as > > > DataGridColumnListPresentationModel; --> this line doesn't work > > > var pm:DataGridColumnListPresentationModel = list.presentationModel as > > > DataGridColumnListPresentationModel; > > > pm.rowHeight = _presentationModel.rowHeight; > > > pm.variableRowHeight = false; > > > pm.align = list.columnInfo.align; > > > } > > > > > > I get null, null too > > > > > > I think it's ok with the current problem, instead of getting the IBead, > > we > > > are getting null, so I guess something is compiling wrongly > > > > > > The compiled code I get is this: > > > > > > /** > > > * @asprivate > > > * @protected > > > * @param {org.apache.royale.events.Event} event > > > */ > > > org.apache.royale.jewel.beads.views.DataGridView.prototype. > > > configureColumnListPresentationModel = function(event) { > > > var /** @type > > > {org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumnList} > */ > > > list = org.apache.royale.utils.Language.as(event.target, > > > org.apache.royale. > > > jewel.supportClasses.datagrid.IDataGridColumnList); > > > var /** @type {Object} */ zzz = org.apache.royale.utils.Language.as > > (list, > > > org.apache.royale.core.IStrand).getBeadByType(org.apache.royale.jewel. > > > supportClasses.list.IListPresentationModel); > > > console.log(zzz, org.apache.royale.utils.Language.as(zzz, > > > org.apache.royale. > > > jewel.beads.models.DataGridColumnListPresentationModel)); > > > var /** @type > > > > > > {org.apache.royale.jewel.beads.models.DataGridColumnListPresentationModel} > > > */ pm = org.apache.royale.utils.Language.as(list.presentationModel, > org. > > > apache.royale.jewel.beads.models.DataGridColumnListPresentationModel); > > > pm.rowHeight = this. > > > org_apache_royale_jewel_beads_views_DataGridView__presentationModel. > > > rowHeight; > > > pm.variableRowHeight = false; > > > pm.align = list.columnInfo.align; > > > }; > > > > > > > > > El mié., 2 sept. 2020 a las 19:44, Josh Tynjala (< > > > [email protected]>) > > > escribió: > > > > > > > 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 > > > > >> > > > > > > > > > > > > > > > > > > -- > > > Carlos Rovira > > > http://about.me/carlosrovira > > > > > > > > -- > Carlos Rovira > http://about.me/carlosrovira >
