Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I know what form control had focus when ribbon button pressed?
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COWould it be possible to have `onstatuschanged` or whatever it's called, connected to every field so that when your user clicks on the ribbon, the previous field looses focus and fires the event? Then, you can store THAT element's id. Haven't tried that - just speculating.
      singulars
    2. CO@Konrad tried that. problem is the "onchange" event (assume this is the one you mean as its the only OOTB event for form fields) is not called when the ribbon button is pressed!. The focus stays in the field. I can change focus to an arbitrary field so the onchange event of the current field does fire. problem then is if the field validation detects an invalid value, i want the ribbon button code to be aware that this happened. I can try doing it setting flags etc etc but it's all very kludgy!
      singulars
    3. COSorry buddy - that's all I've got. If you've tried that already, I'll be of no further use to you. Maybe you could register a control's id upon the validation fault or something like that. Do tell how you did, because next month I'll be doing some GUI work myself, probably weeping over the same issues. Also, just to be clear - you'll be coding it in JavaScript => it **will** be kludgy. :)
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload