Author: taylor
Date: Thu Jun  8 08:49:16 2006
New Revision: 412782

URL: http://svn.apache.org/viewvc?rev=412782&view=rev
Log:
hooked in events to a portlet without requiring head declaration
thanks to Steve Milek for solving this one

Modified:
    
portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/AbstractDojoVelocityPortlet.java
    
portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm

Modified: 
portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/AbstractDojoVelocityPortlet.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/AbstractDojoVelocityPortlet.java?rev=412782&r1=412781&r2=412782&view=diff
==============================================================================
--- 
portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/AbstractDojoVelocityPortlet.java
 (original)
+++ 
portals/jetspeed-2/trunk/applications/gems/src/java/org/apache/portals/gems/dojo/AbstractDojoVelocityPortlet.java
 Thu Jun  8 08:49:16 2006
@@ -164,6 +164,21 @@
             headerInfoMap.put("type", "text/javascript");
             headerResource.addHeaderInfo("script", headerInfoMap, 
headerInfoText.toString());
         }
+        
+        if (!isJetspeedDesktop)
+        {
+            headerInfoText.setLength(0);
+            headerInfoText.append("\r\n");
+            headerInfoText.append("html, body\r\n");
+            headerInfoText.append("{\r\n");
+            headerInfoText.append("   width: 100%;\r\n");
+            headerInfoText.append("   height: 100%;\r\n");
+            headerInfoText.append("   margin: 0 0 0 0;\r\n");
+            headerInfoText.append("}\r\n");
+            headerInfoMap = new HashMap(8);
+            headerResource.addHeaderInfo("style", headerInfoMap, 
headerInfoText.toString());
+        }
+        
 
     }
     

Modified: 
portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm?rev=412782&r1=412781&r2=412782&view=diff
==============================================================================
--- 
portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm
 (original)
+++ 
portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm
 Thu Jun  8 08:49:16 2006
@@ -1,11 +1,4 @@
 <style type="text/css">
-               html, body
-{      
-    width: 100%;       /* make the body expand to fill the visible window */
-    height: 100%;
-    margin: 0 0 0 0;
-}
-
                table {
                        font-family:Lucida Grande, Verdana;
                        font-size:0.8em;
@@ -68,15 +61,68 @@
                        padding: 2px;
                }
        </style>
+
 <div dojoType="LayoutContainer"
     layoutChildPriority='top-bottom'
-    style="width: 100%; height: 100%;">
+    style="width: 100%; height: 250px">
     <div dojoType="SplitContainer"
         orientation="horizontal"
         sizerWidth="5"
         activeSizing="0"
         layoutAlign="client"
     >
+ 
+<div id="mainTabContainer" dojoType="TabContainer" style="width: 100%; height: 
100%" selectedTab="portlets">
+
+<div id="portlets" dojoType="ContentPane" label="Portlets">
+<table dojoType="SortableTable" widgetId="portletTable" 
headClass="fixedHeader" tbodyClass="scrollContent" enableMultipleSelect="true" 
enableAlternateRows="true" rowAlternateClass="alternateRow" cellpadding="0" 
cellspacing="0" border="0">
+<thead>
+<tr>
+    <th field="name" dataType="String">Resource</th>
+    <th field="actions" dataType="String">Actions</th>
+</tr>
+</thead>
+<tbody>
+#foreach($permission in $portletPermissions)
+<tr><td>$permission.Name</td><td>$permission.Actions</td></tr>
+#end
+</tbody>
+</table>
+</div>
+<div id="folders" dojoType="ContentPane" label="Folders">
+<table dojoType="SortableTable" widgetId="folderTable" headClass="fixedHeader" 
tbodyClass="scrollContent" enableMultipleSelect="true" 
enableAlternateRows="true" rowAlternateClass="alternateRow" cellpadding="0" 
cellspacing="0" border="0">
+<thead>
+<tr>
+    <th field="name" dataType="String">Resource</th>
+    <th field="actions" dataType="String">Actions</th>
+</tr>
+</thead>
+<tbody>
+#foreach($permission in $folderPermissions)
+<tr><td>$permission.Name</td><td>$permission.Actions</td></tr>
+#end
+</tbody>
+</table>
+</div>
+<div id="pages" dojoType="ContentPane" label="Pages">
+<table dojoType="SortableTable" widgetId="pageTable" headClass="fixedHeader" 
tbodyClass="scrollContent" enableMultipleSelect="true" 
enableAlternateRows="true" rowAlternateClass="alternateRow" cellpadding="0" 
cellspacing="0" border="0">
+<thead>
+<tr>
+    <th field="name" dataType="String">Resource</th>
+    <th field="actions" dataType="String">Actions</th>
+</tr>
+</thead>
+<tbody>
+#foreach($permission in $pagePermissions)
+<tr><td>$permission.Name</td><td>$permission.Actions</td></tr>
+#end
+</tbody>
+</table>
+</div>
+
+</div>
+
+
         <div dojoType="Tree" publishSelectionTopic="treeSelected" toggle="fade"
              sizeMin="20" sizeShare="20">
             <div dojoType="TreeNode" title="Item 1">
@@ -93,26 +139,29 @@
                     <div dojoType="TreeNode" title="Item 1.4.1"></div>
                 </div>
             </div>
-            <div>
-<ul>
-#foreach($permission in $portletPermissions)
-<li>$permission</li>
-#end
-</ul>            
-            </div>
         </div>
-        <div id="mainTabContainer" dojoType="TabContainer" style="width: 100%; 
height: 70%" selectedTab="tab1">
-            <div id="tab1" dojoType="ContentPane" label="Tab 1">
-                <p>I'm the first tab and my content is local.  Try clicking 
tab#2.  It's loading remotely.</p>
-            </div>
-            <div id="tab2" dojoType="ContentPane" label="Tab 2">
-                <h1>2nd Tab</h1>
-                I'm the second tab and my content is local.  Try clicking 
tab#2.  It's loading remotely.
-            </div>        
-        </div>
-      </div>
 
 </div>
 
-
-
+<script type="text/javascript">
+function processTableRowEvent(e, tableName)
+{
+    alert( tableName + ", " + e.currentTarget.cells.item(0).innerHTML ); 
+}
+function addTableRowSelectListener()
+{
+    dojo.event.connect(dojo.widget.byId("portletTable"), "onSelect", 
function(e) {
+        //dojo.debugShallow( e.currentTarget );
+        processTableRowEvent(e, "portletTable");
+    });
+    dojo.event.connect(dojo.widget.byId("folderTable"), "onSelect", 
function(e) {
+        //dojo.debugShallow( e.currentTarget );
+        processTableRowEvent(e, "folderTable");
+    });
+    dojo.event.connect(dojo.widget.byId("pageTable"), "onSelect", function(e) {
+        //dojo.debugShallow( e.currentTarget );
+        processTableRowEvent(e, "pageTable");
+    });
+}
+dojo.addOnLoad( window.addTableRowSelectListener );
+</script>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to