0

Can anybody tell me how to make a sidebar. There is nothing about sidebar in the XUL reference. I referred some old codes. But, I can't get where to edit. In those codes I have to create jar files frequently which annoys a lot. Can anybody show me a guidance, just a simple code to add a listbox in sidebar?

Edit: This code works. I edited the code in "emptysidebar.xul". But it didn't work.

Any solution to add elements in sidebar is welcomed.

prabhakaran
  • 5,126
  • 17
  • 71
  • 107
  • @allen213 I already mentioned that "I referred some old codes". All the links in that google page refers old codes. – prabhakaran Apr 20 '12 at 08:08
  • Can the downvoter give his reasons? – prabhakaran Apr 20 '12 at 08:09
  • I didnt downvote. But my link as loads of places you could look at. Or you could give what you tried – allen213 Apr 20 '12 at 08:13
  • I did downvote. If you got the code in the documentation working then it should be obvious that `emptysidebar.xul` is the file loading into the sidebar - that's the one to change (at least if you bothered to read in addition to copying the code). If you didn't get this code to work you should be asking specific questions, not "plz show me teh codez". – Wladimir Palant Apr 20 '12 at 11:42
  • @Wladimir I forgot to add a line.Read the question again. Besides I already mentioned "show me a guidance". If the code is my sole need then why I have to mention this. My primary goal is "sidebar". Not that specific code. – prabhakaran Apr 20 '12 at 12:08
  • @prabhakaran: what do you think about this link??? – linguini Apr 20 '12 at 12:11
  • @allen213 Why did you remove that thing. Many persons may be interested in that stuff.Please put that link again. I want to know how to do that. – prabhakaran Apr 20 '12 at 12:12
  • @Karthik Thank you for the link. The search for the word "sidebar" gave many locations including the one which gave my requirement. – prabhakaran Apr 20 '12 at 12:42
  • Didnt remove it : I cant delete from here – allen213 Apr 20 '12 at 16:08
  • @allen213 Please post that link again – prabhakaran Apr 24 '12 at 12:19

1 Answers1

1

I didnt even dreamt that the solution will be this much simple. This is the solution.

var sidebarWindow = document.getElementById("sidebar").contentWindow;

if(sidebarWindow)
{
    sidebarWindow.location = "chrome://custombutton/content/login.xul"; 
                                 // your xul location
}
else
{
    alert("sidebar window is not null");
}
prabhakaran
  • 5,126
  • 17
  • 71
  • 107