WebSphere Portal Server - Struts JSR 168 <portlet:namespace /> problems in styleId attribute

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > October 2006 > Struts JSR 168 <portlet:namespace /> problems in styleId attribute





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Struts JSR 168 <portlet:namespace /> problems in styleId attribute

2006-10-13, 7:51 pm

I can't get a namespace set on a Struts HTML:Text control using the styleId attribute. styleId sets the ID attribute of the resulting INPUT tag. Neither the <portlet:namespace/> nor <%=renderResponse.getNamespace()%> work inside the styleId attribute.
Does anybody have any idea why and how to get around this?

I've tested in on Portal 5.1.0.3 and Portal 6.0 with the same results.

Here's the details:

I use a Struts HTML:Text tag to display an input field like this:
<html:text styleId="<portlet:namespace />email" property="email"/>

However, this renders like this: <input type="text" name="email" value="" id="<portlet:namespace />email">

The namespace tag isn't getting resolved.

So, I changed the Struts tag to use the renderResponse.getNamespace() as shown below:
<html:text styleId="<%= renderResponse.getNamespace()%>email" property="email"/>

Yet this renders like this:
<input type="text" name="email" value="" id="<%= renderResponse.getNamespace()%>email">

If I create a non-struts INPUT tag, both versions of the namespace work fine:
<INPUT type="text" id="<portlet:namespace/>email" name="email"> becomes
<INPUT type="text" id="PC_7_0_58P_email" name="email">
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com