Solved

OnClick for a view opened in popup window

Posted on 2004-09-10
10
356 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
  • 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now