EmptyData from a Model that is linked to a table produces: RangeError: Maximum call stack size exceeded

Defect/Issue Description:
Trying to emptyData (via JS or action) of a UI model that is linked to a table produces: ‘RangeError: Maximum call stack size exceeded’.

Also, the table has to be on not the first page.

Environment:

  • API Version: v2
  • Release: Boston
  • Release version: 13.0.17
  • Platform: Salesforce

Action Performed:

  1. Create UI Model (with 1 field)
  2. Create a table where the UI Model is the source
  3. Show 10 rows of data per page
  4. Add 11 rows of data to the model
  5. Go to 2nd page of the table
  6. emptyData() on the model via JS, or via an action.

Expected Result:
The data should be removed from the model and the table should display no data.

Actual Result
‘RangeError: Maximum call stack size exceeded’ produced in console.

Additional Resources:

<skuid__page unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true">
	<models>
		<model id="UIModel" limit="20" query="true" datasource="Ui-Only" createrowifnonefound="false">
			<fields>
				<field id="Test1" displaytype="TEXT" length="255"/>
			</fields>
			<conditions/>
			<actions/>
		</model>
	</models>
	<components>
		<skuid__table allowColumnFreezing="dragDrop" model="UIModel" uniqueid="sk-2WQk-4576" mode="read" pageSize="10">
			<fields>
				<field id="Test1" uniqueid="fi-2WQq-6928"/>
			</fields>
			<filtering enableSearch="false"/>
			<actions>
				<action type="multi" label="Add">
					<actions>
						<action type="createRow" model="UIModel" appendorprepend="prepend" defaultmodefornewitems="edit" affectedrows="all"/>
					</actions>
				</action>
				<action type="multi" label="Empty">
					<actions>
						<action type="emptyModelData">
							<models>
								<model>UIModel</model>
							</models>
						</action>
					</actions>
				</action>
			</actions>
			<rowActions/>
			<massActions/>
			<exportProperties useTableColumns="true"/>
			<sorting enable="false"/>
			<styles>
				<spacing/>
			</styles>
			<renderConditions logictype="and"/>
			<styleVariantConditions/>
		</skuid__table>
	</components>
	<resources>
		<labels/>
		<javascript/>
		<css/>
		<actionsequences/>
	</resources>
	<styles>
		<styleitem type="background" bgtype="none"/>
	</styles>
</skuid__page>

Best,
Lukas

1 Like

Thanks, @lukaspovilonis ! Sending this to the team now.

@lukaspovilonis just got word that the issue has been resolved in 13.0.24 (latest Boston patch)

As always, we recommend making a sandbox to try out the latest update and make sure all is well before deploying to prod. While you’re at it, you should check out the latest Chicago release!

Hi @JB3 ,

Thank you for the update, and I’m glad it’s working in future releases.

I found out that calling model.cancel() before model.abandonAllRows() worked as it model.cancel() reset the page to 1 on the table.

I am just wondering why is the table updating/resting the page to 1. Is the table getting re-rendered, is it just straight up setting the page index to 1. What is happening in the background?

Best,
Lukas

@lukaspovilonis, from the team:

In V2 tables look at the Display - Pagination property. There is a checkbox that controls whether pagination resets on model actions. It says “query” but it also controls behavior on cancel (Which resets the model to its original state - even though no query from the server is performed.

I see, thank you very much!

1 Like