diff --git a/taipy/gui/_renderers/builder.py b/taipy/gui/_renderers/builder.py index b877ef5d03..179523d86c 100644 --- a/taipy/gui/_renderers/builder.py +++ b/taipy/gui/_renderers/builder.py @@ -663,8 +663,8 @@ def _set_chart_selected(self, max=0): sel = [] def _get_list_attribute(self, name: str, list_type: PropertyType): - varname = self.__hashes.get(name) - if varname is None: + hash_name = self.__hashes.get(name) + if hash_name is None: list_val = self.__attributes.get(name) if isinstance(list_val, str): list_val = list(list_val.split(";")) @@ -680,7 +680,8 @@ def _get_list_attribute(self, name: str, list_type: PropertyType): list_val = [] self.__set_react_attribute(_to_camel_case(name), list_val) else: - self.__set_react_attribute(_to_camel_case(name), varname) + self.__set_react_attribute(_to_camel_case(name), hash_name) + self.__update_vars.append(f"{_to_camel_case(name)}={hash_name}") return self def __set_class_names(self): diff --git a/taipy/gui/_renderers/factory.py b/taipy/gui/_renderers/factory.py index 44848ab0a2..7f18437fd2 100644 --- a/taipy/gui/_renderers/factory.py +++ b/taipy/gui/_renderers/factory.py @@ -502,6 +502,7 @@ class _Factory: ) .set_value_and_default(with_default=False, var_type=PropertyType.data) ._get_dataframe_attributes() + ._get_list_attribute("selected", PropertyType.number) .set_attributes( [ ("page_size", PropertyType.number, "100"), @@ -524,7 +525,6 @@ class _Factory: ] ) ._set_propagate() - ._get_list_attribute("selected", PropertyType.number) ._set_table_pagesize_options(), "text": lambda gui, control_type, attrs: _Builder( gui=gui, diff --git a/taipy/gui/viselements.json b/taipy/gui/viselements.json index d1fdd1ffce..a8a3f69793 100644 --- a/taipy/gui/viselements.json +++ b/taipy/gui/viselements.json @@ -689,7 +689,7 @@ }, { "name": "selected", - "type": "list[int]|str", + "type": "dynamic(list[int]|str)", "doc": "The list of the indices of the rows to be displayed as selected." }, {