Solved

Change embedded view element on a web page.

Posted on 2004-09-16
25
438 Views
Last Modified: 2013-12-18
I currently have a web page with an embedded view element. When the page opens in a frameset the proper view is displayed fine on the page. I'd like to use some kind of hotspot that would trigger a hide-when formula so I could choose to see a different view element on the same web page. I do want the current view element to be the one the page opens with, but I'd like to present a choice within the page to select another view. Is there a way?
0
Comment
Question by:bobdraz
  • 5
  • 5
  • 5
  • +4
25 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12076319
Use $$WebTemplateDefault to show your view, it is a form that serves as a wrapper around every view. Don't open the form then, open de view instead.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12076436
is it webtemplatedefault or $$viewtemplatedefault

Partha
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12076510
for your requirement,lets assume you have the dropdowns of viewnames


on change of the dropdown just give this: (assuming yoru drop down field name to be sMake)
      frm = document.forms[0];
      kwd = frm.sMake.options[frm.sMake.selectedIndex].text;



location.href=location.href.split(".nsf")[0] + ".nsf/" + kwd + "?openview"

Now since you have a $$viewtemplatedefault, it will open any view with that page


HTH
Partha
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12076604
Too fast... $$ViewTemplateDefault... Thanks, Partha
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12076655
Bro,

Webtemplatedefault hmmm,i liked the name, probably we can have it for all documents which don't have a associated form to open in web :)

Partha
0
 

Author Comment

by:bobdraz
ID: 12076715
What can I use on the page to trigger a change in the value of $$ViewTemplateDefault? There is no drop down. There are only 2 views I want to associate with the page. The one it opens with and the one I want to change on the same page. Is there something like a button I can put on the page to click on to change the value of $$ViewTemplateDefault?
0
 
LVL 14

Expert Comment

by:p_partha
ID: 12076727
see ., there is nothign like changing viewtemplatedefault, What u have to do is in the button , just call this:

location.href=location.href.split(".nsf")[0] + ".nsf/" + "<your view name>"+ "?openview"


change the yourviewname to ur real view name

Partha
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12076773
Can you explain why you want to do that.. when you can switch view using sidebar ? What is so special about that page which needs to switch views any other content reside in this page ?

~Hemanth
0
 

Author Comment

by:bobdraz
ID: 12076803
I didn't think buttons were allowed on a page. I'll try to added a button hotspot on the page. Also, will the above solution work within the embedded view element? I don't want the view to take up the entire frame, just within the embedded view element.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12076820
Bob, you're thinking "showing a page", we're thinking "showing a view, which is automatically wrapped in a standard layout".
0
 
LVL 1

Expert Comment

by:yangshuhua
ID: 12076842
1. Create a field to keep which view will be displayed on the page.

2. Create a computed subform. On each subform, embed each view you would like to displayed on the page.In subform formula, change subform name according value from above field

3. Create each subfrom and embed view in it

Sherry


0
 
LVL 1

Expert Comment

by:yangshuhua
ID: 12076897
Probably, this is the simples way to do it.

1 Create a Page and field "ViewName"
2. Embed View on page, check "Choose view based on formula". Then add formula according to value of field "ViewName"
3. For hopspot( or dropdownlist),when clicked, change the field "ViewName" value according to user choice.


It's very simple way to do  it. have fun with it

Sherry
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:bobdraz
ID: 12076903
I'm sorry if I confused you. The page in question has a lot of  links on the page and  alot of usefull information. There is one embedded view element on the bottom that opens with the correct view. Leaving the page right where it is, my client has requested if I can put a button on that page that will change the view in the embedded view element. Basically, he wants the page left as is, with the ability to choose a second view to be displayed within the embedded view element if he chooses to do so.

I don't want to fill the frame with the new view, just click a button on the current page and change the current value of the embedded view element.

Thanks
0
 

Author Comment

by:bobdraz
ID: 12076939
I'm not sure if I specified this is for the Web. Not the Notes client. When I referred to my client I met my customer.
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12076987
You can use a tabbed table.

1. Create a table in a form, with as many rows as the number of views you want to display
2. Select Table / Table Rows / Special table row display / Show only one row at a time
3. Select Table / Table Rows / Which row to display / Users pick row via tab buttons
4. Embed each view in a different row and set a Tab label and caption For selected row
5. Decorate the table
6. Test it

0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12077073
Well, I'm very slow at composing a post... :(

What you need is a DHTML layer where you can change its contents, i.e. the page it's loaded in, without reloading  a whole new page.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12077124
Easiest way to do this ...

place the embedded view 1 and view in browser , copy entier applet with param tags and paste it into the form/page
similarly do it for second one.. (THis is because R5 doesn't allow multiple embedded views in one page, R6 does)

Place first and second view parameters in a div tag with id

eg: <DIV ID="view1"> <APPLET>...</APPLET> </DIV>

Now create this js function in the jsheader
function switchView() {

if(view1.style.visibility == "visible") {
view2.style.visibility = "visible";
view1.style.visibility = "hidden";
} else {
view1.style.visibility = "visible";
view2.style.visibility = "hidden";
}

}

Call this onload event and in the button



0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12077135
So, you should replace the space where now appears your embedded view with such a layer. Then set the layer source in the onLoad event of the page such that the first view is loaded when the page is loaded. Then put two buttons near the layer, such that each changes the source of the layer to the view currently not shown.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12077185
You might see some jump due to positioning if you don't use absolute positioning.. By default it is relative positioning

so your div tag should look like

<BR>
<DIV Style="position:absolute" ID="view1">
THis is <BR>
View area 1 <BR>
</DIV>
<DIV Style="position:absolute" ID="view2">
THis is <BR>
View area 2 <BR>
</DIV>
0
 

Author Comment

by:bobdraz
ID: 12077195
I do understand what you're proposing. In a form I have done that with no problem. On the Web in a Domino Page I seem to be limited.  

I don't mean to be difficult, but my customer wants the Page (not a form) left where it is and just change the embedded view.

I guess what I want to accomplish is a programmable tabbed table on a Page for the web.  Since  you can't create a field on a page, I had no way to change the tabbed value in the $tablenamefield.

Thanks
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12077341
my soln is meant to work on the web
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12077371
bobdraz
Notes tabbed tables work the same in a NotesPage or a NotesForm. Tab captions are automatically rendered as links to change the displayed row.
0
 
LVL 3

Expert Comment

by:Andrea Ercolino
ID: 12077452
You need layers (HemanthaKumar's approach or mine) only if you don't want a complete page reload, else a tabbed table works fine.
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 12077634
I must say bobdraz has a problem of plenty ;-) Oh well! Sometimes easy solutions don't come to mind. Any ideas, why?

What is wrong is having a frameset inside the frameset? Why juggle betweeen subforms/selection formulas/extra fields and view templates.

I would go for a frameset embedded within frameset. In the innner frameset there would be two frames, one (top frame) will hold the listbox/hotspots/buttons/any other means of letting the user choose the view and in the second (bottom frame) will hold the view to display.

The URL generation can be done with Partha's logic given above. Just replace the location of the bottom frame with a new URL.
0
 
LVL 14

Accepted Solution

by:
p_partha earned 500 total points
ID: 12079051
bobdraz
Did you try what i suggested


Partha
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

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…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 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

13 Experts available now in Live!

Get 1:1 Help Now