cancel
Showing results for 
Search instead for 
Did you mean: 

Create an Input Box in XML View with String type and RegEx

Former Member
0 Kudos

Hi,

I have the following piece of code.

Target Version - 1.36.12

	var oInput = new sap.m.Input({
		value: {
			path: "/quantity",  //^\d{1,3}(\.\d{0,2})?$
			type: new sap.ui.model.type.String(
				null,
				{search: new RegExp("[0-9]{2}/[0-9]{2}/[0-9]{4}")
				}//
						
			)
		}
	});

It is working fine as expected when the element is created from Javascript.

For our scenario, we need to use it in existing XML View.

Looking for the same functionality through XML View

	<Input maxLength="16" textAlign="Right"
		id="testInput"
		value="{
			path		  : '/testProperty',
			type		  : 'sap.ui.model.type.String',
			formatOptions : {
				minFractionDigits : 2,
				search: '[0-9]{2}/[0-9]{2}/[0-9]{4}'
			}
			}"
		valueLiveUpdate="false"
		>
	</Input>
					

The above XML code which I came up with is not working similar to the JS Code.

Thanks in advance,

Ravi

Accepted Solutions (0)

Answers (0)