PermaLink Creating a "Starts with..." box for web users01/03/2006
Domino Development
In the Notes client, when you start typing in any view, a "Starts with..." box automatically appears:

Notes Starts with box

This functionality is very handy, especially when you want to "jump to" a particular category in a view:

Categorized view in Notes

Remember back in V3 how you didn't get this box at all? You just started typing as fast as you could, to make sure Notes got the entire string you were looking for? But I digress.

So, how would you implement this for web users? Click the Read More link below to learn how...

I've implemented my "Starts with" box inside a page that contains the outline for the application. Here's how this page looks for web users:

Starts With box contained within Domino page

This page is contained within the following frameset in the navigation frame:

banner
navigationNotesView


The content of the NotesView frame is a categorized view that looks like this for web users:

Categorized view rendered by Domino

In the design element where you want to add the "Starts with" box, you need to close off the <FORM> tag that Domino automatically generates when it translates that design element into HTML:

</form> <!-- close off form Domino automatically created -->

(The above HTML is pass-thru HTML.)

Next, add the HTML tags for a new form called "jump". This form will contain a single text box (or field) that the user will use to enter the search text. The form's onsubmit event is configured to invoke a Javascript function called jumpTo() when the user hits the enter key from within the text box. A submit button is also included, which essentially does the same thing. (The following is pass-thru HTML.)

<form name = "jump" onsubmit="jumpTo(); return false;" action="/" method="POST">
Starts with... <input name="Key" type="text" value="">  
<input type="submit" value="Submit" />
</form> The javascript code behind the jumpTo() function is contained within the page's JS Header event:
function jumpTo ()
{
	var frm;
	var search;
	var newSearch;
	var keyValue;

	frm = document.jump;

	search = window.location.search;

	keyValue = frm.Key.value;

	if ( keyValue == "" )
	{
		alert ( "Please enter a key" );
		return false;
	}

	search = parent.NotesView.location.search;

	newSearch = search + "&StartKey=" + 
                                        document.jump.Key.value + 
                                        "&CollapseView";

	parent.NotesView.location.search = newSearch;
}
The above function grabs the value in the Key field and uses it to create additional search parameters for the URL in the NotesView frame. Note that you need to append "&CollapseView" to the end of the URL. If you don't, Domino will navigate the web view to the first entry after that category.
Comments :v
No comments.
Credits
NuTechs Powered by Domino
Search
Calendar
February 2012
Su
Mo
Tu
We
Th
Fr
Sa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Monthly Archive
Get Real, Detroit!
Real Detroit Weekly
SWARM
Service
With
A
Rapid
Motion


-- old Rally's Hamburgers credo
Lotus Domino ND6 RSS News Feed RSS Comments Feed Podcast Feed Geo URL netcraft RSS Validator Lotus Geek Chris. A. Brandlehner Open Notes Picture Database OpenNTF CoComment Integrated BlogSphere
By Category
The BlogRoll
About
Contact Me
Contact me, Michael Sobczak, using this e-mail address:

my first initial my last name at Yahoo dot com
Recent Entries
No Recent Blogs
Powered by
Blogsphere