0

problem with currentAppData

Hi all,
I am working on a widget which takes user name & password for log on. When user switches the profile he should be allowed to log on with different set of user name and password. Means every profile should maintain its own set of data.
As I understood from document I am using currentAppData to store user credentials in following way.
CODE
         
currentAppData.set("UserName", userName);
currentAppData.set("Password", password);

by
6 Replies
  • Sorry for half post.

    Hi all,
    I am working on a widget which takes user name & password for log on. When user switches the profile he should be allowed to log on with different set of user name and password. Means every profile should maintain its own set of data.
    As I understood from document I am using currentAppData to store user credentials as it is data stored here is different from profile to profile, and from widget to widget.

    CODE
           
    //For storing
    currentAppData.set("UserName", userName);
    currentAppData.set("Password", password);

    //For fetching
    currentAppData.set("UserName");
    currentAppData.set("Password");


    I am using AnchorSnippetView for snippet because I want single and static snippet across profiles.
    But when I switch profile It uses previously logged credentials and logs on directly.
    I tried with appending current profile ID to the key but still result is same.

    Thanks for any help.
    0
  • Try this.
    CODE
           
    //For storing
    currentAppData.set("User", JSON.stringify({username:"",password:""}) );

    //For fetching
    var out = false;
    try{
    out = JSON.parse(currentAppData.get("User")):
    }
    catch(e){}


    Hope this helps.
    0
  • What engine version are you using? And what Container version? We are not seeing this happen on engine 5.5.15 and Container 1.4.x
    0
  • QUOTE (Austin Teames @ Oct 26 2010, 07:31 AM) <{POST_SNAPBACK}>
    What engine version are you using? And what Container version? We are not seeing this happen on engine 5.5.15 and Container 1.4.x


    He was using "currentAppData.set" for both getting and setting the information.
    0
  • Seems like this was only a real issue with earlier versions of the dock and engine. Are you still having this issue?
    0
  • QUOTE (Austin Teames @ Nov 15 2010, 01:12 PM) <{POST_SNAPBACK}>
    Seems like this was only a real issue with earlier versions of the dock and engine. Are you still having this issue?


    Sorry for late reply.
    Its working perfectly fine now.
    What I was missing in my code is that at a particular place I was storing user credentials also in KONtx.messages.store and I am not clearing it on profile switch.
    Also In my second post here I put wrong code while typing for fetching the data using set only.

    So now currentAppData is working fine for two engines here :- 5.2.6 and 5.4.8
    0

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets