bbUI.js and localStorage.getItem return null values

Hello

I build a WebWorks app with bbUI.js for BB10 and I run problems when I want to retrieve items of localStorage. Their storage is no problem. Here is my architecture:

  1. index.html which uses localStorage.getItem in a function ondomready for 1 screen (fueltracker.html), it works
  2. JS/Register.js with functions like registerUser(), registerEngine(), registerBrand(), registerModel() called when onclick in their respective screens, see below
  3. RegisterUser() calls register.html
  4. registerBrand() calls addCar.html
  5. registerModel() calls addModel.html
  6. registerEngine() calls addEngine.html
  7. fueltracker.html which has a few buttons that the label should be changed to values from localStorage

The register() functions make a call to localStorage.setItem (), working (i.e. the values are defined). However, in some cases parts of objects stored in localStorage it update, so this object must be recovered first, updated and then stored again. Unfortunately the calls localStorage.getItem () does not return the value that is stored in the localStorage.

So how does it do?

Yes Chad, variables have been established.

It's the same problem as this one: http://stackoverflow.com/questions/2010892/storing-objects-in-html5-localstorage (objects cannot be stored in LocalStorage, single key-value pairs, so items must be chained before putting them in the LocalStorage). The getObject() en index.html setObject methods and their use instead of getItem() and setItem() solved the problem.

Tags: BlackBerry Developers

Similar Questions

  • Terminal SYS_CONTEXT returns NULL values

    Hi, I'm working on a 10g database.

    I put a trigger on opening session in a database. who uses this query

              SELECT sys_context('USERENV',
                                     'SESSION_USER') s_user,
                      sys_context('USERENV',
                                     'OS_USER') s_osuser,
                      sys_context('USERENV',
                                     'IP_ADDRESS') s_ip,
                      sys_context('USERENV',
                                     'TERMINAL') s_terminal,
                      sys_context('userenv',
                                     'SESSIONID') s_sessid,
                      SYSDATE s_login
              FROM   dual
              WHERE  upper(sys_context('USERENV',
                                             'SESSION_USER')) IN
                      ('SYSADMN',
                        'SUPERUSER')
              AND    upper(sys_context('USERENV',
                                             'OS_USER')) <> 'SYSTEM';
    in a table.

    Why is this code return a NULL value in the terminal for some connections?

    What is the print server? or something else?

    Thank you

    IP address is not available if the client does not connect via TCP (@SID).

    So I can assume that since you are directly on the server you may not be connected through the listening port.

    Response by Anurag.
    Problem with sys_context

    HTH
    Girish Sharma

  • apex_util.get_email returns null values

    Request Express 4.1.0.00.32

    I created a calculation for a page element to get the email of the user.

    The page is P16_EMAIL_ADDRESS.

    The calculation is a type of PL/sql. The code is:

    DECLARE
    L_EMAIL_RTN VARCHAR2 (240);
    BEGIN
    L_EMAIL_RTN: = APEX_UTIL. GET_EMAIL (p_username = > 'APP_USER');
    END;

    When I check the session information and debugging logs it indicates that the function is to return null.

    I figured I was doing something wrong in the APEX while I created a procedure in the database called the APEX_UTIL. GET_EMAIL. I've run in debug mode and saw that he too returned null. I get the same results with the GET_FIRST_NAME and GET_LAST_NAME functions.

    Can you see what I'm doing wrong? Or give an example of using these functions correctly?

    Thank you

    Steve

    Published by: cranestar on February 28, 2012 09:28

    So if you know, APEX forums supports the use of the [code] and [code /] intended to set aside code segments for ease of reading.

    One thing I noticed in your sample service is this unconditional statement: RETURN NULL;

    Your function can do all sorts of things, but this indicates the function always return explicitly NULL - your behavior. You must declare a variable to store the results of the function call to APEX_UTIL. GET_EMAIL() and return this variable:

    create or replace function L_EMAIL_RTN
      return varchar2
     is
    declare
      v_email   VARCHAR2(240);
    begin
      v_email  := APEX_UTIL.GET_EMAIL(p_username => :APP_USER);
      return v_email;
    end;
    
  • Dependency injection and inaccessible target return null

    Hello
    I tried a simple code to jsf 2.
    That's
    Here's the jsp
    -----
    < h:form >
    < h:inputText value="#{MBTest.thePerson.name}"/ >
    < h:commandButton value = 'submit' action = "#{MBTest.action}" / >
    < h:messages / >
    < / h:form >
    -----

    Here's Managed bean MBTest
    -----
    @ManagedBean (name = "MBTest")
    @RequestScoped
    public class MBTest {}

    @ManagedProperty (value = "#{thePerson}")
    private person thePerson = null;

    public MBTest() {}
    }

    public person {} getThePerson()
    Return thePerson;
    }

    {} public void setThePerson (person thePerson)
    this.thePerson = thePerson;
    }

    {} public void action()
    System.out.println (thePerson.GetName ());
    }
    }
    -----
    This is the Person class
    -----
    public class person {}

    private String name = null;
    private int age = 0;

    public int getAge() {}
    return age;
    }

    public void setAge (int age) {}
    This.Age = age;
    }

    public String getName() {}
    return the name.
    }

    public void setName (String name) {}
    myIdName = name;
    }
    }
    -----

    But once this completed page opens (Please note that "thePerson" managed bean instance is not instantiated, just the managed property has been declared). When the button is pressed, it gives me the error of followuing
    -----
    /index. XHTML @12,60 value = "#{MBTest.thePerson.name}": unattainable target, "thePerson" returned null "
    -----
    Could you please tell me why?

    Off topic:
    Where the code tags? I can't find it here.

    as far as I can see, your person class is not a managed bean. I expect an annotation @ManagedBean (name = "thePerson") on it. If you do not a managed bean, JSF doesn't know it exists.

    If you don't want a person as being a managed bean, then simply yourself create an instance of your class MBTest.

    private Person thePerson = new Person();
    
  • [CFFUNCTION return null value

    How can I return a null value when the return function is of type cfc

    Unfortunately ColdFusion doesn't have NULL values. Even if you return null from the database, it will make them in empty strings. If you return null from Java you will get variable is undefined errors.

  • All tables and xml are be NULL problem

    Hello guys

    I'm working on a project that uses the format of loading xml, e4x and intensively, table manipulation and it was fine but now I'm stuck on a strange problem.  All code was beautiful and application work and respond in a desired way, but then mystourisly it stopped working and started to return NULL values in almost all the tables of the (internal) actionscript and XML varibales.

    Now every time I have to load the xml file and set the loaded xml internal variables, internal values get only NULL instead of data.
    The same is the situation with the berries, I created a few components in mxml, and when I passed them to reference tables, the code gets compiled successfully, but again Array has only null values [that code worked very well too]

    I wonder if Adobe Flex did an update reduced to silence or something similar and it's the result of this things!

    I use Adobe Flex 3.2 SDK 3.3 on windows Vista Ultimate Edition.

    Please check this project attached, import it and see if you face the same problem

    Thank you

    Link to the problematic project

    http://isolatedperson.googlepages.com/problemXperiment.zip

    Problem screenshot

    http://isolatedperson.googlepages.com/xmlissue.jpg

    HTTPService to load the data. You will have less problems.

    
    
         
              
         
         
         
    
    
  • How to return a NULL value in LOV and insert into a field of allowingNULL number 4?

    Hello

    I have the following LOV and the return_value is PeopleId which is number 4, allowing NULL. And the LOV options are as follows:

    LOV named--> select named LOV-
    Show Extra values-> no
    Dynamic translation-> - untranslated-
    The number of columns - > 1
    Display Null-> Yes
    Null-> - Select value-
    Return NULL,-> NULL value
    ^^^^^^^^^^^^^^^

    ----------------

    List of values definition:
    Select Lname | ', ' || Fname | ' ' || Mname as display_value, PeopleId as return_value
    of PEOPLETB
    where PEOPLETYPE ('i', 'HERE', 'IF')
    order by 1
    --------------

    Given that PoepleId is a number 4, allowing NULL. I want a NULL value will be inserted, if the user does not select anything in the drop-down list. It seems that I would get "ORA-01722: invalid number" error when the PeopleId msg is null (ie: user doesn't have a selection). What is the good 'return Null value' I need to put it in? I tried "NULL" (see above) or nothing, it still does not work.

    Any suggestions?

    Thank you very much
    Helen

    Hello Helen,.

    You have found one of the many sources of my frustration with APEX. Here's what I do:

    In the definition of the element in your page, go to the LOV part and implemented like this:

    Display Extra values: Yes a dynamic conversion (I ignore this)
    Number of columns: 1 display Null: No.
    Display null value: (leave blank) return Null value: (leave blank)

    An empty row is displayed when the user comes first to the screen. If they do NOT select the drop-down list, the value is left empty (null).

    If anyone has a better way, I will definitely experiment with it.

    Don.

  • Call a jscript vbscript script and return a value

    Hello world

    I'm trying to simplify a tedious task: every day I have to fill in an InDesign document with 48 different numbers that go into 48 blocks of text. I would like to write a script to get these numbers (the temperatures that I get in an excel file) automatically and write them in the corresponding text blocks.

    So basically I use jscript to implement a document. So I want him to call a vbscript script (since only vbscript can retrieve an excel cell value) and have it return the value to the jscript in a variable.

    So far I managed to adapt a .vbs script that retrieves the number of the cell and the poster in a box:

    Option Explicit
    Dim objApp, objWbs, objWorkbook, objSheet

    Set objApp = New
    Set objWbs = objApp.WorkBooks
    objApp.Visible = False
    Set objWorkbook = objWbs.Open ("C:\Temperature")
    Set objSheet = objWorkbook.Sheets ("Sheet1")

    MsgBox objSheet.Range ("C5"). Value

    objWorkbook.Close False
    objWbs.Close
    objApp.Quit

    ObjSheet = Nothing set
    Set objWorkbook = Nothing
    Set objWbs = Nothing
    Set objApp = Nothing

    But it is only that. I always have trouble with:

    (1) the order doScript: How can I call the jscript vbscript script?

    (2) writes the value retrieved (or table) in a variable in vbscript script

    The rest is easy: in the jscript, write the table in the corresponding text blocks.

    Hope someone can help me. Thank you very much

    Maphio M.

    When you place an Excel file in InDesign, it becomes a table. From there on, it's a simple as myFrame.tables [0] .cells [x] .silence (myFrame being a reference to the image that you placed the Excel file in).

  • How to change the NULL value to 0?

    Hello

    I have a formula as below to get the PRODSUPP % against total LICENSE.
    Formula 1
    (sum (case when ECA_SALES_CREDITS_MV.)) ACCOUNT_CODE = "PRODSUPP", AND THEN ECA_SALES_CREDITS_MV. TRANSACTION_AMOUNT_SUM 0 otherwise fine)
    / sum (case when ECA_SALES_CREDITS_MV.) ACCOUNT_CODE = 'LICENSE' THEN ECA_SALES_CREDITS_MV. TRANSACTION_AMOUNT_SUM else 0 end)) * 100

    The problem with the formula 1, is that when in the formula returns a value of 0, there is a division error and formula 1 returns NULL.
    Formula 2
    sum (case when ECA_SALES_CREDITS_MV.) ACCOUNT_CODE = 'LICENSE' THEN ECA_SALES_CREDITS_MV. TRANSACTION_AMOUNT_SUM 0 otherwise fine)

    My question is how formula 1 may return 0 instead of NULL when there is an error in division.
    Would appreciate your help.

    Thank you
    Guy
    case when sum(case when ECA_SALES_CREDITS_MV.ACCOUNT_CODE = 'LICENSE' THEN ECA_SALES_CREDITS_MV.TRANSACTION_AMOUNT_SUM else 0 end) = 0
         then 0
         else (sum(case when ECA_SALES_CREDITS_MV.ACCOUNT_CODE = 'PRODSUPP' THEN ECA_SALES_CREDITS_MV.TRANSACTION_AMOUNT_SUM else 0 end) /
               sum(case when ECA_SALES_CREDITS_MV.ACCOUNT_CODE = 'LICENSE' THEN ECA_SALES_CREDITS_MV.TRANSACTION_AMOUNT_SUM else 0 end)
              ) * 100
    end
    

    Concerning

    Etbin

    more readable:

    case when sum(case when ECA_SALES_CREDITS_MV.ACCOUNT_CODE = 'LICENSE'
                       THEN ECA_SALES_CREDITS_MV.TRANSACTION_AMOUNT_SUM
                       else 0 end
                 ) = 0
         then 0
         else sum(case when ECA_SALES_CREDITS_MV.ACCOUNT_CODE = 'PRODSUPP'
                       THEN ECA_SALES_CREDITS_MV.TRANSACTION_AMOUNT_SUM
                       else 0 end
                 ) /
              sum(case when ECA_SALES_CREDITS_MV.ACCOUNT_CODE = 'LICENSE'
                       THEN ECA_SALES_CREDITS_MV.TRANSACTION_AMOUNT_SUM
                       else 0 end
                 ) * 100    /* intentionally left as original */
    end
    
  • getCharBoundaries returns null

    Hello

    I'm trying to reduce the text field for the simple letters and then make some animations on each letter. But, how can I find out where (position) the letters? I tried to use getCharBoundaries, but when she reached the 3rd line, it keeps returns null values. Someone knows why this happens? And what is perhaps the best way to cut text to the letters/words/strings fields?

    Thank you

    This method can not handle the paragraph characters (\n).   You can expect the same problem with tabs and carriage return.

    to remedy this, strip out and replace it with something that you can only detect a loop in the text of your main textfield.

  • PersistentObject.getContents () returns null after app update

    Hello

    I'm trying to track down a bug with PersistentStore.
    Usually when I update the app I get the getContents() stored content.
    However, something in the code has changed from one version to the other and now getContents() returns null.

    I made sure the id has never changed for PersistentStore.getPersistentObject (id);
    I made sure that we use the same basic sdk (4.3.0)
    I made sure that there are the data stored in the stored hash table

    Currently, it's a hash table - no subclass (even though I know that I should change it to a subclass when it's fixed);

    I wonder if there are any suggestions on what might cause the getContents() return null - or which could result in the PersistentStore have cleared.

    What information is needed, please let me know and I'll paste.

    I found the problem after.

    Classes have begun to obscure differently. If the hash table was still readable, but because he could not read the content of the hash table, he would return null.

    It was unexpected, because if you have a custom class persisted and you try to read it, you will get the content, but you can't cast. But with the hash table, it does not return the content (uncastable) and it throws no exceptions...

    I hope this helps someone else who has a similar problem.

  • Remove data with null value

    Hello

    I'm using Oracle 11 g. I have a table with an id of 3, node, the value column. Combination of the column id and node, that must be taken account for deletion on the registers.

    Here, I need to delete lines with the NULL value in the value column. If for a combination of id and node with non-null values, then I need to delete rows with a null value for this combination.

    If the combination of id, node is not null value then this records should not delete.

    Below table, I need to remove the second row, for which is a value not zero VOICE CAL '10' is there, so I need to delete the row with null values. (VOICE, CAL, NULL)

    Network, FL, there is no value is non-null then I should NOT delete this line.

    This table is to have 100 s of this association, we can delete data in a single delete query?

    Or how I can delete rows with nulls for this combination.

    Tab1

    VALUE OF THE NŒUD ID

    VOICE CAL 10
    VOICE CAL NULL
    NETWORK NULL FL

    Thank you

    Hello

    oradba11 wrote:

    Hello

    I'm using Oracle 11 g. I have a table with an id of 3, node, the value column. Combination of the column id and node, that must be taken account for deletion on the registers.

    Here, I need to delete lines with the NULL value in the value column. If for a combination of id and node with non-null values, then I need to delete rows with a null value for this combination.

    If the combination of id, node is not null value then this records should not delete.

    Below table, I need to remove the second row, for which is a value not zero VOICE CAL '10' is there, so I need to delete the row with null values. (VOICE, CAL, NULL)

    Network, FL, there is no value is non-null then I should NOT delete this line.

    This table is to have 100 s of this association, we can delete data in a single delete query?

    Or how I can delete rows with nulls for this combination.

    Tab1

    VALUE OF THE NŒUD ID

    VOICE CAL 10
    VOICE CAL NULL
    NETWORK NULL FL

    Thank you

    You can do this in a single DELETE statement (it is not a request), using an EXISTS or IN the subquery.  For example:

    REMOVE table_x m

    WHERE the value IS NULL

    AND THERE ARE)

    SELECT 0

    FROM table_x s

    WHERE s.id = m.id

    AND s.node = m.node

    AND s.value IS NOT NULL

    )

    ;

    If you would care to post CREATE TABLE and INSERT instructions for the sample data, and then I could test it.

  • SQL query to restrict null values

    Hello

    I have the following table
    Procurement_id         estimate_end_date          revenue
    
    1                              01-oct-2012                   $1000
    2                              02-oct-2012                   $1500
    3                              01-dec-2012                   $300
    4                              01-jan-2013                    $500
    5                              21-Nov-2013                   $900
    .
    .
    .
    I want only the procurement_ids that have a date of estimated that between 30 and 60 days. and if its estimated finish date is within 30 days, I show that a column monthstoend as 1 and in the 60s would be 2.

    If the output would be something like
    ProcurementId   Monthstoend   revenue
              1                  1              $1000
              2                  1              $1500
              5                  2              $900
    Basically, I want to remove all null values. the query I came was

    Select
    procurement_id,
    (case when (estimated_end_Date - sysdate) < = 30 then 1)
    When (estimated_end_Date - sysdate) between 21 and 60, then 2
    on the other
    null
    end) montstoend
    recipes
    Of
    Table;


    Is there a way to eliminate NULL values in the same query. I know that we can query on top of this request and then to eliminate NULL values, but I was wondering if we can do it in the same query. I use a similar in a much larger request functionality, if want to avoid that if possible.

    Any suggestions?

    Thank you

    Published by: ryansun on September 26, 2012 01:08

    It's not fair...

    select procurement_id
          ,(case when (estimated_end_Date - sysdate) <= 30 then 1
                 when (estimated_end_Date - sysdate) between 31 and 60 then 2
            else null end) montstoend
          ,revenue
    from Table
    where estimated_end_Date - sysdate <= 60
    

    ?

  • Value of the link column remove null values

    Hello

    I use 4.1.1 and I have a column in a classic report that I have configured to post a link to another page in the application. I use one of the IMGS 'edit' and I put the report to show significant like but when I run my page and the value is null, I get always a hyphen and a link (for example. ("' - that is a link) which redirects me to another page. I know a fast method of sale would be to hardcode the html code in the sql code and I know that you should really put an html tag that is similar between your sql. With this in mind are other suggestions of display and img/a for null values.


    Thank you very much

    Alistair

    You can try css:
    #r_contacts_rowview td [headers = "OFFICE_EMAIL"] a [href = "mailto:-"] {}
    display: none;
    }

    He finds the elements of anchoring with mailto value '-' (my null values) in my office_email column. r_contacts_rowview is a static id for a region.
    Display: none to hide items. This works rather graceful.
    Note that this works in IE7/8 your page should be a doctype ( )

    If you don't want a doctype or whatever it is, you can also try jquery of course
    function remove_hyphen_links() {}
    $("td_[en-tetes_=_'office_email']_{a").each (function ()})
    {if ($(this).)} (Text()=='-')}
    $(this) .remove ();
    };
    });
    };

    If I run this onload of my page, I can see hyphens, shortly before they disappear, I don't like too much. Of course, you must bind it to the "apexafterrefresh" - event in your area, as well as the links are also deleted after a partial page refresh (paging).

  • How to set a null value in the calculation section?

    is this possible? What is the correct syntax?

    or use the "body of the function returning a Boolean" and use

    return null;
    

    Scott

Maybe you are looking for

  • How can I turn off the reminder to PIN tabs?

    I don't want to not use pinned tabs, but Firefox guard harassing me on this topic every time I visit Facebook or other sites that I visit often. It doesn't seem to be a way not to say 'Thank you' to Firefox and have never suggest tabs pinned for me y

  • Dismantling of Satellite 3000 - X 4

    Hello! My 3 year old Satellite 3000 - X 4 recently died on me (is not even complete the initial BIOS messages) and I would like to be able to dig into it but I can't seem to get the case out despite the withdrawal of all the screws! It seems to be "s

  • How to manually change the DNS zone files?

    I'm running OS X version 10.11.2 (El Capitan) and using App Server version 5.0.15 on a Mac Mini. I need to change the DNS Zone files manually because the DNS Server App Manager does not provide a U / I in order to add some elements (such as adding a

  • Sleekbook 15-b011nr windows 7 drivers

    Can any body tell me compatible drivers Windows 7 for the 15-b011nr Sleekbook? I currently have trouble finding something that work with the ethernet, the network and the touchpad. Record: http://support.hp.com/us-en/document/c03526325

  • error code 2739 Flipshare on Vista download

    My PC is Vista. I tried to download the Flipshare software via a Flipvideo camcorder on my computer, but towards the end of the installation process the error code 2739 flashes up toward the end of the installation. Then a second message box displays