-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[FEATURE] sap.m.MessageToast: add controls as toast content #1363
Conversation
Hm, strange... but from a legal perspective it's ok to just write here that you agree to the contributor license agreement. A bit old-fashioned, I know, but that's what we did initially. :-) |
Thanks Andreas. In that case, I hereby declare my agreement with the contributor license agreement (copied below)
|
} | ||
|
||
// group content into a single container control so the popup instance key can be added later | ||
oContentContainer = new sap.m.FlexBox({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all used modules need to be imported using a require/declare statement. Is FlexBox needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
What this is trying to achieve:
I was trying to find a way to link the 'child' controls (those in the content parameter of MessageToast.show) of the toast to the reference of the toast's popup, for use by MessageToast.close. This 'link' enables us to close the correct MessageToast popup instance in response to an event of one of the controls within the toast. -
Why FlexBox helps achive this:
The FlexBox solution provides a single container to store the reference to the popup as a custom data property. I felt this was the most simple approach I could come up with. Open to ideas though, I don't like having to use a different control just for this but I'm unaware of how else to achieve the link from content to popup.
all used modules need to be imported using a require/declare statement - would that be jQuery.sap.require?
Thanks in advance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would that be jQuery.sap.require?
It depends... for modules that are always needed or "usually anyway loaded" it would be another entry at the very top of the file in the sap.ui.define arguments list.
For heavyweight stuff that is usually not needed and also not typically used by other modules, it would rather be a lazy require. Could be done synchronously with jQuery.sap.require (but we are getting rid of all sync stuff) or sap.ui.require if possibly async.
But for the moment I'd suggest to first get general feedback before tweaking single issues.
Regards
Andreas
Thanks! But the control owners need to review and also accept the general direction... |
CLA has been successfully signed with cla-assistant, but the status check doesn't seem to be working. I've opened cla-assistant/cla-assistant#200. Update: Status is green now (commit was done by another user how needed to sign. So no issue with cla-assistant itself) |
- Many front end design frameworks provide MessageToast-like popups with which the user can interact. Most common example along the lines of a message "something just happened" with a button to undo the 'something' - sap.m.MessageToast could previously not do this - This feature enables the developer to display in a MessageToast one or more of sap.ui.core.Control to provide this functionality.
Hi @stu-b-doo, Thank you for your feature suggestion and the investment in the pull request! Best Regards, |
Many front end design frameworks provide MessageToast-like popups with which the user can interact.
Most common example along the lines of a message "something just happened" with a button to undo the 'something'
sap.m.MessageToast could previously not do this
This feature enables the developer to display in a MessageToast one or more of sap.ui.core.Control to provide this functionality.