Jface TreeSelection / StructuredSelection sort order - treeview

I am using the Eclipse Nebula GridTreeViewer which lets me access the selected items via a TreeSelection.
This works all good except for the sort order of the elements which are returned via StructuredSelection#iterator(). The sort order considers the order in which the elements were actually selected (e.g. when pressing Ctrl button for multi selection).
What I would need is the top=>down order of the elements as they are shown on the GUI.
I tried sorting the selection and then re-selecting with the new order. But unfortunately, the selection seems to be only updated if the actually selected elements change.
Does anyone know any other way to do this?

Related

Primefaces selectManyMenu: Showing selected items on top of list

I'm using Primefaces' selectManyMenu to display a list of hundreds of items. I've also included a filter on top. The issue is that when I select, say, the 200th item in the list, I have to manually scroll down to the 200th item each time to see if it has been checked.
I want it so that whenever I select an item, it moves to the top of the menu, so that it is easy to view all the selected items from that list at the top without having to scroll down and up all the time.
Any suggestions?
Looks like your component is getting updated when selecting or unselecting an item, and that's the reason you're reloading the list and losing your scroll position.
Else, it looks like you could use a workround for this. Something like
Catch the select/unselect/change event and trigger a backing Bean function where
You rearrange you list of items sot that the selected ones will be pushed first
oncomplete, you will update your selectManyMenu component.
By the way, maybe it's time to think again if you're using the right component and UX practice. and I have the impression that selectManyMenu is not meant to be used with lists of 200+ items. Personally I think you should avoid using a list that will have to scroll down, for selectMany components. For example you could use another component like a pickList

SSRS sort icon not showing up in header but showing up in column values

I am very new to SSRS. Infact this is my 2nd report.So in SSRS, I went to Interactive Sorting and checked the "Enable interactive sort on this text box". Chose the first radio button "Detail rows".For sort by I chose "ColumnName" and clicked ok. I ended up with a sort icon on every value .The data here may seem duplicate but it is correct. I have additional 6 columns apart from this "Product" column. I repeated the sort action for all columns same way, the only difference being the different "Sort by" column. I get the icon on all columns in all rows. I want it on the header only.
Apart from that I get this warning 6 times :[rsIneffectiveSortExpressionScope] The text box ‘ColumnName’ is defined at the scope “Details”, which is identical to the scope used as SortExpressionScope. This interactive sort has no effect at runtime, since it sorts only the particular instance itself.
What is that i am doing wrong ?and what should i do to correct it?
Rt click on the textbox with the Column Name, click on
Interactive Sorting
then Check
Enable Interactive Sorting on this textbox
and then select the appropriate group you want to sort.
AFTER EDIT
if you dont have any groups yet, just select Details Row. If you have/create any group, then you need to select the radio button Group.
The sort by will actually have the column you want to sort with.

extjs 4 How to change ordering of shown column dropdown on grid

Using extjs 4.1.1
I have a grid with lots of columns >20.
Initially, most of these columns are hidden.
If a user wants to unhide the column, they select the menu on any column, then select the "columns" choice, this expands another dropdown/dropout which shows all of the columns. Those with checkboxes next to them are shown.
My issue is this:
The columns in the dropdown are shown in the order in which they are defined/displayed in the grid. The order in which they are displayed in the grid has been chosen for a good reason( e.g. id as the first column). However, when a user wants to display one of the hidden columns, it is hard for them to find it in the list. This is because the list is sorted in the order the columns are defined. I want to sort the column dropdown/dropout list in alphabetical order, without effecting the order of the columns in the grid.
How can this done?
I think I found the solution to your question.
First of all I don't have the Ext JS 4.1.1. framework on my current PC. So I tried to figure out you problem reading the Ext JS 4.1.3. documentation available on Sencha's site. But I don't think that they have made drastical changes in this part of the framework between the two minor releases so my solution should work in your case too.
I have tried out my solution using JSFiddle. Unfortunately they did not have the 4.1.1. ext-all.css file, so I have linked manually the 4.0.2 file available at Sencha, so the menu is looking a bit missplaced.
The header menu and it's submenus are managed by the Ext.grid.header.Container class. The column submenu is constructed by the getColumnMenu method. The whole menu is purged and reconstructed on every drag and drop or other event which should affect the grid view. As a result it is enough to overwrite this method in order to solve the problem. Because the headercontainer class is too deep in the framework it is hard to extend it, so you have to make use of the Ext.base.override method.
The column submenu's menu items are created from the result of the
items = headerContainer.query('>gridcolumn[hideable]')
query. So you have to first sort alphabetically the result, before creating the menu items. I have added to the class the sortColumns method which does all the sorting stuff.
So here is what I did: link to my solution.
I hope that this is what you were looking for.

Dynamics AX 2009: How to sort an unbound form control's contents?

I was using a Listbox control on a form, and programmatically adding items to it. I thought that if I called the sort(SortOrder::Ascending) method on the Listbox it would do just that -- however, I was wrong.
Ultimately, I am unable to achieve these results. I don't have to use a Listbox, but I need two pieces of functionality:
Programmatically be able to add Strings to the control
Be able to run code when an item is clicked or selected
The list should be able to be sorted alphabetically
I couldn't get the listbox to sort either. Easiest might be to use a "ListView" control instead of a listbox. You can see how to use AND sort in (AOT>Forms\tutorial_Form_ListControl). Your requirements #1 & #2 are possible on almost anything you do. The issue is sorting I'd think.
Another option, keep a local variable that controls the sorting. I would use a collection class, either an Array or Map so you can control the sorting via key-value, then you could just re-load the listbox when the user added/removed something. Since it's client side and it doesn't sound like the listbox will have 1000+ controls, re-loading it probably won't be a significant performance hit. You can also use listbox.insert([value], [index]), to insert into the correct location if you are controlling properly.
Another option, hi-jack any simple table from the AOT (TmpABC is a good one), insert the values, then sort using a simple query or even better, set the TmpABC to the ListView control's datasource and just sort via datasource sort..

InfoPath 2007 - Populate drop-down list on-the-fly

I'm working on an InfoPath 2007 form. I have two drop-down lists and i need the second to be populated with items bases on the value chosen in the first list. I use c# to populate the drop-dpwn lists from external sources. I've tried to use the OnChange event to make all this, but the second list is still empty.
If anyone knows, please tell me.
You can filter the entries for the second drop-down list based on your first list (but only if the entries are based on a data source, not manually entered).
Bring up the properties window for
your second drop-down list.
Select your data source.
Click on the button to the right of the Entries text box.
Select the repeating node you wish to use for the basis of your list entry.
Click the Filter Data button. From here you can enter a filter to limit the entries displayed based on the value of your first drop-down list.
Your question was a bit ambiguous. You may be trying to populate a secondary data source based off of your first drop-down list. This should work fine with an OnChange event. Can you post the code you are using to do this?
Some additional tips that may help:
The change event will not fire until focus moves off of the list box. So, for the second drop down to populate, you will need to set the first drop-down then hit tab or click elsewhere in the form.
I don't know the size or nature of the data source you are using for the second drop-down list, but you may consider downloading the entire data source and filter it using the method I described above. This may be a better solution as you won't need to make a database query between entering the first list box and the second one.

Resources