Video Screencast Help

List/grid view options in form builder

Created: 27 Sep 2012 • Updated: 29 Oct 2012 | 3 comments
This issue has been solved. See solution.

So I have a workflow that runs a wmi query to pull back bios boot order info and display it to the user. I would like to be able to have them use an up/down arrow to adjust the order but I can't seem to find a component that would do it. Anyone have any insight or maybe another option to do it? I hadn't quite started thinking about others way to do it, but it would be nice if I could do it this way. Ideally they would get a view like

 

Hard Drive

Nic

CD Rom

 

Then use up/down arrows to change to somethingn like

Nic

Hard Drive

CD Rom

Comments 3 CommentsJump to latest comment

PeeGee's picture

There don't seem to be any arrow components. From the usability point of view, I believe it would be the easiest to have the user select one item per time and add that to another array.

So users get the list of HDD, NIC, CDROM along with instructions to select an item per time and add it into another array, based on the order in which they select the items. So the first item they select and click on "Add" becomes the first item in the new array, after which they select the next item, etc.
If you want to make it fency, you could use the Link Button component with a dynamic text which changes after each selection, so for the first item to add the button would read "Set first device", after which it changes to "Set second device" and then "Set third device" and don't forget the "reset" button ;)

 

Halley1's picture

Just so you have options, here's how I'd do it.

1. Create a custom data type called BootDevice and give it two properties; Name and Order. Add the integration library containing this data type to your project.

2. At the start of your project, create an empty array of BootDevice objects called something like OrderedBootDevices. Then add your wmi query component and use the output to populate your array, setting the Order property appropriately for each.

3. Add a configurable collection sort component just before the form builder that sorts the array by the Order property and outputs back to the same variable.

4. In the form builder, display a listbox component populated from OrderedBootDevices with Name selected as the display field. Next to it put a Move Up and Move Down button. Make the output of listbox required for both these buttons and call it something like SelectedBootDevice. Also set the currently selected item to the same name as the output variable (SelectedBootDevice). You'll see why later.

5. Coming out of the Move Up and Move Down paths, increment or decrement the Order of SelectedBootDevice as appropriate, then add an embedded model component that contains logic to "swap" SelectedBootDevice with its neighbor as appropriate (like if you moved item 1 "down" to 2, then this would set the order of BootDevice 2 to 1.

6. Route the two paths back through the configurable collection sort component (because even though the Orders were changed, the array will still be sorted as before and must be re-sorted). When the listbox renders again, SelectedBootDevice will be moved in the list AND it will still be selected.

I might have missed something as i was just thinking through it quickly, but the premise here is to bind the "order" of a boot device to the boot device itself, rather than depend on array sequence.

SOLUTION
b3tts32's picture

So when I first got started I went the direction of PeeGee's suggestion and got things working pretty easily in my test workflow, however when I tried to integrate it into my main existing workflow I had issues. Long story short, I went with Halley's suggestion which was a bit morer work but turned out to work great. 

 

I did have to add an additional property or 2 for the custom datatypes for my Dells but all in all we're able to view our boot orders for Dell's and HP's and change them on the fly from a form. Great stuff! Thanks for the help.