yes , but it does not solve the problem.
Filter methods get an empty valuesDict at creation of devices/ events.
if I add a "CLICKme" button at the top and just call a dummy method that returns valuesDict, THEN filters get the populated valuesDict.
** eg
- Code: Select all
<Field id="selectExistingDevice" type="menu" defaultValue="" visibleBindingId="newOrExistingDevice" visibleBindingValue="existing,delete">
<Label>select devices in Event:</Label>
<List class="self" filter="existing" method="filterDevicesEvent" dynamicReload="true"/>
</Field>
and then
- Code: Select all
def filterDevicesEvent(self, filter, valuesDict, typeId, targetId):
xList =[]
indigo.server.log("filterDevicesEvent: typeId: "+ unicode(typeId)+" targetId:"+ unicode(targetId)+" valuesDict:"+unicode(valuesDict))
if len(valuesDict) == 0:
indigo.server.log("filterDevicesEvent: vd empty returning")
return xList
.....
if i add:
- Code: Select all
<Field id="startCheck" type="checkbox" defaultValue="true" hidden ="yes"> </Field>
<Field id="start" type="button" visibleBindingId="startCheck" visibleBindingValue="true" >
<Label>To populate the fields hit start once</Label><Title> CLICKme </Title> <CallbackMethod> CLICKme </CallbackMethod>
</Field>
- Code: Select all
def CLICKme(self, valuesDict, typeId, targetId):
valuesDict["startCheck"] = False
return valuesDict
populates everything .. but the user needs to press the button at least once... and then the button disappears...
BUT IT WOULD BE REALLY NICE IF FILTERS COULD GET A POPULATED VALUESDIC AT START !
Karl