Questions on bindings:

Questions on bindings:

1. I have an item text label bound to a builtin variable. I have a separate script which changes the item’s text label (that works). How do I change it back the “default” binding based on the builtin variable?

2. What is the best way to using bindings to change an item’s property when the same item is touched?

]]>
(Next Post) »

4 Commentsto Questions on bindings:

  1. Anonymous says:

    < ![CDATA[

    The only way to trigger the re-evaluation of the binding is to change the value of the variable. Builtin variables can be overwritten, although this is a usually a bad idea. So something like this should work:


    var original_value = LL.getVariables().getX(var_name);


    LL.setVariableX(var_name, some_dummy_value);


    LL.setVariableX(var_name, original_value);


    Where X is the type of data for the variable.



    By touched you mean clicked? If so you may use the tap event and the action “Set a variable”. The value for “Set a variable” can be a JavaScript expression if needed.

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Thanks for the quick reply as always! The script method worked for me, but I found what seems to be a new bug in b8 (just sent you a bug report).


    Basically, I am not able to get LL to link new scripts to event actions. The old links between scripts and events remain, but once I try to change them, or if I try to add new links to scripts using “run a script”, LL does not remember what the selection was. And when I then execute the event, LL crashes



    Separate issue I noticed with bindings was that binding variables (which are then toggled in Tasker) and Item Visibility don’t work very consistently. Can’t pinpoint it down to exactly what’s wrong, but it works <10% of the time

    ]]>

  3. Anonymous says:

    < ![CDATA[

    O.o I can confirm the bug (but it doesn’t crash for me)


    The script selected is not saved when using the ‘run a script’ action



    However, setting the action from a script (setEventHandler) does save it.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Sorry for the delay regarding this annoying bug, I am not sure to be able to push an update before tomorrow.


    Regarding the visibility I think this is because visibility is not persistent: if the launcher is suspended while Tasker toggle the value, it may activate a receiver in Lightning which is then stopped soon after by Android, hence the value is lost. I will have to make this value persistent.

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *