Geeks With Blogs
Dot Net Dunk Wandering in the land of .NET

I've noticed a number of referrals from Google from people looking for help with the UI Process block.

Having spent some time with the UI Process Block I'd like to share my experiences, but to do that I would like to know what information people are after. Please leave me a comment below, or contact me directly using the "Contact" link above and I'll try to come up with some suitable articles.

Finally the obligatory plug: If you are looking for help with UI Process Block implementation, especially on projects that also involve BizTalk, my employer (www.solidsoft.com) specialises in BizTalk and .NET implementations so feel free to make an approach to learn more about us and (I hope) engage us commercially.

IMPORTANT UPDATE: I haven't worked with the UI Process Block for almost a year, so it's increasingly hard to devote time to looking into these issues. Please feel free to continue using my comments section to ask questions - but it's unlikely that I'll be able to chip in with answers. Don't forget the Got Dot Net workspace.

IMPORTANT UPDATE #2: I've now closed comments on this entry; please direct your questions to the official Got Dot Net workspace.

IMPORTANT UPDATE #3 :): Closing comments meant they weren't displayed any more; that was unintentional and seems to be a limitation of the .Text blog engine. Comments are open again so that you can see the old content :).

Posted on Tuesday, May 4, 2004 1:41 PM BizTalk Server , C#/.NET Development , MS Application Blocks | Back to top


Comments on this post: UI Process Block: Let me help you

# re: UI Process Block: Let me help you

# V2 Back Button Patch
Requesting Gravatar...
Duncan,
I'm in the middle of a development process for a new web product and we went with UIP. I applied the patch as posted on GotDotNet.com http://www.gotdotnet.com/Community/Workspaces/viewuploads.aspx?id=0af2b0ef-b049-401a-a2f2-f55a070c1572 as posted by Spidey. As its port from V1, do you have a good readme file about V1 (there wasn't one posted by Spidey). I'm specifically looking to see if there is some configuration options for it.
Left by Kelly on Jul 21, 2004 5:32 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi,

Sorry for the delay in replying - I've been out and about for a while.

The v1 patch is still available for download, and it includes a readme. However to answer your specific question, there is no configuration-driven option, you need to edit the source files to give the behaviour you want.

The good news is that (in v1, at least) all of the options are fully coded up - just uncomment the block you need.

Cheers,

Duncan

From the readme to v1:
This release is a full fix to the issues with the back button, and gives you a number of options as to how to handle reposting of data:

1) Do what the old UI block does (why would anyone want this? I've left it in just in case)
2) Process the postback using the view, navgraph and task that were in use when that view was on screen (this is what is most intuitive to the user, but can give you duplicate posting of data)
3) Throw an exception if there's a repost - you can handle this in your global.asax
4) Force a navigation using the value "repost_error" as soon as the postback is detected - this allows you to control postback handling for every view in every navgraph.

You set these options by editing UIPManager.cs at line 74 - they are not configuration driven (yet...) but the options and code are well commented.
Left by Duncan Millard on Jul 26, 2004 12:08 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi,
I am new in UI prcesse block - one question:
in ASP web form how you deal with frameset or tabs (multiple views) using UIPB?
Left by olaf on Sep 09, 2004 1:51 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi Olaf,

This isn't something that I have worked with but here's how I would address it.

Each frame is a page, or view, in its own right. As such you could assign a different controller to each frame. Bear in mind that you only really need to use the UIPB for complex interactions, so if one frame is simply for navigation you may just want to use a normal ASP.NET page.

For tabbed views you could make your controller "tab aware", so that it retrieves the correct data for the current view.

I hope this helps - it's hard to be more specific without knowing your exact application.
Left by Duncan Millard on Sep 13, 2004 11:23 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hello Duncan,

I'm having a problem to run my "HelloWorld" WebForm using UIPAB. I've followed every step of the UIPAB user manual, but when I try to run the page a exception is thrown : "Objet not set to a instance of object" at this line :
SessionMoniker sessionMoniker = SessionMoniker.GetFromSession( new Guid( Session[CurrentTaskKey].ToString() ) );

I've figured out that there was no instance for Session[CurrentTaskKey] . How it is initialized?

Thanks!

Mattioli
Left by Mattioli on Sep 21, 2004 2:31 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi Mattioli,

It sounds like you haven't started the task. In the UIP you must first use the UIPManager class to "start" the task that the user is carrying out. This assignes a unique Task Key to that user, which is read automatically by the UIPAB. If you don't start the task, you will see an error similar to yours.
See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/uipab-ch03.asp, under the heading 'Starting and Resuming Tasks', for details of how to start a task.
Left by Duncan Millard on Sep 21, 2004 2:03 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi Duncan,

First of all, I'd like to say: it's really nice of you to offer your help to people. Thank you for that!

My question is:
I'm currently trying to find out if UIPAB v2 is the way to go for my application. In trying to understand the block, I'd like to take a look at a class diagram or other schematic. A search on the internet provided me the architectural overview in the MSDN libs (only the flows) ... can you suggest other urls which can assist me?

Thanking you in advance!

Phoenix
Left by Phoenix on Oct 21, 2004 5:18 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi Duncan,

My first question is the same as Phoenix asked i.e. i want to get some sort of diagram to better understand the model.

The second Question:
I've looked into the code that UIPAB2.0 uses to load a class (the GenericClassFactory's method), this method uses reflection to load the assembly and create an instance of whatever class name provided to it. It does'nt even retain the object of the loaded assembly, and reload a new assembly everytime this method is called. Dont you think this would be a huge performance overhead considering that this method is used by ControllerBase,ViewManager and LayoutManager to load their classes. If you agree then can you suggest an alternate strategy for this n if you dont agree then please explain y.

Your quick response will be highly appreciated. Thanks for your help in advance.

Faizan Ahmed
Left by Faizan on Oct 22, 2004 10:06 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hello All,

Does it seem appropriate to use the Graph Navigator in the UIPAB for a workflow web-based application. It will guide the user through a case and allow the user to enter details about each case and see comments made by other parties involved. The application will keep track of what actions were taken in a History file and will keep track of the case by displaying it's current status to the user. Lastly the app will send notifications and generate letters as this work-flow process changes status (i.e. from open to closed or new case, etc.)

Thanks for your help!

-Brian
Left by Brian Evans on Oct 25, 2004 3:30 PM

# re: Brian Evans Workflow Driven App
Requesting Gravatar...
Hi Brian,

The UIP is ideal for applications that have multiple steps - you define the steps as your "navigation graph". At each point in the graph you can specify valid navigations, for example from page 1 of a case to page 2.

In addition, the use of a "controller" to react to user interface events means that you can incorporate some centralised way of controlling the sending of letters, notifications, etc.

I don't know the scale or size of your project, but have you considered BizTalk and/or K2.NET? These are commercial products that could really accelerate your development. If you'd like to know more about these just drop me a note using the "Contact me" tab at the top of this page.
Left by Duncan Millard on Oct 26, 2004 8:46 AM

# re: Jason's User Controls
Requesting Gravatar...
Jason - sorry but custom user controls and the UIPAB isn't something I've worked with. Have you tried posting to the Got Dot Net Workspace?

http://www.gotdotnet.com/workspaces/workspace.aspx?id=0af2b0ef-b049-401a-a2f2-f55a070c1572
Left by Duncan Millard on Oct 26, 2004 7:48 AM

# re: Faizan - UIPAB Performance
Requesting Gravatar...
Hi Faizan,

I don't have time right now to dive into the code to that level, but I will try to look soon. My initial response is that although loading by reflection is *relatively* expensive compared to instantiating an in-memory class, that doesn't necessarily mean it's a problem. There are plenty of parts of .NET that load assemblies dynamically - ASP.NET for example.

Bear in mind that in a typical web app you are going to be rendering pages, talking to the database, running transactions, and so on, so there's a lot more going on that just dynamically loading an assembly or two. Beware of "premature optimisation" [1] - one bad algorithm in your business logic will waste more time than dynamically loading an assembly.

To put it in context, I have used the UIPAB as a front end to an application based on BizTalk - that does a hell of a lot more work than dynamically loading an assembly or two, but it is still fast enough to run synchronously and support many users.

I hope this helps for now - the right answer is to run your own testing; don't get hung up on individual lines of code - CPU and memory are cheap compared to the amount of time it'll take you to analyse every line in the UIPAB!

[1] http://c2.com/cgi/wiki?PrematureOptimization
Left by Duncan Millard on Oct 26, 2004 8:53 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
I am having a similar problem as Mattioli. I get the same error, but I am fairly sure that I am starting the task. Here is code that is in my default.aspx form:

public class _default : Page
{
public _default()
{
}

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
UIPManager.StartNavigationTask("CustomerNavGraph");
}

Am I missing something?

Here is a bit of code from my web.config file:

<navigationGraph iViewManager="WebFormViewManager" name="CustomerNavGraph" state="State"
statePersist="SessionStatePersistence" startView="customerList">


Please help
Left by Jacob on Oct 29, 2004 7:48 PM

# Trouble with start view
Requesting Gravatar...
I have a trouble in the start view. can i put the code

// Put user code to initialize the page here
UIPManager.StartNavigationTask("CustomerNavGraph");

In the page_load() of a web page and then on the click of a button call navigate(). since i want the first page of the site to be the first view. Iam getting a null reference exception .

Can I put the code in session_start ?

now I have put a dummy page dfault.aspx
inside that
UIPManager.StartNavigationTask("CustomerNavGraph");
then response.redirect("first.aspx")
is this the right way??
Left by Sreekumar Menon on Oct 31, 2004 5:18 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Never mind, found my problem, got it working
Left by Jacob on Nov 02, 2004 8:47 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hello

I try to use the StartOpenNavigatorTask in my web app but I keep getting this error

Object reference not set to an instance of an object.

When debugging is see that there is nog DefaultViewManager in my config... How can I do this?

I have used an example of the quickstart so it should work...
but it doesnt :(

Can you help me with this?

Regards,
Barry
Left by "Object reference not set t on Nov 03, 2004 4:49 PM

# Sreekumar Menon...
Requesting Gravatar...
Wanting your first page to start the task is a common grumble - it's annoying to need an initial "launch" page.

Instead of a response.redirect you might want to try a Server.Transfer so that it doesn't rely on a round trip to the client to start, but this isn't something I have tried.

You can't start the task in the page load and then navigate in the same page, because the navigate requires the page to be a WebFormView. But in order to inherit from WebFormView you need to have an active task, otherwise you get the message that you are seeing - the null reference.

One way to get around it is to present a kind of menu/introduction page, and start the task when they choose the first option, such as "Click here to enter". It's not ideal, I know.
Left by Duncan Millard on Nov 05, 2004 2:22 PM

# Barry - DefaultViewManager
Requesting Gravatar...
Barry can be you a bit more explicit? Do you mean that no DefaultViewManger is defined in the configuration? Or that the object was not created even though it's in the configuration file?
Left by Duncan Millard on Nov 05, 2004 2:23 PM

# How to use UI block with multiple web applications?
Requesting Gravatar...
I have written a couple web applications that uses the UI block, it works fine. (They are very simple application, up to 10 aspx pages in one application.)

Now my problem is that, I need to integrate those applications into one and use single login to authenticate users to use these applications. I can twick the FORMs authentication part to use the single login, but I don't know how to navigate away from one application to another. Do you have any suggestions?

Any help will be greatly appreciated.

Thanks a lot, FIC
Left by FIC on Nov 05, 2004 4:13 PM

# re: FIC... 11/5/2004 4:21 PM Duncan Millard
Requesting Gravatar...
Duncan,

Thank you so much for your quick response. Yes, you are right, they will be on the same server, I'm thinking to put them under one root directory. I've been reading up on having multiple controllers, there's a sample app in the UIP download, however it's still in one application. Maybe I will have to end up doing that?

Thanks a lot!

FIC
Left by FIC on Nov 05, 2004 4:42 PM

# re: FIC... 11/5/2004 4:21 PM Duncan Millard
Requesting Gravatar...
Duncan,

Thank you so much for your quick response. Yes, you are right, they will be on the same server, I'm thinking to put them under one root directory. I've been reading up on having multiple controllers, there's a sample app in the UIP download, however it's still in one application. Maybe I will have to end up doing that?

Thanks a lot!

FIC
Left by FIC on Nov 05, 2004 3:42 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
No problem - you're lucky, it's Friday afternoon and I happen to have a spare twenty minutes!

To avoid merging them entirely you could put them under a sub directory, e.g.:

/PhonyRoot/MyApp1 and
/PhonyRoot/MyApp2

then merge the two web.configs and put them at /PhonyRoot/web.config

What is the problem that you are trying to solve? Single sign on to both applications? If so that's nothing to do with the UIPAB - if you want to navigate from one site to another then instead of using a Navigate method you could simply run a Server.Transfer or a Response.Redirect to navigatge to the other web site.
Left by Duncan Millard on Nov 05, 2004 4:03 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Yeah, I am Lucky!

Well, here's my problem, I sure can use a Server.Transfer to navigate to the other web application, but my impression is that the Task starts in my login page.

For example in App A: I have Login.aspx, Dowork.aspx etc

Once the user is authenticated, in Login. Login_Button_Click:

If user is valid then
UIManager.startTask("NavA")

If I do Server.Transfer to another site, since it does not require user to log in again, where would I "StartTask"?

Thanks a lot!

FIC
Left by FIC on Nov 05, 2004 6:07 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
I am trying to implement OpenNaviation. The graphNavigation is working fine but when I change to startOpenNavigation it gives me an error.

Dim task As New myController.myTask("123456")
UIPManager.StartOpenNavigationTask("myGraphNav", task)

Left by Rajesh on Nov 05, 2004 6:23 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
I'm trying to set up exception handling in an app which utilizes UIP. I have a question about the program flow after I try to Navigate() to an error page from within my controller. The issue is that it does not immediately take you to the error page; the successive lines of code are executed until it completes. But because of the exception, I don't want anything following that to execute! So, in the example below, even if an exception occurs, the dataset is returned. If the calling method tries to do something with that dataset, and the dataset is nothing because of the exception encountered, then an error screen is encountered. How do I get UIP to go to my error page right away and not continue any further processing? Thanks!!

Public Function getPropertyTypes() As DataSet
Dim clsCodelistBOB As New PropSearchBOB.CodelistBOB
Dim dstCodelist As DataSet

Try
dstCodelist = clsCodelistBOB.getPropertyTypes()
Catch ex As Exception
State(STATE_EXCEPTION) = ex
State.NavigateValue = "fail"
Navigate()
End Try

Return dstCodelist
End Function
Left by Donna G on Nov 16, 2004 7:27 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi folks - just a quick note to say that I won't be able to answer any queries until the end of November... I'm maxed out on a client site this week, and away on holiday next week... Sorry. I will get back to you though :-)
Left by Duncan Millard on Nov 16, 2004 9:14 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
re: # re: UI Process Block: Let me help you 10/25/2004 7:50 PM Jason

Hi Jason and Ducan.

i just posted this on the got dot net site for you guys...

http://www.gotdotnet.com/workspaces/messageboard/thread.aspx?id=0af2b0ef-b049-401a-a2f2-f55a070c1572&threadid=70045c7b-e96e-4ab6-84de-d0379c35509d

maybe this might help?
Left by Pure Krome on Nov 24, 2004 1:22 AM

# Stopping people avoiding start task?
Requesting Gravatar...
Hi folks.

has anyone found users bookmarking pages deep within your site map / site ... so they try to enter the site via 'backdoors' ... which gets that funny error

"Objet not set to a instance of object" at this line :
SessionMoniker sessionMoniker = SessionMoniker.GetFromSession( new Guid( Session[CurrentTaskKey].ToString() ) );

.. becuase the task hasn't started.

are there any tricks of the trade to check to make sure tasks are started? what things to people do to stop this from happening?

what happens if i log in normally (ie task is started), but then jump deep down to some other random view ... one that is not suppose to be PART of the task navigation graph!?

-PK-
Left by Pure Krome on Nov 24, 2004 12:25 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi Pure Krome-- thanks for the message on the GDN site.

Regarding trapping the backdoors, I'd try putting some code in the Session OnStart event in global.asax and redirecting to the task start page, or trapping errors in the global.asax and checking for the presence of that specific error. I've used the latter approach myself, and it also lets you detect when the UIP session has timed out.
Left by Duncan Millard on Nov 29, 2004 9:15 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
thanks heaps Ducan for the reply. Secondly, i've tried using your back button patch 'cause we've now stumbled to that problem -> mainly with our web design team doing the front end html.

i downloaded the file and noticed 6 .cs files and a readme. After looking at the files and adding them i noticed the solution fails to compile. After reading some of the files i've noticed u've encapsualted a few of the base core files into a new single file (eg. Concrete and Interfaces). ok, so just remove the base core files and compile ... well .. that got rid of the old errors but now there are new ones. like

C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\ViewManagers\WizardViewManager.cs(31): 'Microsoft.ApplicationBlocks.UIProcess.WizardViewManager' does not implement interface member 'Microsoft.ApplicationBlocks.UIProcess.IViewManager.ActivateView(string, System.Guid, string, string)'

i've noticed you've updated the actual interface.

so .. i'm not sure of the correct procedure for implimenting your back button patch -> the readme file said just 'apply' over the base or v1.

?? :(
Left by Pure Krome on Nov 30, 2004 12:07 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
bleh! soz ducan. you're code is for v1. i grabbed spidey's and it seems to be fine.

it currently uses the repost_error method. i'm not sure if he has the ability to choose all 4, like you have.


one other question Ducan : how many websites do u have running live using UIP? we have a number of large projects here in melbourne and i'm currently a test-dummy for using UIP. It's a bit scary but if it works, it would be supa sweet. I'm also going to need to add some extra code to the UIP base code for mobile devices .. which is also very scary.

could you please post some thoughts on your experience with failure / success with your live sites .. if applicable?

thanks once more mate :)
Left by Pure Krome on Nov 30, 2004 1:55 AM

# Pure Krome
Requesting Gravatar...
PK - Glad you spotted the mistake. I was a bit worried when I read your first comment!

We only have one site running on UIP, and that's not live yet although it's planned to go live soon, so as such I can't give you "in the field" details.

It shouldn't be too hard to port a winform view to a mobile view (famous last words...) infact it's probably worth asking around GDN to see if anyone's already done this. If you've architected properly it should be relatively easy to add a mobile front end to an existing application, I've done similar on a similar framework in the past.
Left by Duncan Millard on Nov 30, 2004 9:22 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
>>relatively easy to add a mobile front end to an existing application

yeppers -> that's the beauty of MVC from my understanding of it :)

our MVC has gone pretty detailed 'cause we also have persister factories as well as different persister types (eg. stub, sqlserver db, xml file, etc...) so once we got our head around MVC / UIP .. then we've justed added more advanced stuff by having all this generic customisation. Gotta love config files :) the views aren't the only thing loosly coupled now -> so are the persister types ... PER OBJECT. Maybe by Feb i'll get some time to see about making some mobile views if GDN comes up blank (i posted something a few months back there without much luck).
Left by Pure Krome on Dec 03, 2004 3:04 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi, I am new to the UIP development.
Initially I started using OPen Navigator and

currently trying out the UIP Block V2.0 in a web app and am running into a problem...
using an OpenNavigator. Sometimes, when I start the task (with the code: UIPManager.StartOpenNavigationTask("NavName", "FirstViewName")) my application crashes with the following error message:

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source File:
....Blah...Blah...\Microsoft.ApplicationBlocks.UIProcess\Configuration\UIPConfigSettings.cs
Line: 509
(which is: return(StatePersistenceProviderSettings)_statePersistenceCollection[navigator.StatePersist];)

At times, my application runs fine, but quite often it crashes with the above message. After following the code of the UIPAB through, I've discovered that within the LoadFromCache (Guid taskId) method of the StateCache class, the line of code that checks "weakReference.IsAlive" evaluates to False when the app crashes, and true when it does not.

I could go on to describe the rest of the code that executes as a result of the evaluation of this line of code to False, but I'll keep it short. Eventually the code attempts to retrieve the config settings of the navigator (which is an OpenNavigator that does not have settings in the Web.config) which are nothing, thus resulting in the above exception.

It seems as though along the way, the OpenNavigator is mistaken for another type of navigator.

I found it strange that sometimes the application runs without error, but other times it crashes. Has anyone else come across this problem? Are there any ideas on whether I might be doing something wrong?


As I could not find solution for problem started using Graph navigator,
However, sometimes I get erro "Hadle not initialized"

Can you please help.
Thanks In Advance,
Deepali
Left by Deepali Mistry on Dec 03, 2004 5:07 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi, Sorry fergot to give my email address
deepali.mistry@rfs.nsw.gov.au

Deepali
Left by Deepali Mistry on Dec 03, 2004 6:09 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi,
I really can not figure out cause of error

Exception of type System.Web.HttpUnhandledException was thrown.

Handle is not initialized.

I am using Graph navigator.
Rfeally appriciate any help.

Thanks,
Deepali.mistry@rfs.nsw.gov.au
Left by Deepali Mistry on Dec 06, 2004 12:08 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
G'Day Deepali! Good to see another assie here.

without knowing too much code, are u sure your website is not TIMEING OUT? We had some weird problems with our site when the session timed out -> some UIP error thing0.

maybe check that out? Try dropping your timeout time to 1 minute and then doing some checks.
Left by Pure Krome on Dec 06, 2004 10:43 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
damn! wish i could spell AUSSIE right! *blush*

-PK-
Left by Pure Krome on Dec 06, 2004 10:48 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
G'Day Mate,
Thanks for replying.
Actually there is one more addition to my
Handle is not initialized problem with UIP.

After getting this error if I press back button page gets displayed properly!
I just tried to drop my timeout to 1 minute.
But again same problem. This problem happens only some time.

Really appreciate response,
Cheers,
Deepali
Left by Deepali Mistry on Dec 08, 2004 12:33 AM

# Can v dynamically change the StartView in the NavigationGraph
Requesting Gravatar...
1. Can v dynamically change the StartView in the NavigationGraph
2. Can I navigate to a view which is not a startview in the NavigationGraph
Left by Ashith Raj on Dec 09, 2004 11:06 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi,
Finally I have found someone who is an expert in UIP Application Block. I wanted to convert an existing application of ours to use the UIP as it is a workflow intensive process. But this application consist of 2 frames the top frame contains a set of tabs for each section and the lower frame displays the individual pages for each tab the pages are currently user controls which are dynamically loaded into the lower frame. So have you used UIP with user controls and such a framework and do you have any suggestions ofor how to go about implementing it.

Thanks in advance
Marshall
Left by Marshall Desouza on Dec 16, 2004 2:56 PM

# re: Basic Hello World Example
Requesting Gravatar...
Would it be possible to share a basic hello world example with UIP here? Something that has 1 page and navigates to next page when user clicks next button. Again please use session persistance - becuase we would like to have SQL server complications left out for later. There's only little a brain can handle at one shot!
Left by antzk on Dec 16, 2004 5:50 PM

# Multi NavGraph
Requesting Gravatar...
Hi hope some one can help,

Am trying to move from between NavGraphs defined in App.Config.
According to MS all I need to do is EndTask() and then call OnStartTask().
Issues:
1. Calling EndTask() does not close the window so in cases where I have 3 NavGraphs I will have 3 windows open.

2. Can anyone explain the relationship between Controller, ViewManager and NavigationGraph.
From stepping thru code seems a Controller is created for every (view/node) when Starting a Task.
Left by MoeBaby on Dec 16, 2004 6:44 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Reply to Deepali Mistry's UIP issue with StartOpenNav Task and loadFromCache returning false then bombing on retrieving state persistence provider settings from the config. I had the same issue.

As for why the WeakReference.IsAlive is returning false, well it could be garbage collected and so not guarenteed to always have a value. So the fall back plan if it's not in the cache is to go back and get it from the config, but for Open Navigation we want to get it from the default config, not the nav graph config...


The StateFactory.Load method has an overload to retrieve the default state persistence settings or the persistence settings for a specific nav graph.
statefactory.load (name, taskid) (name is nav graph) vs
statefactory.load(taskid)

Anyway I changed the following and this was worked for me:

In the Open Navigator constructor: public OpenNavigator(string name, Guid taskId)
Change this line: SetState(StateFactory.Load(name,taskId));
To: SetState(StateFactory.Load(taskId));

This should fix this issue for starting an OpenNavigationTask..
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source File:
....Blah...Blah...\Microsoft.ApplicationBlocks.UIProcess\Configuration\UIPConfigSettings.cs
Line: 509
(which is: return(StatePersistenceProviderSettings)_statePersistenceCollection[navigator.StatePersist];)


Left by toyab on Dec 17, 2004 3:46 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...

Hey ,
Thanks a lot for your reply I will definitely try your solution. I really appreciate it
When Open navigator was not working I did shift to Graph navigator as I had to release some of my project this month. However sometimes with Graph navigator also I have problem with state. I get following error

Error page Exception of type System.Web.HttpUnhandledException was thrown.

Handle is not initialized.


System.WeakReference.get_Target() at System.Data.Index.get_RowFilter() at System.Data.Index.AcceptRecord(Int32 record) at System.Data.Index.InitRecords() at System.Data.Index.Reset() at System.Data.DataTable.ResetIndexes() at System.Data.DataTableCollection.Add(DataTable table) at System.Data.DataTable.System.Runtime.Serialization.ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph) at Microsoft.ApplicationBlocks.UIProcess.SqlServerPersistState.Save(State state) in C:\Program Files\Microsoft Application Blocks For .Net\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\Persistence\SqlServerPersistState.cs:line 79 at Microsoft.ApplicationBlocks.UIProcess.State.Save() in c:\program files\microsoft application blocks for .net\user interface process 2.0\code\microsoft.applicationblocks.uiprocess\state.cs:line 242 at Microsoft.ApplicationBlocks.UIProcess.GraphNavigator.Navigate(String nextNode) in c:\program files\microsoft application blocks for .net\user interface process 2.0\code\microsoft.applicationblocks.uiprocess\navigators\graphnavigator.cs:line 178 at Microsoft.ApplicationBlocks.UIProcess.ControllerBase.Navigate(String navigateValue) in c:\program files\microsoft application blocks for .net\user interface process 2.0\code\microsoft.applicationblocks.uiprocess\controllerbase.cs:line 70 at Microsoft.ApplicationBlocks.UIProcess.ControllerBase.Navigate() in c:\program files\microsoft application blocks for .net\user interface process 2.0\code\microsoft.applicationblocks.uiprocess\controllerbase.cs:line 60 at OMS.SitRepController.SitRepMain() in d:\visual studio projects\oms\test\common\sitrepcontroller.cs:line 1192 at OMS.SitRepIAP.incidentDetail.sitrepButton_Click(Object sender, EventArgs e) in D:\Visual Studio Projects\OMS\Test\SitRepIAPTest\incidentDetail.aspx.cs:line 362 at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain()



Can anyone help me with this??
Thanks in advance.

Regards,
Deepali



Left by Deepali Mistry on Dec 20, 2004 3:59 AM

# UI Process Block: Display Performance
Requesting Gravatar...
I am seeing what I can best describe as screen bleeding as we go from one view to the next. For example, the user will sometimes see just a single control from the view that is starting on the existing view's form.

We are only persisting to memory so I don't suspect that is the performance drag.

Has anyone seen this?

thanks,

JR
Left by JR on Dec 20, 2004 6:09 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi Deepali,

It sounds like your unhandled http exception is most likely timeouts as PureKrome suggested. If your Session times out, the UIP loses its context. In this case, like any ASP.NET app, you have to catch the problem. You can maybe use SQL as your state store instead of the ASP.NET Session object (I think there's a SQL Session provider that ships with UIP2?)

Here's the code I used in my global.asax.cs to catch session timeouts with UIP Version 1. I catch the error, and redirect to my error page:
(Note - if you get an httpexception be sure to check the inner exception, it will contain more useful information)



protected void Application_Error(Object sender, EventArgs e)
{
try
{
// Ignore the 'unhandled http error'

Exception ex = Server.GetLastError();
if ((ex is HttpUnhandledException) && (ex.InnerException != null))
ex = ex.InnerException;

Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(ex);

// Clear whatever else was going on and redirect to our error page using
// a server.transfer so that our session is still available
HttpContext.Current.Response.Clear();
Session["lastexception"] = ex;
Server.Transfer(@"~/Licenses/Common/Error.aspx");
}
catch (Exception lex)
{
EventLog el = new EventLog("Application");
el.Source = "Licenses";
el.WriteEntry("Internal exception: " + lex.Message);
if (lex.InnerException != null)
{
el.WriteEntry("Internal exception inner: " + lex.InnerException.Message);
Server.Transfer(@"~/Licenses/Common/Error.aspx");
}
}
}


In my error page I have a bit of code similar to this to check for timeouts (Note in UIP v2 you may need to alter the exact checks):

private void Page_Load(object sender, System.EventArgs e)
{

Exception lastException = null;
if (Session["lastexception"] != null)
{
lastException = (Exception)Session["lastexception"];
// Check UI Process Block Exceptions
if (lastException is UIPException)
{
// No need to cast - UIPException doesn't give us anything useful
if (lastException.Message.StartsWith("Can not get the session moniker"))
{
Response.Write("Session timed out because you have been inactive for too long. Please log in and start again.")
}
}
}
}
}
Left by Duncan Millard on Dec 21, 2004 9:05 AM

# To Ashith Raj
Requesting Gravatar...
Ashith, I'm not sure how to do this. Maybe using an open navitgator? It's not something I've tried. Sorry.
Left by Duncan Millard on Dec 21, 2004 8:09 AM

# To: Marshall Desouza
Requesting Gravatar...
Hi Marshall,

I've not specifically tried this, but check out some of my earlier comments about tabbed views. I've not really worked with user controls and UIP (well, not in depth) - perhaps someone on the got dot net workspace can help out more?

thanks,
Duncan
Left by Duncan Millard on Dec 21, 2004 8:11 AM

# Deepali - handle not initialized
Requesting Gravatar...
Deepali, I just had another thought - the exception looks like it's when state is being saved. Have you stored a non-serializable object in your state? That could be the cause of the problem.

I also found a couple of newsgroup postings suggesting that it could be because you are doing something with a sql connection in a finalizer of one of your objects.... You shouldn't do anything in there - see http://groups-beta.google.com/group/microsoft.public.dotnet.framework.adonet/browse_thread/thread/8f62e59a3502731f/7632f7aa0e36d0fd
Left by Duncan Millard on Dec 21, 2004 8:18 AM

# MoeBaby - Some answers
Requesting Gravatar...
Hi Moe,

You still have to code in the actual user interface actions, so you will need to explicitly hide forms in the UI code before you navigate off to a new task. The UIPAB can't assume that you want windows closed - you might want to leave a task open so that you can resume it later.

With regard to Controllers, View Managers and NavGraphs, a "View" represents the thing that the user sees - so an ASP.NET page, or a Win form, or a Pocket PC form. As you navigate around, these need to be created, opened and initialized with UIP data. This is the responsibility of the View Manager - it knows how to interact with the UI artefacts, and because each view manager implements a common interface, the UIP knows how to interact with the view manage. The View Manager hence decouples the UI and the UIPAB.

A controller is responsible for performing actions in response to UI actions. So consider for example an app that is running on a Pocket PC, a win form, and a web form. When the user clicks "Save" on any of those apps, they will need to save their data. They will (hopefully!) all call the same controller object, for example the "SaveData" controller to tell it that the 'save' button has been clicked. The controller is then responsible for acting on that information and saving the data. The controller therefore allows you to centralise control and logic, and keep your UI as purely for User Interactions.

You can have as many controllers as you like - and yes I believe the controller object is created for each page request.
Left by Duncan Millard on Dec 21, 2004 9:29 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Merry Christmas all :)

>>Can I suggest people always be sure to post to the Got Dot Net workspace?

I feel like no one every answers over there.

>> My "comments" section shouldn't become a replacement for that message board :-)

:)

damn, i've just been wifed .. i'll post more q's later on .. brb in a day or two :)
Left by Pure Krome on Dec 26, 2004 12:05 AM

# UI Process Block: Handle
Requesting Gravatar...
i am getting following error.Please help me.


System.InvalidOperationException: Handle is not initialized.
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: Handle is not initialized.]
System.WeakReference.get_Target() +68
System.Data.Index.get_RowFilter()
System.Data.Index.Equal(Int32[] indexDesc, DataViewRowState recordStates, IFilter rowFilter)
System.Data.DataTable.GetIndex(Int32[] indexDesc, DataViewRowState recordStates, IFilter rowFilter)
System.Data.DataTable.GetIndex(String sort, DataViewRowState recordStates, IFilter rowFilter)
System.Data.DataView.UpdateIndex(Boolean force)
System.Data.DataView.SetIndex(String newSort, DataViewRowState newRowStates, DataFilter newRowFilter)
System.Data.DataView.set_Sort(String value)
Humana.EnterpriseFR.DataMaint.Web.AssociateSummary.LoadAssociateGrid(String sortExp)
Humana.EnterpriseFR.DataMaint.Web.AssociateSummary.dgdAssociates_SortCommand(Object source, DataGridSortCommandEventArgs e)
System.Web.UI.WebControls.DataGrid.OnSortCommand(DataGridSortCommandEventArgs e)
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()


regards
Left by Arabinda on Jan 11, 2005 4:37 PM

# To Arabinda
Requesting Gravatar...
Hi Arabinda - that looks pretty clearly like a problem in your code, not in the UIP.

I think Handle not initialized suggests a problem with the database connection. Be sure the connection is open and valid.
Left by Duncan Millard on Jan 12, 2005 9:34 AM

# re: UI Process Block
Requesting Gravatar...
Hi Duncan
thanks for reply i think this is not a problem with connection as i am getting this error when i am sorting the records in a grid by clicking on the column header . During sorting i am getting the dataset from state and binding to the grid.


regards.
Arabinda
Left by Arabinda on Jan 13, 2005 4:10 AM

# re: UI Process Block
Requesting Gravatar...
Hi Duncan
thanks for reply i think this is not a problem with connection as i am getting this error when i am sorting the records in a grid by clicking on the column header . During sorting i am getting the dataset from state and binding to the grid.


regards.
Arabinda
Left by Arabinda on Jan 13, 2005 4:10 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Ducan .. have u had a chance to try out my virtual domain / real domain problem?
Left by Pure Krome on Jan 14, 2005 8:27 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Ducan (and friends) - more info for you. I'm posting some of my bug fixes up into the UIP workspace on GotDotNet.

my real domain problem (above) is listed twice as a known bug.

i'll also post other little things as time goes by, here and there.
Left by Pure Krome on Jan 20, 2005 5:08 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
With the new UIP pattern, where should query parameters, cookies, and view state be handled? In the controller or the web view? In the past I would use a page controller pattern to define a base page to perform state management processing such as loading query parameters into page properties.



Are there any working implementation using the UIP pattern other than the samples that are part of the download?
Left by Jim Meehan on Jan 27, 2005 6:09 PM

# Re: Cookies/parameters
Requesting Gravatar...
Hi Jim,

The key thing to think is that the controllers should be independent of the UI delivery method; this is the "Model", "View", "Controller" pattern.

Here, your web page (View) needs to pass the values held in the query parameters, cookies, etc into the controller so that it can use it to update the model.

That way if you wanted to, say, write a windows app you could still use the same controller as your web app.

So, eg, in your UI page you would read the query string:

int guessedNumber = Request.QueryString("aNumber");

Then you could pass that directly to the controller

myController.UserHasGuessedANumber(guessedNumber)

Your controller could then, say, compare the guessedNumber to the number it was expecting, and store a true/false in the model to denote whether they matched.

When the UI displays, it will read the true/false from state, and use it to output some HTML (web page) or pop up a messagebox (win form)

Hope this example makes it clearer.

I don't know of samples other than in the download.
Your controller is then completely independent of the UI.
Left by Duncan Millard on Jan 27, 2005 11:26 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Thanks for your quick response. Have you used the open navigation mode? I have read some other newsgroup comments indicating that there were problems with open navigation. On one of my web pages, I display a table of data with a specific column containing a hyperlink to display more detail on the particular row. Typically, I embed a query parameter on the url to specify the primary key id of the row. The query parameter is dynamically set by specifying the databinding field. My first question is will the UIManager be able to interpret the url correctly with the query parameter attached since in the "view" definition I identify the page only.

What is the timing loop for the UIP pattern? When an http request is processed, does the view execute first which calls the UIPmanager or vice versa? I'm just trying to understand the sequence of operations.
Left by Jim Meehan on Jan 28, 2005 6:02 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi All,
Have another query.
I want to navigate between views which are using different contreollers.But I am getting cast exception.
Any Idea how to comunicate between these views?
Thanks
Deepali

Left by Deepali Mistry on Feb 09, 2005 11:22 PM

# UI Process Block: Let me help you
Requesting Gravatar...
Hey guys ...
i am new to UIP
take up a case where in i have a mixture of GraphNavigator and UserControlNavigator
Now from the initializer form i traverse the GraphNavigator and go to frm1 and then to frm2 which calls upon UserCtrlNavig and loads a view which is basically a form with usercontrols....from this state i need to access frm4 which is a part of the former navigation graph..
is it possible..and if yes how..
thx in advc
Maverick
Left by Maverick on Feb 17, 2005 7:09 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Have you integrated the UIPAB 2 with the Config Mgr in the newly released Ent Library? If so maybe you could post some example.

Thanks,
Left by Steve Muise on Feb 18, 2005 1:53 AM

# UIP2 and Enterprise Library
Requesting Gravatar...
Steve - I've been told that there are some plans for UIP to be released as part of the Ent Lib, but that there is no definite timescale on this so don't hold your breath. I know no more than that though!
Left by Duncan Millard on Feb 28, 2005 9:50 AM

# Daylight - back button
Requesting Gravatar...
Daylight - Have you downloaded the back button patch for UIP v2 from the Got Dot net workspace? I found that the documented behaviour wasn't much use, and wrote a patch for v1. Spidey wrote a patch for v2. Suggest you use this as it may make your life much easier...
Left by Duncan Millard on Feb 28, 2005 9:52 AM

# Deepali - different controllers
Requesting Gravatar...
Hi Deepali, first you must have a common base class for your controllers (they are both controller, right?)

So you'll need to check in the code the exact type, and run the appropriate code:

if (myController is ControllerType1)
{
ControllerType1 castController = myController;
castController.Type1Method();
}

etc.

Does that make sense?
Left by Duncan Millard on Feb 28, 2005 9:58 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi,
I'm new to UIP, and I am experiencing an exception with the sample code run on Windows XP - can not get session moniker.

I am on the browsecatalog web page and I found that by clicking add item to cart, then WebFormView.New is called for the browsecatalog page although this page is the current view.

Any recommendations would be greatly appreciated!
Left by Lawrence Smith on Mar 01, 2005 4:48 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Further to my question above, the following is the output I traced immediately before & after the issue:

----------------------------------------
Timestamp: 3/1/2005 1:49:20 PM
Message: ActivateView - Redirect to URL: ~//browsecatalog.aspx?CurrentTask=a226f5b4-e1e9-4e8d-ae85-aa9d6adf2f58
Category: UI Events
Priority: 1
EventId: 0
Severity: Information
Title:
Machine: MKH110645
Application Domain: /LM/W3svc/1/Root/UIPStoreWebUI_VB-3-127541945545136448
Process Id: 4780
Process Name: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_wp.exe
Win32 Thread Id: 632
Thread Name:
Extended Properties: TracerActivityId - e41c28cd-df34-43df-9fa2-0854b96cfd01

----------------------------------------
----------------------------------------
Timestamp: 3/1/2005 1:49:24 PM
Message: WebFormView.New
Category: UI Events
Priority: 1
EventId: 0
Severity: Information
Title:
Machine: MKH110645
Application Domain: /LM/W3svc/1/Root/UIPStoreWebUI_VB-4-127541945601417376
Process Id: 4780
Process Name: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_wp.exe
Win32 Thread Id: 632
Thread Name:
Extended Properties:
----------------------------------------
----------------------------------------
Timestamp: 3/1/2005 1:49:25 PM
Message: WebFormView_Load: app path /UIPStoreWebUI_VB/browsecatalog.aspx query string: a226f5b4-e1e9-4e8d-ae85-aa9d6adf2f58
Category: UI Events
Priority: 1
EventId: 0
Severity: Information
Title:
Machine: MKH110645
Application Domain: /LM/W3svc/1/Root/UIPStoreWebUI_VB-4-127541945601417376
Process Id: 4780
Process Name: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_wp.exe
Win32 Thread Id: 632
Thread Name:
Extended Properties:
----------------------------------------
----------------------------------------
Timestamp: 3/1/2005 1:49:25 PM
Message: GetFromSession - Gets the session moniker related to the specified task - key: TaskMonikera226f5b4-e1e9-4e8d-ae85-aa9d6adf2f58
Category: UI Events
Priority: 1
EventId: 0
Severity: Information
Title:
Machine: MKH110645
Application Domain: /LM/W3svc/1/Root/UIPStoreWebUI_VB-4-127541945601417376
Process Id: 4780
Process Name: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_wp.exe
Win32 Thread Id: 632
Thread Name:
Extended Properties:
----------------------------------------
----------------------------------------
Timestamp: 3/1/2005 1:49:25 PM
Message: session moniker NOT FOUND!
Category: UI Events
Priority: 1
EventId: 0
Severity: Information
Title:
Machine: MKH110645
Application Domain: /LM/W3svc/1/Root/UIPStoreWebUI_VB-4-127541945601417376
Process Id: 4780
Process Name: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_wp.exe
Win32 Thread Id: 632
Thread Name:
Extended Properties:
----------------------------------------
Left by Lawrence Smith on Mar 01, 2005 6:56 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Can anybody help me?

I am getting the same error what Arabindo was experienced. It is

InvalidOperationException: Handle is not initizlized.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: Handle is not initialized.]
System.WeakReference.get_Target() +68
System.Data.Index.get_RowFilter()
System.Data.Index.Equal(Int32[] indexDesc, DataViewRowState recordStates, IFilter rowFilter)
System.Data.DataTable.GetIndex(Int32[] indexDesc, DataViewRowState recordStates, IFilter rowFilter)
System.Data.DataTable.GetIndex(String sort, DataViewRowState recordStates, IFilter rowFilter)
System.Data.DataView.UpdateIndex(Boolean force)
System.Data.DataView.SetIndex(String newSort, DataViewRowState newRowStates, DataFilter newRowFilter)
System.Data.DataView.set_Sort(String value)
Humana.EnterpriseFR.DataMaint.Web.AssociateSummary.LoadAssociateGrid(String sortExp)
Humana.EnterpriseFR.DataMaint.Web.AssociateSummary.dgdAssociates_SortCommand(Object source, DataGridSortCommandEventArgs e)
System.Web.UI.WebControls.DataGrid.OnSortCommand(DataGridSortCommandEventArgs e)
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()


And this is happening oddly, mean very few times and unable to reproduce other times. But the problem persists and throws this exception un-evenly. Everytime I step in debug mode, it works fine and occasionally it fails and throws error.

I appriciate your help on this.

Regards,
RajeshC
Left by Rajesh Cheedalla on Mar 07, 2005 2:56 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
I have been using the UIPB for a few months now, and have been having some success. My problem is that I have started to use logins and I have a different Nav graph for each one. I have been saving the current user ID, or at the very least, user type, to state, but this is getting lost when I start the new Nav Graph. Here is some sample code:

if(Convert.ToInt32(userDV[0]["UserRole"]) == PROGRAM_ADMIN)
{
this.SaveCurrentRole(PROGRAM_ADMIN);
UIPManager.StartNavigationTask("ProgramNavGraph");
}

Is there a way for state to be saved when I start a new navgraph? Thanks for any ideas you can offer.

-Jacob
Left by Jacob on Mar 08, 2005 2:51 PM

# A Little advice
Requesting Gravatar...
Hi everybody,

I'm a novice to the world of UIPAB. I've gone through some discussions on UIPAB on the web. I've to develop an application which needs to be very robust. As many people say UIPAB is buggy, I'm lacking guts to go for it on my application. I'm sending you a list of points I came accross which is preventing me to go for UIPAB without any second thought. Please see the list and suggest: WHETHER I SHOULD GO FOR UIPAB OR NOT. Can I overcome all these problems.

1. Clicking on browser back button leads to state mismatch between client and server thereby resulting into incorrect navigation or error if no navigation value is found in the configuration.
2. Going to a URL without starting a navigation task lead to NullReferenceException in the server i.e. Internal Server Error message to the client.
3. Opening a link more than once in new window confuses the server coz' the states are shared. This leads to unpredictable results at the client.
4. When more than one controller exist in a navigation graph, certain combination of back button leads to mismatch controller at the server.


You people have good experience with UIPAB. Your suggestions would be valuable to me before I go for it.

Regards
Nihar
Left by Nihar on Mar 11, 2005 6:20 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi Duncan,

Can you tell me one thing regarding the deployment of UIP?

I want to change the web.config of UIP during runtime. How can I effectively do this? Can I do it at all? Or do I need to restart the IIS or the app?

Please suggest something.

Thanks in advance
Raman
Left by Raman on Mar 16, 2005 7:52 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi,
M trying to implement custom layout logic using uipab.
any reference sites or sample code available?
Left by Gauri on Mar 22, 2005 9:01 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
I use the UserControlsNavigator, When I want to start a userControl Task, The following error occures :

Cannot activate the view at ......GetViewNameFromNodeName.

Can someone help my out ??

Thank in advance
Left by Mr MM on Mar 24, 2005 9:53 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
I use the UserControlsNavigator, When I want to start a userControl Task, The following error occures :

Cannot activate the view at ......GetViewNameFromNodeName.

Can someone help my out ??

Thanks in advance
Left by Mr MM on Mar 24, 2005 9:53 AM

# How to close previous view?
Requesting Gravatar...
Hi,
I am using UIP in a windows application development and met a problem. I have some WindowsFormView stay open when need navigate to new views. But when I want to complete the task in the new view, it seems impossible to close the view still stay opened.
Any one can help?
Thanks a lot.
Left by Robin Li on Mar 31, 2005 1:02 PM

# layoutManager Winforms
Requesting Gravatar...
I am trying to use the layoutManager for a winforms project and stuck up. We have fathomed a few mysteries and a bug but are stuck up at the layoutManager functionality..

The documentation seems to be pretty cryptic around this feature.

I would really appreciate some help in a sample layoutManager class that works. Specifically how is the LayoutControls method to be implemented and what argument should it accept.
Left by Using layout manager with UserCo on Apr 06, 2005 4:54 PM

# System.Data.SqlClient.SqlException: Could not find stored procedure 'InsertState'.
Requesting Gravatar...
I am getting the error below. I am using the following statePersistence Provider in my web.config:

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

------------------------------------
I created the UIPState database. Is there a sql script file that creates the required tables and stores procedures (InsertState, ..etc) in UIPState database.

Thanks a heeps
abe

----------------------------------------------------------
Could not find stored procedure 'InsertState'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Could not find stored procedure 'InsertState'.

Source Error:


Line 333:
Line 334: // Finally, execute the command
Line 335: int retval = cmd.ExecuteNonQuery();
Line 336:
Line 337: // Detach the SqlParameters from the command object, so they can be used again


Source File: C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.Data\SQLHelper.cs Line: 335

Stack Trace:


[SqlException: Could not find stored procedure 'InsertState'.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +723
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +196
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.Data\SQLHelper.cs:335
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.Data\SQLHelper.cs:252
Microsoft.ApplicationBlocks.UIProcess.SqlServerPersistState.Save(State state) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\Persistence\SqlServerPersistState.cs:88

[ApplicationException: Can not save the specified state object]
Microsoft.ApplicationBlocks.UIProcess.SqlServerPersistState.Save(State state) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\Persistence\SqlServerPersistState.cs:97
Microsoft.ApplicationBlocks.UIProcess.State.Save() in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\State.cs:242
Microsoft.ApplicationBlocks.UIProcess.GraphNavigator.StartTask(TaskArgumentsHolder holder) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\Navigators\GraphNavigator.cs:147
Microsoft.ApplicationBlocks.UIProcess.GraphNavigator.StartTask(ITask task, TaskArgumentsHolder holder) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\Navigators\GraphNavigator.cs:124
Microsoft.ApplicationBlocks.UIProcess.GraphNavigator.StartTask() in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\Navigators\GraphNavigator.cs:113
Microsoft.ApplicationBlocks.UIProcess.UIPManager.StartNavigationTask(String navGraph) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\UIPManager.cs:102
testapp._default.Button1_Click(Object sender, EventArgs e) in C:\Inetpub\testapp\default.aspx.vb:39
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
Left by abe on Apr 07, 2005 2:08 AM

# configuring UIP block
Requesting Gravatar...
Sir,
I wanna know how to configure UIP block using Configuration application block,Since it is not in Entlib.I face some problems in it .Do help me out from this.

Thanks
Left by Nikhil Deshkar on May 26, 2005 6:54 AM

# CurrentView is null
Requesting Gravatar...
Guys,

In method StartTask(TaskArgumentsHolder holder), why I get CurrentView value as blank? This gives me exception for line _startView = UIPConfiguration.Config.GetViewSettingsFromName(CurrentState.CurrentView);

Am i missing something?

Please guide me.

Thanks
Left by Ganesh T on Jun 02, 2005 8:29 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
People have asked how to use the UIPAB with web user controls as views. I am in the middle of developing a method. If you're interested, let me know. brian @ vallelunga . com
Left by Brian Vallelunga on Jun 16, 2005 7:05 AM

# UIPB for Windows application
Requesting Gravatar...
I am using UIPB for my C# windows application. Now the scenario is this:- My start page is A and from A i navigate to B, from B to C which is a modal window and then from C to D which is again a modal window. Now on click of cancel i want to close all the windows and go back to screen A.

How can i close the forms that are opened previoulsy. Can i get any handle to these opened forms??

Left by getstags on Jun 23, 2005 3:18 PM

# My Windows application
Requesting Gravatar...
Hi
I'm using UIPAB in a windows application developement, when system load a new form, sometimes I meet the error like following:
ex Message : An instance of the type NCS.TPISIS.RO.WinUI.MaintainStudentForm could not be loaded.
Please check that the assembly type is fully qualified and is of the format:
type="Microsoft.ApplicationBlocks.UIProcess.Samples.AddressWizard.WizardController, Microsoft.ApplicationBlocks.UIProcess.Samples.AddressWizard, Version=1.0.1.0, Culture=neutral, PublicKeyToken=d69d63db1380c14d"
ANOTHER possibility is that the object creation failed during construction; be sure you have supplied the correct constructor
arguments, and that the type to be created has implemented the constructor overloads/overrides requiredThe original exception is: The operation completed successfully at System.Drawing.Icon.Initialize(Int32 width, Int32 height)

I have spent much time try to find out the root cause, but cannot have any progress.

please guide me, thanks for your help.
Left by helin on Sep 15, 2005 11:12 PM

# help me
Requesting Gravatar...
Hi
I am working n UIPAB for a project. It is a web application in vb .net. I got UIPAB working correctly. But now changed the aspx files in to a folder to follow some coding standards. After that UIP is not working.

The error:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 297: System.Web.UI.Page currentPage = (System.Web.UI.Page)currentView;
Line 298: string viewType = currentPage.Request.CurrentExecutionFilePath.Replace( currentPage.Request.ApplicationPath + "/", "");
Line 299: string viewName = UIPConfiguration.Config.GetViewSettingsFromType(viewType).Name;
Line 300:
Line 301: return viewName;


Source File: C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\ViewManagers\WebFormViewManager.cs Line: 299

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
Microsoft.ApplicationBlocks.UIProcess.WebFormViewManager.GetViewNameForCurrentRequest(IView currentView) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\ViewManagers\WebFormViewManager.cs:299
Microsoft.ApplicationBlocks.UIProcess.Navigator.ActivateViewInStateIfNecessary(IView view) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\Navigators\Navigator.cs:116
Microsoft.ApplicationBlocks.UIProcess.Navigator.GetController(IView view) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\Navigators\Navigator.cs:98
Microsoft.ApplicationBlocks.UIProcess.WebFormView.WebFormView_Load(Object sender, EventArgs e) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\Views\WebFormView.cs:110
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()



pls help
thanks in advance
aparna
Left by aparnavipin on Oct 19, 2005 3:43 AM

# help me
Requesting Gravatar...
Hi
I am working n UIPAB for a project. It is a web application in vb .net. I got UIPAB working correctly. But now changed the aspx files in to a folder to follow some coding standards. After that UIP is not working.

The error:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 297: System.Web.UI.Page currentPage = (System.Web.UI.Page)currentView;
Line 298: string viewType = currentPage.Request.CurrentExecutionFilePath.Replace( currentPage.Request.ApplicationPath + "/", "");
Line 299: string viewName = UIPConfiguration.Config.GetViewSettingsFromType(viewType).Name;
Line 300:
Line 301: return viewName;


Source File: C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\ViewManagers\WebFormViewManager.cs Line: 299

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
Microsoft.ApplicationBlocks.UIProcess.WebFormViewManager.GetViewNameForCurrentRequest(IView currentView) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\ViewManagers\WebFormViewManager.cs:299
Microsoft.ApplicationBlocks.UIProcess.Navigator.ActivateViewInStateIfNecessary(IView view) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\Navigators\Navigator.cs:116
Microsoft.ApplicationBlocks.UIProcess.Navigator.GetController(IView view) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\Navigators\Navigator.cs:98
Microsoft.ApplicationBlocks.UIProcess.WebFormView.WebFormView_Load(Object sender, EventArgs e) in C:\Program Files\Microsoft Application Blocks for .NET\User Interface Process 2.0\Code\Microsoft.ApplicationBlocks.UIProcess\Views\WebFormView.cs:110
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()



pls help
thanks in advance
aparna
Left by aparnavipin on Oct 19, 2005 3:43 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Have you ever shared a view from two different navigation graph?
Left by Swati on Oct 20, 2005 2:24 AM

# Can v dynamically change the StartView in the NavigationGraph
Requesting Gravatar...
1. Can v dynamically change the StartView in the NavigationGraph
2. Can I navigate to a view which is not a startview in the NavigationGraph
Left by Ashith Raj on Oct 27, 2005 10:48 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Any luck on opening multiple windows in web applications that use UIPAB? From the posted messages, it is clear that no concrete solution has been come up on that front. Anyone has had any luck with this as yet?
Left by Dhanya on Dec 08, 2005 6:35 AM

# UI Process Application Block Let me help you
Requesting Gravatar...
Hi, Can u Please sned a web application Sample using UIP........I thing this may help me a lot
Left by Hameed on Jan 02, 2006 5:39 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
re: Separate applications each using UIP under one application. - Do you have to combine the web.config of the separate applications in order for the UIP to work for. Right now only one UIPConfiguration node is being loaded, how can I get both to load
Left by richard on Jan 12, 2006 4:40 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
I figured this one out. I modified the UIP to load each config file it encounters into the collections that it contain.
Left by richard on Jan 17, 2006 5:17 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Sir,

How to pass a query String Via the Navigate function

Like State.Navigate("Default1.aspx?aNo=10)
Left by Shahul on Mar 16, 2006 7:49 AM

# Don't use it
Requesting Gravatar...
I have just implemented a fairly complex ASP.NET application for a large organisation using UIPAB. (9 months of my development time)

If you are reading this and have not passed the point of no return, I suggest that you do not use UIPAB for ASP.NET.

Unless you have a requirement to expose the application as a Windows Forms and an ASP.NET etc application then don't use it. It isn't worth it! It will hinder you. With its bugs, poor implementation, and its limited functionality, it is truly a giant pain in the ass.

The Microsoft Enterprise Library is certainly worthwhile. You will see why UIPAB is not part of it if you choose to use it.

Caveat lector.

Daniel
Left by Daniel on Jul 07, 2006 2:46 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Daniel, I'm sorry that you have had so many problems with it.

All I can say is that, having used it myself and seen it used by others in enterprise-scale projects, it's been a huge huge bonus to have it, reducing dev time and increasing supportability.

I'm sure there are a few bugs, but I've certainly not seen anything of the scale that you would suggest. Sorry you're having so many problems with it.
Left by Duncan Millard on Jul 07, 2006 4:44 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Let,s say I am navigation from page 1 to page 2 and then back to page 1. In page one, I have a bouton to go to page 2 and in page 2, a button to go back to page 1.

When I am in page 2 and press the go back button, the server code of page 2 is redo. i.e. The page_load, the page_reprender etc. Why? since I want to goto page 1, I don't need to reload page 2!! I lost performance because I so a lot of things in the loadind of page 2.

Is there a way to go back to a page without reloading the current page?

Thank you
Left by Martin on Jul 28, 2006 4:44 PM

# re: UI Process Block: Let me help you
Requesting Gravatar...
Hi Duncan,
I learnt a lot about UIPAB from your posts.
You mention that I can dload your V1 fix. But that Gotdotnet link doesnt work anymore..
Where can I dload it, Could you please let me know as and when you find time?
Just like others, I have back button issues with it!
Many thanks in advance.!
Left by allen on Nov 02, 2007 6:39 AM

# re: UI Process Block: Let me help you
Requesting Gravatar...
avast antivirus is being recycling in my computer. It neither uninstall nor to be install another version of its
Left by Amarjeet on Aug 01, 2011 12:12 AM

Your comment:
 (will show your gravatar)
 


Copyright © Duncan Millard | Powered by: GeeksWithBlogs.net | Join free