How to set the order in subnodes of a tree structure - treeview

I have a tree representation of pages in a CMS application. I understand how to persist the tree in the database. However, I don't have a good way to:
A) Reorder subpages under a particular parent page.
B) Provide a UI implementation that allows the user to change the order.
Any suggestions?

Changing the order itself will require you store some sort of ordering along with each page in the database. Just the current highest / lowest value +/- 1 would probably be a fine starting point. Once you've got that ordering in there, reordering becomes a case of swapping two values or changing the value for one page to be between two others (you could use floats I guess, but you may need to renumber if you split it too many times).
Anyway, once you've got that, you need a UI. I've seen a very simple 'swap this with the one above/below' approach which can be a simple web link or an AJAX call. You could also present all the page values to the user and ask them to renumber them as they see fit. If you want to get fancy, JavaScript drag and drop might be a good approach. I've used ExtJS and Mootools as frameworks in this kind of area. If you don't need all the Extjs widgets, I'd say well away from it in future, and look at something like the Mootools Dynamic Sortables demo.

A) I have a similar CMS app and I store an ordinal value with the page for a particular tree and sort on this value -- because lots of my pages appear in completely different sites I have to maintain the ordinal number against a page / tree combination.
B) I too would like a better way to do this. Currently they click on the node in the treeview and in the main page screen they can move the page around. I've tried drag and drop with java script and other solutions but my users could never work with it without lots of hand holding. I'll be interested in the responses to this one.

Related

UI Collapsible items in Elm: a css-only solution vs storing more data in the model

For example when implementing these collapsible items:
First approach that comes to my mind is to store a variable in the model expandedItems: List ItemId
to verify if an item is expanded you check if its id is in the list
to expand an item you add its id to the list
to collapse an item you remove its id from the list
There also are css-only solutions like this one https://jsfiddle.net/5hcwzf7s/2/
What would the advantages / disadvantages of css-only over the id list be?
I think storing the list in the model is common, easy to understand, and the usual way to do things like these.
I find a few downsides to the css solution:
is hard to read and understand
is fragile and hard to maintain
might not work on all browsers
uses href which makes the item id show up in the url when you click to expand
treats expanding as a url change, and when the user clicks back it unexpands the item instead of navigating to the previous page
only allows one item to be expanded at a time
On the other hand, I find no downsides to the expandedItems list approach. Performance might be a concern because we're operating on a list, but the user will have to be expanding thousands of items to make the list long enough to notice any difference. I don't think is polluting the model either, this kind of information is what the model should hold.
I think you want to put this all in your model. The css approach is perhaps a nice trick, but is not very scalable.
In particular you would end up putting state in the css file, and part of it even twice. Keep it all in your model, put the full content into the screen, and then just attach a class when contracted, which sets a max height and truncates the rest with elipsis

Using AngularJS, which is optimal with regards to ng-repeat

I have a potentially long repeating list with lots of data associated with each reapeated list element. There is also a hidden panel that contains more data and interactive tools that can be used on each repeated element (comments, tags, etc.).
My question is: Is it more efficient to include a duplicate of this panel within each ng-repeat, already filled with the appropriate data, or have one panel outside of the ng-repeat scope, who's data get's fill after clicking the 'panel toggle' button?
Extra details: This is a responsive site, with an emphasis on mobile use, so we are trying to minimize data sent, and make the amount of Javascript short and sweet (so far it hasn't been a problem at all).
After typing it out, I think the best option would be to have one tools panel, and populate it depending on which 'panel toggle' button is clicked. Fewer DOM elements the better, right?
It also leave it open for lazy-loading of the extra details in the future.

How to insert multiple rows into embedded view from a subform? Lotus Notes

I have a section that contains a subform ( containing 3 editable fields for the user ).
Then I have an embedded view categorized having two actions: Add and Trash.
What i want to do: After the user complete the 3 fields and then press Add, the first row in the embedded view will appear. ( This easy thing I did ). But then after the first click on Add, I want that all the 3 fields to be refreshed, all of them to have as their value: "".
After, if the user wants to add another row into the embedded view (with different values), in my case it is overwrited on the 1st row. I want to be separate rows in order.
I tried something with #Command(ViewRefreshFields) into the Add action code but I didn't make it to work. Please help, J. U.
Jazir, I'm guessing that you also go by the names "Florin G Mihalache", "Josh Mitchell" and "Yveniss Ltoreau", and I've been following the development of your application along with many other professional Notes developers.
I really think you need to go back to the very first basics, and work out the difference between forms, subforms, documents, views, embedded views, and other important components of Lotus Notes databases.
I strongly suspect that for a couple of weeks you have been trying to use a form to create other documents, via a subform, to be displayed in an embedded view in that form, when what you should be using is just a view, and documents. Perhaps you might need to use pages, outlines and framesets. It is very important that you understand these basic concepts before confusing the people who have tried to help you, to whom you may have lied.
I have voted your question down, not just because you have shown a lack of research, but because you appear to keep switching ID when people lose patience with you. I will undo that vote if I become convinced that you are not Florin.
The documents displayed in an embedded view are controlled by the view's selection formula. You haven't shown that. You haven't shown your code in the Add button. You haven't shown what properties you have set on the embedded view -- e.g., show single category. So you're not giving us quite enough info to diagnose your problem and help you.
But in general, I think that if you want to control the order of insertion of individual documents into an embedded list, perhaps using an embedded folder would be a better idea than an embedded view.

odata and pivot control with several pivotitem controls

my pivotitems each require different odata calls in order to populate data in them.
must i make all those calls when the pivot is intialized or is there a way to fire each call when the user flicks to that pivotitem?
Any example of this will be appreciated.
thanks
You may choose both approaches in different situations.
From user experience view, preload all data is always better. In this situation, when user scrolls to the next page data is already there. Note, that first page you must load as fast as you can (use some delay approaches for other pages, for example).
Write out all pros and cons that you achieve, and you make a right choice ;)

How would you design a good search UI?

I want to provide my users with an 'advanced' search engine.
I basically have a lot of search criteria to chose from :
some are very simple/common and will be largely use (ie time period, item id)
some are a bit less mainstream
and some won't be used a lot, but I still want to provide them
Overall, I have around 30+ criteria to chose from
The result is a dataset which I display in a grid.
I've search for inspiration on internet, and even google doesn't seem to have a nice solution for advanced search.
I've designed this kind of tools in the past, and I wasn't really pleased by the result, although the user were eventually able to use it quite effectively.
Do you think the search panel should be visible all the time (ie displayed on top of my result grid) or available in a separate form (which would let me use more place for all the controls)
Do you think it's better to display all the search criteria, or to let the user click on 'advanced' if he wants to see/use more criteria
How would you organize the criteria? by usage frequency, or rather by area (ie. criteria related to user, to location, to time, etc.)
Where should I put the 'Search' button? next to the more common search controls, or at the bottom, or both?
And more generally, do you have tips you want to share on how to design a nice search UI ?
What kind of functionalities do you usually miss in this kind of 'advanced' search engines?
Not an expert on UI, but I have seen a lot of bad UI.
KISS is a good start.
Make it intuitive.
Keep the search both at the top and at the bottom. I'd be loathe to use something that forces me to move up the page to type (see Flex documentation, their pagination control is only at the top -- a miserable pain you know where).
Organization of criteria should be two-fold:
basic operators (20%) which 80% will use up-front
dynamically edit the set of criteria available at any time.
Get the users started with least ramp-up time and allow them to add/remove criteria on a as needed basis. The idea is to make him use something he needs and not clutter his thought or workflow with the brilliance of your feature set.
As others have mentioned and is the trend nowadays with UI in general, use controls that are hidden until and unless the user explicitly wants advanced/fine-tuning (on-demand UI).
A good rule of thumb is to have a maximum of 5-7 features on a page.
It'd be great if you can arrange the criteria in such a way so as to make a story out of it i.e. the user can read his query and your operators make some meaning out of it.
I'm a big fan of little text and easy to comprehend icons but such a setup depends on your installation environment. Can your grandkid use that mighty workhorse?
Good design also necessiates that you make your UI accessible. That's a tough nut to crack and I have absolutely no idea how you'd do that.
Best of luck!
I tend to like the "list of rules" approach. You know the one:
Find items that match [ All |v] of these conditions:
[Name |v] [Contains |v] [_____________] (-) (+)
[Start date |v] [Is before |v] [_____________] (+)
(Cancel) (Search)
This keeps the dialog from getting too cluttered but still gives users all the options they might need.
But that assumes you need things to be that advanced! You might find that an intelligently-designed keyword list approach will work fine.
Keep the advanced controls hidden by default. Your search input and action button should always be visible and given prominence, regardless of whether or not your advanced controls are visible. Make sure that showing/hiding the advanced controls does not change the location of either the primary input or button - those need to remain static so the user's spatial memory is not affected.
As for the advanced controls, without knowing exactly what type of data you need to show, I can only give an overview of potential organization methods. Personally, I like LATCH:
Location
Alphabet
Time (timeline or chronology - think of a history museum)
Category (think department stores)
Heirarchy (biggest to smallest, lightest to darkest, etc.
Depending on your controls, one of those will make the most sense. Organize accordingly. If you can use a slider or range input (for example, 'lightest', 'lighter', etc.) rather than a list of checkboxes/radios, this is preferable as it reduces the number of visual elements on the page.
Forget about the "plus/minus 7" rule - that has been taken completely out of context by folks who did not actually read the study. In short - it's only applicable to the human's response to external stimuli, not options displayed on a screen. This isn't saying you should go overboard, but even if you have a lot of options, you can visually tweak them. Clutter is a failure of design - not information.
Remember to use plenty of whitespace and <label> elements to give each option a good-sized click target. This is especially important when dealing with checkboxes or radios.
Make sure that when the results are returned, there is a clear title (<h2> or <h3> usually suffices) re-stating the user's query, and how many results were returned. Don't forget about a 0 results page! Offer some advice on broadening the query, if possible.
Just a general advice: keep it simple. To much choice confuses the user and increases the chance a certain piece of functionality is not used.
Try different prototypes on users to findout which options are valuable and which are not.
1) Do you think the search panel should be visible on top of my result grid?
A simple search panel like Google’s basic search may be on the Results page since it’s compact. This allows the user to re-try the search with different criteria without wasting time going to a new page or window. Advanced search is much more cluttering so there’s a more important tradeoff between easy access to the results (in a smaller pane) and easy access to re-search, so you need to appraise the frequency users re-searching versus the work they do with the results. For example, if re-search happens 50% of the time, but including an Advanced Search panel in the Results page requires additional scrolling 75% of the time, your users are better off without an Advanced Search panel on the Results. As a general rule, Advanced Search should not be on the Results page unless the task is really cut-and-try exploration of the data.
Another issue with the Search panel at the top of the results is what to do if the results do not correspond to the criteria (e.g., if the user changes a criterion after the results are shown but before clicking Search again). With Advanced Search it is much easier for users to forget or miss whether they changed a criterion or not and then be confused about what criteria is in effect for the results. Putting Advanced Search on a separate page prevents this, although there are other ways to avoid this problem if Advanced Search is on the Results page (e.g., using instant-apply “faceted” search).
In any case, the Results page should display the criteria used in making the search.
2) Do you think it's better to let the user click on 'advanced' for more criteria?
For most database apps, users of a particular group (e.g., job position) have 2 to 5 specific sets of search criteria that get them through the vast majority of their work, (e.g., search for orders made between two user-supplied dates), sometimes including criteria that even have specific criterion values (e.g., search for all orders with a pending status). In this situation, users will be fastest and least likely to be confused if you have an Advanced button for ad hoc searching, while the default search has controls tailored for these specific searches. Default to Advanced Search only if your users will primarily be conducting exploratory ad hoc searches.
3) How would you organize the criteria?
If there are certain criteria that are used especially often, then they’re handled through Basic Search as described for 2, so there’s little advantage to sorting criteria in Advanced Search by frequency. It just makes it hard for users to find the criterion they’re looking for. Generally you can rely on users having a specific named field in mind, so sort the criterion alphabetically, or, if users are familiar with the Results Page and its fields are laid out in a manner consistent with how the users think, use the same order as used for the Results columns.
4) Where should I put the 'Search' button?
The Search Button ideally should always be visible. The best solution is to have all the criteria on a scrollable pane with the button outside the pane. Putting the button at the top and bottom is a common but kludgey alternative. I wouldn’t put it by the common criteria because if your users have gone from Basic to Advanced Search, they’re probably not using common criteria. Consider no Search Button if you can keep response time under 500 ms, instead providing instant-apply like seen in Vista.
5) How to design a nice search UI?
For field-based multi-criteria Search, there are two basic designs:
a. A form of all fields with a place to enter criterion values for each field. The problem with this is fields with set values can scroll out of view and users may have forgotten they’ve set a value. Thus you want to keep this as compact as possible. See the chapter Improving Data Retrieval in Alan Cooper’s About Face 2.0 for one approach. You can also provide a summary string of the selected criteria near the Search buttons which the user can check. Clicking each criteria in the string can even jump the user to the criteria for changing it.
b. The user selects from a list of fields those to be used in the criteria, then sets the values for the criteria in consolidated location. The main challenge here is to minimize the number of “overhead” clicks to select a field. Ideally, the list of fields are always available and one click selects the field, puts it in the consolidated location, and places the cursor in the value control, something like shown in http://www.zuschlogin.com/content/blogimages/37/FindAdvanced.gif, only for Search rather than Find. (By arbitrary convention “Find” is very different than “Search” for users; Find highlights things within the current page matching a given criteria while Search retrieves things matching a given criteria)
Both of these designs link the criterion for each field by logical ANDs and are limited in the joins among the underlying database tables, but that is likely satisfy nearly all your users. If the tasks require more complicated joins and Boolean combinations, look into graphical querying designs (e.g., Badre AN, Catarci T, Massari A, & Santucci G 1996. Comparative ease of use of a diagrammatic vs. An iconic query language. In J Kennedy & P Barclay (Eds) Interfaces to Databases (IDS-3): Proceedings of the 3rd International Workshop on Interfaces to Databases, Napier University, Edinburgh, 8-10 July) and Query by Example designs.
The default design pattern which I use is Filter Table. That covers maybe 90% of the use cases. For more complex searches, I would need more specific information on the goals and use cases of the users, so that it would be possible to design a more optimal solution for those situations.
Simple is good. I'd recommend an iterative approach where you slowly build functionality after doing user acceptance testing and watching the logs to see which features that they use (or don't use). The only way you'll know what to improve is to watch your users.
Try to keep the interface as simple as possible. Most users will only need a text window and a search button. The remaining options can be put inside of an advanced search option.
This setup is friendlier for new users, as well as helping to conserve resources by saving the more expensive advanced searches for people who actually need them.
my thoughts:
-Only show advanced criteria when it is desired. Search is a great thing when it is made as simple as possible to the people trying to search.
-If there is some very large set of search criteria for advanced searches: do not clutter the results with it. Make it very easy and obvious for a user to go back and modify the criteria, but don't try to waste space on the results by giving them their criteria again right off the bat.
-Organization of criteria is hard to say without knowing it all. but as others have/will say: make it simple! You might not need to show it all at once: let me expand areas if i want more, hide stuff i don't want to use. and then put a search button at the bottom of it. But again, I won't want to scroll through a page of random criteria just to find this button.
There should be a search text box as a part of the mast head on every page of the site.
I prefer that the button be labeled "find" instead of "search" because benefits are always more compelling than features.
What should be sophisticated is your search algorithm and not the GUI.
Please find my answers(in normal text) against each of the questions(in italics) asked.
"1) Do you think the search panel should be visible all the time (ie displayed on top of my result grid) or available in a separate form (which would let me use more place for all the controls)"
Display on top of result grid as this leaves extra horizontal space to display search results and thereby to display more columns of search data without scrolling horizontally.
"2) Do you think it's better to display all the search criteria, or to let the user click on 'advanced' if he wants to see/use more criteria"
Display all available criteria but in a tabbed fashion. i.e. categorize input search fields into categories and have a tab for each category.
"3) How would you organize the criteria? by usage frequency, or rather by area (ie. criteria related to user, to location, to time, etc.)"
Organize 'by area' because different people like using different criteria.
Each criteria would have tab of it's own. But organize the tabs in the order of 'more popular' to 'less popular' as you think. In your case tabs may be 'By Name'(containing fields first name, middle name, last name, mother maiden name, nick name, father's name etc), 'By Location' (place name, county name, district name, state name, country name etc)
and so on until the advanced tab(where you'd put least used fields).
"4) Where should I put the 'Search' button? next to the more common search controls, or at the bottom, or both?"
Put the input fields of search as discussed above in a tabbed fashion categorizing them based on 'type of field'(I'll refer to this area as search grid). Then put action buttons such as 'Search', 'Clear/Reset' just below the search grid aligning to the center(I'll refer to this area as button grid).Then put the search result pane below the button grid as more horizontal area is available for display so that maximum columns can be displayed at once.
Take a look at quince, the infragistics ui patterns site: http://quince.infragistics.com.
Personally, I'd look at using a filterable grid, like the xtragrid from DevExpress: http://www.devexpress.com/Products/NET/Controls/WinForms/Grid/datafiltering.xml
coupled with a search bar above it to initially populate the grid.
Don't think this has been mentioned yet but dont forget that you will also need to initiate the search when the user presses enter in any of the search fields. Probably aware of this already, but worth mentioning anyway.

Resources