Is it possible to access the built in 'done' and 'cancel' buttons to check which was touched/clicked. I am using the timeSpanPicker control and want to check if, when the control has been tapped, the user has confirmed a new time span or cancelled it?
When you pick a new value and tap the done applicationbar button the value changed event is raised. That's how you know a new value has been selected.
Related
I have an Access form with a couple of buttons that I want to disable based on the drop down selection of another field.
When the Status dropdown is set to "Closed" I want the "Add" buttons to be disabled, disappear, or inactive for people to use. I also need the buttons to be reactivated if the job is reopened.
I thought I would use the OnCurrent attribute but so far I can't figure out the correct code to make it happen.
Thank you.
Place code in form Current as well as combobox AfterUpdate events.
Me.buttonname.Enabled = Me.comboboxname <> "Closed"
Or use Visible property if you prefer.
I need few suggestions/workarounds. I am having an issue on user experience of ngx-bootstrap inline datepicker.
If the user selected the date range on the same day, some user only click once. The problem is bsValueChange only emit when click twice. So when the user click the apply button on the screenshot, it applies the previous value. What i want to do is if the user did not click twice, i disable the apply button but the v5.3.0 does not have an event emitter for that situation.
Thank you
enter image description here
Hi I would suggest you add some external buttons with some predefined date ranges like in here. quick dates with buttons
Then you can just hook it to a click event and in the method you set the bsValue input to [m().subtract(0, 'days').startOf('day').toDate(), m().endOf('day').toDate()]; where m refers to momentjs.
In my form contains textbox and button. I am doing some operation in textbox (blur) event and button (click) event.
Let's assume:
user enter some text in textbox and click the button. (blur) event invoked but (click) event not invoking.
note : "at the time of clicking the button focus should be in textbox."
example: https://stackblitz.com/edit/angular-b4h9pi
blur event alert is coming but click event alert not coming.
Scenario
In onblur event I make the service call to save that field value. In onClick event I have to save all the fields data. If cursor focus one of the textbox then user click the save button. First I have save the field after finishing the first call, make the second call to save all the data. Do not call the service parallel. I want to call one by one.
Remove alert with console.log or other relevant code. alert will be triggered as as soon as focus is lost from the input even before the button is clicked. So two event is not firing simultaneously
stackblitz
Both events are indeed firing. You can confirm by changing your alert calls to console.log. I believe the browser is likely just blocking multiple alert dialogs.
Update to answer your comment:
You say you want them to fire simultaneously and then you say you don’t so I’m having trouble understanding your needs.
I can tell you this though. The blur event fires, then the click event fires. You should be able to handle whatever you need to in those handlers with that knowledge.
If you need to wait for your blur handler to come back with a response before sending that data along with your click handler, you could theoretically set a variable like
this.blurRequestLoading=true
That way, instead of firing the click request, if blurRequestLoading is true, you could set a this.clickEventPendingBlurResponse=true.
Then when the blurResponse comes back, you can set blurRequestLoading back to false, and if clickEventPendingBlurResponse is true, fire the clickEvent manually within the response handler, and set clickEventPendingBlurResponse back to false.
Hi thanks for your time and effort, i did one logic to sequence the event, please suggest me is this code in production level.
sample code base: https://stackblitz.com/edit/angular-czxn9o
I am using htmlunit to select radio button, and after clicking this button i checked if it is selected and got true which is fine.
my problem is when I leave the page and then back to it the radio button is not checkd and the default one will be the checked one !
does any one has idea about this issue ?
If somebody needs solution to this, you need to save the state to HtmlPage. When you want to resume to earlier radio button selection state, can achieve that using following code
HtmlPage selectionsHtmlPage = (HtmlPage) webClient.getCurrentWindow().getEnclosedPage();
in future, at any point when you want to start over from the selection again,
webClient.getCurrentWindow().setEnclosedPage(selectionsHtmlPage);
This method is just a way to do that operation only when doing this does not affect/break the ideal expected workflow of the web application.
Working in both A2003 & A2007.
How do we ensure that a selected TextBox gets the focus when the form loads? If we put MyTextBox.SetFocus in the Form_Load then we get the error:
can't move the focus to the control
This form is designed for rapid data entry, and the form somewhat rearranges itself based on the last used settings. So there are several different textboxes any of which may need the focus depending on the user. We can't just fix it in design time by giving MyTextBox TabIndex=0.
The help says something about calling Repaint which just doesn't make any sense at all:
You can move the focus only to a
visible control or form. A form and
controls on a form aren't visible
until the form's Load event has
finished. Therefore, if you use the
SetFocus method in a form's Load event
to move the focus to that form, you
must use the Repaint method before the
SetFocus method.
The best bet in this case, is to ensure that the textbox to get focus is numbered 0 in the Tab Index property.
You cant set the focus as the controls don’t really exist yet, try putting the code in the OnActivate event instead
Or just put a DoCmd.Repaint in the OnLoad event before trying to set the focus. Both should work but I'm not near a computer to check
In my experience, I've always gotten that error when the control I was trying to set focus to was either 1)not visible or 2)not enabled. I assume you've already checked those, but it would be worth double checking at runtime when you get the error message (especially since you said you are shuffling the controls at runtime).
I use the .SetFocus method pretty regularly without trouble. I don't recall ever getting an error message when setting focus to a control that already has it as Remou stated in his answer.
I believe there is also a third case that occurs if you try to set focus to a control in the form header/footer of a bound form that has had all of its records filtered out. I know that situation causes "disappearing" contents in an unbound combo box, but I think it may also play havoc with the SetFocus method. If you are opening the form in Data Entry mode, though, that should not be an issue.
Move SetFocus to the form's On Current event. Should work then unless perhaps the form's record source contains no records and you've set the form's Allow Additions property to No. In that case your text box will not be available to SetFocus on, but in my testing it doesn't throw an error.