Hi,
I have an object that is a 255 byte string and I would display it in line in the visualization. If I check Show control it returns an error.
I don't want that when the user have to write, he must click on the object that open the popup where to write.
Have you any idea how to do that?
Possible reasons:
• Read-only is enabled
• Send fixed value is not empty
• Widget is selected
• Object datatype is either Time, Date or Color
• Control type is set to Custom value select
My object is a 255 byte string, I attach the property:
Try this script, it will enable show control for all elements mapped to group address 1/1/14. No guarantees that it will work though
Code:
addr = '1/1/14'
require('json')
object = knxlib.encodega(addr)
items = db:getall('SELECT id, params FROM visobjects WHERE object=?', object)
for _, item in ipairs(items) do
params = json.pdecode(item.params)
if type(params) == 'table' then
params.showcontrol = 1
params = json.encode(params)
db:update('visobjects', { params = params }, { id = item.id })
end
end
27.01.2017, 08:09 (This post was last modified: 27.01.2017, 08:11 by Mirco.)
I tryed to put it in the init script but it didn't work, then I tryed to put it in the Javascript code but it didn't work.
Sorry I forgot to restart the HomeLYnk after put the code in the init script, now it work! Thank you!!!
27.01.2017, 10:11 (This post was last modified: 27.01.2017, 10:17 by Mirco.)
I have another problem: when I change the string inside the input box, but don't press enter or the button, the value displayed don't return to the value of the object until I refresh the page, neither if I change page.
Do you have any advice?
30.01.2017, 06:53 (This post was last modified: 30.01.2017, 07:07 by Mirco.)
(27.01.2017, 17:14)admin Wrote: Use .val("new value") instead of .attr(...)
Thanks you admin! Now it works!
This is the code I used:
Code:
var visible = false;
setInterval(function() {
var state = $('#widget-7').is(':visible');
if (state != visible) {
visible = state;
if (state == false) {
var tmp = objectStore.objects[Scada.encodeGroupAddress('15/7/215')].value;
//console.log(tmp);
$(".Email > div > div > input").val(tmp);
}
}
}, 1000);
When the "widget-7" that contains the text input is closed the text inside the input box is reset!
(28.01.2017, 12:43)Erwin van der Zwart Wrote: Hi Mirco,
You can create a HTML file like this and put it in a iframe with this URL "/user/input.html", run this LUA code once to create the file: