on 10-12-2015 5:07 PM
Hello experts,
I am working in DS 1.5.
I'd like to use data binding to get the value_1, and then calculate it to get value_2, I set the code "On Startup" like following :
but it seems to have the problem of sequence about values' loadings in data binding, because the value of value_2 is always "-1", no matter how much the value_1 is. If I use the same code in "On Click" of TEXT_5, when we click TEXT_5, the result is correct, but what I need is TEXT_5 will display the correct value without click. So how can I arrive at it? Would you please give me some advice?
Thanks a lot!
Best regards,
Ying
Hi Ying,
The problem might be TEXT_4.getText() returns you empty on startup. because no value has been selected hence always returns -1 in value_2. It works fine when you on-click the text because, now it have the value for TEXT_4.getText(). Just try the way Alfred suggested.
Thanks,
Nithyanandam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ying,
I think we cannot control when the data binding is executed.
To realize the same effect, you can use getData instead.
On startup:
var value_1=DS_1.getData("AMOUNT_SOLD", {"YR": "2003"}).value;
var value_2=value_1-1;
TEXT_5.setText(""+value_2);
Best,
Alfred
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.