Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: H5b XE5 listbox problem


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Sep 11, 2015 8:13 PM Last Post By: Erick Engelke
Angelica Zampieri

Posts: 15
Registered: 11/17/12
H5b XE5 listbox problem  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 15, 2014 10:04 AM
sometimes the listbox is not compiled despite simple text strings. It does not quite explain. Has anyone encountered problems in filling the listbox with values taken from a database?
UPDATE --- My code is simply
            $this->QOp->close();
            $this->QOp->SQL = "SELECT * FROM table";
            $this->QOp->open();
 
            while (!$this->QOp->EOF) {
                //test 1 NO
                //$name = html_entity_decode($this->QOp->fieldget("name"));
                //test 2 NO
                //$name = mb_convert_encoding($this->QOp->fieldget("name"), 'ASCII', 'UTF-8');
                //test 3 NO
                //$name = str_replace("/","",$this->QOp->fieldget("name"));
                //test 4 NO
                $name = $this->QOp->fieldget("name");
                $idet = $this->QOp->fieldget("id");
                $this->ListBox1->AddItem($name,null,$idet);
                $this->QOp->next();
            }
            $this->QOp->close();

In the next list the data between and are displayed while the other not. What's up?
The data from db is this:
id name
4 04/12/04
5 04/16/04
6 04/18/04
7 04/20/04
8 04/12/04 stC
9 04/16/04 stC
10 04/18/04 stC
11 04/20/04 stC
12 04/12/04 Satinato
13 04/16/04 Satinato
14 04/18/04 Satinato
15 04/20/04 Satinato
16 33.1/12/04
17 33.1/14/04
18 33.1/16/04
19 33.1/18/04
20 33.1/20/04
21 44.2/10/04
22 44.2/12/04
23 44.2/14/04
24 44.2/16/04
25 44.2/18/04
26 55.4/10/04
27 55.4/12/04
28 55.4/14/04
29 55.4/16/04
30 04/16argon/04be
31 04/18argon/04be
32 04/20argon/04be
33 04/22argon/04be
34 33.1/14argon/04be
35 33.1/16argon/04be
36 33.1/18argon/04be
37 33.1/20argon/04be
38 04/16argon/04
39 04/18argon/04
40 04/20argon/04
41 04/22argon/04
42 04/16argon/04C
43 04/18argon/04C
44 04/20argon/04C
45 04/22argon/04C
46 04/14argon/04C
47 PROVA-prova/04
48 PROVA-prova/04/05
49 prova-prova-27

I found that field 47 contains last 00 4F character not visible in db, my page file format is UTF8 and property encodig also, but the code stops executing without error and without filling in the listbox.
which is the correct setting to read and write accented characters etc?

Edited by: Angelica Zampieri on Dec 16, 2014 12:48 AM
Erick Engelke

Posts: 101
Registered: 12/5/02
Re: H5b XE5 listbox problem  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 11, 2015 8:13 PM   in response to: Angelica Zampieri in response to: Angelica Zampieri
You need to do error checking. What if a field is null.

Erick

Angelica Zampieri wrote:
sometimes the listbox is not compiled despite simple text strings. It does not quite explain. Has anyone encountered problems in filling the listbox with values taken from a database?
UPDATE --- My code is simply
            $this->QOp->close();
            $this->QOp->SQL = "SELECT * FROM table";
            $this->QOp->open();
 
            while (!$this->QOp->EOF) {
                //test 1 NO
                //$name = html_entity_decode($this->QOp->fieldget("name"));
                //test 2 NO
                //$name = mb_convert_encoding($this->QOp->fieldget("name"), 'ASCII', 'UTF-8');
                //test 3 NO
                //$name = str_replace("/","",$this->QOp->fieldget("name"));
                //test 4 NO
                $name = $this->QOp->fieldget("name");
                $idet = $this->QOp->fieldget("id");
                $this->ListBox1->AddItem($name,null,$idet);
                $this->QOp->next();
            }
            $this->QOp->close();

In the next list the data between and are displayed while the other not. What's up?
The data from db is this:
id name
4 04/12/04
5 04/16/04
6 04/18/04
7 04/20/04
8 04/12/04 stC
9 04/16/04 stC
10 04/18/04 stC
11 04/20/04 stC
12 04/12/04 Satinato
13 04/16/04 Satinato
14 04/18/04 Satinato
15 04/20/04 Satinato
16 33.1/12/04
17 33.1/14/04
18 33.1/16/04
19 33.1/18/04
20 33.1/20/04
21 44.2/10/04
22 44.2/12/04
23 44.2/14/04
24 44.2/16/04
25 44.2/18/04
26 55.4/10/04
27 55.4/12/04
28 55.4/14/04
29 55.4/16/04
30 04/16argon/04be
31 04/18argon/04be
32 04/20argon/04be
33 04/22argon/04be
34 33.1/14argon/04be
35 33.1/16argon/04be
36 33.1/18argon/04be
37 33.1/20argon/04be
38 04/16argon/04
39 04/18argon/04
40 04/20argon/04
41 04/22argon/04
42 04/16argon/04C
43 04/18argon/04C
44 04/20argon/04C
45 04/22argon/04C
46 04/14argon/04C
47 PROVA-prova/04
48 PROVA-prova/04/05
49 prova-prova-27

I found that field 47 contains last 00 4F character not visible in db, my page file format is UTF8 and property encodig also, but the code stops executing without error and without filling in the listbox.
which is the correct setting to read and write accented characters etc?

Edited by: Angelica Zampieri on Dec 16, 2014 12:48 AM

--
Erick Engelke
HTML5 Builder Book
http://www.erickengelke.com
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02