on 07-28-2020 11:43 PM
hello experts
in my project i have a table binded to json model.
my table has a column that contains a button that shows a fragment.
i need to bind the row data to the fragment.
this is my fragment.xml :
<ResponsivePopover title="{i18n>DesignDescr}">
<content>
<richtexteditor:RichTextEditor id="RichDescription" value="{oJSONModel>/Description}"/>
</content>
</ResponsivePopover>
this is my controller
onRichText: function (oEvent) {
var oButton = oEvent.getSource();
var sPathToBind;
if (!this._oPopover) {
this._oPopover = sap.ui.xmlfragment("fragmentId", "Table.view.RichText", this);
sPathToBind = oEvent.getSource().getBindingContext("oJSONModel").getPath();
this._oPopover.bindElement(sPathToBind);
this.getView().addDependent(this._oPopover);
this._oPopover.openBy(oButton);
} else {
sPathToBind = oEvent.getSource().getBindingContext("oModelMNA").getPath();
this._oPopover.bindElement(sPathToBind);
this.getView().addDependent(this._oPopover);
this._oPopover.openBy(oButton);
}
this is the result
i need to show tha value that exsists in the input , in the rich text area
when i debug the sPathToBind is getting values like this "/0" which is the row of the table.
how can i bind data please ?
Best regards
Stay safe
Hi abdallah,
I think you need to modify you setBindingContext statement to:
this._oPopover.setBindingContext(oContext, "oJSONModel");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this.getView().addDependent(this._oPopover);
this._oPopover.setBindingContext(oEvent.getSource().getBindingContext("oModelMNA"));
<ResponsivePopover title="{i18n>DesignDescr}"><content><richtexteditor:RichTextEditor id="RichDescription" value="{oJSONModel>Description}"/></content></ResponsivePopover>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank for your response
theses are the modifications that i did :
controller :
if (!this._oPopover) {
this._oPopover = sap.ui.xmlfragment("fragmentId", "smartTable.SmartTable.view.RichText", this);
this.getView().addDependent(this._oPopover);
sPathToBind = oEvent.getSource().getBindingContext("oJSONModel").getPath();
sap.ui.core.Fragment.byId("fragmentId","RichDescription").bindElement(sPathToBind);
this._oPopover.openBy(oButton);
} else {
this.getView().addDependent(this._oPopover);
sPathToBind = oEvent.getSource().getBindingContext("oJSONModel").getPath();
this._oPopover.bindElement(sPathToBind);
this._oPopover.openBy(oButton);
}
fragment :
<ResponsivePopover title="{i18n>DesignDescr}">
<content>
<richtexteditor:RichTextEditor id="RichDescription" value="{oJSONModel>Description}"/>
</content>
</ResponsivePopover>
but it still not working
data is not showing in the richtext editor
thank youu
hello
it is still not working
here is the code
onRichText: function (oEvent) {
var oButton = oEvent.getSource();
if (!this._oPopover) {
this._oPopover = sap.ui.xmlfragment("fragmentId", "smartTable.SmartTable.view.RichText", this);
this.getView().addDependent(this._oPopover);
var oContext = oEvent.getSource().getBindingContext("oJSONModel");
this._oPopover.setBindingContext(oContext);
}
this._oPopover.openBy(oButton);
},
thank youu
Hi ,
Did you found solution on this ? I'm facing same issue that I'm unable to bind table record to the fragment .
If you have resolve this issue please share the solution .
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.