|
|
Home » U++ Library support » U++ SQL » Strange (perhaps) DropList ctrl behaviour
Strange (perhaps) DropList ctrl behaviour [message #33057] |
Tue, 05 July 2011 16:00  |
 |
forlano
Messages: 1207 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Hello,
I am playing with the reference example SqlArray.
I have modified the schema description, in the lay file added a droplist, and feeded this one with some values
dl.Add(1,"uno");
dl.Add(2,"due");
dl.Add(3,"tre");
Then I connected it to 'detail'
detail.AddCtrl(DL, dl);
When I enter the values it seems to work (the keys of droplist are stored in the table).
But when I click to resume the stored values in the table the droplist remains empty while the others are populated with data.
It looks for me a strange behaviour but I could mistake. Any hint?
Thank you,
Luigi
-
Attachment: SqlArray.rar
(Size: 2.45KB, Downloaded 388 times)
|
|
|
Re: Strange (perhaps) DropList ctrl behaviour [message #33170 is a reply to message #33057] |
Tue, 12 July 2011 23:58   |
 |
forlano
Messages: 1207 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
forlano wrote on Tue, 05 July 2011 16:00 | Hello,
I am playing with the reference example SqlArray.
I have modified the schema description, in the lay file added a droplist, and feeded this one with some values
dl.Add(1,"uno");
dl.Add(2,"due");
dl.Add(3,"tre");
Then I connected it to 'detail'
detail.AddCtrl(DL, dl);
When I enter the values it seems to work (the keys of droplist are stored in the table).
But when I click to resume the stored values in the table the droplist remains empty while the others are populated with data.
It looks for me a strange behaviour but I could mistake. Any hint?
Thank you,
Luigi
|
it seems that the sql gurus are already in holidays... or simply the DropList cannot be used with AddCtrl()+SqlArray.
Luigi
|
|
|
|
Re: Strange (perhaps) DropList ctrl behaviour [message #33178 is a reply to message #33174] |
Wed, 13 July 2011 11:19   |
 |
forlano
Messages: 1207 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
sergeynikitin wrote on Wed, 13 July 2011 08:35 | 1-st Ctrls must be defined not in layout. (Only like
2nd
By code is not clear that you want to do in the end?
|
I've seen others Ctrls defined in Layout.
Any way I have super simplified my test case to only one SqlArray to explain better what I want to achieve.
In master SqlArray I added a droplist ctrl:
country.Add(12,"Russia");
country.Add(24,"Czech Republic");
country.Add(31,"Italy");
country.Add(36,"Zimbawe");
master.SetTable(BOOK);
master.AddKey(ID);
master.AddColumn(AUTHOR, "Author").Edit(author);
master.AddColumn(TITLE, "Title").Edit(title);
master.AddColumn(COUNTRY, "Country").Edit(country);
master.Appending().Removing();
master.SetOrderBy(AUTHOR, TITLE);
I want to record in the database the key of the droplist but I want to see on the screen its value.
After some insertion I see the following

As you see the table show a number (the key) in the third column and nobody knows what countries stand for those numbers.
Instead when I start editing an old row or inserting a new row, the value of the droplist appears

What I would like is to show ALWAYS in the array the VALUE of the droplist and not its key. The test case is attached.
Thanks a lot,
Luigi
-
Attachment: pic1.jpg
(Size: 22.94KB, Downloaded 865 times)
-
Attachment: pic2.jpg
(Size: 23.31KB, Downloaded 820 times)
-
Attachment: SqlArray2.rar
(Size: 1.56KB, Downloaded 352 times)
|
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 21:31:13 CEST 2025
Total time taken to generate the page: 0.02884 seconds
|
|
|