Dynamics AX Form Item Ordering - forms

For the most part, AX forms seem to follow the AOT layout and appear in order. However, in some cases, the form items appear in seemingly arbitrary order, and in others, the items in the AOT won't even reorder. No matter how you drag and drop items in the AOT, they are always in the same order. This problem happened on occasion in AX 2009, but seems to be worse in AX 2012. The only way I've found to get around it is to drop the non-reordering items and recreate them.
Has anyone else had similar experiences? Anyone have a fix?

Ok, I've found that dragging and dropping only works part of the time. However, if you use ALT+the arrow keys to move items up and down in the hierarchy, that seems to work just fine.

The way I read your question it seems you are referring to control layout within a form. If your question is about something else please clarify.
To change form control layout you need to use AOT \Forms[FormName]\Designs\Design node. You can drag and drop controls and control groups.
If you drag a control (let's call it "dragControl") and drop it on top of another control (say "dropControl"), then dragControl will be placed after dropControl. This means that if you want to change the first control of a control group, you need to drag the first control, as dropping any control on top of the first one will place them after the first control.
Also make sure your form does not have changes is some higher layer that would override the changes you are making in a lower layer.
Does this answer your question?

Related

How to implement a 'dynamic' drag and drop (like iOS/Android)?

I would like to implement a 'dynamic' drag and drop in a list. By 'dynamic' I mean that in the list in which the drag is happening, there's an empty space below the dragged element which 'follows it' as you drag through the list (to make it visually obvious where the dropped element will end up in the list). Like what you see in iOS/Android apps supporting D&D.
What I've tried is to use Component.dragEnter to insert an empty Component with the size of the dragged element below the dragged compoment. And as the drag moves through the list, remove the old Component and insert a new one in the new position (explanation of why I create a new Component in next paragraph). However, with the dynamic updates that CN1 does while dragging, and my own updates when moving the empty Component, I just cannot find a way to make it work so I get the right vusual behavior. One aspect making this more complex than you'd think at first is that CN1's built-in support for drag&drop makes the original dragged component invisible with setVisible(false) which means it leaves an empty space behind.
The reason I recreate a new empty Component is because the final drop() will happen on the empty Component, and my trick to make this work is to override drop() on the empty Component to call drop on the dropTarget that is (was) in the Component's position.
All in all, I've spend I don't know how many days trying to get this to work with no success so far. Let me know if anyone has a suggestion for a more straightforward approach?
Big thanks in advance!
The builtin support hides the original component but drags an image of it which you can customize by overriding getDragImage().
You can use custom code to highlight the drop location by using a drag over listener which you can accomplish by using addDragOverListener(ActionListener).

Sort project browser tree view programmatically

I need to know how to set the order of elements shown in EA's project browser programmatically (in order to mimic the green arrows).
The tree view can not be sorted freely. EA puts a couple of constraints on the sorting. So diagrams, packages and a couple of other elements appear always on top and in groups. This is hard coded.
Use Element.TreePos to change the order where appropriate to simulate a manual order.
FWIW: Features have another queer behavior sometimes. You might need to uncheck the following in Tools/Options:

Access Forms prevent mouse from selecting values from dropdown, force keyb input

I have a data entry form. Its properly tab indexed etc. and there are three dropdown menus which automatically unfurl with the on enter event.
No matter how much advice i give to users about using the tab key and keboard and checking what they just input.
they still insist on using the mouse to select values from the dropdown menus
the problem is that in their haste they often make mistakes as a result of using the mouse.
I would like to be able to force users to input into these fields using the keyboard.
the drop down is neccessary for users see the appropriate values for the field because the values will vary based on previous selections.
I have already tried experimenting with onclick events but to no avail.
Is there a way I can do this?
i am using access 2007 many of the users have access 2003.
Based on your comments, I would take one of two different approaches.
If your users are really comfortable with the codes AND know which ones they should use based on their previous selections, then just use text boxes instead of combo boxes. You can still put some validation code in either the Form_BeforeUpdate event or the individual control's _BeforeUpdate event.
If the users are not that comfortable, then I would suggest you have the first field in the combo boxes be the description of the code, not the code itself. So instead of choosing from 101, 102, 103 they are instead choosing from "Small", "Medium", "Large" or whatever those codes actually apply to. If you still wanted to display the codes themselves, you could do that with a separate disabled text box.
Now to answer your actual question. For the record, I highly recommend against using this approach. The simplest way I can thing of to prevent your users from using the mouse to select the combo box, would be to add a Transparent button covering the combo box.
To do this, draw a regular command button over the combo. Set Transparent = Yes, Visible = Yes, Enabled = Yes, Tab Stop = No.
When users click on the combo now, they will actually be clicking on the Transparent button and nothing will happen. The ONLY way they will be able to get into the control is by tabbing from a neighboring control or using a hotkey (via '&' in attached label).
Once they enter the control via Tab and your code forces a dropdown, they will still be able to choose an option using the mouse. But by forcing them to use the keyboard initially, it will make it much more likely that they just stick with the keyboard.
Again--I can't stress this enough--I think this is a terrible, horrible, no-good idea. Please don't use this approach. But you asked a technical question and this site is all about giving technical answers, so there you go...

Is there a tree control for the iphone?

Is there a Tree control available for the iphone?
I need to represent a tree with sub nodes in a tree, how can I do it?
Thanks
No tree widget by default. It's basically not there because you shouldn't really need one and most cases it should probably be avoided.
A table navigation controller is the most common way to navigate down nodes in a hierarchy/tree usually.
It's hard to fit a tree like control we have on our desktops in the touch world where you have huge fingers (so huge nodes) and with the nodes offset to show depth, there isn't much space left over. Adding it to the iOS environment would create a weird UX flow so I would probably rethink my design flow if I think I need one.
If you need to fake it, you can use a table view and offset the left side of each subitem with some padding to show depth.
See this help
Rolling your own iPhone treeview control
part 1 : http://dotnet.kapenilattex.com/?p=566, part 2 and part 3 are in the pages : 585 and 633
part 4 : http://dotnet.kapenilattex.com/?p=648&cpage=1#comment-59842
I would use a UITableView and expand and collapse items further down the tree. You can set an indentation level for each UITableViewCell as it is displayed, depending on its position in the tree. You would need to keep track of which items in the tree are expanded/visible in order to always provide the tree with the correct data.
I just did just that for a project. Unfortunately I am not at liberty to share the full code. But it should not be terribly hard to write.
Let us know if you find an out-of-the-box solution.
From what I see, the best solution for my problem will be a BreadCrumbs control. I am looking for a ready solution of breadcrumbs, but if there isn't, it is not a big deal to write it.
OK, I did it.
I added a WebView and I am adding to it the crumb list. The design is similar to the Apple's official site.
When a user clikcs on the link, I call the popToViewController function and I am there.
This prevent the user from clicking Back and Back.
Hope this will help somebody.

Arrange GUI elements in WPF in a similar way to the applications on the iPhone

I would like to arrange UIControls in WPF in a similar way to the applications on the iPhone. They should be positioned on a grid, but a user should be able to drag them somewhere else, after releasing the mouse button (or the finger in case of an iPhone) the selected UIControl should snap back to the next position in the grid. The other UIElements should be rearranged automatically.
Further the user should also be connect two elements with a line or something.
I'm not experienced with WPF. The first question is if there is a container which is suitable for something (System.Windows.Controls.Grid ?) or if I have to extend canvas or somethig else for this.
I would like to know which elements from the WPF framework can be used and which elements I have to write myself.
For people who do not own an iPhone: http://www.youtube.com/watch?v=3omhu2AUWC8
Update
I've looked at AnimatedTilePanel in the BangOTricks examples (see below), this one explains how to create your own Panel and how to let it arrange things there.. However I still need an idea how to implement drag and drop correctly in this example..
Unfortunately, you'll have to write a lot of things yourself, as WPF doesn't automatically do what you're looking for.
For positioning the controls, you can use either UniformGrid or Grid. Assuming it's much like the iPhone video you showed, you can just use the UniformGrid with 4 columns and however many rows you need.
For the dragging animation, layout-wise, you could start by manipulating the RenderTransform property on whatever is being dragged, but you'll have to set a handler to check once you've met whatever threshold necessary to move into the another "cell" -- and at that point, you'll have to changed the order of the items in the tree.
Take a look at AnimatedTilePanel from Kevin's Bag-o-Tricks at:
http://j832.com/bagotricks/
It doesn't do everything you want but it will show you how to write a panel that animates its children when changing size or order.
New input to this old post in 09. Earlier this year (2012) someone has wrote a FluidWrapPanel and open sourced it. I tried it and it works like a charm - just like that on the iPhone menu.
You can also apply to other UI Elements or UserControl.