Forum

How to create a Com...
 
Notifications
Retirer tout

How to create a ComboBox

15 Posts
2 Utilisateurs
0 Reactions
13.1 K Vu
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 
[#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


 
Posté : 30 Nov PM 19:1111
(@babynus)
Posts: 14952
Membre 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:


 
Posté : 30 Nov PM 20:1111
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 

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 :



 
Posté : 3 Déc PM 13:1212
(@babynus)
Posts: 14952
Membre Admin
 

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


 
Posté : 3 Déc PM 13:1212
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 

No, i have add two lines :

1 - YES
2 - NO


 
Posté : 3 Déc PM 13:1212
(@babynus)
Posts: 14952
Membre 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.


 
Posté : 3 Déc PM 13:1212
(@babynus)
Posts: 14952
Membre Admin
 

Idea ! :woohoo:

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


 
Posté : 3 Déc PM 13:1212
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 

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]

 
Posté : 3 Déc PM 13:1212
(@babynus)
Posts: 14952
Membre Admin
 

Hi,

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


 
Posté : 3 Déc PM 13:1212
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 

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

[Yes]
[No]


 
Posté : 3 Déc PM 14:1212
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 

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


 
Posté : 3 Déc PM 14:1212
(@babynus)
Posts: 14952
Membre Admin
 

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


 
Posté : 3 Déc PM 14:1212
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 

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

It works! ;D

Thx babynus.

Probably I will come later to other problems 🙂


 
Posté : 3 Déc PM 14:1212
(@babynus)
Posts: 14952
Membre 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.


 
Posté : 3 Déc PM 14:1212
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 

Ok i understand !

Thx 😉


 
Posté : 3 Déc PM 15:1212
Share:
Retour en haut