Anyone know how dropthings store the position of widget

Jun 18, 2008 at 9:36 AM
Anyone know how dropthings store the position of widget ?


I am a newbie in this area.Anyone can tell me?
Jun 19, 2008 at 3:16 PM
look for the PageId, ColumnNo and OrderNo columns in the WidgetInstance table. They together define the position.
Jun 19, 2008 at 9:28 PM
thks! I got it.However, I want to know  how the program connect to database,when I move the widget from the middle to the left zone
Jun 20, 2008 at 10:16 AM
OK,

MyFramework.js -> onDrop() calls WidgetService.MoveWidgetInstance() which is proxied via the service back to the server, where the web method calls the MoveWidgetInstance method on the DashboardFacade.

That executes the MoveWidgetInstanceWorkflow, which is essentially a chain of Activity objects. Each one has a simple nugget of code in, mostly with a LINQ snippet to access the DB. For example the PushDownWidgetsOnColumnActivity uses LINQ to pull out the widget instances below the destination position in the destination column and loops through them, incrementing their OrderNo fields.

If this doesn't make sense, you probably want to do a bit of background reading on LINQ, the Workflow Foundation (WF) and the Facade pattern.

The system is pretty complex and I've picked up what I know from code inspection, debugging the frequently broken released source code (v1.1 wouldn't even build on our systems) and by reading Omar's book. I'd recommend getting a copy to get a top down view of the architecture. The Javascript payload is probably the most complicated bit actually, frequently breaking in the browser during development, largely due to browsers cacheing the scripts. Ctrl-f5 and Delete Browser History are your new friends ;)

Enjoy