struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Muhammad Salman (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (WW-4987) Setting Struts2 <s:select> options Css Class
Date Wed, 28 Nov 2018 15:51:01 GMT

    [ https://issues.apache.org/jira/browse/WW-4987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16702044#comment-16702044
] 

Muhammad Salman edited comment on WW-4987 at 11/28/18 3:50 PM:
---------------------------------------------------------------

[~aleksandr-m]
I tried your proposed solution but It didn't worked for me or perhaps I misunderstood your
point.
Basically we were previously on struts 2.2.3 version, and on that version *cssClass* attribute
of *<s:select>* populates the class for *<option>* in *<optgroup>* and on
that particular class we have some business logic implemented. Now after migration our that
functionality stops working because of the class not being applied by *<s:select>* to
*<option>* tag within *<optgroup>*. I believe the struts version onwards from
2.2.3 must be supporting this feature of *<s:select>* perhaps in some other way. Can
you guide me how can get through it or propose a rough snippet which I try on my end. Other
features of latest struts 2.5.17 are really awesome but I am really stuck in this particular
scenario.


was (Author: mfsalmani678):
[~aleksandr-m]
I tried your proposed solution but It didn't worked for me or perhaps I misunderstood your
point.
Basically we were previously on struts 2.2.3 version, and on that version *cssClass* attribute
of *<s:select>* populates the class for *<option>* in *<optgroup>* and on
that particular class we have some business logic implemented. Now after migration our that
functionality stops working because of the class not being applied by *<s:select>* to
*<option>* tag within *<optgroup>*. I believe the struts version onwards from
2.2.3 should support this feature of *<s:select>* perhaps in some other way. Can you
guide me how can get through it or propose a rough snippet which I try on my end. Other features
of latest struts 2.5.17 are really awesome but I am really stuck in this particular scenario.

> Setting Struts2 <s:select> options Css Class
> --------------------------------------------
>
>                 Key: WW-4987
>                 URL: https://issues.apache.org/jira/browse/WW-4987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Tags
>    Affects Versions: 2.5.17
>            Reporter: Muhammad Salman
>            Priority: Major
>             Fix For: 2.6, 2.5.19
>
>
> Hi
> I am working on an application that is built on struts 2.5.17. I have {{<s:select>}}
tag with <optgroup> and <option>. I am trying to add cssClass to <options>
under <optgroup>. I am trying to add css class to <option> using listCssClass
attribute of {{<s:select>}} but it is not adding class to the <option>. Any help
would be much appreciated.
> Here is code from my JSP:
> {code:xml}
> <s:select list="#\{'none':'-Select Template-'}" id="export-data" cssStyle="width:250px;"
title="templateDesc" cssClass="templateType" onchange="adjustReportText()" name="templateID"
listCssClass="templateType"> 
> <s:iterator value="\{SOME MAP WITH KEY AND LIST OF VALUES}" var="TG" status="stat">

> <s:optgroup label="%\{key}" list="%\{value}" listKey="templateId" listValue="templateName"
></s:optgroup> 
> </s:iterator> 
> </s:select>
> {code}
>  Initially we were working on struts 2.2.3 version and in that version, cssClass attribute
populates the CSS Class for <option>, but in 2.5.17 neither cssClass is populated class
to <option> nor listCssClass.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message