FK shows field_key instead field_name in Edit mode

Talk about foreign keys

Moderator: alexandrleonenko

samuro
Newbie
Newbie
Posts: 2
Joined: Aug 25th, '11, 17:27

FK shows field_key instead field_name in Edit mode

Postby samuro » Aug 25th, '11, 17:44

I have an web app for display a large list of items to be evaluated and qualified. The app works great, but i have a issue with displaying information, depending if is in Detail or Edit Mode:
This is the SQL string:

Code: Select all

$sql="SELECT "
  ."datosevaluacion.ID, "
  ."datosevaluacion.nummanual, "
  ."datosevaluacion.numestandar, "
  ."listaestandares.nomestandar, "
  ."datosevaluacion.fortalezas, "
  ."datosevaluacion.opmejora, "
  ."datosevaluacion.soportes, "
  ."FROM datosevaluacion "
  ."INNER JOIN listaestandares ON datosevaluacion.numestandar=listaestandares.numestandar "
  ."INNER JOIN listamanuales ON datosevaluacion.nummanual=listamanuales.ID "
  ."WHERE cronograma.completo != '1' AND ".$ambito;

This is the $em_columns array:

Code: Select all

$em_columns = array(
  "fechaevaluacion" =>array("header"=>"Fecha de la evaluación", "type"=>"date", "req_type"=>"rt", "width"=>"100px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "calendar_type"=>"popup|floating"),
  "nummanual" =>array("header"=>"Manual", "type"=>"foreign_key","req_type"=>"sy", "width"=>"", "title"=>"", "readonly"=>"true", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true"),
  "numestandar" =>array("header"=>"Estándar", "type"=>"foreign_key","req_type"=>"sy", "width"=>"", "title"=>"", "readonly"=>"true", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true"),
  "fortalezas" =>array("header"=>"Fortalezas", "type"=>"textarea", "req_type"=>"sy", "width"=>"400px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "resizable"=>"true", "rows"=>"7", "cols"=>"100", "on_js_event"=>""),
  "opmejora" =>array("header"=>"Oportunidades de mejora", "type"=>"textarea", "req_type"=>"sy", "width"=>"400px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "resizable"=>"true", "rows"=>"7", "cols"=>"100", "on_js_event"=>""),
  "soportes" =>array("header"=>"Evidencia", "type"=>"file", "req_type"=>"st", "width"=>"210px", "title"=>"", "readonly"=>"false", "maxlength"=>"-1", "default"=>"", "unique"=>"false", "unique_condition"=>"", "visible"=>"true", "on_js_event"=>"", "target_path"=>"soportes/", "max_file_size"=>"10M", "file_name"=>"", "host"=>"local"),
);

This is the foreign key definition:

Code: Select all

$foreign_keys = array(
"nummanual"=>array("table"=>"listamanuales", "field_key"=>"ID", "field_name"=>"nommanual", "view_type"=>"dropdownlist", "condition"=>"", "order_by_field"=>"nommanual", "order_type"=>"ASC", "on_js_event"=>""),
"numestandar"=>array("table"=>"listaestandares", "field_key"=>"ID", "field_name"=>"nomestandar", "view_type"=>"textbox", "condition"=>"", "order_by_field"=>"ID", "order_type"=>"ASC", "on_js_event"=>""),
);

The (little, but shocking!) issue, it's: on Detail mode, "numestandar" shows correctly the text from the field defined in field_name, but in Edit Mode, only shows the number stored in the field_key field defined. I need to fix this, please advice me. Thanks you for this great script!

PD: I apologize my English, I'm Spanish spokeman! (From Colombia)

administrator
Site Admin
Site Admin
Posts: 6003
Joined: Jan 7th, '09, 23:18
Contact:

Re: FK shows field_key instead field_name in Edit mode

Postby administrator » Aug 28th, '11, 07:31

1. What version you work with.
2. Do you mean you see ID instead of nomestandar?
3. Can you please turn debug On and show us this page online?

samuro
Newbie
Newbie
Posts: 2
Joined: Aug 25th, '11, 17:27

Re: FK shows field_key instead field_name in Edit mode

Postby samuro » Aug 29th, '11, 17:35

administrator wrote:1. What version you work with.
2. Do you mean you see ID instead of nomestandar?
3. Can you please turn debug On and show us this page online?


1. ApPHP Data drid 4.2.8. But i brought 6.4 version, but i will install when i finished my actual tasks
2. No, i see 'numestandar' data instead ´nomstandar´ text
3. I took this 2 screenshots:
1) Image
2) Image

administrator
Site Admin
Site Admin
Posts: 6003
Joined: Jan 7th, '09, 23:18
Contact:

Re: FK shows field_key instead field_name in Edit mode

Postby administrator » Aug 30th, '11, 08:45

Please download and try the latest version before.
It may resolve your problems, if not - please post your note here again.


Return to “Field type: "foreign key"”