Question

I tried to insert space between two controls inside MatrixLayoutCell in sapui5. However, it is giving and error. My code is :

var control = new sap.m.Input("id_mtr_kra_rating_val", {
        value : "Something",
        width:"70px"
        });

var control3= new sap.ui.core.HTML("htmlspace",{
        content:" "
        });

var control2 = new sap.m.Label("percentlabel",{
    text:"labelText"
    });

var cell= new sap.ui.commons.layout.MatrixLayoutCell("idcellmtr",{
           content:[control1,control2,control3]
            });
matrixLayout.createRow(null,cell,null );

It is giving an error : Uncaught Error: Syntax error, unrecognized expression:   Is this the right way to do this? If not, please help me with the solution. Thanks.

Was it helpful?

Solution

Looking at it, you are only placing a simple nonbreaking space to the DOM, whereas I think it would expect something that can be added to the DOM.

You can try using <span>&nbsp;</span> instead and see if that works.

But a better approach would be to use an empty spacer cell -- if you want padding between the matrixlayout columns -- or add some extra padding using the attachStyleClass method -- if you want spacing between controls inside a column

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top