Articles
PermaLink Free Domino Designer 8.5 Courseware02/07/2010 09:03 AM
Domino 8.5
The folks over at TLCC are providing a "free" introductory level Domino Designer 8.5 course.  If you have some newbie Domino developers in your group, Domino developers that want to start learning XPages, or administrators that want to get up to speed on development, you should check out this course.  

From my past experience, TLCC provides high quality courses with a focus on details.  It is delivered within the Notes 8.5 client, which you can also download for free from IBM.  Using the Notes client allows you to learn at your own pace and perform the corresponding exercises in the Designer.  I had the opportunity to review their full blown XPages course last year and would recommend it to anyone wanting to learn XPages.  Click here to read that review.

Here's an overview of the course modules:
  • What is Notes and Domino software?
  • The role of the Notes client and Domino server
  • Domino Application Architecture
  • Using Domino Designer software
  • Creating a Domino Application
  • Creating Forms and adding fields
  • Designing Views
  • Creating XPages for your application
  • Programming options in Domino Designer applications
  • Deploying a Domino application

For more details visit the TLCC site.  Nowadays, everyone could appreciate free courseware....
Technorati:
(1)

PermaLink Domino 8.5 DDE Tip - How to edit multiple design elements in the same window. (Agents, Forms, Views, XPages, etc. )02/01/2010 05:50 AM
Domino 8.5
Now that Domino Designer 8.5 is based on Eclipse, you can take advantage of some built in Eclipse features.  Eclipse provides the capability for editing multiple elements in the same design window by splitting the window either horizontally or vertically.

Let's say you want to edit an XPage and a Custom Control together.  Open up both the XPage and Custom Control as you normally would.  Open up the Custom Control. Now drag the XPage tab onto the currently opened Custom Control in the design pane.  Release the mouse when the icon turns to a black arrow and a black shaded outline appears:
Image:John's Blog - Domino 8.5 DDE Tip - How to edit multiple design elements in the same window.  (Agents, Forms, Views, XPages, etc. )


Once the mouse is released the screen will split and contain both design elements:
Image:John's Blog - Domino 8.5 DDE Tip - How to edit multiple design elements in the same window.  (Agents, Forms, Views, XPages, etc. )


This is not limited to XPages.  If you want to edit a Lotusscript agent and view the associated Notes Form at the same time you don't  need to flip back and forth between tabs anymore.  You open both design elements as normal.  Click on the Form tab.  Now drag the Lotusscript Agent tab onto the opened window toward the right side of the screen this time:
Image:John's Blog - Domino 8.5 DDE Tip - How to edit multiple design elements in the same window.  (Agents, Forms, Views, XPages, etc. )

Here you can see the Form and Agent side by side:
Image:John's Blog - Domino 8.5 DDE Tip - How to edit multiple design elements in the same window.  (Agents, Forms, Views, XPages, etc. )

If you need more real estate temporarily, you can double click on the design elements title and it will maximize that window.  Double clicking again will restore the window size.

To move the split window back to it's original tab you can drag the window back to the Tab bar and the window will return to normal.

Good stuff....

-John
Technorati:
(1)

PermaLink XPages: Generate Dynamic Views at runtime - Custom Control....opinions wanted01/28/2010 08:04 AM
Domino 8.5 - XPages
I was working on an application where I had a number of views on an XPage that I would hide/show depending on the navigation selected.  I thought it would be great not to have to embed every view on the page, plus build out all the XPages views.

Just for fun I looked into creating a custom control that would accept the view name, the columns/fields, the link to open, etc. as parameters. The custom control would then generate the view for me. It turned out not to be so difficult to build...at least a scaled down version of a view control.

There's more to do though, but I was curious before I put more time into this if this is something folks could use?  Please comment and let me know if you could use something like this and I'll finish it and publish it on openNTF.org.  You can try out the example here: Dynamic View Custom Control

Here's a screen shot of it in action.  The top section is for demo purposes only.  The view name, columns, etc., can be passed via scope variables (or anyway you want).  There might be a use case to allow users to save their view preferences in a profile or config document.  (the data in the example db is garbage, that's why it looks to be duplicated):

Image:John's Blog - XPages: Generate Dynamic Views at runtime - Custom Control....opinions wanted

So far, here are the parameters that I pass to the custom control.
Image:John's Blog - XPages: Generate Dynamic Views at runtime - Custom Control....opinions wanted

The custom control uses nested repeat controls to build the view.  I used Paul Calhoun's example Creating a Dynamic HTML Table on an XPage to add the columns to the tables as it iterates through the field list.  By adding the <xp:td> tags around the repeat controls the Outline palette seemed to object to this and will not let me select the repeat control anymore with my mouse.  I have to work on that because it's torture to work with like this....

Here's a screen shot of the custom control with the nested repeat controls.  Not much to it.  Right now I'm being challenged to add a sorting feature to the columns.  Any ideas?:
Image:John's Blog - XPages: Generate Dynamic Views at runtime - Custom Control....opinions wanted

-John
Technorati:
(7)

PermaLink XPages Running in the Notes Client, Composite Applications, Mashups, and Websphere Portal!10/19/2009 05:56 AM
Domino 8.5
With the 8.5.1 release you can now run your XPages applications in the Notes client, composite applications, Mashup Center, and Websphere Portal.  

Imagine taking some of your key Notes applications and adding an XPage front end to some core corporate functionality.  Then componentizing those XPages and publishing them as components to your catalogs for consumption.  Notes users can then add them to composite applications and take them offline, a Mashup Center user can add them to a mashup along with their sales projection spreadsheet, Portal users can wire them to their dashboards for drill down capabilities.  All of this with one development tool, the Domino Designer!

The great thing here is this is not just surfacing your Notes data in these other platforms.  This is providing the same Web 2.0 applications and functionality that Xpages delivers in a web browser to these platforms.

There are 2 new design elements/features in 8.5.1 that make all this possible:
- The ability to run your XPages applications in the Lotus Notes client, both on the server or locally.
- The new Component design element that allows you to split up your XPages applications into components for wiring in composite applications.  Once you have defined your components, they are immediatley available to run in Notes Composite applications, the Mashup center or Websphere Portal as iWidgets....without any code changes!

All this with minimal design effort required on your part....point and click, drag and drop and you now created a component that has properties and events for wiring.

I have a new article published on The View that goes in depth step by step on how to utilize all these new features.  It shows you how to create components and run your XPages applications in the Notes Client, composite applications, Mashup Center, and Portal.  You can access the article here: Domino Designer 8.5.1— XPages in the Notes Client, Composite Applications, Mashups, and Portal!  (*requires login)

Here's a preview:

Web Client and Notes Client
This is an image of the sample XPages application running in a browser and also running in the Notes client.  In this example I am using the same theme.  Note the use of the @ClientType() formula in a computed field displaying what client the application is running in. You can use the @ClientType() formula in any JavaScript computable property to tailor the page to the client or the browser.
Image:John's Blog - XPages Running in the Notes Client, Composite Applications, Mashups, and Websphere Portal!



Notes Client as Components in a Composite Applications
In this screen shot I took the XPages application and created two components from it.  It is very easy to add actions for the wiring since there are new client side simple action available.  When the customer link is clicked it fires off the events sending the customer name and the customer address.    The viewOrders component receives the customer name and filters the orders view to show only the orders for this customer.  The Google map receives the address and opens up a street map showing the location.
Image:John's Blog - XPages Running in the Notes Client, Composite Applications, Mashups, and Websphere Portal!


Mashup Center
This picture shows the same components running in a mashup in the Mashup Center without any changes from the Notes client version!  The Domino server projects the components as iWidgets for us so there is nothing we need to do to use them in the Mashup Center....just drag and drop and add the wiring.
Image:John's Blog - XPages Running in the Notes Client, Composite Applications, Mashups, and Websphere Portal!

Websphere Portal
Here is a screen shot of the XPage component running in Websphere Portal in the iWidget portlet along side two Portlet Factory generated portlets.
Image:John's Blog - XPages Running in the Notes Client, Composite Applications, Mashups, and Websphere Portal!

This is really an amazing release!  It is packed with hundreds of fixes and new features.  These new features really open the door to developing applications for platforms that might have been previously out of reach for Domino developers.

A special thanks to Stephan Wissel and Henry Christiaan who helped me troubleshoot issues I was having with the iWidget portlet in Portal.  I was having problems getting the portlet to work in my test environment across my VMware servers.  The resolution was to adjust the Ajax security settings in the portlet proxy-config.xml to allow across servers and port access.  These guys recently demoed similar functionality at the IBM Portal Excellence Conference 2009 in Macau China.  Thanks for your help!

-John
Technorati:
(1)

PermaLink XPages: The View article(s) - How to Compute a Custom Control at Runtime09/13/2009 10:40 AM
Domino 8.5
I recently had 2 articles published in The View that demonstrate how to compute which custom control to display at runtime based on a formula.  This is similar to using a computed subform in traditional Notes/Domino development.  

The first article provides the technical overview on how to accomplish this using a built-in XPages feature.  The second article expands on the first by enhancing the custom control to allow the use of parameters so that it can be re-used in any of your applications.

Here's a synopsis of the articles.  (the full articles require a subscription login)

XPages — How to Compute a Custom Control at Runtime
     
       
When Domino developers first start exploring XPages, they naturally tend to compare the new XPages controls and functionality with traditional IBM Lotus Notes and Domino development: “I know what I want to do and how I would have accomplished it with Domino Designer. Now how do I do it in XPages?”

Take the concept of a Notes computed subform. I have heard many developers asking how this is handled in XPages. While many Notes concepts are handled the same way in XPages as in traditional Notes development, the computed-subforms concept is not one of them.

The XPages design component that most closely corresponds with subforms is the custom control. You use a custom control where you have a group of fields or functionality that you want to reuse on other XPages within your application. Once created, a custom control shows up in the Controls palette. Then you can drag and drop the control onto any XPage in your application.

In Notes, you can compute which subform to include on a form based on a formula. Computing which subform to include at runtime is an easy way to tailor the form and functionality without having to maintain numerous hide/when formulas. This is a very valuable feature for rapid application development. With XPages, however, there is no computed custom control. I’ll show you a technique to help you get functionality in XPages that is similar to computed subforms.
 
XPages — A Reusable Solution for Computing a Custom Control at Runtime
In XPages development, you use a custom control when you have a group of fields or functionality that you want to reuse on other XPages within your application. In an earlier article (THE VIEW, 2009) I showed you how to use a custom control that computes which custom control to display on an XPage at runtime, similar to using computed subforms in Domino Designer.

Now I’ll show you how to enhance that custom control so you can reuse it in any XPages application to compute any custom control at runtime. Plus, I’ll show you how to create custom control properties for parameters that can be accessed with serverside JavaScript. Learning how to parameterize your custom controls will enable you to build your own library of reusable controls for rapid application development.

-John

Technorati:
(1)

PermaLink XPages - How to pass a Document Data Source to a Custom Control08/17/2009 06:29 AM
None
In a previous article I explained how you can use the undocumented currentDocument data source object to get the data source for the XPage from a Custom Control.  This works great if the XPage has one data source. What if you have multiple data sources?  For example, you want to include a custom control within a repeat control that is accessing multiple documents from a document collection or a view.  The currentDocument variable would only point to the first data source on the XPage.

At first glance, looking at the data types that are available for parameters in a Custom Control, you cannot pass a data source object. The type list drop down is a list of standard JavaScript variable types.

Image:John's Blog - XPages - How to pass a Document Data Source to a Custom Control



But, if you click on the folder icon next to the Type field you will see an extended list of type available.

Image:John's Blog - XPages - How to pass a Document Data Source to a Custom Control


Then from your XPage you can pass the datasource using computed JavaScript, such as: "OrderDetails.getDocument();"

*updated - see note below

Image:John's Blog - XPages - How to pass a Document Data Source to a Custom Control

Binding fields on a Custom Control to a dynamic datasource
The second part of this can be tricky.  On your Custom Control you cannot use the "Simple Data Binding" option to bind your fields since you have no datasource set for the Custom Control, the datasource is dynamic.  

The perfect solution for this is to use the Advanced -> Expression Language (EL) binding.  For example, to bind the field to the "Comment" field, we would use "compositeData.docdatasource.Comment".  Where....
- compositeData holds all the parameters for the Custom Control
- docdatasource is the parameter that we created that receives the datasource
- Comment is the field name on the Notes form

Image:John's Blog - XPages - How to pass a Document Data Source to a Custom Control

Now, with that said, there is an issue with this in 8.5.  DDE tries to convert the EL expression to a Simple data binding when you save and reopen the Custom Control. So it works the first time you enter it, but loses the binding when you edit the Custom Control.  However, it looks like this is fixed in 8.5.1.

BUT, no sweat, I have a workaround.  If you select JavaScript for the binding type, select "Compute on page load", and then enter the formula as '#{compositeData.docdatasource.Comment}' it will continue to work.

Image:John's Blog - XPages - How to pass a Document Data Source to a Custom Control


Here's an example of the Custom Control used with multiple Data Sources in action:

Image:John's Blog - XPages - How to pass a Document Data Source to a Custom Control

You can download this example here.

*update - by passing the NotesXSPDocument instead of the NotesDocument, the fields will automatically handle whether the document is in read or edit mode.

To do this, select "ModelDataSource" as the type for the property.  Then when passing the datasource from your XPage change the JavaScript from "OrderDetails.getDocument()" to just "OrderDetails".

-John

Technorati:
(0)

PermaLink XPages - My Review of the New Course from TLCC08/06/2009 10:21 AM
Domino 8.5
I recently had the opportunity to review the Developing XPages using Domino Designer 8.5  distance learning course being offered from TLCC,, The Learning Continuum Company.  I have to tell you I could not get through it......I didn't have enough time!  This course is packed with information, examples, samples, and tips.  The course is equivalent to a 4 day classroom course, so about 32 hours worth of material.

The author is Paul T. Calhoun who is also an author on the infamous XPagesBlog.com.  Paul does an excellent job of guiding the student from beginner topics all the way through to advanced topics.  Like all TLCC distance learning courses, the course is delivered via Lotus Notes.  This makes it easy to switch from concept to hands on development activities in the Domino Designer.

The course is broken up into 8 modules covering topics such as: introduction, creating XPages, Controls, client side and server side JavaScript, advanced techniques (my favorite), custom controls, among others.

I could not help comparing the depth of the information with the DDE 8.5 help.  The course by far covers more details on functionality and the various control properties than the help file.  It's worth the price just for reference purposes.

One of the great benefits of the TLCC course is that you have access to ask the instructor, Paul,  for assistance via a discussion database for 4 months from the purchase date.  That is really helpful.

The course costs $800, but is on sale right now for $600 (ends tomorrow...sorry for the late post).  I give this course two thumbs up!

-John
Technorati:
(2)

PermaLink XPages - Example on how to generate dynamic controls for your fields at runtime07/20/2009 12:01 PM
Domino 8.5 - XPages
In my XPages Survey tool example that I demoed at Lotusphere, I showed how to dynamically generate fields at runtime for a document collection. The tool allows an administrator to create survey questions and select the control type and selection values.  Then the tool generates the fields for the questions when the user opens a survey.  The XPage utilizes a repeat control and panel control to accomplish this.  

For today's example I pulled out the specific code that generates the fields,  i.e. checkbox, list, radio button, edit box, etc.,  and simplified it so that it is clearer how this technique works....and just how easy it is to implement.  In the full survey tool example, this feature and technique easily gets lost.

You can download the sample database here.

The real key to this technique is the separation between presentation and data in XPages as compared with traditional Domino development.  With XPages, you can have multiple controls bound to the same Lotus Notes fields.  As long as only one of these controls is rendered at runtime, there is no issue with data integrity.

Below is a screen shot of the example generating a radio button group control :
Image:John's Blog - XPages - Example on how to generate dynamic controls for your fields at runtime


Here's how it is built:

On the DynamicFieldDemo XPage, the fields in the Field Attributes section control how the control is generated.  There is one control in the Field Preview section for each possible control type.  The Required field sets the validation required property on each control to true or false.  The Generate Field button reloads the page.  This is only required for this example because we need to regenerate the controls, which is not something that would be changing for your users.

The XPage layout looks like this:
Image:John's Blog - XPages - Example on how to generate dynamic controls for your fields at runtime


The visibility formula for the "Combo Box" control returns true if the user selected "DropDown" for the Control Type.  In this example I pick the value up from a session variable:
Image:John's Blog - XPages - Example on how to generate dynamic controls for your fields at runtime


The data Binding is set the same for all the controls.  In this example I am not using a Notes form as a datasource in order to keep it simple and instead just using session variables:
Image:John's Blog - XPages - Example on how to generate dynamic controls for your fields at runtime


The Validation is set, in this case for the combo box, from the All Properties->basics->required property:
Image:John's Blog - XPages - Example on how to generate dynamic controls for your fields at runtime

The possible selection values are set by exploding out the choices using a "," as the delimiter:
Image:John's Blog - XPages - Example on how to generate dynamic controls for your fields at runtime

Lastly, the Display Error control will display an error if the field is required and you pushed the Test Validation button.  The really cool thing here is that I have only one Display Error control which I compute what control it should report errors for.  This is accomplished by computing the "Show error messages for" property.  Since the control names I used match the selection names it is easy to compute which control is being displayed:
Image:John's Blog - XPages - Example on how to generate dynamic controls for your fields at runtime

As you can see, this opens up many possibilities.  I'm sure it won't be long before you discover other uses for this technique.

-John
Technorati:
(5)

Search
Partner with us
Need help on your XPages projects?

Talk to the experts! Read more...
Powered by
Blogsphere
Lotus Domino ND7 RSS News Feed RSS Comments Feed Geo URL netcraft RSS Validator Lotus Geek Chris. A. Brandlehner OpenNTF BlogSphere