MarioM1977
Posts: 23
|
| Posted: 10/22/2010, 5:54 AM |
|
I have a problem with Retrieve Value for Control action.
I have two textboxes: AAA and BBB (this one is hidden)
Both textboxes have same Control Source field (DDD) from SQL table. Both textboxes are in grid: CCC.
DDD value is "100" - only one record in DB.
AAA shows "100" value currently. Now I would like to show the value of record in field AAA but increased + 10. Finaly, textbox AAA should show 110.
I use Retrieve Value for Control action in BeforeShow for textbox AAA:
Control Name: AAA
Source Type: Exproession
Source Name: here I would like to read value of BBB testbox + 100
No idea how to do it.
Thanks for help.
|
 |
 |
datadoit
|
| Posted: 10/22/2010, 7:04 AM |
|
Since the control is getting it's original value from the database, you
can retrieve it via:
$Container->ds->f("DDD");
so try $Container->ds->f("DDD")+100 in the Source Name property.
This will create the code:
$Component->SetValue($Container->ds->f("DDD")+100);
Make sure the control and database definitions are both set to Integer.
Also remember this is a Server-Side event, so this calculation will
only occur on a page load or refresh.
|
|
|
 |
MarioM1977
Posts: 23
|
| Posted: 10/22/2010, 8:47 AM |
|
Unfortunately, it does not work. I got empty textbox.
----------------------------------------------------------------------
After checking and fixing the mistake in code - it works :)
Thanks
|
 |
 |
|