cancel
Showing results for 
Search instead for 
Did you mean: 

Values loading in data binding

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member194504
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Alfred,

It works ! Thank you so much for your suggestion

Best regards,

Ying