joejac
Posts: 242
|
| Posted: 03/25/2009, 3:56 PM |
|
Hello,
In a record form I have a listbox where:
The Control Source is: state_no
Data Source Table is: state
Bound Column is: state_no
Text Column is: state_name
I would like to get the state_name and replace it with the corresponding translation, I know how to do the translation, I know how to get the control value of a normal field: $form_name->state_no->GetValue(); to write: $form_name->state_no->SetValue();
But $form_name->state_name->GetValue(); do not work it gives an error "... non-object" so I need to find the correct way to get the value and to write to all the listbox elements in the correct event before they are shown on the record form.
I appreciate a lot if somebody can help me to find the way.
Best regards
joejac
|
 |
 |
Gena
Posts: 591
|
| Posted: 03/25/2009, 4:31 PM |
|
I don't think that this is possible... Your Listbox ARRAY already generated!
As idea - you need to generate it manually so you can put ANY values you need and do what you want.
Look, I had listbox Spedisci. And I generate it manually in youformname_BeforeShow event like
global $CCSLocales;
$Container->Spedisci->Values = array(array(1, $CCSLocales->GetText("BillTheSame") ),array(2, $CCSLocales->GetText("BillNew")));
you need to understand that Listbox is Array and each element is array of 2 values:
Bound Column (so some ID)
Text Column (so text user will see)
_________________
Gena |
 |
 |
|