UI5: setting variable values with input control not working

I have a simple text input based on a service variable and a button to set it. This used to work fine in UI4 but does not work in UI5.

in deviceButtonClicked, when looking for the input matching the ID defined for the action of the button, it finds the correct input html control but does not return it in getDeviceCOMControlsByIndexFromCPanel (called from ControlAction)

$$(controls[i]).data(“service”) (devices.js line 834) does not fined this data associated with the input control (however that gets created).

To duplicate, create a device using the attached plugin files. Go to the control tab and try to set the “Devices” text box. The variable will be set as “undefined” rather than the value entered by the user.

This appears to be because devices.js line 303 does not set the .data for (“service”) and (“variable”)

                   case "input":
                        //echo(clone_input);
                        _this.append(clone_input.clone()
                                                .data("index",i)
                                                .addClass(no_control_class)
                                                .find("input")
                                                    .attr("name",controls[i].ID)
                                                    .css({
                                                        position:"absolute",
                                                        top:controls[i].Display.Top,
                                                        left:controls[i].Display.Left,
                                                        height:controls[i].Display.Height,
                                                        width:controls[i].Display.Width
                                                        }).parent());
                        break;

Bug entered.

http://bugs.micasaverde.com/view.php?id=2094

Remove these lines, because they don’t do anything anyway. After removing them, updating the Devices variable should work.

{ "ControlType": "input", "ID": "Devices", "Display": { "Top": 110, "Left": 140, "Width": 280, "Height": 20, [s]"Service": "urn:automatorapp-com:serviceId:Push1",[/s] [s]"Variable": "Devices"[/s] } },

[quote=“mcvflorin, post:3, topic:170243”]Remove these lines, because they don’t do anything anyway. After removing them, updating the Devices variable should work.

{ "ControlType": "input", "ID": "Devices", "Display": { "Top": 110, "Left": 140, "Width": 280, "Height": 20, [s]"Service": "urn:automatorapp-com:serviceId:Push1",[/s] [s]"Variable": "Devices"[/s] } },
[/quote]

While that does work, that is divergent behavior from UI4. The reason to have the service and variable defined for the input control is to allow the current value to be defaulted into the text box.

Yeah, I don’t think the team that made the new UI thought about this. Actually, they didn’t think of many things. As a workaround you could set the default value in Lua like this:

local devices = luup.variable_get(<Devices>)
devices = lul_settings.Devices or devices

It’s not about default values, it’s about letting them edit the existing value without having to memorize it or re-type it. In this case the field is for iOS device ids which are very long and not memorizable.

I would like the UI4 behavior to continue with UI5 for this respect.