2011-08-03 4 views
0

IcePush Renderアップデートでカスタムコードを実行したい。 IcePush自体は、(複数のポートレットにも)うまく機能していますPortletにIcePush Listenerを登録する方法は?

私は正確に画像を所定のアスペクト比にリサイズし、マーカピン(Googleマップから知られています)を配置します。しかし、これらのマーカー(および画像)は、IcePushを介して動的に更新されます。

私はJQueryのready()を使用すると、初めて動作しますが、ページの更新後に失敗します。

挨拶フロリアン

答えて

0

私はそれを解決しました! JSコードを変更すると、AJAX Update後に実行されます。 このように:

<script type="text/javascript"> 
     function resizeStage() { 
      var prefWidth=maxWidth*(1+(0.1*zoomFactor)); 
      jQuery(".slide_" + slideUUID).width(prefWidth); 
      var actualWidth=jQuery(".slide_" + slideUUID).width(); 
      jQuery(".slide_" + slideUUID).height(actualWidth * 3/4); // Fix to 4x3 
     } 
     // This will be executed after AJAX Update 
     // Because the var slideUUID changes after each AJAX Update 
     var slideUUID = "#{navigationBackingBean.currentSlide.uuid}"; // To identify slide and to execute JS after AJAX udpate! 

     resizeStage(); 
     jQuery(window).unbind('resize', resizeStage) 
     jQuery(window).resize(resizeStage); 
    </script> 
関連する問題