I have an expression and it is entity attribute and it has numeric value and then i have a button, the thing is that the expression shows the overall total and when i click the button there will be some calculations. is there a way that i can click the button, expression can dynamically change depends on the total of the calculations? in short it can refresh after transaction? thank youo!
Hi budang haba,
I have attached the OML for you !! kindly Try,
hope this will help you!! if not plz let me know.
Kind regards
Sourabh Sharma
it actually work sir. thank you this is what im looking for
Hello,
Have you tried refreshing the aggregate (by which the expression is bind) inside the button on click logic??
yes sir i tried refreshing it but doesnt work
ok, can you please share your oml so that we can look into it and find out what exactly the problem is?
Regards
Anees
sorry i cant send you the oml due to privacy
Hi Budang,
Assuming you don't want to update data in the entity & refresh the aggregate on the button on-click action. You can use a local variable for this in your expression. Assign the local variable on the onAfterFetch of your aggregate with the value of your desired entity attribute. In the button on-click action you can perform the necessary calculation and update the value of the local variable accordingly. This should update the value of the expression dynamically.
Thanks
thank you for responding sir, can you provide me your oml on that? thanks
Hi @budang haba ,I shared my OML here please refer it. I implemented by @Anshul Jain suggestion.Thanks
Thanks for sharing sir but for my part it doesnt work
My 2 cents on not refresh:
1. make sure the data has been updated in the entity - use commit if in doubt
2. use refresh widget tool
3. use action hasfetch()
4. put inside 'on afterfetch' callback
regards
already tried the refresh widget tool but doesnt work sir thnaks
Hi budang,
Please clarify whether you want to or you do not want to update the attribute in the entity. Do you want to save the value of that particular attribute in the entity or is it just for the client side(Front-end)? If it is only for client-side then the suggested solution should work. Could you share more details about your application behavior after implementing this? If you want the attribute value to be updated in the entity, you first need to call an entity action(update or upsert action depending on your requirement) to update the data and then use the refresh data tool in your action.
i want to update only
Create a local variable and assign it to expression.
Fetched the data from DB and on after fetch assign it to the variable created by you.
On Button click do the calcu;ations and assign the value again to the local variable created by you.
Hope it will work for you.
Regards,
Hi Mohammad Hasib,
I wanted to suggest the same. I think this will work.
Do you have an oml for this sir? thank!