SAPUI5 - Mobile app paging, alternatives to paginator - pagination

I'm investing a survey / questionnaire app in SAPUI5...
As it's mainly to be used on a mobile device, and the questionnaires will consist of many questions, what are the best SAPUI5 components to use for paging through the questions?
Paginator is ugly and will be deprecated soon, so I'm looking for alternative suggestions.
Can anyone help?

how about NavContainer. https://sapui5.hana.ondemand.com/explored.html#/sample/sap.m.sample.NavContainer/preview
It is very good fit for your use case , and it has good user experience in mobile devices. You can define your own Back and Next button in the footer to navigate between different questions.
Thank you.

I know the question is already answered by Allen, so this is an alternavtive suggestion.
Assuming that your model will be something like:
{
"Questions": [{
"QuestionID": "0001",
"QuestionText":"What is a Blah?"
"Options": [{
"OptionA":"Blah",
"OptionB":"BlahBlah",
"OptionC":"BlahBlahBlah",
"OptionD":"None Of the Above Blahs"
}]
},{
"QuestionID": "0002",
"QuestionText":"To Blah or not to Blah?"
"Options": [{
"OptionA":"Yes",
"OptionB":"No",
"OptionC":"Blah",
"OptionD":"Blah ha ha ha"
}]
}]
}
You can also accomplish the same effect without a NavContainer and a Single View. The View will be bound to the above model. The View / Page might have two buttons for the "next" and "previous" functionality. On click of each button you can manipulate the BindingContext that is bound to the view so that the Context changes and not the view. To set a new BindingContext, you can track which question is currently displayed on the screen and use the .bindElement function to set the Path of the next / previous element to be displayed.
Pros: Only one View and Controller
Cons: Need to manage the context and paths, Also means that the binding is little more complex and you might need factory functions based on whether the number of answers can vary between 2 (True / False questions) to 4 (MCP as in the above example)
Helpful link for Element Binding: https://sapui5.hana.ondemand.com/explored.html#/sample/sap.ui.core.tutorial.databinding.13/preview

Thanks for all you help on this. I'd like to use binding path/context to create a new survey create app, but just need some examples of manipulating the binding to create a new path for example, I've created a new question
here

Related

drupal 7 nodes listed in views are not attached to the menu, but need to be

Using Drupal 7, I am displaying news articles via a View. The view is linked into the menu, naturally, but as a consequence the news articles are not. This becomes an issue because when an article's detail page is displayed, the site loses the active trail and consequently the breadcrumb trail and the left-hand secondary navigation menu lose their place.
Is there some way of setting the menu to think it's in a certain place within the menu tree, eg. Your College -> Life at the College -> News & Events?
I've seen menu_tree_set_path, which looks promising, but haven't seen an example of how it's used (at least in terms an Enthusiastic Amateur like myself would get).
As ever, any and all assistance given is greatly appreciated,
~Matt
The Context module will allow you to set the active trail of a drupal menu dependant on paths etc.
https://drupal.org/project/context
When you're dealing with breadcrumbs, an easy way to achieve breadcrumbs on a per content type basis (and others) is the custom_breadcrumbs module.
On a separate note, if you want to display full menus, look at the menu_block module. We used this plus the menu_tree_set_path() function to display local menus on nodes that weren't in menus.
$config = menu_block_get_config(1);
$path = "node/{$nid}";
menu_tree_set_path($config['menu_name'], $path);
$data = menu_tree_build($config);
The number passed to menu_block_get_config(), is the delta of the menu_block configuration in blocks.
With $data you can use a drupal_render or pass it back to another theme rendering function.

QSelectSection not saving values when scrolling QuickDialog

I've been struggling with this for 3 days. The documentation for the QSelectSection is the class itself, and the QuickDialog docs are minimal at best.
I'm trying to use the QSelectSection using the QuickDialog framework. I have it working for most of the controls (after diving head first into the code to see how the component works) but this one has beaten me. From my understanding, and the way the other controls work, this should dump the selected item values into the alerts array within my controller. I want to put as much in the JSON as I can, and only use the controller to store/submit the details if this is possible.
The JSON below generates the dialog and my multi select form. Awesome, but for some reason when I scroll the select section off screen, my values are gone. When I submit the form, the app does not see my selected items. When I try to use "controllerAction" to store these values, the app just crashes.
{
"grouped": true,
"title": "MyTitle",
"controllerName": "LOrderViewController",
"sections": [
{
"title": "Notifications",
"type": "QSelectSection",
"bind": "selectedItems:alerts",
"multipleAllowed": true,
"items": [
"Email Alerts",
"App Alerts"
],
"footer": "My Footer text."
}
...
]
}
What am I missing? What code is required in my controller, how can I trigger that code?
Am I better off scrapping QuickDialog for something that is better documented, or just stick with native methods?
Love the concept of QuickDialog, but the same isn't holding true for me with this taking so long to learn.

Swapping ActionBar items when displaying different Tabs and Detail Views

this is not a technical question, but one for advice regarding the best practices in designing an Android tablet UI.
I've got my concept of an Android Phone app pinned down.
The first activity (master view) launched contains a tab bar with three fragments from which the user can launch detail view activities of different sorts.
Both the master-view activity and the detail-view activities have actions in their action bars. Different detail views have different action items.
My question is: How should I organize and display the action items on a tablet, where an activity combines both views side by side?
The problem is the unified action bar for both the master-view fragment and whatever kind of detail fragment is shown. I do not think it is a good idea to start messing with the contents of the action bar whenever a different kind of detail view is opened.
The Android Design Guide does not tell you much on that front. There is a sample of a Contacts app in the "Multi-pane Layouts" section, but it does not actually deal with the problem. It evades it, by putting the single relevant action as an icon inside the detail view fragment.
Any advice with regards to best practices and references are appreciated.
I would suggest leaving your master details icons in the action bar, whilst putting your details view icons in another view/area within the details fragment.
My reasoning would be that icons in the action bar affect / are associated with the whole app / view on screen. Whilst your details icons only affect the details view and therefor should not be in the action menu when showing multiple fragments.
I guess you will have to see how the designs look..
I am not a fan of the action bar icons being changed from within the same activity (even if it contains multiple fragments), however when you load a new activity (like in your phone design) then I say yeah throw them in the action bar.
If I understand your question correctly, which I think is basically a question of how multiple Fragments (i.e. when on a multi-pane layout such as on a tablet) should contribute to the single ActionBar, it's quite straightforward and it is actually briefly discussed in the documentation here. Essentially, you can have the multiple Fragments all contributing their own menu items / action items to the single action bar, via some simple API calls.

Reusable edit form in Apache Wicket

I have a simple ContactEditPanel which contains a form and a number of textfields. Up until now I included an AjaxSubmitLink in this panel which, if the form content is valid, saves/updates the Contact instance contained in the Panel model. So far so simple. However now I'd like to remove the link in order that I may, depending on the context in which I use the ContactEditPanel, place the submit link at different levels of my overall component hierarchy. For instance in one context I'd like to use to flip between ContactEditPanel and ContactViewPanel with a bar of actions above the current view (edit | save , cancel). Another context would be to use ContactEditPanel in a standalone way (maybe part of a multi-step process) with just a save link below.
I was contemplating refactoring my ContactEditPanel to extends FormComponentPanel rather than Panel as described here but I'm not sure whether this is the right approach and I'm having trouble wrapping my head around this.
Any help would be most appreciated!
Many Thanks,
A
Your using the panel like a FormComponent so extend FormComponentPanel, it will allow you to keep all the validation you write contained to the component and also allow you to reuse it as you wish.
Just think of it as you've created a new FormComponent, like a TextField or DropDownChoice.

Using the DataView in XPages Extension Library Mobile Controls

On page 1 of a mobile app I need to display categories from a categorised view. When the user selects a category the app should transition to page 2 showing documents in the selected category. The customer does not want the category to expand/collapse on the first page of the app.
Would I use the DataView for this? Any advice on how best to achieve this?
Thanks.
if something like this http://sutol.mapsys.cz/ (application is in Czech, but you can still see what it is about) is what you need, I can send you the code.
"dopoledne" and "odpoledne" are categories
Yes what you want is a dataview, there is a property to disable collapsing / expanding of the category sections.
My suggestion would be to view either of the remodelled templates "Discussion 853 XL" or "Teamroom 853 XL" that come with the ExtLib, these applications have been modified to add mobile front ends and are great examples of how to build mobile applications
I do something along these lines in mobile pages of XPages Help Application - Contents and Index views both drill down from categories to documents in the category. I think I just use a repeat control.
The one thing to bear in mind is that you cannot currently redirect to the current Mobile Page with different parameters. That's why I switch between two mobile pages that use the same Custom Control for the view.

Resources