Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binding readdata early attachment when possible. #30

Open
michaelelfial opened this issue May 26, 2020 · 2 comments
Open

Binding readdata early attachment when possible. #30

michaelelfial opened this issue May 26, 2020 · 2 comments
Assignees
Labels
enhancement request Request for a new feature or improvement of an existing one TO DO Task Well-defined Task

Comments

@michaelelfial
Copy link
Contributor

The problem

Unlike the writedata the readdata setting in bindings is more difficult to process. It consists of a list of event specifications to which the binding must attach and update its target when any of the specified occurs. The events can be specified in two ways:

  • event name e.g. click, $activatedevent

  • parent/child element address and event on it e.g. panel1/repeater1:$itemschangedevent or panel1/button1:click

The second syntax specifies the exact location and event to attach to without need of further calculations, but the first doesn't. It means attach to this event on the object from which source data is read. So, the object on which the event should be used is determined by two things together: the source or service setting and the path setting. This makes its calculation the same as the calculation need to really read the source and for this reason currently readdata events are attached during the first read from the source. This effectively means that this is occurring typically on the first updateTargets. In the overwhelming majority of cases this will be good enough, but if a readdata event points to an earlier sibling and event occurrence may be skipped, because the registration with that event will be late.

Solution

Obviously advising the late registrants for the last event occurrence (if any) is only a partial and even bad solution, not even possible for DOM events and forcing this behavior on classes that have no actual reason to enable it.

So, the solution I have in mind is a bit more complicated:

  1. Attach all events with parent/child keys early, just like in the writedata case (completely doable)

  2. If the binding has a single part path the source object is completely determined by the source setting and this makes finding it as simple as in the other case (with parent/child keys). So, analyse this and attach all events if this is the case.

  3. What remains is done like before (on first source read) with (possibly) an option to force early source calculation. The option can be used by the developer if he thinks the calculation is indeed possible while creating the bindings - a case we cannot determine safely enough automatically.

@michaelelfial michaelelfial added the TO DO Task Well-defined Task label May 26, 2020
@michaelelfial michaelelfial self-assigned this May 26, 2020
@michaelelfial michaelelfial added the enhancement request Request for a new feature or improvement of an existing one label Jun 17, 2021
@michaelelfial
Copy link
Contributor Author

When readdata is used with a service attachment may be impossible due to lack of linkage with the service provider. To deal with this problem a notification or other mechanism for retrial should be invoked when hierarchy changes. This issue will require (especially windows) hierarchical broadcasts in the leaves direction which can be used as an initiator for retrial. This problem may affect some other features, so the solution could become a separate issue (check the list)

@michaelelfial
Copy link
Contributor Author

Important

The flagging of still unsuccessful readdata attachments must be done for each event listed in readdata and not for the whole list like it is now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement request Request for a new feature or improvement of an existing one TO DO Task Well-defined Task
Projects
None yet
Development

No branches or pull requests

1 participant