cancel
Showing results for 
Search instead for 
Did you mean: 

How to Attach Input Assisted to Input field which in SimpleForm?

former_member593030
Participant
0 Kudos

Hello All,

I am using below link as an example,

https://sapui5.hana.ondemand.com/#/sample/sap.uxap.sample.ObjectPageFormLayout/preview

Please check block/employment/BlockJobInfo.view.xml Very Important -

The input field is available in Simple form.

Now I also need to Attach, Input - Assisted.

So I am using this example below to my input field in SimpleForm

https://sapui5.hana.ondemand.com/#/sample/sap.m.sample.InputAssisted/preview

My Code is

<Input id="HomeCompCode1" 
		       type="Text"
		       maxLength="8" 
		       width="200px"
		       showSuggestion="true"
		       showValueHelp="true"
		       valueHelpRequest="handleValueHelp"
		       suggestionItems="{/CostCenterSet}"/>

So Error is

Uncaught Error: Missing template or factory function for aggregation suggestionItems of Element sap.m.Input#__xmlview0--jobinfo-Collapsed--"HomeCompCode1"


Without SimpleForm it is working fine me.

Accepted Solutions (1)

Accepted Solutions (1)

maheshpalavalli
Active Contributor
0 Kudos

You are missing one important piece of code there.. Actually you are using aggregation here, which is suggestion items.. So if you are using the aggregation suggestion items, you need to put template for the same.. see below:

Also, you can check the code there as well, which clearly mentions the aggregation usage.

https://sapui5.hana.ondemand.com/#/sample/sap.m.sample.InputAssisted/code

<Input id="HomeCompCode1" 
		       type="Text"
		       maxLength="8" 
		       width="200px"
		       showSuggestion="true"
		       showValueHelp="true"
		       valueHelpRequest="handleValueHelp"
		       suggestionItems="{/CostCenterSet}">
	<suggestionItems> // This is the aggregation you need to use as you are using suggestionitems
	   <core:Item text="{Name}" /> // This is the template which is missing in your case
	</suggestionItems>

</Input>
former_member593030
Participant
0 Kudos

Hello Mahesh kumar palavalli,

Thanks a lot for Help, This work for me now. I tried this earlier also but was not working.I guess I was missing </Input> tag at End.

How To Call valueHelpRequest="handleValueHelp" in my Controller?

When I press f4 , valueHelpRequest in controller is not getting triggered.

Is it a special way we should call this in controller.

maheshpalavalli
Active Contributor
0 Kudos

Hi Sujoy, I suggest you to close this thread and open a new post for that question as the error might be due to many reasons and that itself is a new question..

But the most probable issue is due to missing controller name in xml view.. if the controller is not mentioned in the view then it won't trigger the function..

Best Regards,

Mahesh

Answers (0)