Home > Ask the Domino Experts > ARCHIVE: LotusScript and Web Development Questions & Answers > Several ways to design a dynamic menu
Ask The Domino Expert: Questions & Answers
EMAIL THIS

Several ways to design a dynamic menu

Dave Hatter EXPERT RESPONSE FROM: Dave Hatter

Pose a Question
Other Domino Categories
Meet all Domino Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 15 May 2002
I read there are several ways to design a dynamic menu for a Web application. But, I do not understand it. How could I generate, using LotusScript or Java, a dynamic menu? Could you explain and give an example?

>
It depends on what you mean by "dynamic" menu. The are numerous ways to do this, you could use a view with one column to create a menu, you could write a LotusScript or Java Agent to generate a page of links or two dynamically create a JavaScript menu. You could just use JavaScript to create a menu, or you could do it with DHTML, if really just rdepends on what style of "dynamic" menu you want. The following simple Java agent could be used to generate page of links based on content read from a database. It assumes that you have a view named vwMenu, which contains documents with at least two fields, tLink and tDescription. The tLink field contains the actual link and tDescription, which contains description text to display to the user. You would probably want to add some more error handling to this agent before using it in production.

// Last mods 020506.105101 - dhatter@libertastechnologies.com - www.libertastechnologies.com import lotus.domino.*; import java.util.*; import java.io.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session nsCurrent = getSession(); AgentContext nactxCurrent = nsCurrent.getAgentContext(); Database ndbCurrent = nactxCurrent.getCurrentDatabase(); PrintWriter pwHTML=getAgentOutput(); pwHTML.println("Content-Type: text/html"); pwHTML.println("Pragma: No-cache"); pwHTML.println("Expires: 0"); View nvwMenu; Document ndocMenu; String strHTML; nvwMenu=ndbCurrent.getView("vwMenu"); strHTML="Dynamic Menu"; strHTML=strHTML + ""; strHTML=strHTML +""; ndocMenu=nvwMenu.getFirstDocument(); while(ndocMenu != null){ strHTML=strHTML +""; ndocMenu=nvwMenu.getNextDocument(ndocMenu); } strHTML=strHTML+"
"+ ndocMenu.getItemValueString("tDescription") +"
"; pwHTML.println(strHTML); } catch(Exception e) { e.printStackTrace(); } } } // end of agent
I have included the source of the page this agent generates below: Dynamic Menu
Libertas Technologies, LLC
New Riders Press
Lotus
IBM


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
ARCHIVE: LotusScript and Web Development
"Field or view column exceeds 32 Kb" errors from the @DBLookup formulas
Agent to open an Excel file and pass the URL on for a Web query?
WebQueryOpen/Save agent problem
Using the function @DialogBox in a Web application
Code for validation on a field
Displaying info. in the order it appeared in the view
Display from my Web page an an online link using Excel
Creating a dynamic menu
Using @Unique
Code used for the HTML head content section

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Lotus Notes Domino on Blackberry and mobile devices
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts