<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how can I refer the widget property in multiple view environment? in Vuforia Studio</title>
    <link>https://www.ptcusercommunity.com/t5/Vuforia-Studio/how-can-I-refer-the-widget-property-in-multiple-view-environment/m-p/854501#M11540</link>
    <description>&lt;P&gt;Hi, RolandRaytchev&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your kind explanation.&lt;/P&gt;&lt;P&gt;I resolved this problem with your explanation.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 08 Feb 2023 23:47:43 GMT</pubDate>
    <dc:creator>jsj</dc:creator>
    <dc:date>2023-02-08T23:47:43Z</dc:date>
    <item>
      <title>how can I refer the widget property in multiple view environment?</title>
      <link>https://www.ptcusercommunity.com/t5/Vuforia-Studio/how-can-I-refer-the-widget-property-in-multiple-view-environment/m-p/854029#M11528</link>
      <description>&lt;P&gt;Hi, all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to refer the widget property value in multiple view.&lt;/P&gt;&lt;P&gt;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/P&gt;&lt;P&gt;$scope.test = function(){&lt;BR /&gt;$scope.app.view['Home'].wdg['label-1']['text'] = "test";&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I coded like upper to set the property in other view.&lt;/P&gt;&lt;P&gt;but I got the error log like below.&lt;/P&gt;&lt;P&gt;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/P&gt;&lt;P&gt;Error evaluating button-1 click JS: test();&lt;/P&gt;&lt;P&gt;TypeError: Cannot read properties of undefined (reading 'wdg')&lt;/P&gt;&lt;P&gt;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why I am not able to set the property value in other view?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="headerbuttontrackingcode"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="headerbuttontrackingcode"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 08:10:20 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Vuforia-Studio/how-can-I-refer-the-widget-property-in-multiple-view-environment/m-p/854029#M11528</guid>
      <dc:creator>jsj</dc:creator>
      <dc:date>2023-02-07T08:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: how can I refer the widget property in multiple view environment?</title>
      <link>https://www.ptcusercommunity.com/t5/Vuforia-Studio/how-can-I-refer-the-widget-property-in-multiple-view-environment/m-p/854384#M11537</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/546708"&gt;@jsj&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so far my knowledge the widget data is accessible only in the context of the active view. So that when the view is not loaded you could not set properties. Also all property which are set , they will be lost when the view unloaded e.g. by exit or loading of another view.&lt;/P&gt;
&lt;P&gt;So, I think there are some&amp;nbsp; different techniques to take care about a permanent setting of variables and properties at run time. The simples is to have variables which are persistent for different views&amp;nbsp; is to use an application parameter which could be set any time e.g. by property link or javascript code. So the application parameter could be linked to a property of the specific view - so means changing the app parameter will change the property when the view is loaded. This is some kind of static link&lt;/P&gt;
&lt;P&gt;Another option is to use&amp;nbsp; some&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt; scope.$on('$ionicView.afterEnter', function() {
//your javascript here
})&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where you can do some setup task when a view is loaded. So you can read for some saved variables globally in the app parameters or in the global scope $rootScope and set them to the widgets of particular view when the view is loaded. also windows context could be used e.g. window.localStorage which could save permanent values during a project is opened (see also &lt;A href="https://community.ptc.com/t5/Vuforia-Studio/How-do-I-save-a-text-file-and-picture-to-local-drive-on-device/td-p/826325" target="_self"&gt;post&lt;/A&gt; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;window.localStorage.clickcount = 1;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 15:16:19 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Vuforia-Studio/how-can-I-refer-the-widget-property-in-multiple-view-environment/m-p/854384#M11537</guid>
      <dc:creator>RolandRaytchev</dc:creator>
      <dc:date>2023-02-08T15:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: how can I refer the widget property in multiple view environment?</title>
      <link>https://www.ptcusercommunity.com/t5/Vuforia-Studio/how-can-I-refer-the-widget-property-in-multiple-view-environment/m-p/854393#M11538</link>
      <description>&lt;P&gt;so back to your example and the app parameter&lt;/P&gt;
&lt;P&gt;e.g. create an app parameter&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-02-08_16-01-38.jpg" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/75694iFBBAE6A2D253089D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2023-02-08_16-01-38.jpg" alt="2023-02-08_16-01-38.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;you can create a binding form this app parameter to different widget properties.&lt;/P&gt;
&lt;P&gt;Then when you change the parameter value this will change all property in the active view which are associated with this app parameter.&amp;nbsp; When another view is loaded and it use a binding to this parameter this should update the value , when there is existing&amp;nbsp; binding form parameter to the property.&lt;/P&gt;
&lt;P&gt;Then to sett all values having binding from this parameter you should do some thing like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$scope.test = function(){
//$scope.app.view['Home'].wdg['label-1']['text'] = "test";
//instead of this above set the app parameter which has binding to
// text property of label-1 widget
$scope.app.params.myMultiViewTEXT="test";

$scope.app.params['myMultiViewTEXT']="test";
// or another valid usage, syntax which will accept space in paramName
//e.g bla bla  $scope.app.params['bla bla']="test";
//$scope.app.params.bla bla="test";
// will not work in this case
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 15:21:59 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Vuforia-Studio/how-can-I-refer-the-widget-property-in-multiple-view-environment/m-p/854393#M11538</guid>
      <dc:creator>RolandRaytchev</dc:creator>
      <dc:date>2023-02-08T15:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: how can I refer the widget property in multiple view environment?</title>
      <link>https://www.ptcusercommunity.com/t5/Vuforia-Studio/how-can-I-refer-the-widget-property-in-multiple-view-environment/m-p/854501#M11540</link>
      <description>&lt;P&gt;Hi, RolandRaytchev&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your kind explanation.&lt;/P&gt;&lt;P&gt;I resolved this problem with your explanation.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 23:47:43 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Vuforia-Studio/how-can-I-refer-the-widget-property-in-multiple-view-environment/m-p/854501#M11540</guid>
      <dc:creator>jsj</dc:creator>
      <dc:date>2023-02-08T23:47:43Z</dc:date>
    </item>
  </channel>
</rss>

