Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hello Community,
So i have a app which shows the dropdown with values and when user takes one ipad and perform something then dropdown values get update and change appears when he click the drop but i have in total two ipads and other ipad the view app and project is still open from yesterday and when user click on it and see then it shows old status in the drop down values.. how can i update it because when the app load there i call the service which gives us the drop down values to show....
any idea??
Hi @MA8731174 ,
so let me summarize the issue to see if I undstood the problem correctly
- the issue is to synchronize the both iPads after one iPath will change the list -means the list should change after some action is done on iPad 1 -so then you requirment is to get also iPad 2 updated? Right?
If that is the issue you can use some property in TWX which mirrors the change - let say the new value set in the dropdown list of the widget. So for example when you set the value in the widget you could also set the property what is linked to the both proejcts /or let say to the both instances of the same project. so you can use a $watch() construct which will montor the change of the parameter , and if such change occured you will call the update service.
So usage of the watch construct of parameter should be something like that:
$scope.$watch('app.params.myProperty',function (newValue, oldValue, scope) {
//myProperty is an applicaiton parameter defined in Studio UI
if(newValue==undefined ) return; // do nothinbg if new value is undefined
if(newValue == oldValue) return;//value is not changed odl is new
else
{
//here do you action to update the setting with the newValue
//here scope ! but not $scope
//that - is the variable which copies the $scope inside the $watch callback
}
})
//-----------------------------------------------------------------------
Thank you for this detailed answer but i have just selected the Auto Refresh for that service which loads the list in vuforia studio and now its working all fine..
Hi @MA8731174 ,
thanks for the feedback. Ok autorefresh will always work! that is a good option in that case. The suggested way I mentioned was more then concentrated to the change of specific property with awareness of what was changed in the foreign studio instance