Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

How to create a Com...
 
Notifications
Clear all

How to create a ComboBox

15 Posts
2 Users
0 Reactions
13.1 K Views
(@a-mikael)
Posts: 35
Active Member
Topic starter
 
[#839]

Hi,

how to create à ComboBox in Projectoria ?

I have my class Milestone who extends to SqlElement and my field "clarety".

I have create in the table "milestone" on my DB the field "clarety" who is a "tinyint" and i have add this line in the class Milestone :

public $test

So, in projectoria when i open a milestone my field clarety is created but is a textfield.

How to change this textfield in combobox ?

Thanks


 
Posted : 30 Nov 2012 19H02
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Project'Or RIA framework is "explicit", non desciptive. 👿

To get a combobox, you need :
- name the field "idClarety"
- define idClarety in db, with format int(12).
- define table clarety, with at least "id" int(12) and "name" varchar(100)
- define class Clarety.php, mapping clarety table.

All the rest is automatic :woohoo:


 
Posted : 30 Nov 2012 20H30
(@a-mikael)
Posts: 35
Active Member
Topic starter
 

Now, i see the combo Clarety but is empty :S

I Have create table clarety
I have add idClarety in Milestone with index
I have add

public $idClarety;

in Milestone.php
I have add class Clarety.php in model :



 
Posted : 03 Dec 2012 13H10
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Just fill in Clarety table with some data ... 😉


 
Posted : 03 Dec 2012 13H36
(@a-mikael)
Posts: 35
Active Member
Topic starter
 

No, i have add two lines :

1 - YES
2 - NO


 
Posted : 03 Dec 2012 13H38
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Check log file for errors.

private static $_databaseTableName = 'clarety';

Remove this line, no use if table name=class name

  //public $_isNameTranslatable = true;

Uncomment this line, YES/ NO will be translated.


 
Posted : 03 Dec 2012 13H46
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Idea ! :woohoo:

Add "idle" field - int(1) - on table and class.


 
Posted : 03 Dec 2012 13H48
(@a-mikael)
Posts: 35
Active Member
Topic starter
 

Ok, and i have check log file :

2012-12-03 11:50:32 ** ERROR ** Exception-[42S22] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'idle' in 'where clause'
2012-12-03 11:50:32 ** ERROR **    For query : select id as id, name as name from clarety where (idle=0 ) or id= '1' order by clarety.name
2012-12-03 11:50:32 ** ERROR **    Strack trace :
2012-12-03 11:50:32 ** ERROR **    #0 Sql->query called at [C:wampwwwbeta_V3.0modelpersistenceSqlList.php:82]
2012-12-03 11:50:32 ** ERROR **    #1 SqlList->fetchList called at [C:wampwwwbeta_V3.0modelpersistenceSqlList.php:34]
2012-12-03 11:50:32 ** ERROR **    #2 SqlList->getList called at [C:wampwwwbeta_V3.0toolhtml.php:49]
2012-12-03 11:50:32 ** ERROR **    #3 htmlDrawOptionForReference called at [C:wampwwwbeta_V3.0viewobjectDetail.php:803]
2012-12-03 11:50:32 ** ERROR **    #4 drawTableFromObject called at [C:wampwwwbeta_V3.0viewobjectDetail.php:2416]

 
Posted : 03 Dec 2012 13H53
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Hi,

Logged error confirms previous idea :
Add "idle" field - int(1) - on table and class.


 
Posted : 03 Dec 2012 13H57
(@a-mikael)
Posts: 35
Active Member
Topic starter
 

So, i have add idle (DB and class Clarety) and now i see my combo with :

[Yes]
[No]


 
Posted : 03 Dec 2012 14H01
(@a-mikael)
Posts: 35
Active Member
Topic starter
 

I think there must be a link with displayYes: "Oui" in lang.js


 
Posted : 03 Dec 2012 14H04
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Yes,
Change names "YES" and "NO" to "displayYes" and "displayNo"


 
Posted : 03 Dec 2012 14H10
(@a-mikael)
Posts: 35
Active Member
Topic starter
 

I have add in lang.js trad of YES and NO.

It works! ;D

Thx babynus.

Probably I will come later to other problems 🙂


 
Posted : 03 Dec 2012 14H13
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

Hi,
Better replace names in table from "YES" and "NO" to "displayYes" and "displayNo", because lang.js will be erased when deploying next version.


 
Posted : 03 Dec 2012 14H59
(@a-mikael)
Posts: 35
Active Member
Topic starter
 

Ok i understand !

Thx 😉


 
Posted : 03 Dec 2012 15H23
Share:

Scroll to Top