3

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.

4
  • The error is in this line: matrixLayout.createRow(createRow(null,cell,null ); where you have an unrecognized expression createRow, probably a copy-paste error
    – Qualiture
    Mar 28, 2014 at 9:07
  • @Qualiture It is not a copy paste error as it is working when I dont give the html space i.e control2.
    – abhhab
    Mar 28, 2014 at 9:21
  • I just simply could not work... have a closer look at this line: matrixLayout.createRow(createRow(null,cell,null ); where it has a secondary function createRow and you are missing a closing ) in the end
    – Qualiture
    Mar 28, 2014 at 9:28
  • @Qualiture sorry for the typing mistake here. I edited the post and It is not working.
    – abhhab
    Mar 28, 2014 at 9:38

1 Answer 1

4

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.