Dot Net Dunk

Wandering in the land of .NET
posts - 42, comments - 22, trackbacks - 187

My Links

News

Archives

Post Categories

Blog Roll

User Interface Process Block v2 and Back Button Issues

Microsoft have released the User Interface Process (UIP) Application Block Version 2. This application block lets you separate out your UI code from your UI navigation code by using a config-driven navigation/workflow system.

I've been using version 1 quite extensively on a project in my day job, and an in-house framework that was pretty similar at my previous company and I recommend you take a look at it if you have any kind of halfway-complex or repeating navigation/workflow.

One caveat - the back button support isn't quite as good in v2 as it could be. V1 had some serious issues with the back button for which I released a fix on the Got Dot Net community workspace. Having had a quick glance at the v2 source, I'm pleased to see that it looks like they've fixed one of my biggest gripes - namely that an out of order post back used the wrong controller - however three key issues are still present:

- You can't use the same ASP.NET page as the basis for multiple views
- Out-of-order postbacks of the same ASP.NET page are not detected as being an out of order postback
- Out-of-order postbacks (when detected and explicitly allowed) are potentially sent to the wrong nav graph.

In detail, it detects back-button usage by comparing the System.Type of the posted back page with the System.Type of the most-recently-rendered page and uses this to figure out the page's view name. This is where we hit the first issue: You can't have multiple views defined with the same underlying page. I use this scenario quite extensively when I want to have a common page which renders subtly differently in different contexts - for example on a customer details screen the page checks if it's the "new customer details", or the "amend customer details" view, and adjusts itself accordingly. Yes, I could infer this from the NavGraph but then the UI code becomes aware of the navigation, instead of only caring about its own state.

Secondly, the post back is handled by the most recent navgraph. Hence if your view is used in multiple navigation graphs (eg the 'new customer' and the 'amend details' nav graphs) then you're going to suddenly launch into the wrong navgraph if you use the 'back' button to get to a view used in an old navgraph. The UIP block does check that the view exists in the current nav graph, which seems to me to be a half hearted compromise. If you are doing context-sensitive navigation - for example by having a 'next' button for new customer but an 'update' button for amendments then Stuff will still break.

Finally, and as should be obvious from the above, the system can't detect that you're an out of order postback when you use the back button and post back a page of the same System.Type as the most recently rendered page.

So all in all the V2 release is better than the V1 release in terms of back button support, but still leaves a lot to be desired for my particular scenario. I'll try to get an enhanced back button support release together for V2 as soon as I can.

Print | posted on Monday, April 26, 2004 12:39 PM | Filed Under [ MS Application Blocks ]

Feedback

Gravatar

# re: User Interface Process Block v2 and Back Button Issues

Hi
Why U are Not Using Uip 2.0 For Open navigator instead Navigation Graph .
Open navigator Is lots of flexible over Navigation Graph

From sudhir
11/29/2004 12:24 PM | SudhIr
Gravatar

# Looking for UIP sample code

Hi,
Came across your site looking for UIP info. I get the basic concepts and can get some simple pages going but still looking for some clarification. I was wondering if you knew of any full baked site examples using UIP for ASP.NET.
One question is, should I be creating a separate controller for every view (aspx) page in my site? or is it acceptable to place numerous methods in one controller?

Thanks,

Ed Garabedian
Web Developer
Workscape
www.workscape.com
3/10/2005 1:25 PM | Ed Garabedian
Gravatar

# re: User Interface Process Block v2 and Back Button Issues

Hi Ed,

I don't know of any live full baked sites using UIP but I've worked on one that is going to go live some time soon. Try asking on the Got Dot Net workspace, you may get some examples there.

As for controllers - you most definitely want one controller with multiple methods. Controllers wrap up functionality - for example on a project I worked on, I had a "form controller" which had methods such as "NextPage", "PreviousPage", "SubmitForm", "CancelForm", and so on.

Cheers,

Duncan
3/11/2005 10:10 AM | Duncan Millard
Gravatar

# re: User Interface Process Block v2 and Back Button Issues

the quick brown fox jump over the lazy dog
6/7/2005 6:08 AM | louie ramos
Gravatar

# re: User Interface Process Block v2 and Back Button Issues

I'm looking for the sample code for back button
6/7/2005 6:11 AM | louie
Gravatar

# re: User Interface Process Block v2 and Back Button Issues

Hi everybody,

i have a litte problem when i start my UIP Application.

i've a error message :
//////////////////////
"The assembly SolutionWindowsApplication1.Controlers,Version=1.0.1.0,Culture=neutral,PublicKeyToken=null could not be loaded. Please check that the assembly type is fully qualified and is of format that follows. Also be sure that the version and public key token are correct.

The correct format is: type="Microsoft.ApplicationBlocks.UIProcess.Samples.AddressWizard.WizardController, Microsoft.ApplicationBlocks.UIProcess.Samples.AddressWizard, Version=1.0.1.0, Culture=neutral, PublicKeyToken=d69d63db1380c14d"The original exception is:

Could not load file or assembly 'SolutionWindowsApplication1.Controlers, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Le fichier spécifié est introuvable. at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)"
/////////////////

my configuration file is
<-------------------------->
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="uipConfiguration"
type="Microsoft.ApplicationBlocks.UIProcess.UIPConfigHandler,
Microsoft.ApplicationBlocks.UIProcess,
Version=1.0.1.0,Culture=neutral,PublicKeyToken=null" />
</configSections>
<uipConfiguration enableStateCache="true" allowBackButton="false">
<objectTypes>
<iViewManager
name="WindowsFormViewManager"
type="Microsoft.ApplicationBlocks.UIProcess.WindowsFormViewManager, Microsoft.ApplicationBlocks.UIProcess, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"
/>

<state
name="State"
type="Microsoft.ApplicationBlocks.UIProcess.State, Microsoft.ApplicationBlocks.UIProcess, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"
/>


<controller
name="MyController"
type="SolutionWindowsApplication1.Controlers.MyController, SolutionWindowsApplication1.Controler, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"
/>

<statePersistenceProvider
name="SqlServerPersistState"
type="Microsoft.ApplicationBlocks.UIProcess.SqlServerPersistState, Microsoft.ApplicationBlocks.UIProcess, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"
connectionString="Data Source=JALIMI3-1; Initial Catalog=UIPState; Trusted_Connection=True"
/>

</objectTypes>
<views>
<view
name="CreateLogon"
type="SolutionWindowsApplication1.WindowsApplicationUIP.CreateLogon, SolutionWindowsApplication1.WindowsApplicationUIP, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"
controller="MyController"/>
<view
name="InfoPerso"
type="SolutionWindowsApplication1.WindowsApplicationUIP.InfoPerso, SolutionWindowsApplication1.WindowsApplicationUIP, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"
controller="MyController" />
<view
name="Congratulation"
type="SolutionWindowsApplication1.WindowsApplicationUIP.Congratulation, SolutionWindowsApplication1.WindowsApplicationUIP, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null"
controller="MyController" />
</views>

<navigationGraph iViewManager='WindowsFormViewManager' name='MyNavigationGraph' state='State' statePersist='SqlServerPersistState' startView='CreateLogon'>
<node view='CreateLogon'>
<navigateTo navigateValue="CreateToInfo" view='InfoPerso' />
</node>
<node view='InfoPerso'>
<navigateTo navigateValue="InfoToCongratulation" view='Congratulation' />
</node>
<node view='Congratulation'>
<navigateTo navigateValue="CongratulationToCreate" view="CreateLogon"/>
</node>
</navigationGraph>
</uipConfiguration>
</configuration>

<---------------------------->

I don't know to do, help me please.
5/15/2006 8:10 AM | Jonathan
Gravatar

# re: User Interface Process Block v2 and Back Button Issues

There is a bug in UIP
12/11/2006 7:39 AM | shankar prasad

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 5 and 7 and type the answer here:

Powered by: