1. Classic report region with apex_item.radiogroup() to select a row
2. Button to submit the page, request = R1
UI pattern - When radio button is clicked and page submitted using button R1, follow should happen
1. Lookup value from database based on value of clicked on radiobutton
2. Compare with value of a page item P1_X. Page items has currency formatting, needs to be stripped before comparing numeric value
3. If values don't match, popup alert message
Sounds simple enough for a dynamic action but I couldn't think of anything simpler than creating a DA
1. When = Click on Button R1
3. Set Value to retrieve value from database and set another hidden page item P1_Y
if ($v('P1_X') !== $v('P1_Y')) alert('whatever');
To-do: strip out currency formatting before comparing the values
5. Finally, submit the page to continue page processing.
All this seems too cumbersome and un-APEXy. Is there a easier, declarative way to do this?
I hate to be the one to suggest it because it's been mentioned before in these discussions BUT ... wouldn't it be easier to keep two fields:
1) A hidden one without formatting and
2) one visible with fomatting.
The formatting is not the issue here, I was asking if there is a simpler, more elegant way to implement this pattern. The basic idea is; upon a button click, instead of submitting the page, fetch some client-side content based on user input on some form control (checkbox, radiobutton, etc), use that to lookup some server-side value, compare to another client-side value, compare, generate conditional alert and continue with the page submission.