Author: wesleyhales
Date: 2008-04-01 16:02:48 -0400 (Tue, 01 Apr 2008)
New Revision: 10460
Modified:
branches/JBoss_Portal_2_6_4_JBPB/core-admin/src/resources/portal-admin-war/jsf/common/editPageLayout.xhtml
branches/JBoss_Portal_2_6_4_JBPB/core-admin/src/resources/portal-admin-war/jsf/editWindow.xhtml
branches/JBoss_Portal_2_6_4_JBPB/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp
Log:
admin migration to portlet bridge - enhance component to allow nested forms and normal
portlet operation
Modified:
branches/JBoss_Portal_2_6_4_JBPB/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp
===================================================================
---
branches/JBoss_Portal_2_6_4_JBPB/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp 2008-04-01
17:53:30 UTC (rev 10459)
+++
branches/JBoss_Portal_2_6_4_JBPB/core/src/resources/portal-core-war/WEB-INF/jsp/content/portlet_editor.jsp 2008-04-01
20:02:48 UTC (rev 10460)
@@ -29,13 +29,34 @@
var domTT_maxWidth = false;
//]]>
- function submitForm(elem,actionUrl){
- while (elem.parentNode && elem.parentNode.tagName.toLowerCase() !=
"form"){
- elem = elem.parentNode;
+ //This function checks for a previousSibling in the DOM and it must be a form
+ //generated by JSF. otherwise the actionURL will be treated as a regular link
+ //for non-JSF environment
+ //
+ //For JSF use:
+ //<h:form></h:form>
+ //<jbp:portlet
+ //...
+ function submitForm(actionUrl){
+ var jsfForm;
+ try{
+ //ie is normal
+
if(document.getElementById('bilto').previousSibling.nodeName.toLowerCase() ==
'form'){
+ jsfForm = document.getElementById('bilto').previousSibling;
+ }else{
+ //firefox adds that extra text node
+ jsfForm =
document.getElementById('bilto').previousSibling.previousSibling;
+ }
+ }catch(e){
+
}
- var oForm = elem.parentNode;
- oForm.action = actionUrl;
- oForm.submit();
+
+ if (jsfForm.nodeName.toLowerCase() == 'form'){
+ jsfForm.action = actionUrl;
+ jsfForm.submit();
+ }else{
+ window.location = actionUrl;
+ }
}
</script>
@@ -99,6 +120,7 @@
<td>
<div style="height:300px; width:500px; overflow: auto; overflow-x: hidden;
border: 1px solid #333;">
+
<table style="width:100%;" cellspacing="0"
cellpadding="0">
<%
for (IteratorStatus i = new IteratorStatus(instances); i.hasNext();)
@@ -144,7 +166,7 @@
<tr class="<%= rowClass %>" >
<td >
<img src="<%= iconLocation %>" align="middle"
style="margin:0 4px 0 0"/>
- <span onmouseover="domTT_activate(this, event, 'content',
document.getElementById('info-container-<%= displayName
%>'),'delay', 0, 'trail', false, 'fade', 'both',
'fadeMax', 95, 'styleClass', 'none');"><a
href="javascript:void(0);" onclick="submitForm(this,'<%= test
%>');return false" id="portlet-instance-link"><%= displayName
%></a></span>
+ <span onmouseover="domTT_activate(this, event, 'content',
document.getElementById('info-container-<%= displayName
%>'),'delay', 0, 'trail', false, 'fade', 'both',
'fadeMax', 95, 'styleClass', 'none');"><a
href="javascript:void(0);" onclick="submitForm('<%= test
%>');return false" id="portlet-instance-link"><%= displayName
%></a></span>
</td>
</tr>
<%
Modified:
branches/JBoss_Portal_2_6_4_JBPB/core-admin/src/resources/portal-admin-war/jsf/common/editPageLayout.xhtml
===================================================================
---
branches/JBoss_Portal_2_6_4_JBPB/core-admin/src/resources/portal-admin-war/jsf/common/editPageLayout.xhtml 2008-04-01
17:53:30 UTC (rev 10459)
+++
branches/JBoss_Portal_2_6_4_JBPB/core-admin/src/resources/portal-admin-war/jsf/common/editPageLayout.xhtml 2008-04-01
20:02:48 UTC (rev 10460)
@@ -63,7 +63,7 @@
</tr>
<tr>
<td colspan="2" valign="top">
- <h:form>
+ <h:form></h:form>
<jbp:portlet
portletId="#{pageManager.selectedEditorPortletId}"
portletInvoker="#{pageManager.portletInvoker}"
@@ -74,7 +74,6 @@
initialWindowState="normal"
renderParameters="#{pageManager.selectedRenderParameters}"
onClick="url.setParameter('windowName',
document.getElementById('windowForm:windowName').value);"/>
- </h:form>
</td>
</tr>
</table>
Modified:
branches/JBoss_Portal_2_6_4_JBPB/core-admin/src/resources/portal-admin-war/jsf/editWindow.xhtml
===================================================================
---
branches/JBoss_Portal_2_6_4_JBPB/core-admin/src/resources/portal-admin-war/jsf/editWindow.xhtml 2008-04-01
17:53:30 UTC (rev 10459)
+++
branches/JBoss_Portal_2_6_4_JBPB/core-admin/src/resources/portal-admin-war/jsf/editWindow.xhtml 2008-04-01
20:02:48 UTC (rev 10460)
@@ -10,8 +10,8 @@
<ui:define name="content">
<!-- -->
- <h:form>
<div class="clear">
+ <h:form></h:form>
<jbp:portlet
actionListener="#{portalobjectmgr.processEvent}"
portletId="#{portalobjectmgr.selectedContentEditorInstance}"
@@ -22,7 +22,7 @@
initialMode="edit_content"
initialWindowState="normal"/>
</div>
- </h:form>
+
</ui:define>
</ui:composition>
Show replies by date