My toolbox

Posted by: Jaime

After getting the urge to say my tool(box) out, I thought I would just list some of the tools/parts/modules/whatever I have been using as of late and love to just "plug-in".

Date.js (datejs.com)
- this open-source java-script date library is a killer. Download the js from the site and drop the script tag reference into the header and "wacha" , you are a date ninja.

Code examples from datejs.com site
// What date is next thrusday?
Date.today().next().thursday();

// Add 3 days to Today
Date.today().add(3).days();

// Is today Friday?
Date.today().is().friday();

// Number fun
(3).days().ago();


Datepicker.js (link)
- from Julian Robichaux of http://www.nsftools.com
This is a JavaScript library that will allow you to easily add some basic DHTML
drop-down datepicker functionality to your Notes forms. I know that everyone has their own date control (pop-up), but this one is easy to add, easy to modify and looks cool too.

Google Suggest-type Lookups In Notes (notessuggest.zip)
- from Julian Robichaux of http://www.nsftools.com
This database demonstrates how to use XmlHttp requests to make dynamic lookups on a Notes web page, using the same technique that is found on the Google Suggest page. This is a great application of ajaxian type-ahead.

AJAX NAB picker single/multi (link)
-from Scott Good of Teamwork Solutions and updated/fixed by Ben Dupic
The form (multi or single lookup) allows you to search and dynamically return values from ANY view. I assume most users use it to pick names from the NAB, hence the name, but I have used it to return names and other values from many types of views. A nice "plugin".

Control "home page" on launch of database via web (Using a form as a db homepage)
-from Jake Howlett of Codestore.net
Basically create your home page however you would like it and name the form $$NavigatorDefaultTemplate, Create a navigator and name it whatever (doesn't matter, you're not gonna use it), then change the database launch properties to launch the navigator. Allows you to launch the desired home page from the root directory (myhomepage.nsf) without links, redirect, or fixed urls. Nice.

Very fast import from Excel to Notes (link)
- from http://Botstation.com
Import data from Excel cells into Notes. Very fast code using Range method of Excel OLE object to read the whole datasheet. Use this non stop. Slick, easy, not hard-coded like most imports. Put the field names in the first row of the spreadsheet and done. Who doesn't need to import from excel ?

Dynamic Report filter - no link
- from Tom @ http://codepress.net
This form and script library allow for quick report setups. Used it at many places for many types of reports. Never disappoints. Perhaps this will get Tom to write something up and possibly disclose the code. It has always been a work in progress.

Do you have any "tools" that you can't live without that make your job easier ?

Display remaining characters in field

Posted by: Jaime

I was recently asked to display the remaining characters in a field as the user types (eg. 500 maxlen). So, I of course went online to avoidre-inventing the wheel.

Here is what I found. Coding forums had an article entitled Characters remaining as you type. The code is pretty straightforward. I made some minor tweaks to get the code where I wanted it and came up with the following as a result.

> & < replaced with {} for display
-field value

{textarea cols="58" rows = "3" onKeyUp="updatelen(event,500,this,document.getElementById('textCounter'))" onBlur="document.getElementById('textCounter').innerHTML='';" name = "npdShortDesc" }{/textarea}
{div id="textCounter"}{/div}


-jsheader

//called on onKeyUp - shows remaing characters in text field
// @ maxchars = max # of chars to allow
// @obj = text field in question
//@msgObj = div to hold remaining text messages
function updatelen(event,maxchars,obj,msgObj){
var xlen = 0;
var curText = obj.value;
curText = curText.replace(/\W/g,"ZyXw")
var x = curText.match(/ZyXw/g);
if (x) {xlen = x.length;}
var remaining = maxchars - curText.length - xlen;
if (remaining < 0) {remaining = 0}
msgObj.innerHTML = "Characters remaining: " + remaining;
if (remaining == 0) {
curText = curText.substr(0, (maxchars - xlen));
obj.value = curText;
alert ("You have now used the maximum number of characters allowed! ");
}
}


-examples (Tom)
text counter

text counter max

reload Method

Posted by: Jaime

I was trying to reload a page after it was updated and the function was eluding me. So, I am putting it here for my own reference.

Here is the link to the MSDN documentation on the reload method; location.reload([x]). Where x can be true, false, or a location: true = from the server; false = from cache; location = location.href.

http://msdn.microsoft.com/en-us/library/ms536691(VS.85).aspx

Friendlier source code with two FF add-ons

Posted by: Jaime

Just read a great article in TechRepublic that talks about two new Firefox add-ons. View formatted source and View Source Chart — for viewing and working with the source code for pages viewed within Firefox.

Great new add-ons that I just started playing with. Read the rest of the article for more info.

LND Performance 101

Posted by: Jaime

Andre Guirard of Best Practice Makes Perfect has a new whitepaper out on how to write well-performing Notes/Domino apps. It is invaluable and long overdue. Thanks Andre ! Read it now.

The case of the missing design element

Posted by: Jaime

I was asked to weigh in on a strange occurrence. A developer had worked on the design of a database in test and had refreshed the production template's design. Soon after, the database owner called and reported a 404 error; page not found. Upon further investigation, the cause of the error was a missing design element. What? The page the owner navigated to, a view, was missing. That page wasn't even affected by the change. But, this error was not present prior to the development changes. Although it was not part of the development changes, it must have been deleted , right? Ok, restore the design from backup and we're ok. Well, not exactly. The design element is missing there too. What's up ?

A little background. The original design was signed by a user who is no longer with the organization. No, this organization does not sign all design elements prior to moving into production (that will be a point for discussion soon). About a week prior to the design changes, the user id in question was terminated. They validated that there were no agents in production that were signed by the old employee, so that was enough right? Apparently not.

Fast forward to the answer. Here is how the missing design element was discovered. We restored the terminated employees id and opened the design (the newly changed design in test) and viola, there was the design element. Ok, you say, the design element was hidden (using the last tab in the design properties that looks like a key) right? Yes, but not to show only to the ex-employee, but rather to a currently existing, valid role [DBAdmin]. So, if the role still exists, why did the design element suddenly go away when updated and refreshed? There in lies the question.

To review, a view signed by a newly terminated id had its design hidden to only members of the role [DBAdmin]. The ONLY change in the environment was the signing developers id was terminated one week prior to development changes being moved into production. This move caused the design element to disappear (seemingly) when the design was refreshed. Not immediately upon termination of the id but only after the design was refreshed. Admittedly, the new developer probably did not see the missing design element during the design changes and this was the reason that the design element eventually disappeared from production, however, the question I have is why was the design element missing in the first place? The role was still viable and the new developer was a member?

Even if I never truly find the answer, I posted this as a reference for me and anyone else that experiences this issue.
viagra mexico free viagra sample cheap viagra mail order viagra cheapest viagra viagra prices uk viagra sales buy viagra on line free viagra in the uk alternative to viagra buy cheap viagra viagra alternative buying viagra viagra without prescription viagra side effects discount viagra over the counter viagra viagra suppliers in the uk viagra online viagra stories buy cheap viagra online uk viagra soft tabs viagra for sale viagra from india side effects of viagra cialis vs viagra viagra alternatives cialis viagra viagra online stores non prescription viagra order viagra online cheap generic viagra viagra substitute viagra lawyers buy online viagra how does viagra work natural viagra viagra canada herbal viagra buy viagra now free viagra buy viagra soft online free trial of viagra viagra for women female viagra