[prev in list] [next in list] [prev in thread] [next in thread]
List: struts-dev
Subject: [jira] Resolved: (WW-2816) s:if test do not seem to work with logic
From: "Philip Luppens (JIRA)" <jira () apache ! org>
Date: 2008-09-26 6:46:24
Message-ID: 801753523.1222411584920.JavaMail.jira () brutus
[Download RAW message or body]
[ https://issues.apache.org/struts/browse/WW-2816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel \
]
Philip Luppens resolved WW-2816.
--------------------------------
Resolution: Not A Problem
A couple of things.
- the test attribute is always evaluated, so don't use %{..}.
- both && and 'and' work, just like || and 'or'.
Please run this type of question by the user mailing list first.
If this is really a problem (although I cannot imagine, but hey .. ), please reopen.
> s:if test do not seem to work with logic and
> --------------------------------------------
>
> Key: WW-2816
> URL: https://issues.apache.org/struts/browse/WW-2816
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Tags, Value Stack
> Affects Versions: 2.0.11.2
> Environment: Windows XP, Websphere, JSP
> Reporter: Philip Chan
>
> Apache documentation show simple s:if test usage. e.g. s:if \
> test="%{mode=='AddEdit'}" I try to use a little more complex test s:if \
> test="%{mode=='AddEdit'} && %{id==null}" and it fail to evaluate properly. \
> EmployeeUsername is assigned when created. Once created it should not be changed \
> while other field like first name may be changed. There are 3 modes \
> (Add/Edit/ViewOnly) Here is the sample code that somehow works. It allow data entry \
> in employeeUsername in Add/Edit mode. The problem is it allow data entry after \
> username is assigned. <s:if test="%{mode=='AddEdit'}">
> <td><s:textfield name="employeeUsername"/></td>
> </s:if>
> <s:else>
> <td><s:textfield name="employeeUsername" readonly="true"/></td>
> </s:else>
> Here is code that try to fix the above problem but do not work (The textfield is \
> always readonly even when mode is 'AddEdit' and id is really null). <s:if \
> test="%{mode=='AddEdit'} && %{id==null}"> <td><s:textfield \
> name="employeeUsername"/></td> </s:if>
> <s:else>
> <td><s:textfield name="employeeUsername" readonly="true"/></td>
> </s:else>
> I got around the problem with 2 individual s:if test but that is a ugly solution.
> Is this a OGNL problem (OGNL document say and/or is allowed)?
> Is this a struts s:if tag problem or simply s:if limitation? There is simply no \
> documentation that said s:if support this behavior or not.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic