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

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 Search this Thread Display Modes
  #1 (permalink)  
Old 07-19-2007, 05:33 AM
Zimlet Guru & Moderator
 
Posts: 467
Default Strange Zimlet behavior

I've been hitting some really strange zimlet behavior with 5.0b1.
Code:
<zimlet name="org_technicaldetails_weather"  version="1.8" description="Weather Test Sample">
	   <zimletPanelItem label="Weather">
	      <toolTipText>Pull up the weather forecast for your location</toolTipText>
	      <contextMenu>
	         <menuItem label="Lookup the weather for your location" id="WEATHER">
	            <canvas type="dialog" title="Weather" width="800"  height="600" />
	            <actionUrl 
	            	target="http://www.wunderground.com/cgi-bin/findweather/getForecast">
	            	<param name="query">${prop.zipcode}</param>
	            </actionUrl>
	         </menuItem>
	      </contextMenu>
	   </zimletPanelItem>
   <userProperties>
	  <property type="string" name="zipcode" minLength="6" maxLength="10" label="Zip Code"/>
   </userProperties>

	</zimlet>
The problematic code is:
Code:
	            <actionUrl 
	           target="http://www.wunderground.com/cgi-bin/findweather/getForecast">
	            	<param name="query">${prop.zipcode}</param>
	            </actionUrl>
For whatever reason {prop.zipcode}, even when it exists, returns null. (I get my URI plus ?query=).

Also, the standard zimlet handler automatically pops up the property editor when I double click, but the okay button does not work. Thankfully the cancel button does, but it also saves the properrties(!!?)

Code:
<zimlet name="org_technicaldetails_weather"  version="1.8" description="Weather Test Sample">
	   <zimletPanelItem label="Weather">
	      <toolTipText>Pull up the weather forecast for your location</toolTipText>
	      <contextMenu>
	         <menuItem label="Lookup the weather for your location" id="WEATHER">
	            <canvas type="dialog" title="Weather" width="800"  height="600" />
	            <actionUrl 
	            	target="http://www.wunderground.com/cgi-bin/findweather/getForecast/${prop.zipcode}">
	            </actionUrl>
	         </menuItem>
	      </contextMenu>
	   </zimletPanelItem>
   <userProperties>
	  <property type="string" name="zipcode" minLength="6" maxLength="10" label="Zip Code"/>
   </userProperties>

	</zimlet>
For some reason
Code:
target="http://www.wunderground.com/cgi-bin/findweather/getForecast/${prop.zipcode}">
	            </actionUrl>
${prop.zipcode} is never substituted at all. This is a bad thing is a REST view of the world.

Any ideas?
Reply With Quote
  #2 (permalink)  
Old 07-23-2007, 09:26 AM
Zimbra Employee
 
Posts: 4,792
Default

I think these are just bugs. One thing you could try is to use Firebug or Venkman to step through the Zimlet code just before your URLs are called and make sure that prop is even defined. I know in some cases we use obj. rather than prop.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.