on-screen calculation with DA - oracle-apex

when
:p1_radio_button_1
:p1_radio_button_2
:p1_radio_button_3
change,
dynamic actions fired to set values on
:p1_score_1
:p1_score_2
:p1_score_3
with simple math such as (:p1_lov_1's return value) * (a constant from global page) /100
and these changes on :p1_score_x fires another DA to do some other simple calculations.
eventually I am expecting a weighted_score to be calculated.
**
mechanically, it works. but when I click radio buttons a couple of times one after another, calculation goes crazy.
I believe my approach is wrong. What would you suggest? Should I submit the page after each radio button clicks?
Thanks in advance.
APEX version 18.x
browser Firefox
OS windows

I think chained dynamic actions are not the best idea. I changed the behaviour a little:
placed a dummyButton
hide realButton on page load
redirected dummyButton to page inline dialog saying to end user "please click calcButton"
show realButton when calcButton clicked
hide dummyButton when calcButton clicked
hide realButton & show dummyButton if anything changes on radioButtons
I wasn't sure if I should delete the post or reply it. admins; please delete if it somehow against the community rules.
thank you very much

Related

famo.us click really slow respond sometimes multiple clicks get ignored, has anyone faced this?

I am not sure what the state of click is with the new version 0.3.0 but even with fastclick. On click event handlers are really slow to respond. Sometimes the first few clicks are just ignored.
Fastclick seems to ignore taps that the browser perceives to be a touchmove. See pull request for the needed changes for this to work https://github.com/Famous/famous/pull/421

Context help button behaviour on CPropertySheet

The latest version of Microsoft Office uses property sheets that have the context help [?] button next to the close button:
When the context button is clicked it invokes the application's help rather than switching to 'context mode', by which I mean the arrow cursor with a question mark, i.e. there is no context help despite this being the context help button (or appears to be).
I'm trying to recreate this behaviour in an property sheet derived from the MFC CPropertySheet. So far I've had no luck. Ideally I'd like a click on this button to act in the same way as pressing F1, e.g. call directly on to the OnHelpInfo function.
Can anyone tell me how this might be achieved?
As per my comment, adding ON_WM_SYSCOMMAND to the message map and then processing SC_CONTEXTHELP in OnSysCommand did the trick.

What event is sent by a click on the "X" close button for an MFC balloon tooltip?

I am working on a very big and complex application for Windows written in C++ and using MFC.
I am working on this bug, where if a user presses on a balloon tooltip, it won't close, only after a timeout.
The thing is that I got the NIN_BALLOONUSERCLICK event and managed to close the tooltip, but I can't seem to catch the event raised when the user presses on the "X" button in the upper right corner.
Can anyone help me? What event should I look for? I've spent around 3 days of searching the Internet, but no one seems to know of a way.
If you can tell me how to make the "X" close button disappear, that would be okay, too!
The reason you can't find any such event is because one does not exist. It is not possible to distinguish between the balloon being closed because the user clicked somewhere on it and the balloon being dismissed because the user clicked specifically on the close ("X") button.
More information can be found in this article on Raymond Chen's blog: Why don't notification icons get a message when the user clicks the "X" button?
Basically, the event doesn't exist to keep you from doing bad things, like annoying your users. There's absolutely no reason that you should need to do something different based on how the user dismissed the balloon notification.
Making the "X" button disappear is definitely the wrong choice. Asking for that makes it sound like you're exactly the developer that the Windows Shell team was trying to protect us from. Glad someone has our back as unsuspecting users of your application. Users like to be able to dismiss things. Usability studies have repeatedly indicate that it's extremely stressful and confusing for users when there is no "Cancel" button. You need to work within the constraints of sensible, user-friendly design.
NIN_BALLOONUSERCLICK is the right choice. The tooltip will be dismissed when the user clicks on it. The documentation explains all of the various notifications that are available in greater detail.

how to make slew key in mfc

i have a dialog box in which a edit control and a button is presentfuncionality is that when i cliked on button edit control changes values from 0 to 30.for single click functionality is working fine but when i hold that button then it should quickly go on increasing 0 to 30 but its not going that way.it not taking left click down event.how to achecve this functionality
Try Spin control, it should work as you expect.
Edit: maybe you can use AutoRepeat button: http://www.codeproject.com/KB/buttons/autorepeat.aspx

"Sticky" MFC popup menu

I currently have some toolbar buttons with a small arrow on the side (TBSTYLE_EX_DRAWDDARROWS) that, when clicked, result in a popup context menu being displayed under the button. This is done by constructing a custom popup menu and calling TrackPopupMenu.
The client now wants to be able to select multiple options from the menu before it closes, so that multiple options can be be modified without the need to re-open the menu and wait for an intermediate redraw between each change.
For example:
User clicks dropdown button
Dropdown menu appears (modal, waits indefinitely for user action)
User clicks some item (e.g., toggle a checkmark)
Timer (e.g., 500ms) starts
If timer expires, the menu is closed and all selected actions are executed.
User clicks another item before the timer expires, go back to 4.
The best I can come up with is to redisplay the menu by calling TrackPopupMenu multiple times. This makes the menu "flicker" when you select an item, and will probably require me to start a thread in order to do the timeouts, which I would rather avoid.
Rather than a menu, put up a dialog box with the options on it. A dialog can easily do all that is required.
A menu that doesn't close when you click it will just seem wrong. A dialog that closes by itself will seem wrong too, but it's probably the least of two evils.
Edit: If there's anything I've learned with Microsoft, it's don't try to fight the default behavior. You're asking for trouble if you do.
If you're building your menu dynamically I can see how automatic sizing can be handy, but it's not hard to do in a dialog either - make the dialog really big and before it becomes visible, enumerate the children and take a union of all their rectangles, then resize to that. Checking the boundaries to make sure they're on-screen is just a few if statements with OffsetRect. Checkboxes are trivial; icons less so, but still not bad.
One additional enhancement that would be easy to add is to dismiss the dialog immediately on a double-click.
Following #Mark Ransom's answer, you should put up a dialog box. But you can make the dialog modeless and make it close itself when you click outside of it (i.e., the dialog loses focus). That way it could behave more like a menu.
Notice that normal menus never go away by themselves, you always have to click somewhere outside the menu (or one of its options) to make it disappear.