cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Repeated xml fragment

benlim
Contributor
0 Kudos

Hi Expert,

I'm having such requirement whereby I need to display repeated fragment view dynamically as below screen shot. When there is a scenario of 3 blocks is selected, i need to append this fragment view accordingly to the page. The question is how can I retrieve the input dynamically since I'm not providing the element id in the fragment view? The reason I'm not insert the id in the fragment view is due to the view will append dynamically and it will get duplicate id errors if I gives the element id in the fragment view.

I've tried using domfef to get the value but unfortunately I only can get the input field for name and passport number. Relationship field is using select controller and it's not under input field category. Any idea whereby I can retrieve all the inputs dynamically?

$(pageDom).find("input").each(function(index, elem)

Thanks.

Regards,

-Ben-

Accepted Solutions (1)

Accepted Solutions (1)

vaibhav_gb
Explorer
0 Kudos

Hi Ben,

you do not really need a fragment here to fulfill your requirement, you can add a simple form inside a list and bind a model to it, by this you can capture all the data in the model.

here is an example for your reference, where all the dynamic data is stored in the model and fetched when needed.

Note: make sure you add some users before you press "get all data" in the example.

regards

GB

benlim
Contributor
0 Kudos

Thanks @VAIBHAV GB for the sample reference shared out! It does help me in terms of my app design. I would like to ask your advise what if another way round. For example, I already have the model data stored, how would I be able to populate these model in the dynamic form?

Regards,

-Ben-

vaibhav_gb
Explorer
0 Kudos

you can assign the model to the list in any of the hook method or in router pattern matched method.

Answers (0)