Skip to Content
0

SAPUI5 Repeated xml fragment

Apr 12 at 03:18 AM

51

avatar image

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-

1.png (14.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Apr 12 at 04:30 AM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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-

0
Former Member

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

0