Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.7DR#3
-
Component/s: Framework, ICE-Components
-
Labels:None
-
Environment:portal portlet, JSF 1.2, JBoss Portal
Description
Does JSF 1.2 treat client ID's differently? The reason that I ask is that the file upload component is not working in JBoss Portal (which comes with JSF 1.2) but it is working in Liferay (using JSF 1.1).
When I look at the rendered out HTML of the two and compare, it appears that the client ID supplied by the <ice:portlet> tag is rendered all the way down the tree in Liferay. For example, in Liferay the <ice:portlet> renders out to:
...
<div id="_components_fileUpload_WAR_componentshowcase_INSTANCE_mbUk_">
...
and then later, when the iframe for the file upload is rendered, the hidden input that identifies the fileupload section looks like this:
...
<input type="hidden"
name="ice.component"
value="_components_fileUpload_WAR_componentshowcase_INSTANCE_mbUk_:ifSub:iceform:icepnltabset:0:inputFileName"/>
...
Now if we look at exactly the same thing running under JBoss Portal, we get this from the <ice:portlet> tag:
...
<div id="jbpns_2fdefault_2fShowcase_2fFile_20Uploadsnpbj">
...
And this is the hidden input:
<input type="hidden"
name="ice.component"
value="j_id2:ifSub:iceform:icepnltabset:0:inputFileName"/>
So you see that the portlet component's id is not pre-pended. It's generated some default one. The whole thing is failing in our UploadServer where it calls the D2DViewHandler logic in findComponent the result is always "null" and I assume it's because of this ID discrepancy. Anyone able to educate me on why this is?
When I look at the rendered out HTML of the two and compare, it appears that the client ID supplied by the <ice:portlet> tag is rendered all the way down the tree in Liferay. For example, in Liferay the <ice:portlet> renders out to:
...
<div id="_components_fileUpload_WAR_componentshowcase_INSTANCE_mbUk_">
...
and then later, when the iframe for the file upload is rendered, the hidden input that identifies the fileupload section looks like this:
...
<input type="hidden"
name="ice.component"
value="_components_fileUpload_WAR_componentshowcase_INSTANCE_mbUk_:ifSub:iceform:icepnltabset:0:inputFileName"/>
...
Now if we look at exactly the same thing running under JBoss Portal, we get this from the <ice:portlet> tag:
...
<div id="jbpns_2fdefault_2fShowcase_2fFile_20Uploadsnpbj">
...
And this is the hidden input:
<input type="hidden"
name="ice.component"
value="j_id2:ifSub:iceform:icepnltabset:0:inputFileName"/>
So you see that the portlet component's id is not pre-pended. It's generated some default one. The whole thing is failing in our UploadServer where it calls the D2DViewHandler logic in findComponent the result is always "null" and I assume it's because of this ID discrepancy. Anyone able to educate me on why this is?
Okay, following up on this, I have some more data. It appears to be an issue with the PanelBorder component interacting with JSF 1.2. Currently, we use a panel border as the layout for the individual portlets. The children of the panel border are all losing the portlet id when running under JBoss:
<div id="jbpns_2fdefault_2fShowcase_2fFile_20Uploadsnpbj">
<table cellspacing="0"
cellpadding="0"
border="0"
name="jbpns_2fdefault_2fShowcase_2fFile_20Uploadsnpbj:j_id3"
id="jbpns_2fdefault_2fShowcase_2fFile_20Uploadsnpbj:j_id3"
class="icePnlBrdr mainBorderLayout">
<tbody>
<tr>
<td colspan="1"
class="icePnlBrdrCenter Center mainBorderLayoutCenter">
<div id="j_id2:j_id4"
class="icePnlGrp">
...
But when running under Liferay, the kids are fine:
<div id="components_fileUpload_WAR_componentshowcase_INSTANCE_mbUk">
<table cellspacing="0"
cellpadding="0"
border="0"
name="components_fileUpload_WAR_componentshowcase_INSTANCE_mbUk:_id2"
id="components_fileUpload_WAR_componentshowcase_INSTANCE_mbUk:_id2"
class="icePnlBrdr mainBorderLayout">
<tbody>
<tr>
<td colspan="1"
class="icePnlBrdrCenter Center mainBorderLayoutCenter">
<div id="components_fileUpload_WAR_componentshowcase_INSTANCE_mbUk:_id3"
class="icePnlGrp">
...
Just to verify, I removed the panel border from the portlet view and ran the FileUpload under JBoss Portal again. Not only did the portlet id cascade properly down to the child components, but the FileUpload worked as well.