UWP DatePicker Update Value on DatePart-Changed, do not require "OK" button - mvvm

Using either Xamarin.Forms (for UWP), or pure UWP, How do I force the Date value binding to update as soon as a date-part is changed, without requiring the user clicks the "OK"/done/checkmark button?
<DatePicker Date="{Binding StartDate, Mode=TwoWay}" />

The DatePicker template allows you only to change how the control looks like when it is not in the picker mode, but rather when it displays the picked date: https://msdn.microsoft.com/en-us/library/windows/apps/mt299121.aspx?f=255&MSPPError=-2147217396
So basically you would have to make a new DatePicker from the scratch to achieve that.

Related

SAPUI5 DatePicker how to forbid manual / keyboard entry while change the date through calendar is possible?

I would like on my DatePicker to force the user to use the calendar and not the keyboard to enter a date.
How can I do that ? I've tried readonly but that does not work.
Thank you
You can use CSS since ultimately the code is HTML.
<DatePicker class="disabledInput"/>
.disabledInput input.sapMInputBaseInner {
pointer-events: none;
}
Another way would be to extend the standard sap.m.DatePicker to put disabled attribute for this input field as well.

Why doesn't the ng-lightning datepicker fire a (change) event when selecting a date?

I'm using Angular 9 and ng-lightning 7. I'm trying to use the ngl-datepicker-input component, but I'm having trouble having it behave how I want. The effect I'd like to achieve is to have a save() method be invoked EITHER:
When a date is selected in the datepicker popup window
When the user is done making changes to the input box (ie: the Angular (change) event binding for an input box)
However, it seems like the ngl-datepicker-input (https://ng-lightning.github.io/ng-lightning/#/components/datepickers) only provides the (valueChange) EventEmitter. This fires when the user selects a date in the datepicker popup window (ok for me) but it also fires on every keystroke into the input box (NOT ok for me). I don't want to save() until the user is done with editing.
I tried using just an ordinary (change) event binding on the input like below. This works very well for any user interactions with the input box. However, selecting a date out of the input box does not fire the (change) event, so I'm not able to capture those changes.
<ngl-datepicker-input
format="middle-endian"
[openOnInputClick]="false"
[class.slds-has-error]="!model.valid"
[(ngModel)]="checkpointDate"
#model="ngModel">
<input nglDatepickerInput type="text" (change)="save()">
</ngl-datepicker-input>
How can I either:
Use the (change) event binding on the input box, and then separately handle changes emitted by ONLY the datepicker popup window?
Allow selections in the datepicker popup window to also trigger a (change) event in the input box?

AEM not deleting data inside of datepicker from JCR when input field is changed to empty

In Adobe AEM, I have a CQ dialog (using Granite UI) that has a datepicker inside of it. It looks like this when viewed in the CQ dialog:
The problem occurs whenever I set a date, and save the contents of the dialog:
When I do this, I can't set the date property back to blank again. If I open the dialog and remove the date inside of this field and click save, the property still stays there.
This is an except of my cq dialog's content.xml file which contains the datepicker:
<startdate
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/datepicker"
displayedFormat="YYYY-MM-DD"
emptyText="YYYY-MM-DD"
fieldDescription="If limited by a start date, add a start date value. (YYYY-MM-DD)"
fieldLabel="Start Date"
name="./startdate"
storedFormat="YYYY-MM-DD"/>
Why doesn't it save the property when I set it to blank and how do I fix it?
---------EDIT----------
I found that even if I don't put the delete suffixes as #nateyolles places in his answer, the dialog does delete the dates when it is in full-screen mode. It still does not work when the cq dialog is NOT in full screen mode. Either way, I'm sure that this is a bug in AEM.
Use the Sling Post Servlet's Delete Suffix. See the Apache Sling doc.
<startdate
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/datepicker"
displayedFormat="YYYY-MM-DD"
emptyText="YYYY-MM-DD"
fieldDescription="If limited by a start date, add a start date value. (YYYY-MM-DD)"
fieldLabel="Start Date"
name="./startdate"
storedFormat="YYYY-MM-DD"/>
<startdateType
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/hidden"
name="./startdate#Delete"
value="this text is ignored"/>
As #nateyolles answer. You should open browser console and network tab when you submit the dialog in order to see any form's value that the dialog is transferring to server.
You can also use the date picker from coral ui : granite/ui/components/coral/foundation/form/datepicker
I've seen the issue with the old foundation components and the new coral ui one fixes that issue.

XPages mobile web application ; input time with iPhone

I'm making a mobile web application with the extension library in XPages. The user has to make some inputs. One of those is time. I would like the user to get the native spinning time scroller from the iPhone. Instead he gets an unusable time "choser". How could I do this? Now I'm using standard code like: (code is for a date but problem remains the same)
<xp:inputText value="#{document1.visDate}" id="visDate1"
defaultValue="#{javascript:#Now()}" style="width:100px">
<xp:dateTimeHelper id="dateTimeHelper1"></xp:dateTimeHelper>
<xp:this.converter>
<xp:convertDateTime type="date">
</xp:convertDateTime>
</xp:this.converter>
</xp:inputText>
You could set the type property of edit box to time, something like this:
<xp:inputText id="inputText1" type="time"></xp:inputText>
The type property supports quite a few other values. Have a look in the All Properties tab for edit box. But I doubt the value stored would be in NotesDateTime format.

kendo ui combobox data-value-change parameter not working

I'm using Kendo UI and using declarative bindings to binda element on a form. It uses the combo box widget to search for a list of options. The widget is actually performing as expected, however the search is only requested when the value has changed (this makes sense). The issue I have is the change event is only firing when the user blurs the combo box (e.g. by clicking outside the input).
This is to be expected due to the DOM change event firing after blurring, however the Kendo UI docs state that by using the 'data-value-update' parameter you can specify the event to fire on 'keyup'.
Unfortunately I cannot get this to work, here is the combobox HTML
<input data-role='combobox' data-bind="value: comboBoxValue, events: { change: methodToDoSearch}" data-value-update="keyup" type="text" data-text-field='Text' data-value-field='Id' />
This is being created as part of a kendo ui template (although I have tested outside of the template so this should not make a difference)
Thanks in advance.
The data-value-update attribute is supported only for vanilla textboxes (<input type="text" />). Kendo ComboBox raises its change event only when it loses focus.
Specifically, the data-value-update is only meant to update the bound object the widget is applied to (when you enter something into the widget, the observable is updated with the value on the given event. In this case, keyup).
I.E., because the combobox widget can only be set to one of the combobox datasource values, it doesn't make sense for the observable to bind to a temporary non-combobox-value.
I haven't tried this, but what events can you bind to via the events binding? The Kendo demos show mouseover, click, etc. Perhaps try something like this:
<input data-role='combobox' data-bind="value: comboBoxValue, events: { change: methodToDoSearch, keyup: methodToDoSearch}" type="text" data-text-field='Text' data-value-field='Id' />
In general, what event do you want to fire on keyup? If you'd like to do some manual searching to change the datasource of the combobox on keyup, that's what I'd look in to.