Announcement
Collapse
No announcement yet.
X
-
In fact, that initial fetch is being caused by components redrawing. To fix it, just mark your components autoDraw: false, so they aren't cleared and redrawn when added to their parent. Note also that your initial sample code needs the components to be inside a layout in order for it to work at all.Last edited by Isomorphic; 5 Jul 2023, 01:15.
-
hi Claudio,
We've fixed the duplicate implicitCriteria issue for tomorrow's builds, dated July 6 and later.
Retesting your other comments (defaultToFirstOption/defaultValue and form.values not working initially) - we see all of these work as expected, although they *do* happen in a second fetch, after the initial one with a null value.
We're looking into preventing that initial fetch - the grid is implicitly bound to that formItem, and it has no value at creation time, when ruleScope binding first takes place.
We'll update here when we have more information about that.
Leave a comment:
-
We do see the duplicated criterion when fetching, and we're taking a look - we'll update here when we have more information on that and your other comments.
Leave a comment:
-
Hello, did you have a chance to look at the last little issue of the duplicated criterion?
Leave a comment:
-
SmartClient Version: v13.0p_2023-06-16/AllModules Development Only (built 2023-06-16)
Hello, I can confirm that I don't see javascript errors, and neither I see the warning, thanks.
So the test case is basically working.
The only thing I still see are a duplicated criterion in the criteria, ie:
Code:{ dataSource:"supplyItem", operationType:"fetch", componentId:"supplyList", data:{ operator:"and", criteria:[ { fieldName:"category", operator:"equals", valuePath:"aForm.values.category", value:"Pastes and Gum" }, { fieldName:"category", operator:"equals", valuePath:"aForm.values.category", value:"Pastes and Gum" } ] }, ...
Code:{ dataSource:"supplyItem", operationType:"fetch", componentId:"supplyList", data:{ operator:"and", criteria:[ { fieldName:"category", operator:"equals", valuePath:"aForm.values.category", value:null } ] }, ...
Also, is it normal that if I try selectItem.defaultToFirstOption:true, or form.values:{category:"Batteries"}, those are ignored for the first fetch?
Leave a comment:
-
hi claudiobosticco ;)
We've fixed the original crash you reported, which was caused by the ruleScope attempting to refreshData() before any data had been fetched - so you can get rid of the autoFetchData setting as of tomorrow's builds, dated June 16 and later.
Please retest and let us know if you still see that warning about pending fetches - we're not seeing it.
Leave a comment:
-
adding autoFetchData to the test case seems to do the trick, but:
1. I see this in the dev console (is it a problem?):
WARN:refreshData:supplyList:A fetch for this component is currently pending, please try again later.
Code:data:{ operator:"and", criteria:[ { fieldName:"category", operator:"equals", valuePath:"aForm.values.category", value:null } ] },
Also, I have attempted to add an initial value for the selectItem, both using form.values:{} and defaultToFirstOption. However, it does not seem to be used in the criteria for the initial fetch. On the other hand, if I use item.defaultValue, it is applied to the first fetch, which I think it's nice.
I am not sure if I am overcomplicating things, but to me, this appears to be nice usage of implicitCriteria, so I'm experimenting with different options.
ps: you're tagging another person who has my same name ;-)
Leave a comment:
-
hi claudio ,
In your test-case, you should see things start to work if you set autoFetchData: true on your grid (or otherwise fetch it), and then put your grid and form inside a mutual parent, like a Layout. Then changes to the formItem will filter the grid accordingly.
Leave a comment:
-
This is likely the same regression as noted in your other thread. We'll confirm and let you know when fixes hit builds.
Leave a comment:
-
I'd prefer to use the above pattern, but I've tried it after noticing that a usage similar to this:
https://forums.smartclient.com/forum...ed-by-treegrid
stopped to work in my application, after updating the SmartClient version.
Leave a comment:
-
I must say that I stumbled into this while trying to make a test case for another problem, where an implicit criteria seems to be ignored by a TreeGrid.
So, before trying to replicate it, I want to ask: is it supported setting a implicitCriteria on a TreeGrid?
Leave a comment:
-
error with grid.implicitCriteria which uses a valuePath
SmartClient Version: v13.0p_2023-06-12/AllModules Development Only (built 2023-06-12)
Chrome on OSX
Hello, please try this test case:
Code:isc.DynamicForm.create({ ID: "aForm", fields: [ { name: "category", optionDataSource: "supplyItem", displayField: "category", valueField: "category", editorType: "SelectItem" } ] }) isc.ListGrid.create({ ID: "supplyList", top: 100, width: 500, height: 300, alternateRecordStyles: true, implicitCriteria: { _constructor: "AdvancedCriteria", operator: "and", criteria: [ {fieldName: "category", operator: "equals", valuePath: "aForm.values.category"} ] }, dataSource: supplyItem, fields: [ {name: "SKU"}, {name: "itemName"}, {name: "description"}, {name: "category"} ], showFilterEditor: true, filterOnKeypress: true, fetchDelay: 500 });
Code:18:39:46.418:TMR2:WARN:Log:TypeError: Cannot read properties of undefined (reading 'fetchMode') Stack from error.stack: Canvas.refreshData(<no args: exited>) on[ListGrid ID:supplyList] @ ISC_Core.js:4894:183 _3.<anonymous>(<no args: exited>) on[ListGrid ID:supplyList] @ ISC_Grids.js:3429:40 _3.observation(<no args: exited>) on [FeatureExplorer ID:featureExplorer] @ ISC_Core.js:367:394 Canvas.fireRuleContextChanged(<no args: exited>) on [DynamicForm ID:aForm] @ ISC_Core.js:4302:1279 Canvas._provideRuleContext(<no args: exited>) on [DynamicForm ID:aForm] @ ISC_Core.js:4298:54 Canvas.provideRuleContext(<no args: exited>) on [DynamicForm ID:aForm] @ ISC_Core.js:4286:6 DynamicForm._delayedSetValues(<no args: exited>) on [DynamicForm ID:aForm] @ ISC_Forms.js:593:275 [c]Page.handleEvent(<no args: exited>) on [Class Page] @ ISC_Core.js:2178:72 EventHandler._handleIdle(<no args: exited>) on [Class EventHandler] @ ISC_Core.js:2631:769 [c]Class.fireCallback(_1=>Obj, _2=>null, _3=>null, _4=>null, _5=>true) on [Class Timer] @ ISC_Core.js:330:252 Timer._fireTimeout(_1=>"$ir142", _2=>157, _3=>undef) on [Class Timer] @ ISC_Core.js:2163:6 null.<anonymous>() @ ISC_Core.js:2159:40
Tags: None
Leave a comment: