on 02-10-2017 4:49 PM
Hi,
I have bound a text box and am trying to dynamically read its value from the script which is triggered by a button by adding and removing filters using setFilter or clearFilter.
Although, I have observed that i do not have access to the actual refreshed data. Only when the control is transferred back to the page containing the component which triggered the event.
Please let me know if there is a way to access the refreshed data in the script itself?
1. Initial value (without any filters)
2. Value read from the Button (before filter)
3. Value read from Button (after filter). As seen, the correct data is not accessible.
4. Finally correct value is observed only when the alerts are closed and the control returns back to the initial screen
Hi Saleh,
This is probably a timing issue since your script for reading the text component is being triggered within the "On Click" event of the button at the same time as filtering. You should be able to resolve your issue as follows:
1. In the "On Click" event of the button execute only the setFilter() script;
2. In the "On Result Set Changed" event of the data source bound to the text component execute the TEXT.getValue() script.
Regards,
Mustafa.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mustafa,
Thanks for the response. I have altered the "On Result Set Changed" event but the issue still exists. My OnClick event also has the setFilter() script.
/* DS_1 OnResultSetChanged code*/
TEXT_1.getText();
/* Button script */
APPLICATION.alert("Sales before setting filter = "+TEXT_1.getText());
DS_1.setFilter("COUNTRY", "United Arab Emirates");
APPLICATION.alert("Sales after setting filter = " + TEXT_1.getText());
/* Chart data selection (Initial) */
{"(MEASURES_DIMENSION)":"SALES","COUNTRY":"(RESULT_MEMBER)"}
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.