Skip to Content
0

TimePicker does not update the OData Model

Mar 24, 2017 at 01:38 PM

75

avatar image
Former Member

Hi,

I am facing a problem with a TimePicker in my UI5 application. I have an ODataV2 Service which has a time field in the format "Edm.Time". I have bound it to a TimePicker and used a formatter Function to resolve the timezone offset issue.

<m:TimePicker dateValue="{path: 'Bcontd/Cttime', formatter: '.formatter.timePicker'}" />
timePicker: function(time) {
			if(time == null)
				return null;
			//timezone offset in ms
			var TZOffsetMs = new Date(0).getTimezoneOffset()*60*1000;
			return new Date(time.ms + TZOffsetMs);

}

The time is perfectly fine displayed in my Timepicker and I am able to change the time inside the TimePicker but my OData Model does not seem to update the value.

Does anyone know what I am missing?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Jun Wu Mar 24, 2017 at 01:42 PM
1

once you use formatter, it becomes oneway binding....if i am not wrong.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Yes, you are right! When I removed the formatter function, the TimePicker updates the model. But now I'm facing the problem that I have to pass the value over the "value" parameter because "dateValue" only allows a JavaScript object to be passed. Therefore, the Timepicker writes a String into my model which causes an error when I send the Merge request to the backend system. Do you have any idea for that?

0