473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to render a template page by calling its method from TAL portlet(@@manage-portlet

I want to know that how to call a method which is in file system (createPictMenu.py in my case) from TAL Portlet(from zmi) which is in @@manage-portlets(in the Add Portlet drop down list).
I did like this

1.Created one new class for the address(tal portlet) in my createPictMenu.py
2.I then registered the portlet in configure.zcml.

Here is my code bit:

Expand|Select|Wrap|Line Numbers
  1.  
  2.       class address_tal(BrowserView)
  3.  
  4.          def myaddress()
  5.              address_bar = ViewTemplatePageFile('templates/address_left.pt')--> (this 
  6.              is  the template page which i want in my newly created address portlet manage-     
  7.              portlets)
  8.  
And my configure.zcml looks like this :
Expand|Select|Wrap|Line Numbers
  1.          <plone:portlet
  2.          name="collective.portlet.tal.TALPortlet"
  3.          interface="collective.portlet.tal.talportlet.ITALPortlet"
  4.          assignment="collective.portlet.tal.talportlet.Assignment"
  5.          view_permission="zope2.View"
  6.          edit_permission="cmf.ManagePortal"
  7.          renderer=".browser.createPictMenu.address_tal"
  8.          addview="collective.portlet.tal.talportlet.AddForm"
  9.          editview="collective.portlet.tal.talportlet.EditForm"
  10.          />
  11.  

And in Zmi:

In zmi i did the following things localhost:8080/myproject/@@manage-portlets --> AddPortlet(dropdown list)--> selected TAL Portlet option-> Then i gave title as address and for description i given the code to call the address_tal from createPictMenu.py.

address_tal:

Expand|Select|Wrap|Line Numbers
  1.         <span tal:define="global li python:view.myaddress()">
  2.                <span tal:replace="structure python:li" /> 
  3.         </span> 
  4.  
i dont know how to call a method of a file which is in file system from zmi @@manage-portlets->TAL portlet. Please help
Aug 28 '13 #1
0 1161

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Alex Vinokur | last post by:
========================================= Windows 2000 CYGWIN_NT-5.0 1.3.22(0.78/3/2) GNU gcc version 3.2 20020927 (prerelease) ========================================= Here is some program...
8
by: Rakehs | last post by:
Hi, I have a method Show() which is invoked by several methods at different intervals. I want to identify the calling method within Show() whenever it is invoked. How do i do this? Thanks in...
2
by: terry | last post by:
Hi, I am using a FrameSet with three frames. In server code (c# code behind) is it possible for a page to call a function in another page of the frameset? I suspect that it is not possible but...
0
by: Sobhan Vezzu | last post by:
Hi All, We have recently migrated our intranet website from Windows 2000,IIS5.0 to Windows 2003, IIS 6.0. It is developed in ASP.NET We have give a new IP address for this website and we are...
7
by: mrwoopey | last post by:
I have a asp.net application that uses the crystal report viewer control. It displays all of my reports but all of a sudden it started giving me the following error on ONLY two reports: "Fail...
1
by: Rippo | last post by:
Hi I have a Master page that opens up a db connection, performs a couple of global routines in the page_load event. All of my other web pages in my web app then inherits this Master Page I...
1
by: Jake Barnes | last post by:
I can not figure out the meaning of this error: Error: " nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame :: http://www.bluecasts.com/pdsIncludes/pdsAjax.js ::...
1
by: ahmh | last post by:
The javascript function is called getsportart2 in the codebehind page_load I have the following Page.RegisterStartupScript("MyScript3","<script type='text/javascript'...
1
by: jsibrahimeye | last post by:
when i call the crystal report (using chart) from flexbuilder (in windows vista) i am getting error message on the page. CrystalReportViewer - CrystalReportViewer1 Error: Fail to render...
1
by: john20 | last post by:
Hi All, I am having a problem with accesing function in the page. i have a page say user.aspx in the page load method i am calling function to validate the user. it works fine when single...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.