199 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Why we DO migrate code.
Tue, Jun 27th 2017 10
Migrate Notes to DOCOVA Blog Series Part 17: Input translation and input validation formulas
Thu, May 25th 2017 5
Migrate Notes to DOCOVA Blog Series Part 16: Form events
Tue, May 23rd 2017 4
Migrate Notes to DOCOVA Blog Series Part 15: Private on first use folders
Thu, May 18th 2017 7
Migrate Notes to DOCOVA Blog Series Part 14: Column sorting and categorizing
Tue, May 16th 2017 8
Migrate Notes to DOCOVA Blog Series Part 13: Shared columns and fields
Thu, May 11th 2017 8
Migrate Notes to DOCOVA Blog Series Part 12: Multi-value fields
Tue, May 9th 2017 7
Top 10
Is 2017 The Year IBM Announces the End of Life of Notes?
Tue, May 24th 2016 27
DOCOVA V4.5 – Feature Quick Tour
Sun, Sep 27th 2015 14
DIY – Migrating from IBM Quickr with DOCOVA Migration Tools
Tue, Apr 21st 2015 13
DOCOVA University Updated
Fri, Nov 7th 2014 12
Migrate Notes to DOCOVA Blog Series Part 11: Pass-thru HTML and Generate HTML for all fields
Thu, May 4th 2017 10
Why we DO migrate code.
Tue, Jun 27th 2017 10
DOCOVA SE General Release Announcement!
Wed, May 27th 2015 9
IBM Announces a Change is Coming to the Notes & Domino Life Cycle Policy
Fri, Aug 12th 2016 9
Migrating from QSI to DOCOVA
Thu, Jun 25th 2015 8
DOCOVA SE (SQL Edition) vs. DOCOVA Domino/XWork
Wed, May 27th 2015 8


@DbLookup in Javascript? You Bet!
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
David Wice    

When moving Notes applications from a Notes client to a web client, there are a number of design approaches that need to be changed.   While Domino will support many @Functions on the web, often they come with the unwanted side effect of a refresh of the form.  One example of this is drop down selection fields that present available values based on a lookup, where the lookup key comes from another field on the form.

This article presents a way to achieve this functionality using Javascript and jQuery.

The examples shown are within the DOCOVA framework, however the concepts can be applied to any Domino web application, or actually, any web application.

Let me setup the scenario.  First, I have some configured lists setup, in this case, a list of countries, where each country has a list of cities.

fig1

fig2

In my form, I have Country and City fields setup, with drop down like icons for selecting the respective values.  The concept is straightforward, after a Country is selected, the City list shows only those cities that are listed for that Country.

fig3

Here’s the selection dialog in action, first picking a Country

fig4

Then a City

fig5

Selected values, shown in the form

fig6

Now let’s have a look at how this is done.   In my example, I’m working on a Domino server, but as mentioned, the concepts can be applied to any platform.

Here are my fields in Domino Designer

fig7

Arguably, the Country field could be a standard drop down field with a @DBLookup formula that retrieves the Country list, however I’ve opted for full client side Javascript for this example so it can be applied to any platform.

The selectCountry() function calls dbLookup, which we have created as a direct replacement for the formula language @DBLookup function, and is part of our Docova.Utils JS class that contains a number of such methods.   The syntax for our dbLookup function and corresponding code is included in the attached code.  We use a JSON value pair array to pass the options so that the order doesn’t matter, and we can easily add options to the functions in the future without having to revisit all existing code. (Note the selectKeyword function is not included with this article)

selectCity() is very similar to selectCountry(), the difference being we pass the Country as part of the lookup key, allowing us to return the correct list of cities.

The JS header code is available here, and the dblookup function is here.

For more information on DOCOVA and how we’re migrating Notes applications to the web, visit www.docova.com.

 



---------------------
http://www.docova.com/dblookup-in-javascript-you-bet/
Nov 07, 2016
4 hits



Recent Blog Posts
10
Why we DO migrate code.
Tue, Jun 27th 2017 1:28p   John Ryan
I decided to write a blog entry on the issue of migrating Notes application code when migrating Notes applications to DOCOVA.  When I say “code”, I mean the LotusScript and @formula language that is contained in Notes applications. Now, I’ve seen some blogs and vendor web pages that espouse how you should NOT attempt to migrate the code.  These vendors typically want to convince you that you should re-develop your Notes applications on their platforms.  I get it.  That repr
5
Migrate Notes to DOCOVA Blog Series Part 17: Input translation and input validation formulas
Thu, May 25th 2017 1:51p   John Ryan
Welcome to blog series part 17 of 17 on migrating Notes apps to DOCOVA.  The subject of this blog is Input translation and input validation formulas (formulae if you prefer). Right.  So, one day I hear this argument coming from down the hall here at DOCOVA.  The dev team embroiled in some discussion.  Oh the controversy.  Fisticuffs? Naw.  Heated?  Maybe that would be a bit of a stretch.  The debate?  How should input translation and input validation formulas be handled in DOCOVA? In a
4
Migrate Notes to DOCOVA Blog Series Part 16: Form events
Tue, May 23rd 2017 1:24p   John Ryan
Welcome to blog series part 16 of 17 on migrating Notes apps to DOCOVA.  In this entry I’m going to talk about form events. Okay, so the talk about form events usually starts of with the question: Does DOCOVA have document events like onLoad, onUnload, QueryOpen, QuerySave and WebQueryOpen? Yes.  DOCOVA supports both typical browser events like onLoad and onUnload but has also been extended to handle similar events that were found in Notes forms like QueryOpen, QuerySave, PostSave and so
7
Migrate Notes to DOCOVA Blog Series Part 15: Private on first use folders
Thu, May 18th 2017 1:38p   John Ryan
Welcome to blog series part 15 of 17 on migrating Notes apps to DOCOVA..  In this entry I’m going to talk about good ‘ol Private on first use folders. This is another one of those “interesting” Notes application design constructs.  In my journeys I don’t think I’ve ever come across this same sort of construct in any other application environment.  Anywhere.  Ever.  Sure, a private folder, but “…on first use” is the kicker.  Interestingl
8
Migrate Notes to DOCOVA Blog Series Part 14: Column sorting and categorizing
Tue, May 16th 2017 12:18p   John Ryan
Welcome to blog series part 14 of 17 on migrating Notes apps to DOCOVA..  In this entry I’m going to talk about view column sorting and categorizing. All view sorting and categorizing functionality is supported in DOCOVA.  Additionally, other properties like “Show multiple values as separate entries” and showing response docs in a hierarchy are also supported. I mean, as you get more in depth with DOCOVA, you’ll learn the breadth of the view object model and all the cool stuff
8
Migrate Notes to DOCOVA Blog Series Part 13: Shared columns and fields
Thu, May 11th 2017 1:52p   John Ryan
Welcome to blog series part 13 of 17 on migrating Notes apps to DOCOVA.  This entry is dedicated to shared columns and fields.  It’s short and sweet. DOCOVA does not support the concept of shared columns and fields between applications at this time. Say what?  I know, right?  DOCOVA is so over the top, so chalk full of functionality…it’s crazy, alas at the time of writing this blog entry, it doesn’t support shared columns and fields.  Well, that’s the reason ri
7
Migrate Notes to DOCOVA Blog Series Part 12: Multi-value fields
Tue, May 9th 2017 12:01p   John Ryan
Welcome to blog series part 12 of 17 on migrating Notes apps to DOCOVA.  In this entry it’s all about multi-value fields. Notes had the concept of multi-value fields on forms.  All fields were basically treated as arrays of values.  For example when addressing field values in LotusScript, you might write some code like; Dim myval = doc.myfield(0)  (where doc is a NotesDocument) Although it’s a bit of an odd duck, DOCOVA supports the same type of addressing when it comes to form
10
Migrate Notes to DOCOVA Blog Series Part 11: Pass-thru HTML and Generate HTML for all fields
Thu, May 4th 2017 1:02p   John Ryan
Welcome to blog series part 11 of 17 on migrating Notes apps to DOCOVA. In this entry I’m going to talk about “Pass-thru HTML and Generate HTML for all fields”. A neat aspect of forms development in Notes was the ability to treat text on a form as pass-thru HTML.  This meant that you could add HTML and inline JavaScript directly onto your forms and mark it as pass-thru so that the Domino server would let the text “pass-thru” as HTML/JavaScript when the form was being rende
6
Migrate Notes to DOCOVA Blog Series Part 10: Refresh fields on keyword change
Tue, May 2nd 2017 12:11p   John Ryan
Welcome to blog series part 10 of 17 on migrating Notes apps to DOCOVA.  In this entry it’s all about “Refresh fields on keyword change”. Ya, let’s take a moment to just love this one.  Have you ever used it in your Notes apps?  Refresh fields on keyword change was a bit of an odd beast, no?  The purpose of this operation was to enable field options (or values) to be recalculated based on the change of a selection field. For example, if you had one keyword field on a
6
Calendar View Integration in DOCOVA V5
Mon, May 1st 2017 10:50p   David Wice
You’ve built a new application for your client and they love it. You’re their hero. Two weeks later, they’re back with a list of enhancement questions and new ideas. This can happen regardless how many requirements gathering sessions you have. Once the system is in Production and all the users start accessing it, the requests start to come in. One of these requests may be “Can we see the data in a Calendar format?”. For those of us that have spent many years buildin




Created and Maintained by Yancy Lent - About - Planet Lotus Blog - Advertising - Mobile Edition