on 2014 Feb 12 4:03 PM
Hi to All
I have been looking at UI5 for a while now, going through examples and slowly getting them to work. I saw a couple of them with the word "dynamic" in the description but I failed to find what of the code gets generated during runtime. For example in a table the columns which should be displayed are all written out in code with an "addColumn". This means that I need to know before hand what the table is going to look like. There are cases (e.g. customer configurable table in SAP back end) where this will not be known while creating the view in UI5. Sooo... how is it possible to handle something like this with SAPUI5?
It is not obvious and maybe I am just missing something. Sometimes I think UI5 is a step backward compared to WebDynpro (which of course has other issues).
I would much appreciate any pointers or links which could help explain how SAPUI5 can handle runtime/dynamic generation.
Thanks
Harry
Thanks for your responses to my question. I appreciate the time you have given me.
Regards,
Harry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harry,
I've never been a big fan of dynamic generation of content in Web Dynpro although I have built it on occasion (in WD Java at least.) However, I don't really see SAPUI5 as being any different in terms of how you would approach it, in fact I'd say the approach would generally be the same regardless of the UI technology.
If you can get a table of dynamic columns from your backend SAP system, you can write some relatively simplistic JavaScript loops to create the columns and add them to a table. You could also use binding methods as highlighted by Jason above, which may or may not be easier depending upon the use case. I noticed earlier on posted a question over on StackOverflow along similar lines, where he has some code that might give you a starter for 10?
For me, I'd typically approach it in a similar way to many of the other *sp languages, such as JSP, BSP, etc. So you can create your empty table, then add the columns via either binding or looping, then add your data rows via binding.
This is exactly the same way as I'd do it with Web Dynpro.
Does that make any sense?!
Cheers,
Gareth.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One possible approach is to use the function factory to create controls from model data.
See the example in the documentation.
https://sapui5.hana.ondemand.com/sdk/#docs/guide/BindingAggregations.html
Many thanks,
Jason
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
12 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.