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
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:
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 :
Just fill in Clarety table with some data ... 😉
No, i have add two lines :
1 - YES
2 - NO
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.
Idea ! :woohoo:
Add "idle" field - int(1) - on table and class.
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]
Hi,
Logged error confirms previous idea :
Add "idle" field - int(1) - on table and class.
So, i have add idle (DB and class Clarety) and now i see my combo with :
[Yes]
[No]
I think there must be a link with displayYes: "Oui" in lang.js
Yes,
Change names "YES" and "NO" to "displayYes" and "displayNo"
I have add in lang.js trad of YES and NO.
It works! ;D
Thx babynus.
Probably I will come later to other problems 🙂
Hi,
Better replace names in table from "YES" and "NO" to "displayYes" and "displayNo", because lang.js will be erased when deploying next version.
Ok i understand !
Thx 😉
