<?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: Reset application parameters after placing order in Vuforia Studio</title>
    <link>https://www.ptcusercommunity.com/t5/Vuforia-Studio/Reset-application-parameters-after-placing-order/m-p/989185#M12810</link>
    <description>&lt;P&gt;possibly we need to check more detailed the calling sequence to see why that happend&amp;nbsp;&lt;/P&gt;
&lt;P&gt;... but when you say - when the customer will not refresh the view. - so means that issue is chrome - is that also in view on device?&lt;/P&gt;
&lt;P&gt;- and I will undertand your statement that it will work ok when user will referesh the view /browser after the order- therefore possibly via some a little stupid technques we can force the refresh. $sope.apply() - found follow internal info but never used it- so possibly you can try if that will referesh:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$scope.$apply() function takes a function as parameter which is executed, and after that $scope.$digest() is called
internally. That makes it easier for you to make sure that all watches are checked, and thus all data bindings refreshed.
Here is an $apply() example:
$scope.$apply(function() {
$scope.data.myVar = "Another value";
});
The function passed to the $apply() function as parameter will change the value of $scope.data.myVar. When the
function exits AngularJS will call the $scope.$digest() function so all watches are checked for changes in the watched
values.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;one possible way to refersh I know is to call a second view widget&lt;/P&gt;
&lt;P&gt;let say a dummy view widget what has e.g. a text saying&amp;nbsp; something like&amp;nbsp; " &lt;STRONG&gt;am processing your order&lt;/STRONG&gt;" etc. let say you view is named order_process&lt;/P&gt;
&lt;P&gt;so you can call&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;$scope.app.fn.navigate('order_process');&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;that will call the 2D view and there we can define in oder_process.js some think like :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt; $scope.$on("$ionicView.afterEnter", function (event,info) {
   
//======when the view is loaded
//then wait 1 second and navigate back to Home or what ever the name
    $timeout( () =&amp;gt;{ //I will call with 2550 delay the srv
        let navigateObject = {'viewname': 'Home'};
        $scope.$emit('app-fn-navigate', navigateObject);}
       
},1000); 
//-----------------------------
}) //######################## finish afterEnter view    &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So means you will navigate to the process_view and then after 1 second it will navigate back to the Home or what ever you name of the original view is. You can also use for that an app parameter e.g.&amp;nbsp; &amp;nbsp; $sope.app.params.CallingView e.g&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt; $sope.app.params.CallingView ="MyStartView"
 $scope.app.fn.navigate('order_process');&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then the defintion in order_process.js&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt; $scope.$on("$ionicView.afterEnter", function (event,info) {
   
//======when the view is loaded
//then wait 1 second and navigate back to Home or what ever the name
    $timeout( () =&amp;gt;{ //I will call with 2550 delay the srv
        let navigateObject = {'viewname': $sope.app.params.CallingView };
        $scope.$emit('app-fn-navigate', navigateObject);}
       
},1000); 
//-----------------------------
}) //######################## finish afterEnter view    &lt;/LI-CODE&gt;
&lt;P&gt;Could you check if that will work in your case? Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 16 Dec 2024 15:33:06 GMT</pubDate>
    <dc:creator>RolandRaytchev</dc:creator>
    <dc:date>2024-12-16T15:33:06Z</dc:date>
    <item>
      <title>Reset application parameters after placing order</title>
      <link>https://www.ptcusercommunity.com/t5/Vuforia-Studio/Reset-application-parameters-after-placing-order/m-p/988971#M12803</link>
      <description>&lt;P&gt;I want to reset application parameters in Vuforia Studio after placing an order.The orderid is getting reused even after setting it to undefined ex: $scope.app.params['uid'] = undefined.Can you please help me with this.&lt;/P&gt;&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/24955"&gt;@RolandRaytchev&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2024 14:08:52 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Vuforia-Studio/Reset-application-parameters-after-placing-order/m-p/988971#M12803</guid>
      <dc:creator>SS_11298241</dc:creator>
      <dc:date>2024-12-15T14:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reset application parameters after placing order</title>
      <link>https://www.ptcusercommunity.com/t5/Vuforia-Studio/Reset-application-parameters-after-placing-order/m-p/989115#M12806</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/889625"&gt;@SS_11298241&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;when you set the parameter to an value you need to check what is the value there.&lt;/P&gt;
&lt;P&gt;I believe that app parameter could not be set later to undefined but it is an empty string- there is some automatic parsing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The quesiton how you did hanlde the setting a parmater value to undefined. Possibly you can use the string 'undefined' and check something like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;if($scope.app.params['uid'].indexOf('undefined') !=-1) ...&amp;nbsp; please see also&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/2559318/how-to-check-for-an-undefined-or-null-variable-in-javascript" target="_blank"&gt;https://stackoverflow.com/questions/2559318/how-to-check-for-an-undefined-or-null-variable-in-javascript&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;but possibly you can check an empty string&amp;nbsp;&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/5515310/is-there-a-standard-function-to-check-for-null-undefined-or-blank-variables-in" target="_blank"&gt;https://stackoverflow.com/questions/5515310/is-there-a-standard-function-to-check-for-null-undefined-or-blank-variables-in&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;or not valid uid ... (so means the stinng does not match the uid requirments) I think you need to have define your function e.g. (check_valid_uid) what should be the best option.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It depends when you say reused - what that means. where you reuse .it ?&amp;nbsp; e.g. $whatch construct or some service call.... you can even do you check if ui is valid or not.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 10:00:56 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Vuforia-Studio/Reset-application-parameters-after-placing-order/m-p/989115#M12806</guid>
      <dc:creator>RolandRaytchev</dc:creator>
      <dc:date>2024-12-16T10:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reset application parameters after placing order</title>
      <link>https://www.ptcusercommunity.com/t5/Vuforia-Studio/Reset-application-parameters-after-placing-order/m-p/989143#M12808</link>
      <description>&lt;P&gt;Hi Roland,&lt;/P&gt;&lt;P&gt;Thanks for responding to my previous post. Apologies if my earlier explanation was too vague. Here's a detailed description of the issue I'm facing with my cart application:&lt;/P&gt;&lt;H3&gt;Problem Description&lt;/H3&gt;&lt;P&gt;My cart application generates a unique ID (uid) whenever items are added to the cart. However, I've encountered an issue when users place multiple orders without refreshing the page.&lt;/P&gt;&lt;H4&gt;Steps to Reproduce&lt;/H4&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;First Order&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;User selects 2 items and places the order.&lt;/LI&gt;&lt;LI&gt;The order is successfully placed, and the user receives an email confirmation for the 2 items.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;No Page Refresh&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The user does not refresh the browser after placing the first order.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Second Order&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The user selects 3 new items for a second order.&lt;/LI&gt;&lt;LI&gt;On placing the second order, the application processes it with &lt;STRONG&gt;5 items&lt;/STRONG&gt; (2 from the previous order + 3 new ones).&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H4&gt;Cause&lt;/H4&gt;&lt;P&gt;The cart application reuses the uid for subsequent operations when the page is not refreshed, resulting in a merge of the previous order's items with the current one.&lt;/P&gt;&lt;H4&gt;Limitation&lt;/H4&gt;&lt;P&gt;I would like the addToCart functionality to use a &lt;STRONG&gt;new uid for each order&lt;/STRONG&gt; without requiring the user to refresh the page or triggering a location.reload().&lt;/P&gt;&lt;H3&gt;Question&lt;/H3&gt;&lt;P&gt;How can I ensure that a new uid is generated and used for each order without requiring a page refresh?&lt;/P&gt;&lt;P&gt;I've attached my bindings for reference. Any suggestions or best practices to resolve this would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 12:13:11 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Vuforia-Studio/Reset-application-parameters-after-placing-order/m-p/989143#M12808</guid>
      <dc:creator>SS_11298241</dc:creator>
      <dc:date>2024-12-16T12:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reset application parameters after placing order</title>
      <link>https://www.ptcusercommunity.com/t5/Vuforia-Studio/Reset-application-parameters-after-placing-order/m-p/989185#M12810</link>
      <description>&lt;P&gt;possibly we need to check more detailed the calling sequence to see why that happend&amp;nbsp;&lt;/P&gt;
&lt;P&gt;... but when you say - when the customer will not refresh the view. - so means that issue is chrome - is that also in view on device?&lt;/P&gt;
&lt;P&gt;- and I will undertand your statement that it will work ok when user will referesh the view /browser after the order- therefore possibly via some a little stupid technques we can force the refresh. $sope.apply() - found follow internal info but never used it- so possibly you can try if that will referesh:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$scope.$apply() function takes a function as parameter which is executed, and after that $scope.$digest() is called
internally. That makes it easier for you to make sure that all watches are checked, and thus all data bindings refreshed.
Here is an $apply() example:
$scope.$apply(function() {
$scope.data.myVar = "Another value";
});
The function passed to the $apply() function as parameter will change the value of $scope.data.myVar. When the
function exits AngularJS will call the $scope.$digest() function so all watches are checked for changes in the watched
values.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;one possible way to refersh I know is to call a second view widget&lt;/P&gt;
&lt;P&gt;let say a dummy view widget what has e.g. a text saying&amp;nbsp; something like&amp;nbsp; " &lt;STRONG&gt;am processing your order&lt;/STRONG&gt;" etc. let say you view is named order_process&lt;/P&gt;
&lt;P&gt;so you can call&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;$scope.app.fn.navigate('order_process');&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;that will call the 2D view and there we can define in oder_process.js some think like :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt; $scope.$on("$ionicView.afterEnter", function (event,info) {
   
//======when the view is loaded
//then wait 1 second and navigate back to Home or what ever the name
    $timeout( () =&amp;gt;{ //I will call with 2550 delay the srv
        let navigateObject = {'viewname': 'Home'};
        $scope.$emit('app-fn-navigate', navigateObject);}
       
},1000); 
//-----------------------------
}) //######################## finish afterEnter view    &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So means you will navigate to the process_view and then after 1 second it will navigate back to the Home or what ever you name of the original view is. You can also use for that an app parameter e.g.&amp;nbsp; &amp;nbsp; $sope.app.params.CallingView e.g&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt; $sope.app.params.CallingView ="MyStartView"
 $scope.app.fn.navigate('order_process');&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then the defintion in order_process.js&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt; $scope.$on("$ionicView.afterEnter", function (event,info) {
   
//======when the view is loaded
//then wait 1 second and navigate back to Home or what ever the name
    $timeout( () =&amp;gt;{ //I will call with 2550 delay the srv
        let navigateObject = {'viewname': $sope.app.params.CallingView };
        $scope.$emit('app-fn-navigate', navigateObject);}
       
},1000); 
//-----------------------------
}) //######################## finish afterEnter view    &lt;/LI-CODE&gt;
&lt;P&gt;Could you check if that will work in your case? Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2024 15:33:06 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Vuforia-Studio/Reset-application-parameters-after-placing-order/m-p/989185#M12810</guid>
      <dc:creator>RolandRaytchev</dc:creator>
      <dc:date>2024-12-16T15:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Reset application parameters after placing order</title>
      <link>https://www.ptcusercommunity.com/t5/Vuforia-Studio/Reset-application-parameters-after-placing-order/m-p/990168#M12819</link>
      <description>&lt;P&gt;Hello &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/889625"&gt;@SS_11298241&lt;/a&gt;&lt;/SPAN&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you have some &lt;A href="https://community.ptc.com/t5/Vuforia-Studio/Reset-application-parameters-after-placing-order/m-p/989185#M12810" target="_blank"&gt;responses&lt;/A&gt; from some community members. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Vivek N.&lt;BR /&gt;Community Moderation Team.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 04:06:14 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Vuforia-Studio/Reset-application-parameters-after-placing-order/m-p/990168#M12819</guid>
      <dc:creator>vnamboodheri</dc:creator>
      <dc:date>2024-12-20T04:06:14Z</dc:date>
    </item>
  </channel>
</rss>

