Solved

Dialog List from a view with Link

Posted on 2000-03-16
10
387 Views
Last Modified: 2013-12-18
I am creating a web page with a dialog list. The dialog list pulls the items from a view that I have created. On the computed dialog list formula I used
@DbColumn("";"";"WebView";1).
for the column I used
"[<a href="+URLName+">"+Title+"</a>
What I want is when I choose the dialog list it will open a particular URL. This can be easily done if you hardcode it using JavaScript on page, but what I want is that it pulls the data from a view which is easily maintainable.I am hoping for your help. Thanks.

from,
Barkley
0
Comment
Question by:Barkley
10 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 2623356
Hi

From ur statement I understand that u wan't to open a dialog window where user chooses the option and that value should reflect in the field, right !

If so then u can't use dialog list used in notes as it is in the web, for that u should go for window opener javascript function. You can do it, for that there are few steps to be followed, if this is what u r looking for , let me know .


~Hemanth



0
 

Author Comment

by:Barkley
ID: 2626058
Hemanth,
  Yes that is what I wanted, what I want is whenever the user clicks on one of the items in the dialog list, it will open the window of that link.But the items on that link, comes from a view not hardcoded.

Thanks,
Dennis
0
 
LVL 6

Expert Comment

by:ghassan99
ID: 2626068
Create a form with 2 fields, 'Title' & 'URL'.  Create a view say 'Webs' with 2 columns 'Title' & 'URL' too which corresponds to the 2 fields in the form created above.  Make sure the first column is sorted.  Create your addresses from that form, eg. Title: Lotus, URL: http://www.lotus.com.
In your main form that will be displayed on the web, create a keyword field with this fomula: @DbColumn("";"";"webs";1), call the field say 'urls'.  Add a button next to it, call it 'Go To' with this formula:
@Command([FileCloseWindow]);
@Command([ToolsRunMacro];"redir")

'redir' is an agent that you must create with this code in the initialize event:

Dim s As New notessession
Dim doc,doc1 As notesdocument
Dim db As notesdatabase
Dim v As notesview
Set doc = s.documentcontext
Set db = s.currentdatabase
Set v = db.getview("Webs")
test = doc.urls
Set doc1 = v.getdocumentbykey(test(0))
test1 = doc1.url
Print "[" + test1(0) + "]"

The agent must be shared and 'Run Once...' and 'Manually from the Actions Menu'

I created this on R5, and tested it locally on R4 successfuly.  I believe it might create problems on R4 while not on local, but probably there is a workaround.

-Gus
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:Barkley
ID: 2626692
ghassan99,
   Thanks for the reply.This will work if there is a button but what I wanted was the user will just click on the item and will trigger the URL. I am looking at the OnClick event which is JavaScript.
This is what I have also done:
Create a form with 2 fields, 'Title' & 'URL'.  Create a view say 'Webs' with 2 columns 'Title' & 'URL' too which corresponds to the 2 fields in the form created above.  Make sure the first column is sorted.  Create your addresses from that form, eg. Title: Lotus, URL: http://www.lotus.com.
In your main form that will be displayed on the web, create a keyword field with this fomula: @DbColumn("";"";"webs";1), call the field say 'urls'.  
On the event OnClick I call  a
javascript.

"<script language=\"JavaScript\">
function ref()
{location=document.forms[0].urls.options[0].text}</script>
This works if the URL is shown on the dialog list but if the Title is shown it does not work. I have to link the title and the URL whenever I click.
Thanks.

from,
Barkley







0
 

Author Comment

by:Barkley
ID: 2626895
My problem now is how do I pass the  data from Notes R5 to JavaScript. I can get the URL link using DBLookup but I can only trigger it though the OnClick of JavaScript.If Notes and JavaScript can't pass the data, is there a Notes command similar to OnClick? Or a JavaScript that can do a DBLookup?

Need help,
Barkley
0
 
LVL 6

Expert Comment

by:ghassan99
ID: 2627078
Then try and start the agent in JS, something like:
window.location="http://www.abc.com/redir?openagent"
in the onclick JS event.

-Gus
0
 

Expert Comment

by:LRM
ID: 2627445
Hi Barkley,

Create a  form with 2 fields,"JavaScriptArray", “Choice”  and "$$HTMLHead".

The formula for the field JavaScriptArray is as follows:

"if(document.forms[0].KeywordfieldName.options[document.forms[0].KeywordfieldName.selectedIndex].text==\""
+@DbColumn("":"nocache";"";"webs";1)+"\"{"
+@NewLine
var url=\""+@DbColumn("":"nocache";"";"webs";2)+"\";"
+@NewLine
+"parent.location=url;"
+"}"

The formula for the field $$HTMLHead is as follows:

"<SCRIPT language=JavaScript>"+@NewLine
+<!--"+@NewLine
"function go(){"+@NewLine
+"     "+@Implode(JavaScriptArray;@NewLine)+@NewLine
+@NewLine
+"}"+@NewLine
+@NewLine
+"//-->"+@NewLine
+"</SCRIPT>"

The formula for the field Choice is as follows:

@DbColumn("":"nocache";"";"webs";1)

You can call the above JavaScript function in onChange event of Choice Field so that it will trigger when the user selects a value from the Keyword field.


~LRM
0
 
LVL 1

Accepted Solution

by:
bennyliaw earned 100 total points
ID: 2631019
I believe LRM resolution should work, and I also have another simpler alternative.

Use the form with 2 fields that you already have.
In your "WebView", first column will be the title field and the second  is the url field.

Use following formula for the dialog list:
@DbColumn("";"";"WebView";1) + "|" + @DbColumn("";"";"WebView";2)

In th onchange event use following javascript:
location = document.forms[0].KeywordfieldName.options[document.forms[0].KeywordfieldName.selectedIndex].value

Let me know whether it works
benny@ematic.com
0
 

Author Comment

by:Barkley
ID: 2634865
bennyliaw,
  your answer worked. So I will give you the points.
  I would also like to thank ghassan99 and LRM, their proposals all worked.But I have to choose the simplest answer.

Thanks to you guys for helping me.

from,
Barkley
0
 
LVL 6

Expert Comment

by:ghassan99
ID: 2634917
Anytime...

-Gus
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HP DP 7.03 and lotus collaboration suite 9 3 162
Domino Application - View Refresh on Subform 15 98
Domino Server 2 80
Lotus Domino 9 web server 6 93
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question