cancel
Showing results for 
Search instead for 
Did you mean: 

TimePicker does not update the OData Model

Former Member
0 Kudos

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?

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
Active Contributor

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

Former Member
0 Kudos

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?