I'm using the VerticalGrid in MultiRecordView. Its Validate event fires when the grid detects that a record that has been changed is losing focus. I'm writing data to the database from this event.
My users want to use the keyboard left/right arrow keys to move forwards and backwards through the recordset, so I trap those keys and set the FocusedRecord accordingly.
If one of the row editors is a RepositoryItemRadioButton, the Validate event doesn't always fire. The users will click on the radio-button value desired and then, before they click on another row in the record, they'll hit the arrow key to move to the next record. The change to the radio button group has not been detected by the grid in that sequence of events.
The radio button change is detected only when the button loses focus.
Is there a way to cause the vertical grid to recognize that a radio button editor has been changed and fire the Validate event, if the user doesn't give another row in the record the focus?
I thought EditValueChangedFiringMode property controlled that behavior, but setting it to Default or to Buffered does not have the desired effect.
Thanks
Related
I have an application whereby I have the behaviour of 2 groupboxes enable/disable based on the value in a combobox.
This combobox however the behaviour for the group boxes only works when I leave the field by tab or click, not when the text changes.
I have tried using the Leave, TextChanged, Validated Events and everytime I have to actually "Leave" the field for it to perform the enabled/disabled of the groupboxes and their subsequent controls.
I need it so that when they choose 1 of the 3 options it immediately changes and doesn't work when they leave the field but when they choose the correct word.
Any assistance would be great I'm tearing my hair out here.
I think you are looking for the event on your combo boxes
SelectedIndexChanged
To stop the user from leaving an invalid field use the event
Validating
set the e.cancel to True if the validation fails
I have a textbox that when focused it calls an ajax request and populates a list for the user to choose from. Basically just recreated the dropdown using a textbox instead of a select.
The problem is that if I click on the textbox the browser does not recognize the tabindex of the input. Instead it resets its self and starts back at 0. If I tab to the next element tabs work fine, only when I click in the input field to give it focus does it start acting up.
I did notice last night if I put an alert in the page on the focus event that it seems to work. Guessing because the browser focuses on the elememt after I click the ok button.
has anyone heard of this before?
found what was causing the problem. I was calling .blur() on keydown and code was 9 or 13 (Tab/Enter). Not sure why this would give me the problem I was having. I would have just thought the blur event would have executed twice. However I suppose that I was forcing blur on keydown and the current tabindex was not being set. If this is the case then If I needed to I should beable to call blur() onkeyup event.
I have a form with a subform that is a continuous form. I have a tab control that displays information related to the record selected in the continuous form; the tab control displays as soon as a record is selected/clicked. That all is grand.
However, after the user updates information in the tab control and clicks a button, I want to hide the tab control until a record is actually clicked on the continuous form.
What is currently happening is that the first record in the continuous subform is selected and I'd like for no record to be selected.
Is there a way to set the current record/selection of a continuous form to nothing or null? I've tried setting the bookmark on the continuous form to null in the button click event using Parent.SubApptList.Form.Bookmark = Null and that does not work for me.
Seems like it should be easy, but I can't figure it out.
After the button click event could you set focus to the parent form? Doing this would force the user to click on a record. Maybe I'm not fully understanding exactly what you're trying to do but if all you want is for nothing to have focus after a button event then that's the route I would take. That's assuming you don't having any on focus events for thr main form.
Triggering edit mode in dojo dgrid with mouse event is easy. Here's what I have done:
editor({field: "checkNumber",label: "Check Number",editOn: "click"})
However, i want to trigger edit mode using keyboard. Specifically, i want to go into edit mode when I press the space key. How can I programmatically set a cell to 'edit mode' or 'non-edit mode'?
When you add one or more editor columns to a grid, it makes the edit method available on the grid instance, which you can call with a cell element (or event referencing one) to programmatically shift focus to the editor for the cell.
Meanwhile, the Keyboard mixin has an addKeyHandler method which you can use to add handlers to respond to keydown events for particular keys.
Combining these two things, you can easily do the following to cause the grid to edit the focused cell when space is pressed:
grid.addKeyHandler(32, function (event) {
grid.edit(event);
});
(edit should have no effect for cells in non-editor columns.)
An alternative solution could be to create an extension event which triggers either on mouse click or on space keypress, and pass that to editOn instead of 'click'.
var grdobj = dijit.byId("...");
var editCell=grdobj.cell(rowNo, "checkNumber");
grdobj.edit(editCell);
Instead of cell function, you could make use of right, left, up, or down functions.
Hope that helps.
I have a text box and want to know if the data enter into is via pressing numeric keys or via a CTRL+V or via mouse right click.
Do not want to use windows message to process for paste/right click paste event.
You can use the KeyDown event to see whether Ctrl, then V was pressed (in two subsequent events).
You can use the MouseDown event to see whether the right mouse button was pressed.
You can use the KeyDown event to see if numeric keys were pressed.
If you use a flag for these three cases, then check it in the TextChanged event, you can determine where the text likely came from.