on 03-18-2017 6:58 PM
Hi, I am trying to print a view created using xml in sapui5 which has few controls structured to display a form. I am using the following code to print the form which I found online var oTarget = this.getView(); if (oTarget) { var $domTarget = oTarget.$()[0], sTargetContent = $domTarget.innerHTML, sOriginalContent = document.body.innerHTML; document.body.innerHTML = sTargetContent; window.print(); document.body.innerHTML = sOriginalContent; } However the form structure is successfully getting created but its not picking the text field values which have been entered. The values are not coming from any db but from locally saved XML file . I am setting the value form this file to text fields in the form. On setting up the debugger I found that document. body.innerHTML has value parameter "". I tried setting the placeholder, value attribute of textfield on the click event of print button and before the above code snippet but it didnt work, also tried changing the innerhtml of that particular text field, didnt work. Please note I want to print the entire form and therefore I am fetching the body using innerhtml . Please help. Regards, Pooja
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.