@Script Developers:

@Script Developers:

Does anyone have an idea how to reliably track down an item in Lightning even if it might’ve been moved to other containers?

(Context: I want to update my music widget instead of having the user recreate it after an update https://plus.google.com/+LukasMorawietz/posts/QVm3e4Xpwfq)

]]>

6 Commentsto @Script Developers:

  1. Anonymous says:

    < ![CDATA[

    Assuming the user doesn’t delete the widget and then adds a new item which would get the same id, you can use LL.getItemById() to get an item in any container

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Colin de Roos


    Sadly, Ids will change if the item is moved to a different container.

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Oh really?! Didn’t know that. Sorry. The next best thing i can think of is running a script on the resumed event to tell the app where it is

    ]]>

  4. Anonymous says:

    < ![CDATA[

    The resumed event seems the best.


    Maybe: make it so that the widget itself keeps a copy of its id, and if it detects that the id has changed it sends the new id to the manager.

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Maybe I can use the container id, it shouldn’t change… I have to test that

    ]]>

  6. Anonymous says:

    < ![CDATA[

    I confirm container ids never change, except when imported from a template but that’s not an issue here.


    Maybe what you could do is set a unique name or tag with a random UUID, but still there need to be a recursive search to find an item by name or tag value.

    ]]>

Leave a Reply

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