struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart James <ravenh...@btinternet.com>
Subject Re: I would like help with the template theme changes in 2.3.16.1
Date Wed, 09 Apr 2014 14:53:23 GMT
Hi Lukasz,
I have raised an issue
https://issues.apache.org/jira/browse/WW-4319
and included an demo app.
Please let me know if there are any problems with the demo.

Thanks
Steve
----- Original Message -----
From: Lukasz Lenart <lukaszlenart@apache.org>
To: Struts Users Mailing List <user@struts.apache.org>; Stuart James <ravenholm@btinternet.com>
Cc: 
Sent: Wednesday, 9 April 2014, 13:11
Subject: Re: I would like help with the template theme changes in 2.3.16.1

And register an issue?

2014-04-09 14:10 GMT+02:00 Lukasz Lenart <lukaszlenart@apache.org>:
> Can you prepare a small Maven based demo app?
>
> 2014-04-09 14:00 GMT+02:00 Stuart James <ravenholm@btinternet.com>:
>> Hi,
>> I am developing an application which has been predominantly written with Struts2
version 2.3.15.3 and the struts2-jquery-plugin version 3.6.1.
>> I have recently upgraded to Struts2 version 2.3.16.1 and struts2-jquery-plugin version
3.7.0.
>> The application has used the css_xhtml theme throughout, defined in struts.xml.
>> Since the upgrade, the HTML markup of the struts2-jquery-plugin (sj:) components
has been adversly affected.
>> I have debugged the application and found that the issue is caused by the changes
made to themes under WW-4145.
>> The situation appears to be this:
>> The struts2-jquery-plugin has implemented custom tags for their components and these
classes will return the value of 'jquery' in response to the getTheme() method. They do appear
to correctly store a 'parentTheme' parameter with the correct value (in my case from the parent
form element) of 'css_xhtml'.
>> The struts2-jquery-plugin custom templates are successfully found on the templates/jquery
path, but some of them contain 'include' statements, for example, the datepicker.ftl contains
the following snippet:
>>
>>  <#if parameters.parentTheme == 'css_xhtml'>
>>  <#include "/${parameters.templateDir}/css_xhtml/controlheader.ftl" />
>>  </#if>
>>
>> So, at this point, all is well, the correct controlheader.ftl template for the css_xhtml
theme is found and included, however this template (now) contains the following include:
>>
>> <#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader-core.ftl">
>>
>> And this is where it starts to go wrong. The ${parameters.expandTheme} resolves to
'~~~jquery' and, after reading the WW-4145 change info, I understand that this will cause
the ThemeManager to load the template from the parent theme as defined in the theme.properties
file. This, in the case of the struts2-jquery-plugin, is defiend as 'xhtml' and NOT 'css_xhtml'
as discovered from the parent form component. Consequently, the wrong controlheader-core.ftl
template is included, and the resulting HTML includes incorrect <tr> and <td>
tags which ultimately break the page.
>>
>> Other than hacking the templates, I cannot see a satisfactory way of resolving this
problem, so any assistance would be gratefully received.
>>
>> Thanks
>> Steve
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message