Update of /cvsroot/tacos/tacos4/src/java/net/sf/tacos/ajax/components
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13867/src/java/net/sf/tacos/ajax/components

Modified Files:
        AjaxDirectLink.java 
Log Message:
Corrected support for preEffects

Index: AjaxDirectLink.java
===================================================================
RCS file: 
/cvsroot/tacos/tacos4/src/java/net/sf/tacos/ajax/components/AjaxDirectLink.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** AjaxDirectLink.java 2 Dec 2005 01:24:57 -0000       1.25
--- AjaxDirectLink.java 23 Dec 2005 18:43:40 -0000      1.26
***************
*** 10,13 ****
--- 10,14 ----
  import net.sf.tacos.ajax.AjaxDirectService;
  import net.sf.tacos.ajax.AjaxDirectServiceParameter;
+ import net.sf.tacos.util.EffectStringUtils;
  import net.sf.tacos.util.StringUtils;
  
***************
*** 28,32 ****
   * @author jkuhnert
   */
! public abstract class AjaxDirectLink extends DirectLink {
      
      /** Logger */
--- 29,34 ----
   * @author jkuhnert
   */
! public abstract class AjaxDirectLink extends DirectLink 
!     implements PreEffectable {
      
      /** Logger */
***************
*** 51,56 ****
      /** The html id - don't know why we've declared this as a parameter */
      public abstract String getIdParameter();
!     /** Pre-effects parameter */
!     public abstract String getPreEffects();
      /** Set popup parameter if you want it popup */
      public abstract String getPopup();
--- 53,57 ----
      /** The html id - don't know why we've declared this as a parameter */
      public abstract String getIdParameter();
! 
      /** Set popup parameter if you want it popup */
      public abstract String getPopup();
***************
*** 92,96 ****
              
              writer.attribute("onclick", "javascript:" 
!                     + getPreEffectsScript()
                      + getLinkString(cycle) 
                      + "; return false;");
--- 93,97 ----
              
              writer.attribute("onclick", "javascript:" 
!                     + 
EffectStringUtils.createPreEffectsScript(getPreEffects())
                      + getLinkString(cycle) 
                      + "; return false;");
***************
*** 108,124 ****
      {
          return "tacos.defaultLinkAction(" + getLinkArguments(cycle) + ")";
!     }
!     
!     /**
!      * Creates the javascript for the effects that should execute immediately
!      * @return
!      */
!     public String getPreEffectsScript()
!     {
!         if (getPreEffects() == null || getPreEffects().length() == 0)
!             return "";
!         return "tacos.processEffects(" + getPreEffects() + ");";
!     }
!     
      /**
       * Returns a javascript string representation of the kwArgs object
--- 109,114 ----
      {
          return "tacos.defaultLinkAction(" + getLinkArguments(cycle) + ")";
!     }    
! 
      /**
       * Returns a javascript string representation of the kwArgs object
***************
*** 136,139 ****
--- 126,131 ----
              str.append("updateObject: 
").append(getUpdateObject()).append(",");
          str.append("url: '").append(link.getAbsoluteURL()).append("', ");
+         // TODO: getAbsoluteURL() is unsupported in portlets, perhaps use the 
next
+         //str.append("url: '").append(link.getURL()).append("', ");
          str.append("processScripts: ").append(true);
          if (getEffects() != null) {



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Tacos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to