administration mode
Pssst...Ferdy is the creator of JungleDragon, an awesome wildlife community. Visit JungleDragon

 

Formula Optimizations »

FERDY CHRISTANT - MAY 30, 2004 (03:34:56 PM)

The R6 formula engine is great. I love the new @Functions, they make things more easy on the web and allow you to write portable code. Additionally, you can create very elegant and short code by optimizing your old code. Here's an example:

code next

It is the optimized and shortened version of an older code fragment I wrote. The code tries to mimic the @Command( [NavigatePrev] ) function on the web. This is what you need if your Domino form is pure (X)HTML, because you can't use some of those commands then.

New is that I dynamically retrieve the view alias. Furthermore, I use the new @IsNull functions to check on, well..null values. The most interesting line is the one in which I use the new @Max function to replace an @If statement. A lot more elegant, right? It really pays of to know the new @functions to find better or new ways to code your solutions.

For the curious, here's the code that mimics the @Command( [NavigateNext] function:

code next

As you can see, the navigate next code has a @DbColumn in it. It is needed to calculate the number of documents in the current view, which is needed to overcome the problem of navigating to a document in the current view that does not exist. Apart from that, both code snippets are portable, as I have been able to paste them in all my XHTML view templates without any modification.

Looks like us Lotus geeks have a new sport: formula optimization.

Comments: 2

COMMENT: VIDEO IZLE emailhomepage

SEP 21, 2008 - 11:30:50

comment » thank you «

COMMENT: SARAH

SEP 1, 2009 - 09:54:28 AM

comment » Hello, it's me again :) as I mentioned, I have been using your example xhtml database (s3_xhtml.nsf) to build my own. I am now trying to put in the view navigator. I am quite puzzled that when i try it on the Contacts\By Name view which is embedded on the $$ViewTemplate, it works such that the view is transferred to the next couple of entries in it but still retaining it in the same window, in the same page, with all the other page components such as the banner, the other links, etc. in place, but when i try it on my own form, using the same structure as the contact example, i do get redirected to http://localhost/s3_xhtml.nsf/myview?openview&start=1&count=30 but i only see the plain white html table listing the corresponding entries -- all the formating, images, etc. are taken out.

Sorry if my questions really seem so naive -- i'm really just starting to understand stuff here. thank you very much. :) «

CREATE A NEW COMMENT
required field
required field HTML is not allowed. Hyperlinks will automatically be converted.