PDA

View Full Version : Feed Viewer inside a window



SachinJadhav
28 May 2009, 7:52 AM
Hi All,

I am trying to make use of Feed-Viewer (http://extjs.com/deploy/dev/examples/feed-viewer/view.html) in my application.

I am trying to add this inside the window (in a desktop (http://extjs.com/deploy/dev/examples/desktop/desktop.html)) . But could not do it, probably Viewport of feed-viewer is creating a problem. Can we really have two viewports (1. Feed-viewer 2. Desktop) for a single document.

Please let me know your suggestions.

Any help towards this would be really useful.

Thanks for your precious time interest towards my concern.

Thanks and Regards,
Sachin.

28 May 2009, 10:12 AM
only one viewport.

remove the feedviewer from the viewport and place it in a maximized window.

SachinJadhav
28 May 2009, 9:34 PM
Dear Jgarcia,

Thanks a billion for your time.

I tried to replace a viewport in 'FeedViewer.js' (http://extjs.com/deploy/dev/examples/feed-viewer/FeedViewer.js) with Ext.Panel, but the Preview-Panel is creating a problem, reason being it is using 'Ext.Template.from'.

Also, I found that Preview-Panel has dependency on 'div' in 'view.html'. Please let me know your valuable suggestions, how can I resolve this.

Jgarcia, I really appreciate your efforts, for my concern.

Thanks and Regards,
SachinJadhav.

loicdevaux
3 Jun 2009, 9:33 PM
I had the same problem with previewpanel sending some this.body.update('') javascript error "this.body is undefined".
After removing in FeedViewer.js the addFeed calls


// add some default feeds
feeds.addFeed({
url:'http://feeds.feedburner.com/extblog',
text: 'ExtJS.com Blog'
}, false, true);
...
I got the Feedviewer showing okay in a tab . I created the feedviewer as a Panel like this :


var feedViewerPanel = new Ext.Panel({
layout:'border',
title: 'RSS Feeds',
id:'feedViewerPanel',
items:[
new Ext.BoxComponent({ // raw element
region:'north',
el: 'header',
height:5
}),
feeds,
mainPanel
]
});if you use the BoxComponent inside the panel don't forget to put the following div in your html :

<div id="header"><div style="float:right;margin:5px;" class="x-small-editor"></div></div>
Of course you also need the textarea with the template in your html.

Having this set you can call the addFeed() method once the viewport is created, at least that worked for me.
I'll put a demo online as soon as I have fixed some other things.

SachinJadhav
3 Jun 2009, 9:58 PM
Dear Loicdevau,

I appreciate your efforts, success.

What I am trying to do is, I want to add this feed viewer inside a window (i.e. Panel). I can not use viewport, because feed viewer is the only part of my application (desktop) and not the whole.

Please let me know is there any way, I can add viewport inside a window (except iFrame). Or how can I add feed viewer inside a Panel.

Thanks you all, for your time and energy.

Thanks and Regards.
SachinJadhav.

loicdevaux
5 Jun 2009, 10:26 AM
well that's what I have been doing. I added the feedviewer to a panel, the panel to a tabpanel and the tabpanel to a viewport.

Loic

SachinJadhav
8 Jun 2009, 6:13 AM
Dear Loicdevau,

My intention is "just not to have viewport in picture". Because I already I have one('desktop').

I tried, as you mentioned but I am getting the following error, when I replace viewport with panel


"
this.body is undefined MainPanel.js (line 38)
this.body.update('');
"
Also can I have a feedviewer without viewport.

What if I add mainPanel and feeds inside a panel, and this panel inside another windowPanel(in your case its tabPanel). Till this point no doubt, but what about previewPanel, where are you adding this? Is viewport necessary for this component.

Thanks a lot for your patience and efforts, Please do the needful, if possible can I see your demo online.

Thanks and Regards,
SachinJadhav.

loicdevaux
8 Jun 2009, 9:34 AM
If you read my previous posts carefully you'll see that I am mentioning this error and a workaround.
You were asking if you could put the feedviewer inside a panel and I answered yes. Now you are free to stick this panel wherever you want ... including trashcan >:)

I don't know how desktop works but I would
solve the js problem "this.body is undefined"
follow jgarcia @ tdg-i.com advice and put the feedviewer inside a window
use this window with your desktopI put the demo online but this might not help you much since it's based on a viewport.
It might be interesting for other though.
Here is the link http://lolo.asia/antisuyu2009/extjsge.php

Push the trial and error method a little further and I am sure you will find the solution.
I sent you a private message to offer you assistance on skype so we can find and publish the solution faster and avoid long and boring talks on this board.

darkassassain
23 Jun 2009, 2:57 PM
Greetings,

I have been browsing Google for the past week or so trying to find examples of people using the Web-Desktop from ExtJs and have found many examples on how to add certain information onto my desktop style site for the game I play. I have found a way to put a feed-viewer into a panel and have it load immediately on page load, but have not been able to make it load off of a shortcut link on the desktop. Any advice would be grateful.

My Demo Links are here:

This link has the feedviewer loading in a window and queries the feeds properly:

http://eve.jebspaintball.com/desktop/desktop/modules/feedwin/view.html


This link has it loading with the OnReady feature but doesn't pull the feeds.

http://eve.jebspaintball.com/desktop/

This link tries to load it via shortcut and it doesn't load:

http://eve.jebspaintball.com/desktop/desktop2/

This site loads the desktop style environment but notice that the start menu is missing the following links: Ventrilo Status and Forum Feeds

I will provide any source and would love any assistance. I have tried many different options and tried many different ways to get this incorporated properly for my site. I am sure once this is completed and working as a feed-viewer in a panel many other ExtJs Desktop users will use it in their site.

Thanks in advance for any assistance.
->Robbie

SachinJadhav
23 Jun 2009, 9:10 PM
Dear Darkassassain,

As Loicdevaux guided me, Please go through the his reply to thread and visit (http://lolo.asia/antisuyu2009/extjsge.php).

There can be only one viewport in a document.

So, naturally you need to remove the viewport from feed-viewer and replace it with panel.

Regards,
SachinJadhav.

SachinJadhav
23 Jun 2009, 9:17 PM
If you read my previous posts carefully you'll see that I am mentioning this error and a workaround.
You were asking if you could put the feedviewer inside a panel and I answered yes. Now you are free to stick this panel wherever you want ... including trashcan >:)

I don't know how desktop works but I would
solve the js problem "this.body is undefined"
follow jgarcia @ tdg-i.com advice and put the feedviewer inside a window
use this window with your desktopI put the demo online but this might not help you much since it's based on a viewport.
It might be interesting for other though.
Here is the link http://lolo.asia/antisuyu2009/extjsge.php

Push the trial and error method a little further and I am sure you will find the solution.
I sent you a private message to offer you assistance on skype so we can find and publish the solution faster and avoid long and boring talks on this board.


@loicdevaux,

Thanks a Billion,

Problem was related to header division and textarea divisions in html page.

Thanks and Regards,
SachinJadhav.

darkassassain
24 Jun 2009, 6:45 AM
Dear Darkassassain,

As Loicdevaux guided me, Please go through the his reply to thread and visit (http://lolo.asia/antisuyu2009/extjsge.php).

There can be only one viewport in a document.

So, naturally you need to remove the viewport from feed-viewer and replace it with panel.

Regards,
SachinJadhav.

SachinJadhav,

I have followed his example off that site and moved it into a panel/window allowing it to be displayed on the desktop environment but I am unable to get it to load via the shortcut links off the page. When I have it load onready it loads but doesn't hit the rss feeds properly and doesn't show the data.

Can you send me your desktop site or code for this via pm or here. I am also available via msn/gtalk/icq.

Thanks.
>Robbie

SachinJadhav
24 Jun 2009, 8:53 PM
Dear Robbie,

Please let me know what error is it throwing, when you try to load it through shortcut.

I suggest you to have following two different POCs.

Desktop-Window pop up with two tabs(having plain HTML contents), when you click on shortcut.
Plain feed-viewer in a browser(this would be almost similar to ready-made example (http://extjs.com/deploy/dev/examples/feed-viewer/view.html)).Once this is done, let me know the problem that you face. We would solve it together.

I can not post my demo online due to policies at my org. Also external mail servers are not accessible.

Regards,
SachinJadhav.

darkassassain
25 Jun 2009, 6:18 AM
Dear Robbie,

Please let me know what error is it throwing, when you try to load it through shortcut.

I suggest you to have following two different POCs.

Desktop-Window pop up with two tabs(having plain HTML contents), when you click on shortcut.
Plain feed-viewer in a browser(this would be almost similar to ready-made example (http://extjs.com/deploy/dev/examples/feed-viewer/view.html)).Once this is done, let me know the problem that you face. We would solve it together.

I can not post my demo online due to policies at my org. Also external mail servers are not accessible.

Regards,
SachinJadhav.


Completely understandable about not being about not being able to post it. I took your advice and made it link through a tab window on the desktop environment. This worked well and it is working through a tab window. I would like to have it outside the tab window and in a standard window if possible.

Here is the demo of it working via tabs.

http://eve.jebspaintball.com/desktop/

Here is the demo again where it works in a standard window initiated by a button.

http://eve.jebspaintball.com/desktop/desktop2/desktop/modules/feedwin/view.html


Thanks for your assistance.

SachinJadhav
25 Jun 2009, 7:11 AM
Dear Robbie,

Kindly note, I personally feel, Following is the most harmful (No doubt this is useful as well but in some other cases) option that we can use,


html : '<iframe src="/desktop/desktop/modules/feed-viewer/view.html" width=100% height=100% ></iframe>',Rather you try to add actual feed_viewer object in demo (http://eve.jebspaintball.com/desktop/). Please avoid using iFrame.

What you can do is replace your FeedViewer.js with the attached one (http://extjs.com/forum/attachment.php?attachmentid=14550&d=1245942429).

Once this is done simply give a call to getFeedViewerPanel() in tab_POC (http://eve.jebspaintball.com/desktop/desktop/modules/feed-viewer/tab_window.js) in the following way.



MyDesktop.forum_tab = Ext.extend(Ext.app.Module, {
id:'tab-win',
init : function(){
this.launcher = {
text: 'Forum Tab',
iconCls:'tabs',
handler : this.createWindow,
scope: this
}
},

createWindow : function(){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('tab-win');
if(!win){
win = desktop.createWindow({
id: 'tab-win',
title:'Forum Tabs',
width:1024,
height:768,
iconCls: 'tabs',
shim:false,
animCollapse:false,
border:false,
constrainHeader:true,

layout: 'fit',
items: getFeedViewerPanel
});
}
win.show();
}
});
Let me know still if you face any problem.

Please find the attachment (http://extjs.com/forum/attachment.php?attachmentid=14550&d=1245942429). And DO NOT forget to rename this to FeedViewer.js.

Regards,
SachinJadhav.

darkassassain
25 Jun 2009, 8:24 AM
SachinJadhav,

I realize that the iframe is insecure but it was the quickest way for me to demonstrate what I was trying to illustrate.

I have posted your changes to the following link:

http://eve.jebspaintball.com/desktop/

With your changes the desktop now renders properly and the shortcut/startmenu links now launch a window but I receive no js errors but the feed-viewer never displays. I linked all the necessary files for the feed-viewer in the index.html page hopefully in the proper order.

I am going to fiddle around with this new copy [the one where the shortcut works] and see if I can find the issue but if you know off the top of your head please do tell. I am sure it is just something minor that I am overlook in eagerness to get this working.

Thanks
>Robbie

SachinJadhav
26 Jun 2009, 1:05 AM
Dear Robbie,

I have changed few of your files and am attaching them, please find two attachments.

I am sure you would get the changes I made, If you find any difficulty just go through the inline comments.

Also, It was nice experience for me to debug your code. ;)

Still, if you get any problem or if you seek any explanation, ask it then and there.

Regards,
SachinJadhav.

darkassassain
28 Jun 2009, 5:50 PM
Close but no Cigar,

The changes you made made it work better in IE but still doesn't work in the sense that it doesn't retrieve the feeds. I have it trying to pull from EXTjs forums, and my forums and neither return any results. When you try to add a feed it ends up saying that it is not a valid rss2 feed. I tried to relink the proxy page but no luck on it. I have ran firebug, httpheaders on the site to see if something is not being found but everything showed up as found so there is not a linking issue it seems.

I have tried many RSS feeds that are valid but they fail to retrieve as well. Any ideas?:-/

darkassassain
7 Jul 2009, 12:33 PM
SachinJadhav,

I really appreciate you assistance. I made a very crucial mistake and took me a couple days of debugging and use of firebug to realize my mistake. I didn't realize that the js calls to the feed-proxy.php were relative to the index.html file so I rerouted the path to the right directory and they work now.

ie by default it is "feed-proxy.php"

I needed to change it to "/desktop/modules/feed-viewer/feed-proxy.php" which resolved the issue.

I cannot believe i didn't see that to begin with but every coder misses the simplest of mistakes till someone points them out or hours of debugging is spent.

Thanks for all of your assistance and I hope one day I return the favor.

-Robbie