Friday, August 18, 2006

YES/NO/CANCEL

I recently received an issue from our diligent QA department asking to have a dialog box, which presented Yes/No/Cancel as options, shortened down to just Yes/No

I responded with my reason for the existance of this combination of options:

It is a UI decision. Both Yes and No are definitive answers to a question, however, sometimes a user will interact an application and perform actions that they had no intentions of doing.
Definitive answers like Yes and No imply that you are instructing the application to do something (even if you answer no). Because you answered the question, the application is going to take action accordingly.

The Cancel option gives the user peace-of-mind that, if they just cancel, nothing will happen because they have just instructed the application to "cancel" the previous action all together.

Of course wording the question is crucial here. The question could very well imply that clicking No means that the action will be cancelled. However with a very critical action, a user may feel more at ease indicating to the application to completely disregard the previous action, even if No does mean NO!

Wednesday, August 16, 2006

One of the most useful pieces of code used by the InfoPath Developers here at Visiphor is the SecondaryDataSource Class written by one of our senior developers, Keith Curtis.

This class exposes some simple methods which we use to interact with secondary data sources.
  • Call the secondary datasource (query()),
  • Query data (GetNodeValue(), GetValue())
  • Set data (SetNodeValue).
All of the clutter of handling a secondary datasource in code (namespacing, instantiating the connection, etc.) are handled from within the class. The developer need only instanciate the class, by passing the name of the secondary data source and the XDocument, to have access to these very simple tools.

The GetNodeValue and GetValue methods behave more like typical XSLT xsl:value-of calls where xpath queries that result in missing nodes do not cause catastrophic exceptions, but rather return empty strings. Trace messages can be returned if the xpath query does not return a node, but the call will not fail.

We added a winform to the InfoPath form that is called by the query method. The winform displays a progress bar, which runs in a separate thread so while the form is disabled by calls to a datasource/webservice, the progress bar gives the user something to look at. Also, because the winform runs in a separate thread, it displays while the form is initially loading (before the first view is rendered) - NICE!

I'll talk more about the winform and the speed-of-load issues which spawned the need/want of the progress bar in future entries.

If you'd like more info about the class, drop me a line.

Thanks for reading,

Jessel