Bug 793885 (JBEPP-958) - UIFormCheckBoxInput.setValue() doesn't parse String
Summary: UIFormCheckBoxInput.setValue() doesn't parse String
Keywords:
Status: CLOSED NEXTRELEASE
Alias: JBEPP-958
Product: JBoss Enterprise Portal Platform 5
Classification: JBoss
Component: Portal
Version: 5.1.0.GA,5.1.1.DEV01
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 5.1.1.DEV02
Assignee: hfnukal@redhat.com
QA Contact:
URL: http://jira.jboss.org/jira/browse/JBE...
Whiteboard:
Depends On:
Blocks: 793886
TreeView+ depends on / blocked
 
Reported: 2011-05-24 14:35 UTC by Toshiya Kobayashi
Modified: 2012-02-28 16:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-07 14:55:53 UTC
Type: Bug


Attachments (Terms of Use)
exo-ecms-core-webui-explorer-2.1.2.jar.ECMS-1782 (1.09 MB, application/octet-stream)
2011-05-24 14:45 UTC, Toshiya Kobayashi
no flags Details
JBEPP-958.patch (636 bytes, text/plain)
2011-05-24 14:49 UTC, Toshiya Kobayashi
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEPP-958 0 None None None Never

Description Toshiya Kobayashi 2011-05-24 14:35:25 UTC
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A0000006Iqry&sbstr=00418872&sfdc.override=1
project_key: JBEPP

If you call org.exoplatform.webui.form.UIFormCheckBoxInput.setValue() with a String "true", it will be evaluated as "false" because it parses only Boolean, not String.

{noformat}
   public UIFormInput setValue(T value)
   {
      if (value == null)
         return super.setValue(value);
      if (value instanceof Boolean)
      {
         checked = ((Boolean)value).booleanValue();
      }
      else if (boolean.class.isInstance(value))
      {
         checked = boolean.class.cast(value);
      }
      typeValue_ = (Class<T>)value.getClass();
      return super.setValue(value);
   }
{noformat}

The caller may be changed to pass a Boolean but fixing UIFormCheckBoxInput to parse a String would be an essential resolution.

Actually org.exoplatform.ecm.webui.component.explorer.popup.admin.UIPropertyForm in WCM(Site Publisher) is hitting this issue.

How to reproduce(EPP 5.1.0 + SP 2.1.2):

1. Rename attached exo-ecms-core-webui-explorer-2.1.2.jar.ECMS-1782 to exo-ecms-core-webui-explorer-2.1.2.jar and copy it to $JBOSS_HOME/server/$PROFILE/deploy/gatein-wcm-extension-2.1.2.ear/lib (This patch helps to reproduce the issue. It doesn't affect the issue itself)
2. Start EPP with SP(ecmdemo)
3. Go to Content Explorer and click "Add Folder" to create a folder 'test' under '/acme'
4. Select 'test' and click "System" > "View Node Properties". Go to "Add New Property" tab. Set Name="testprop", Type="Boolean", Multiple="false" and check "Value" checkbox. Save.
5. You can confirm "testprop" is 'true' in "Properties" tab
6. Click 'Edit' icon in 'Action' column of "testprop"
- You will see "Value" checkbox is unchecked

Comment 1 Toshiya Kobayashi 2011-05-24 14:45:02 UTC
Attachment: Added: exo-ecms-core-webui-explorer-2.1.2.jar.ECMS-1782


Comment 3 Toshiya Kobayashi 2011-05-24 14:49:25 UTC
Attachment: Added: JBEPP-958.patch


Comment 4 Toshiya Kobayashi 2011-05-24 14:50:21 UTC
Attached JBEPP-958.patch

Comment 5 Toshiya Kobayashi 2011-05-24 14:58:03 UTC
Link: Added: This issue incorporates GTNPORTAL-1910


Comment 6 Toshiya Kobayashi 2011-05-24 15:07:01 UTC
Link: Added: This issue is a dependency of JBEPP-959


Comment 7 hfnukal@redhat.com 2011-06-07 14:55:53 UTC
Release Notes Text: Added: If you call org.exoplatform.webui.form.UIFormCheckBoxInput.setValue() with a String "true", it will be evaluated as "false" because it parses only Boolean, not String.
Fixed by recognizing string and converting to boolean value.


Comment 8 Scott Mumford 2011-08-09 04:04:06 UTC
Release Notes Docs Status: Added: Documented as Resolved Issue
Release Notes Text: Removed: If you call org.exoplatform.webui.form.UIFormCheckBoxInput.setValue() with a String "true", it will be evaluated as "false" because it parses only Boolean, not String.
Fixed by recognizing string and converting to boolean value. Added: In previous JBoss Enterprise Portal Platform versions, calling org.exoplatform.webui.form.UIFormCheckBoxInput.setValue() with a String value of 'true', would result in the value being interpreted as 'false' as only Boolean values (not String values) were parsed. This behaviour has been corrected by recognizing string values when entered and converting them to boolean values.


Comment 9 Scott Mumford 2011-08-23 05:03:28 UTC
Release Notes Text: Removed: In previous JBoss Enterprise Portal Platform versions, calling org.exoplatform.webui.form.UIFormCheckBoxInput.setValue() with a String value of 'true', would result in the value being interpreted as 'false' as only Boolean values (not String values) were parsed. This behaviour has been corrected by recognizing string values when entered and converting them to boolean values. Added: In previous JBoss Enterprise Portal Platform versions, calling org.exoplatform.webui.form.UIFormCheckBoxInput.setValue() with a String value of 'true', would result in the value being interpreted as 'false' as only Boolean values (not String values) were parsed. This behavior has been corrected by recognizing string values when entered and converting them to boolean values.



Note You need to log in before you can comment on or make changes to this bug.