Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra - Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-12-2007, 01:13 PM
Project Contributor
 
Posts: 65
Default Admin Extension fail view

I'm writing an Admin Extension for a Domain view.

I saw Admin Extension from wiki: Extending Admin UI - Zimbra :: Wiki

I did deploy my new Extension successfully, but when i want to see my new "Devel" tab, is clear.

I should see the DomainName and a TextArea.

Can you help me with my Admin Extension?

Thanks
Attached Images
File Type: jpg devel_tab.jpg (20.2 KB, 65 views)
Attached Files
File Type: zip devel.zip (980 Bytes, 9 views)
__________________
Daniel Eugenin
http://www.it-linux.cl
Reply With Quote
  #2 (permalink)  
Old 11-20-2007, 02:34 PM
Zimbra Employee
 
Posts: 123
Default

It looks like the problem is in the tab definition. You have

var myTab = [
{type:_SWITCH_, items:[
{type:_CASE_, relevant: ("instance[ZaModel.currentTab] == " + myTabIndex),
items:[
{ ref: ZaDomain.A_domainName, type:_OUTPUT_,
label:ZaMsg.Domain_DomainName
},
{ ref: ZaDomain.A_notes, type:_TEXTAREA_,
label:"Texto Devel", labelCssStyle:"vertical-align:top", width:250
}
]
}
]
}
];

but you should have:

var myTab = {type:_CASE_, relevant: ("instance[ZaModel.currentTab] == " + myTabIndex),
items:[
{ ref: ZaDomain.A_domainName, type:_OUTPUT_,
label:ZaMsg.Domain_DomainName
},
{ ref: ZaDomain.A_notes, type:_TEXTAREA_,
label:"Texto Devel", labelCssStyle:"vertical-align:top", width:250
}
]
};


because items array and SWITCH element are already defined in the original form in ZaDomainXFormView, and your extension only needs to add one more tab.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
P.S.: don't forget to vote on this bug
add Samba LDAP entries to Exchange Migration Tool
Reply With Quote
  #3 (permalink)  
Old 11-20-2007, 05:54 PM
Project Contributor
 
Posts: 65
Default

Thanks for your reply Greg, but I still with the problem... :-(

Mi new Tab its appears on Domain view, but OUTPUT and TEXTAREA it's not appears (the tab is clear)...


Mi devel.js is:

-------------------------------------------------------------------------------------------
function DevelExtension() {}

DevelExtension.DomainXFormModifier = function (xFormObject) {

//find _TAB_BAR_ element
var cnt = xFormObject.items.length;
for(i = 0; i < cnt; i++) {
if(xFormObject.items[i].type=="tab_bar") break;
}
//get a tab index
var myTabIndex = ++ZaDomainXFormView.TAB_INDEX;

//add a tab
xFormObject.items[i].choices.push({value:myTabIndex, label:"Devel Tab"});

//define a form for my new tab.
var myTab = {type:_CASE_, relevant"instance[ZaModel.currentTab] == " + myTabIndex),
items:[
{ ref:ZaDomain.A_domainName, type:_OUTPUT_,
label:ZaMsg.Domain_DomainName
},
{ ref:ZaDomain.A_notes, type:_TEXTAREA_,
label:"Texto Devel", labelCssStyle:"vertical-align:top", width:250
}
]
};

//find SWITCH element
for(i = 0; i < cnt; i++) {
if(xFormObject.items[i].type=="switch") break;
}

//add my tab to the form
xFormObject.items[i].items.push(myTab);
}

ZaTabView.XFormModifiers["ZaDomainXFormView"].push(DevelExtension.DomainXFormModifier);

-------------------------------------------------------------------------------------------
__________________
Daniel Eugenin
http://www.it-linux.cl
Reply With Quote
  #4 (permalink)  
Old 11-21-2007, 04:04 PM
Zimbra Employee
 
Posts: 123
Default

I updated the guide to creating admin extensions on the wiki Extending Admin UI - Zimbra :: Wiki

and added a general guide to the admin framework:

Admin UI Framework Guide - Zimbra :: Wiki
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
P.S.: don't forget to vote on this bug
add Samba LDAP entries to Exchange Migration Tool
Reply With Quote
  #5 (permalink)  
Old 11-21-2007, 04:37 PM
Zimbra Employee
 
Posts: 123
Default

Quote:
Originally Posted by deugenin View Post
Thanks for your reply Greg, but I still with the problem... :-(

Mi new Tab its appears on Domain view, but OUTPUT and TEXTAREA it's not appears (the tab is clear)...

Ok, I figured it out. The problem is that in 4.5.7 ZaDomainXFormView.TAB_INDEX global variable is not defined, I added it only in 5.0 branch. Instead, we used hard-coded tab indexes. So, in order to make it work you need to change this line

var myTabIndex = ++ZaDomainXFormView.TAB_INDEX;

to this

var myTabIndex = 6;
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
P.S.: don't forget to vote on this bug
add Samba LDAP entries to Exchange Migration Tool
Reply With Quote
  #6 (permalink)  
Old 11-22-2007, 03:01 PM
Project Contributor
 
Posts: 65
Default

Thanks you very much Greg!, that solved my problem!
__________________
Daniel Eugenin
http://www.it-linux.cl
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0