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

Extend bindings modeling #69

Merged
merged 50 commits into from
Dec 18, 2023
Merged

Extend bindings modeling #69

merged 50 commits into from
Dec 18, 2023

Conversation

rvermeulen
Copy link

This extends the number of supported bindings and introduces a binding parser to deal with binding strings.

value: "{/root/name}"
});

var oInputWithLateBinding = this.byId("foo");

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused variable oInputWithLateBinding.
return Controller.extend("foo", {
onInit: function() {
// Early property binding
var oInputWithEarlyPropertyBinding = new sap.m.Input({

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused variable oInputWithEarlyPropertyBinding.

// Early dynamic property binding
const model = "model";
var oInputWithEarlyDynamicPropertyBinding = new sap.m.Input({

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused variable oInputWithEarlyDynamicPropertyBinding.
oInput.bindProperty("value", "name");

// Early composite binding
var oInputWithEarlyContextBinding = new sap.m.Input({

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused variable oInputWithEarlyContextBinding.
});

// Early property metadata binding
var oLabel = new sap.m.Label({

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused variable oLabel.
Copy link
Contributor

@jeongsoolee09 jeongsoolee09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another fantastic huge improvement and I learned a lot reading through this PR. Added more docstrings for documentation and to check if we are on the same page.

@rvermeulen rvermeulen marked this pull request as ready for review December 7, 2023 16:34
We substitute the value with the object because that combined with the
key represents which property of the object gets bounded.
The object represents a better binding target since we don't represents
Json object members and the value is the binding itself.
Copy link
Contributor

@jeongsoolee09 jeongsoolee09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one additional comment

@jeongsoolee09
Copy link
Contributor

jeongsoolee09 commented Dec 18, 2023

One more addition please: Since views can be declared in JS code as well (example), can you cover this as well? Maybe like:

private newtype TBindingTarget =
    ...
} or
TJsonPropertyBindingTarget(JsonObject target, string key, Binding binding) {
  binding = TJsonPropertyBinding(target, key, _)
} or
TJsViewBindingTarget(/* TBD */) {
   /* TBD */
}

@jeongsoolee09
Copy link
Contributor

No need to do this now; works great on my branch. TY!

@jeongsoolee09 jeongsoolee09 self-requested a review December 18, 2023 20:08
Copy link
Contributor

@jeongsoolee09 jeongsoolee09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants