Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
properties refresh (#897) (#958)
Browse files Browse the repository at this point in the history
* #897 properties refresh

* handle complex expressions

* format

---------

Co-authored-by: Fred Lefévère-Laoide <[email protected]>
  • Loading branch information
FredLL-Avaiga and Fred Lefévère-Laoide authored Oct 9, 2023
1 parent 49f3ec0 commit 4d51245
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/taipy/gui/_renderers/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ def __init__(
prop_dict = _getscopeattr(self.__gui, prop_hash)
if isinstance(prop_dict, (dict, _MapDict)):
# Iterate through prop_dict and append to self.attributes
var_name, _ = gui._get_real_var_name(prop_hash)
for k, v in prop_dict.items():
(val, key_hash) = _Builder.__parse_attribute_value(gui, v)
self.__attributes[k] = f"{{{prop_hash}['{k}']}}" if key_hash is None else v
self.__attributes[k] = (
f"{{None if ({var_name}) is None else ({var_name}).get('{k}')}}" if key_hash is None else v
)
else:
_warn(f"{self.__control_type}.properties ({prop_hash}) must be a dict.")

Expand Down

0 comments on commit 4d51245

Please sign in to comment.