Solved

OnClick for a view opened in popup window

Posted on 2004-09-10
10
365 Views
Last Modified: 2013-12-18
Hi,
This should be an easy one for all the experts here. Here goes: I have a popup window that shows a view. It is opened from an onFocus event in another form with codes:
window.open("/DBname.nsf/Test?OpenView");blur()

How and where do I make it such that if I click(single-click) a document in the view, it will send the document's column values back to the fields in the form where this view was opened from? Thanks in advance


DominoNotes Beginner
0
Comment
Question by:lianaizhouzhiruo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12025365
What do you mean "send the document's column values back"? Do you want to open the document, or anything else?

Assumption: you want to click a line in the view and copy some values to the existing other window. That's not too difficult, you can do that using JavaScript. Add an HTML column, or add some HTML around one of the column values, that creates a link to a JavaScript function, like

    <A ONCLICK="copyvalues(col1,col2,col3,...);">...</A>

and then fill in for the col# values the corresponding column values. The copyvalues function should find the correct target window, and copy the values to the right fields. It could be defined like

    function copyvalues(col1,col2,col3,etc) {
        window.frames['targetframe'].elements['fieldname'].value= col1
        etc...
    }
0
 

Author Comment

by:lianaizhouzhiruo
ID: 12050750
Hi bosman, I meant send column values of the selected document to another form's field(the form where the view window was opened from)

Regarding your suggestion, I created a new column in my current view and put it as 1st column then i added the following code in the column formula: "<A ONCLICK=\"copyvalues(Code);\"></A>" where Code is a column name of the view which I want to copy to the other form. However, I have no idea where to put the copyvalues function so I put them in the JS Header and onClick event of the form where the view window was opened from. The codes in my function is:
function copyvalues(Code) {
        window.frames[0].elements[whatCode].value= Code;
        window.frames[0].elements[whatCode].text= Code;
}
The entire thing doesnt seem to work though. When I click a line in the view nothing happens.

I think I'm probably doing something wrong, please enlighten thanks!



Domino/Notes Beginner
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12052191
New column created: OK
Code should be:
      "["<A ONCLICK=\"copyvalues(\"" + @Implode(value1:value2:value3:etc; "\",\"") +"\");\">copy</A>]"
   the [ and ] are required to force passthru-HTML in a view column, the wordt copy will be shown as Link
copyvalues in JS-Header: OK
onClick-event: has got nothing to do with this...
copyvalues:
     function copyvalues(val1, val2, val3, etc) {
             window.frames[0].elements[field1].value= val1;
             ...etc
     }
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:lianaizhouzhiruo
ID: 12081078
Hi Bosman,

I tried what you posted but the codes have an "operator or semicolon expected" error. I changed it to :
"[<A HREF='javascript:void(0);' ONCLICK=\"copyvalues('" + @Implode(@Text(TCode):Description;"','") +"');\">copy</A>]"
and theres no error now. However, nothing happens when i click the document in the view. Therefore, I created a ViewTemplate for the view(with an embedded view) and now it works fine. I also changed the function codes to :
window.opener.document.forms[0].whatTCode.value = Tcode;
window.opener.document.forms[0].description.value = desc;
because frames[0].elements[field].value doesnt seem to work and gives me an error.

Anyway, now I've managed to get all this opening, clicking and sending values back to main window working. There is just one problem now though. When I use the viewtemplate, it seems that the displayed lines are limited to 9999(which seems to be the max for an embedded view). Is there any workaround for this?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12082177
So the other question helped you a little? Great!

I'm not quite sure if it's the right document, but read "To set line counts in embedded views" in de Domino Designer help db. It says:
- there's an info tab on the embedded view, it contains the number of lines to display; what happens if you set it to 0?
- you can add the &Count=n argument to the URL; what happens if you add &Count=99999
- there is a server-wide default, see the Internet Site document for your server; read "Specifying the number of lines to display in a view" in the Domino Administrator help db
0
 

Author Comment

by:lianaizhouzhiruo
ID: 12082638
Hi Bosman,

1    Changing the display to 0 in embedded view property limits the lines to 30 whcih i believe is a server default.
2.   Adding &Count=99999 to the end of the URL string increases the limit to 1000 but it does not go any higher no matter what i change the number to.
3.   I dont know where I can change this server administrator thing you mentioned and I probably wont be allowed access to it anyway.
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 50 total points
ID: 12082904
I'm terribly afraid that there's only one thing you can do:
- write your WebQueryOpen agent in script, which ...
- opens the view,
- reads all the lines using columnvalues(), and
- creates the webcontent you want.
0
 

Author Comment

by:lianaizhouzhiruo
ID: 12098583
Hi Bosman,

I'll try writing a script to do what you said. Will get back to you on that. Anyway, is it possible to change the default $$ViewTemplate form, rather than creating a new "$$ViewTemplate for <form>" form.



DominoNotes Beginner
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12100016
There is no default $$ViewTemplate form, but you can create your own default form that will be used for all views opened on the web. That form should be called $$ViewTemplateDefault. Small drawback: you have to provide your own buttons.
0
 

Author Comment

by:lianaizhouzhiruo
ID: 12293943
Sorry have been busy with other stuffs. Wont be following up on this question anymore so i'm just gonna accept your answer about writing a webqueryopen agent to close this question
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

617 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