This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | wrong set selection component's default value code generated when | ||
---|---|---|---|
Product: | obsolete | Reporter: | Sherry Zhou <sherryzhou> |
Component: | visualweb | Assignee: | Dongmei Cao <dongmeic> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | ||
Priority: | P1 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Sherry Zhou
2007-03-21 19:39:19 UTC
The generated code has compilation error. When remove these code and deploy the project, it shows nothing at browser. It happens on J2EE 4 and Java EE 5 project. This bug occurs only in case of J2EE1.5 project. Upon debugging I found that OptionListCustomizer in case of J2EE1.5 project provides "???" to persist in java source which is incorrect According to Dongmei this bug cannot be fixed in M8 because they have to update woodstock components which is lots of changes. Therefore downgrading the bug to P2 Reset this to a P1. Did not assign it the to Stopper upbrella bug so it can be ignored for M8 Fixed checked in woodstock repository User: dcao Date: 2007-04-12 04:21:59+0000 Log: Fix for issue http://www.netbeans.org/issues/show_bug.cgi?id=98558: implemented public String getJavaInitializationString() File Changes: Directory: /woodstock/webui/src/designtime/com/sun/webui/jsf/component/propertyeditors/ ======================================================================================= File [changed]: SelectedValuesPropertyEditor.java Url: https://woodstock.dev.java.net/source/browse/woodstock/webui/src/designtime/com/sun/webui/jsf/component/propertyeditors/SelectedValuesPropertyEditor.java?r1=1.2&r2=1.3 Delta lines: +19 -0 -------------------- --- SelectedValuesPropertyEditor.java 2007-02-28 22:47:39+0000 1.2 +++ SelectedValuesPropertyEditor.java 2007-04-12 04:21:57+0000 1.3 @@ -25,6 +25,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import com.sun.rave.propertyeditors.util.JavaInitializer; /** @@ -42,6 +43,24 @@ // Read-only } + public String getJavaInitializationString() { + StringBuffer buffer = new StringBuffer(); + Object value = this.getValue(); + if (value instanceof Object[]) { + buffer.append("new Object[] {"); + Object[] values = (Object[]) value; + for (int i = 0; i < values.length; i++) { + if (i > 0) + buffer.append(", "); + buffer.append(JavaInitializer.toJavaInitializationString(values[i])); + } + buffer.append("}"); + } else { + buffer.append(JavaInitializer.toJavaInitializationString(value)); + } + return buffer.toString(); + } + public String getAsText() { Object value = this.getValue(); if (value == null) verified in netbeans M9 070430 |