Dynamic box of database results

Hello

I create dynamic checkboxes based on a read to sqlite database.  I am able to get the data and the number of boxes is being created, but I'm having a problem populating the labels from the boxes.  This is the section of code that gets the results of the database and creates the boxes.

Table of results: var = stmt.getResult () .data;
                
for each (var objobject result)
{
var cb:CheckBox = new CheckBox();
CB.label = obj.toString ();
cb.setStyle ("color", 0x00593B);
cb.setStyle ("symbolColor", 0x000000);
container.contentGroup.addElement (cb);
}

Neil

Hello

normally, your "obj" is dynamic and must contain a property with the column you want to display from DB in the label of the cb. (I do not this template, so not sure...)

So, you should try:

CB.label = objthe_column_name

If you want a label based on more than 1 column, you can replace the method. toString(), by using a specific class to manage your ValueObject (instead of object).

Tags: BlackBerry Developers

Similar Questions

  • Help with dynamic checkbox of database results

    Hello

    I create dynamic checkboxes based on a read to sqlite database.  I am able to get the data and the number of boxes is being created, but I'm having a problem populating the labels from the boxes.  This is the section of code that gets the results of the database and creates the boxes.

    Table of results: var = stmt.getResult () .data;

    for each (var obj:Object in the result)

    {

    var cb:CheckBox = new CheckBox();

    CB.label = obj.toString ();

    cb.setStyle ("color", 0x00593B);

    cb.setStyle ("symbolColor", 0x000000);

    container.contentGroup.addElement (cb);

    }

    Neil

    For me, this has been answered on another forum.

    The line cb.label = obj.toString ();

    needed to be replaced by data.

    CB.label = obj.myDatabaseFieldName;

    myDatabaseFieldName would be the column you extract data from and should be the actual name of the table.

    Neil

  • How to dynamically access the SQLite result set?

    I want to dynamically access the SQLite result set. Since webworks does not support the "PRAGMA table_info (table_name); I save all newly created information tables in a single two-column table called schema. schema has two columns, table_name, and column_name.

    So I created a function to dynamically access the data in the table. I use the item = results.rows.item (i) and that the data access with item.column line.

    column is a variable that will receive the value of a schema representative of column_name. When I alert (column) I get the column_name is correct, but when I used item.column my results are "not defined".

    any advice on how to solve this issue.

    I managed to solve this issue. The solution is the following: the normal way to access the data of the variable item = results.rows.item (i) is item.column (where the column is the name of the column in the database table. To access the data dynamically, I Specifies a var col1 to assign different values in col1. I then access the data in the database using point [col1] hope that makes sense. If you need a further explanation contact me at [email protected]

  • dynamically create a database in form 10g

    Hi guys,.

    I got a new requirement, that is to dynamically create a database of blocks and elements...

    How is it possible... ?

    Thank you...

    Ok...

    Thank you

    concerning

    SAI sandeep t

  • PHP "current page marker" dynamic menu of database?

    Cannot get my head around this one. Anyone know how to add a "current page" marker to a menu item when the menu is generated dynamically in a database?

    I currently have the underside, which offers the menu:

    < ul >

    <? PHP while ($row = $listNav-> fetch_assoc()) {? >}

    < li > < a href = "index.php? pageNo = <?" PHP echo $row ['page_id'];? ' > '.

    >

    <? PHP echo $row ['page_title'];? > < /a > < /li >

    <? PHP}? >

    < /ul >

    Which is this:

    <ul >

    "<li ><a href="index.php? pageNo = 1">home< /a >< /li > .

    "<li ><a href="index.php? pageNo = 2">on< /a >< /li > .

    "<li ><a href="index.php? pageNo = 3' >Our Vision< /a >< /li > .

    "<li ><a href="index.php? pageNo = 4' >Contact< /a >< /li > .

    < /ul >

    What I need is the id = "currentPage" appear only when the requested page is perceived:

    <ul >

    "<li ><a href="index.php? pageNo = 1">home< /a >< /li > .

    "<li ><a href="index.php? pageNo = 2" id ="currentPage">on< /a >< /li > "

    "<li ><a href="index.php? pageNo = 4' >Our Vision< /a >< /li > .

    "<li ><a href="index.php? pageNo = 3' >Contact< /a >< /li > .

    < /ul >

    I tried a few solutions, but everything I've tried so far has added id = "currentPage" to all links.

    If I say something like below of course its 'true' if all the links get lidentifiant = "currentPage"; because of the php while loop.

    <? PHP $thisPage = 'A comments';? >

    "<li ><a href="index.php? pageNo = 2" "


    <? PHP

    If ($thisPage == "About") {}

    echo "id ="currentPage;"

    }

    ? >

    > On< /a >< /li >

    See you soon

    Operating system

    Solved with a little tweaking autour

      fetch_assoc()) {? >}

    • ">

      ID = "currentPage"

      >

    Then dynamicaly to generate the css to match the $row ['page_id']

    #currentPage {}

    background-color: #09C;

    }

  • How to connect the parallel test using the logarithmic function Teststand database result

    Hello

    How can I connect a test result of 4 EHR tested in parallel using the logarithmic function Teststand database

    I use Labview 2013, 2013 Teststand and sequential model.

    The test is performed using a single digital card (SMU-6556). The FSD 4 is connected to the port of the digital map and is tested in parallel.

    Currently at the end of the test, I would have a report with all the measures, but I need 4 reports (1 report / dut)

    TKS


  • ACTION DYNAMIC - box Expression Javascript

    Hello
    I have 2 PCs in stock
    1 P2_REQUEST_TYPE_CODE
    a. SELECT LIST
    i. EQUIPMENT REV
    II. POSTERS
    III. the SHELL ROOM
    IV. VISIO CAD
    2 P2_RETURNED_FILE_TYPE_CODE
    a. BOX
    i. 2D POSTER
    DRAWING CAD II.
    III. PDF
    IV. VISIO

    I have a dynamic Action
    Event: change
    Selection type: item (s)
    Article (s): P2_RETURNED_FILE_TYPE_CODE, P2_REQUEST_TYPE_CODE
    Condition: Expression of JavsScript
    Value:
    $v ('P2_RETURNED_FILE_TYPE_CODE') == '2D POSTER |
    $v ('P2_REQUEST_TYPE_CODE') == 'POST '.

    When my user chooses ' P2_REQUEST_TYPE_CODE ("POST") "there shows the address columns, and it does.". When my user chooses "P2_RETURNED_FILE_TYPE_CODE ('2D POSTER")"it should display the address columns and it does. Everything works well except when in "P2_RETURNED_FILE_TYPE_CODE" all the checkboxes are checked the address columns don't get display, no idea?

    Request Express 4.1.1.00.23

    Thank you
    -JC

    Hi JC,.

    If you check multiply the boxes that the value will be a string with the value separated by a colon.
    You must use something like indexOf.

    $v('P2_RETURNED_FILE_TYPE_CODE')=='2D POSTER'||
    $v('P2_REQUEST_TYPE_CODE').indexOf('POSTER') != -1
    

    Kind regards
    Kees Vlek

    http://www.orcado.nl
    http://www.orcado.nl/blog/blogger/listings/69-kvlek

    If the answer to question please change to answered.

  • Dynamic link of database table

    Hello
    I need to create the menu on the left on a page. Hyperlink and the label of the menu are stored in the database. What is the best way to achieve this. Basically when user opens a session based on his user name query will get labels and the source of the hyperlink. How to achieve this in the ADF? I couldn't find anything out of the box. I've seen object that stores this information, but I do not know how to convert this information into hyperlinks.

    Assuming that the UrlInfo is the name of the View object that has the attributes & link label, you can use the af: iterator to display labels & links as follows:

    (1) make drag & drop the UrlInfo page tabular. Remove the table in the. JSPX page and keep the pageDef as it is.

    (2) instead of af: table, use af:iterator to display the same.

    . JSPX page example:


    lines = ' #{bindings. " UrlInfo.rangeSize}"id ="t1">

    destination = "#{row." Link} "/ >"

    PageDef, example:




    DataControl = "AppModuleDataControl" id = "UrlInfoIterator" / >










    Thank you
    Nini

  • Dynamic box table

    Hello

    I have 4 buttons, all have a number (1-4)

    I want these numbers to be entered in a dynamic area whenever you click on one of the buttons.

    Dynamic area has 4 characters, so when a button is clicked, the first characted is deleted, all move along one and the new character (entered by pressing the button) is added at the end of the string to a number.

    I guess this is done in a table somehow.

    Define an array of 4 elements.

    When the button is clicked, [0] = [1], [1] = [2]... etc.

    Then [3] = the number of the button.

    And then this table is assigned to the box.

    That seems like a good way to go about it. I had a play around but can't seem to get the right syntax.

    Any help would be fantastic.

    See you soon

    Dave

    You could just continuously generate value chain and extract only the last four of him every time that changes channel.

  • adding 3 points in a database results in a square to appear instead

    Every time I insert 3 points in my database how «...» "with quotes and insert the line in my php site, that a square appears instead of these 3 points and instead of firefox has also written in fffd. What can I do to avoid this problem.

    It's an encoding issue. It seems that you are pasting from a Word document. Word converts the three points at the suspension points. I don't know which Word coding uses, but if it does not match the encoding of your application and a database, it displays incorrectly. You must make sure that Word (or whatever it is you use to create the text) is not converted three ellipsis points, but retains the original three points.

  • RMAN DUPLICATE DATABASE RESULT IN A RE - ORG

    Database Version 10.2.0.4

    When I perform a duplicate database RMAN is the new database completely reorganized? The new database can be any fragmentation or water marks high if the source database has done?

    Thank you

    The answer to your question is no duplicate RMAN does not cause a re - org, RMAN is a block of files of database level backup, RMAN duplicate is a double level of a data block. Therefore, duplicate RMAN is fundamentally a restoration of the source database, because it is in another location and an instance of the database and the database name change.

  • Check boxes not showing results

    I have a html form that has checkboxes
    quote:
    < name of entry = "text" type = "checkbox" value = "text" >
  • How to fill the area of the bean with values from database

    I have a box of bean shaped which act as last autocomplete, I want to fill it with dynamic values of database, any help will be appreciated.
    http://Forms.PJC.Bean.over-blog.com/article-16369664.html "It is the example that I am"

    Best regards.

    An example with the EMP table:

    DECLARE
      cursor cur is select empno,ename from emp;
    BEGIN
      -- initialise the ComboBox twin values --
      for c in cur loop
       if c.empno is not null then
        Set_Custom_Property('BL.BEAN',1,'ADD_TWIN',c.empno||','||c.ename);
       else
        Set_Custom_Property('BL.BEAN',1,'ADD_TWIN_NULL',c.empno||','||c.ename);
       end if ;
      end loop;
      Set_Custom_Property('BL.BEAN',1,'ADD_TWIN','[END_DATA]');
      Set_Custom_Property('BL.BEAN',1,'SET_ALIGNMENT','right');
    END;
    

    François

  • Fusion of data/result defines what are parent/child?

    Hello:

    I have seen a few examples to make a data model so that a BI report can have master-detail data. They are a set of Q1 data and a set of T2 data with a variable binding to connect the two in a parent/child relationship.

    But what I need, it is actually a UNION. I have the same table on multiple instances of database and I want to show the results grouped in a single report, as if it all happened to a table. Examples of master-detail have a section defining the grouping but they group Q1 (see here)

    http://blogs.Oracle.com/BIDeveloper/data_template/

    and I need to regroup in a column in Q1 and Q2 to "merge" the two sets of data.

    Does anyone do this?

    Thank you.

    If you define multiple SQL-queries/data models data sets, you can combine them into a single set of data by selecting the concatenated SQL Data Source.

    Choose concatenate them box, concatenation will result in the union.

    RTF again, you can use the two dataset and display as a single table.

  • verification of dynamic grid options

    Hello

    I have a grid made of dynamic boxes and I need to check each box to see whether or not it is enabled to perform a function...

    Problem is I have 60 boxes in the grid - in the code below, there is only the boxes that need to be selected!

    I still have to add the other 54 boxes and set them as .chosen = false;

    There must be a better way to do so than my code?

    If (event.currentTarget.parent.getChildByName("m1").chosen == true & & event.currentTarget.parent.getChildByName("m2").chosen == true & & event.currentTarget.parent.getChildByName("m3").chosen == true & & event.currentTarget.parent.getChildByName("m4").chosen == true & & event.currentTarget.parent.getChildByName("m5").chosen == true & & event.currentTarget.parent.getChildByName("m6").chosen == true) {}

    Do Something();

    }

    Thanks in advance

    The big advantage of this method is that when you check the response, you can use Array methods such as every() and indexOf().

    Say that your correct answers are the 1 and 15. Place them in a table:

    var correctAnswers:Array = [0,14];
    

    The test function would be something like:

    // returns true only if a correct answer is selected and an incorrect answer is not selected
    function checkAnswer(box:Box, index:uint, boxList:Array):Boolean {
        var pass:Boolean = true;
        if(box.choosen){
            if(correctAnswers.indexOf(index) < 0){
                pass = false;
            }
        } else {
            if(correctAnswers.indexOf(index) > -1){
                pass = false;
            }
        }
        return pass;
    }
    

    To test the result, simply do:

    var passed:Boolean = boxList.every(checkAnswer);
    

Maybe you are looking for