Results 1 to 7 of 7

Thread: Has to be something simple

  1. #1
    Join Date
    Oct 2008
    Posts
    11
    Rep Power
    6

    Default Has to be something simple

    Trying to make a zimlet that searches email text for job number and will search db and return possible matches in new window/tab. So far I have the search for job numbers part OK (at least good enough to test with). As soon as I add any 'onCllick' info the search for job numbers stops working and I've yet to get it to open a new window and return results. Have even gone so far as just trying to have it open my company's webpage but no dice. Has to be something simple.

    This is my first zimlet. Newb to js and all that too. First text is trying to search and return possible matches for job number. Second is just trying to open my company's webpage. Both are XML and have no other accompanying files

    Thx..Matt

    Code:
    <zimlet name="com_kucera_jobnum" version="1.0" description="Kucera Job Number Zimlet">
    	<summary>
    		This Zimlet will search for job numbers (30000-79999) within emails and, upon user click,  
    		search job database to provide likely matches in a new window (hopefully a new tab, not window).
    	</summary>
    	<contentObject>
    		<matchOn>
    			<regex attrs="ig"> [3-7][0-9][0-9][0-9][0-9] </regex>
    		</matchOn>
    		<toolTip sticky="false">Search Job #</toolTip>
    		<onClick>
    			<actionUrl method="get" target="http://ma09/writeupdb/listings.php?search_list=y&linked_items=include&title_match=partial&title=">
    				<param name="">${src.objectContent}</param>
    			</actionUrl>
    		</onClick>
    	</contentObject>
    </zimlet>
    Code:
    <zimlet name="com_kucera_jobnum" version="1.0" description="Kucera Job Number Zimlet">
    	<summary>
    		This Zimlet will search for job numbers (30000-79999) within emails and, upon user click,  
    		search job database to provide likely matches in a new window (hopefully a new tab, not window).
    	</summary>
    	<contentObject>
    		<matchOn>
    			<regex attrs="ig"> [3-7][0-9][0-9][0-9][0-9] </regex>
    		</matchOn>
    		<toolTip sticky="false">Search Job #</toolTip>
    		<onClick>
    			<actionUrl method="get" target="http://www.kucerainternational.com">
    			</actionUrl>
    		</onClick>
    	</contentObject>
    </zimlet>
    Geography is where it's at!

  2. #2
    agnes is offline Active Member
    Join Date
    Mar 2008
    Posts
    40
    Rep Power
    7

    Default

    Just add a canvas element.

  3. #3
    Join Date
    Oct 2008
    Posts
    11
    Rep Power
    6

    Default

    Just added a canvas element, no joy. Same problem. Without any 'OnClick' and code between those tags, the job numbers are highlighted. With the 'OnClick' and code between, the job numbers don't even get highlighted.

    Matt
    Geography is where it's at!

  4. #4
    agnes is offline Active Member
    Join Date
    Mar 2008
    Posts
    40
    Rep Power
    7

    Default

    I guess the problem is with the actionUrl element and the way you send the parameters. See a zimlets whitepaper for details on actionUrl element.

    Regards

  5. #5
    Join Date
    Oct 2008
    Posts
    11
    Rep Power
    6

    Default

    Thanks Agnes. Wish there was more documentation. I've poured through all 40 pages of the whitepaper and gotten the code directly from there. Just don't understand why it's not working. This should be an ultra-simple thing.

    Any supporting files needed? (js, template, etc.)

    Matt
    Geography is where it's at!

  6. #6
    Join Date
    Oct 2008
    Posts
    11
    Rep Power
    6

    Default

    SUCCESS! I'm pretty stoked even though it's rather simple and uses no js. Laugh if you will. Code below.

    However, when the new window pops up, it is an actual new window and not a new tab in the browser (FireFox). The new window shows the search results but does not have a scroll bar. If following one of the search results (clickable link) it opens that job writeup in same window and the user is unable to scroll to see the complete writeup. If instead I right click on one of the search result links and select 'open link in new tab' it opens new tab in that window with a scroll bar.

    - Can it be forced to open new tab in existing browser instead of new window?
    - If answer to above is negative, can I force the new window to have scrollbars?
    - I don't know how to use js for zimlets...although willing to learn. Really need a super simple sample of how the definition and js files work together so as to see what role each plays if js file is used.

    SEARCH RESULTS NEW WINDOW- NO SCROLLBAR


    CLICK LINK - NO SCROLLBAR


    OPEN LINK IN NEW TAB - HAS SCROLLBAR


    Code:
    <zimlet name="com_kucera_jobnum" version="1.0" description="Kucera Job Number Zimlet">
    	<summary>
    		This Zimlet will search for job numbers within emails and, upon user click, will 
    		search job database to provide likely matches in a new window.
    		M.Albring, 11/2008
    	</summary>
    	<contentObject>
    		<matchOn>
    			<regex attrs="ig">\d\d\d\d\d</regex>
    		</matchOn>
    		<toolTip sticky="false">
    			Search Writeup Database for Job ${src.objectContent}
    		</toolTip>
    		<onClick>
    			<canvas type="window" />
    			<actionUrl method="get" target="http://ma09/writeupdb/listings.php" 
    				paramStart="?">
    			<param name="title_match">partial</param>
    			<param name="title">${src.objectContent}</param>
    			</actionUrl>
    		</onClick>
    	</contentObject>
    </zimlet>
    Geography is where it's at!

  7. #7
    tdesorbaix is offline Zimlet Guru & Moderator
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    - Can it be forced to open new tab in existing browser instead of new window?
    I don't think it is possible. Anyway, the choice should be left to the user.

    - If answer to above is negative, can I force the new window to have scrollbars?
    Not if you only use the xml file, but you can if you use a js file.

    - I don't know how to use js for zimlets...although willing to learn. Really need a super simple sample of how the definition and js files work together so as to see what role each plays if js file is used.
    To use a js file, you put in the xml :
    Code:
    	<include>thefile.js</include>
    	<handlerObject>Zimlet_Object_Name</handlerObject>
    In the js file,most of the time you write those lines to define the zimlet object :
    Code:
    function Zimlet_Object_Name() {
    }
    Zimlet_Object_Name.prototype = new ZmZimletBase();
    Zimlet_Object_Name.prototype.constructor = Zimlet_Object_Name;
    As you can see, you are using the object ZmZimletBase, so you can rewrite in your js file some of the ZmZimletBase methods to change the zimlet
    behavior.
    I recommend you to look at the file ZmZimletBase.js to see all the available methods.
    Some of the methods : init, dodrop, singleclicked, doubleclicked, menuItemSelected.
    Here is a link to a simple zimlet with a js file managing the event of the click on a right-click menu item :
    Help needed. Simple Zimlet

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 06-21-2008, 11:41 PM
  2. Simple problem? Domain documents...
    By pcsupport in forum Administrators
    Replies: 2
    Last Post: 04-20-2008, 05:41 AM
  3. Replies: 1
    Last Post: 01-03-2008, 11:58 AM
  4. Simple lookup zimlet, help needed
    By Dirk in forum Zimlets
    Replies: 15
    Last Post: 09-20-2007, 08:32 AM
  5. Replies: 1
    Last Post: 08-11-2006, 09:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •