Issue
I’ve managed to display a programmatically created ‘pop up’ page with some buttons when a button on my main page is clicked/tapped but don’t know how to display a title. How do I do this and are there any other items I should set in HEAD? I’m a novice here.
btnToolsClicked(Event e) {
var content = 'Choose an Action <b>(Work In Progress)</b>'
'<div id="menu-btns" class="radio-btns">'
'<input id="B1" type="radio" name="radio-btn">'
'<label id="lblB1" class="radiobutton-label" for="B1"> Extract Thermal Data.</label><br>'
'<input id="B2" type="radio" name="radio-btn" >'
'<label id="lblB2" class="radiobutton-label" for="B2"> Copy Data to USB drive.</label><br>'
'<input id="BClose" type="radio" name="radio-btn" >'
'<label id="lblClose" class="radiobutton-label" for=" BClose">Close</label>'
'</div>';
JsObject w =
context.callMethod("open",["","MsgWindow","width=640,height=480,top=100,left=100"]);
JsObject doc = w['document'];
doc['head']['innerHtML'] = '<title>Tools Menu</title>'; // FAILS
doc['body']['innerHTML'] = content;
}
Solution
Haven’t tested it but I would expect this to work:
JsObject doc = w['document'];
doc['title'] = 'Tools Menu';
Answered By – Fox32
Answer Checked By – Mary Flores (FlutterFixes Volunteer)