Dual Embedded View's

HI Guys,I’m creating a web page using a notes form.

I have two subform’s in the form each with it’s own embedded view.

When i try to include both embedded view’s one doesn’t show.

If i delete the one that does show the one that didn’t before shows.

:confused:

I just can’t make it show both embedded view’s on the one page.

One of the view’s is from another database (if that makes a difference)

Thanks

Pat

Subject: Dual Embedded Views

I’m creating a web page using a notes Notes form.I have two subform’s subforms in the form each with it’s its own embedded view.

When i I try to include both embedded view’s views one doesn’t show.

If i I delete the one that does show the one that didn’t before shows.

:confused:

I just can’t make it show both embedded view’s views on the one page.

One of the view’s views is from another database (if that makes a difference)[.]

Subject: RE: Dual Embedded Views

Didn’t know this was a grammar forum?

Subject: Dual Embedded View’s

You can only have one embedded view on the web unless you use the Java applet – only one view can be “Display using HTML” or “Treat as HTML”.

Subject: RE: Dual Embedded View’s

Aw :(That make my job so much more exciting.

Agent’s here I come unless someone else has any ideas?

Subject: RE: Dual Embedded View’s

You could use iFrames and mimic what Embedded views do in the Notes client.I always find handling iFrames much easier than embedded views on the web - iFrames give you a lot more control.

HTH

Arshad

Subject: RE: Dual Embedded View’s

Just my opinion but iframes are not such a good idea for various reasons but…

this is where xmlhttprequest comes in handy… request your view using readviewentries then parse it into your browser using javascript. I do all my embedded views this way as it gives you maximim control over your data and can do it all asynchronously…

Subject: RE: Dual Embedded View’s

Yeah Adam I agree,I don’t like iFrame’s either they are a bit evil and well 90’s web style.

I think i will have to fire up jscript and do some xmlhttp request love but I will use JSON with the view’s.

Thanks for the input guys!

Subject: Curious …

I’m curious, why are iframes a bad idea?And are there samples of what you propose to use instead in the Sandbox or elsewhere that you could share?

Thanks!

Subject: RE: Curious …

Mainly for flexibility but can be a bit of a pain to keep track of for javascript (i.e. if any links to a page are in an inline frame, unless you set the target to be the parent frame the document will appear in the frame itself which can be a bit of a pain if you are going to have multiple views some of which could be in frames and some of which might not be.

inline frames are not resizable and won’t span to fit the view you put in them. If you want iframe-type behavoiur then use

with the width and height (and max-height if you want size to fit) properties and the overflow property for scrolling if needs be.

I will have a look at putting them in the sandbox if I can figure it out but basically it goes somehting like this:

function getXMLDoc(sUrl)

{

var xDoc=null;

var d=new Date();

sUrl+=“&NoCache=”+d.getTime(); //note add dummy item to query string to ensure browser doesnt’ cache it…

if (window.XMLHttpRequest) { xDoc=new XMLHttpRequest(); }

else if (window.ActiveXObject) xDoc=new ActiveXObject(“Microsoft.XMLHTTP”);

if (xDoc==null) return(null);

if(xDoc.overrideMimeType) { xDoc.overrideMimeType(‘text/xml’);}

xDoc.open(“GET”,sUrl,false);

xDoc.send(null);

return(xDoc.responseXML);

}

function embedHTMLView(view, id, category,hdr,ftr,defaultcmt)

{

defaultcmt=defaultcmt || ‘No documents found’;

var sUrl=“”+view+“?ReadViewEntries&ExpandView&Count=200&RestrictToCategory=”+encodeURI(category);

var sTxt=“”;

var sT=“”;

sDoc=getXMLDoc(sUrl);

if(sDoc==null) return;

var dt=sDoc.getElementsByTagName(“viewentry”);

var n=dt.length;

for(i=0;i<n;i++)

{

//get each view entry....

var y=dt[i].getElementsByTagName("entrydata");

n2=y.length;

for(j=0;j<n2;j++)

	{

	//extract your data and format into sTxt

	}

}

var x=document.getElementById(id);

if(sTxt.length!=0) x.innerHTML=hdr+sTxt+ftr; else x.innerHTML=defaultcmt;

}

Subject: RE: Curious …

Thanks Adam for the response & code snippets. I’ve wanted to try what you’re suggesting but couldn’t figure out how to get going on it.

In terms of IFRAMES, I’ve never had a problem with the links since all of mine were set to open to a particular target frame; guess I was just lucky. I’ve needed to use IFRAMES when I’ve had to combine a search with search qualifier fields on a form that also displays a categorized view which uses the stock @Command([ViewExpandAll]) etc. buttons. And I’ve then used DIV tags to surround the view itself on the form contained within the IFRAME tags & Javascript to resize the IFRAME & DIV tags according to the display height. So I got my scroll-bars & resizing functionality to work that way. A little convoluted but it works.

Subject: RE: Curious …

Cool… if it work, it works which is the main thing. I found iframes in a page to be okay when displaying information but if you have a button in the page in the frame that has to refer to a value in the parent window it can get tricky… but… there’s always more than one way to skin a cat. I must admit these days I do more on the client side (web) than server side so I don’t need so many views.