Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Is there a better way to exchange FILEURL with JS?
I was able to change it by creating a global variable and linking it to the file url path, but I wonder if there is a more optimized way?
Solved! Go to Solution.
Binding to an app param is good and can help if you are having UI update issues. Using app.param is a useful approach.
Going forward I have started using
$scope.setWidgetProp("Your widget name" , "attribute name" , value)
and
$scope.getWidgetProp ("Your widget name" , "attribute name")
as opposed tp
$scope.view.wdg["Text-1].text = "some text";
The set and get are higher functions and do additional work
You could do setWidgetProp but am unsure of the use model below shows the syntax where src is the property name
$scope.setWidgetProp("YourWidgetStudioID", "src", "app/resources/Uploaded/Procedimento1.PNG");
Maybe we need a little more info on what your are trying to achieve.
I am changing the fileurl of a 2D "File" widget according to the switch case, as I am currently doing it is working and it works with a global variable linked in the fileurl, but I wonder if there is any other way to conform to good usage practices.
Binding to an app param is good and can help if you are having UI update issues. Using app.param is a useful approach.
Going forward I have started using
$scope.setWidgetProp("Your widget name" , "attribute name" , value)
and
$scope.getWidgetProp ("Your widget name" , "attribute name")
as opposed tp
$scope.view.wdg["Text-1].text = "some text";
The set and get are higher functions and do additional work