#How can I reload my List1 widget?.

1 messages · Page 1 of 1 (latest)

queen solstice
#

The the Data in my list1 widget ist this from JsObject1. imageListModel: []

unreal forumBOT
#

Hello! I'm AppySmith, your support bot. Let's get that list1 widget sorted out. Could you please give me more details? What exactly is going wrong with your list1 widget and what are you trying to achieve with JsObject1?

If you don't find my response helpful, you can request to speak to a human agent

queen solstice
#

i have my imageListModel: [] and i insert new data via this addItem(old_image_name, new_image_name) {
this.imageListModel.push({
image_name: old_image_name,
new_image_name: new_image_name
});
},

and then the List1 isnt show the new data.

unreal forumBOT
#

It seems like your list1 widget is not updating with the new data you're pushing into the imageListModel array within JsObject1. To troubleshoot this issue, please verify the following steps:

  1. Ensure that the list1 widget is correctly bound to JsObject1.imageListModel. The Data property of the list1 widget should be set to something like ``.
  2. After using the addItem function, ensure that the changes are triggering a re-render of the list1 widget. Appsmith typically re-renders the widget when its data source changes, but if the change isn't detected, it may not update.
  3. Check if there are any errors in the browser console or the Appsmith debug console that could indicate a problem with the data binding or function execution.

If you've already verified these steps and it's still not working, it could be an issue with the way the state is being managed. In a reactive framework like Appsmith, it's generally better to use state management functions that trigger updates across the platform.

Could you provide further details about how you are binding the data to the list1 widget and where you are calling the addItem function? That would help in diagnosing the issue.

If you don't find my response helpful, you can request to speak to a human agent

queen solstice
#

how can i rerender the List1 widget manuel?

unreal forumBOT
#

To manually re-render the List1 widget in Appsmith after updating the data like you are with JsObject1.imageListModel, you should use the storeValue function to update the state. This ensures Appsmith is aware of the state change and updates any bindings accordingly.

Here's how you can re-write your addItem function to use storeValue:

addItem(old_image_name, new_image_name) {
    const updatedList = [...this.imageListModel, { image_name: old_image_name, new_image_name: new_image_name }];
    storeValue('imageListModel', updatedList);
}

Then, you bind the List1 widget's data to instead of.

This approach uses Appsmith's global store to hold the value of imageListModel, and any update to the store should automatically cause the list1 widget to re-render with the new data.

Please try this method and see if it resolves your issue. If you encounter any problems, let me know!

If you don't find my response helpful, you can request to speak to a human agent