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.

Bug 91034 - Dropping element on element is not recognized in Design view
Summary: Dropping element on element is not recognized in Design view
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: Sun All
: P3 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-13 19:03 UTC by htt
Modified: 2007-03-07 21:23 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description htt 2006-12-13 19:03:06 UTC
Open OTA schema.
In Design view,
  expand Complex Types > CustomerInfoType > Customer > Address
  drag/drop an element onto Address, name it 'foo'
  right-click foo > Go to Schema
  => good so far
Back in Design view,
  drag/drop an element onto StreetNmbr (the 1st item under Address)
  => this newElement is obviously not officially recognized:
     + Go to and Delete are disabled.
     + newElement is not auto-selected for editing.
     + there's no trace of it anywhere in other views.

At first glance, it'd seem that this is the case for any element dropped on a
type that's referenceable, such as StreetNmbr (referencing StreetNmbrType) or
Telephone (referencing TelephoneInfoType).
Comment 1 Samaresh Panda 2007-02-13 01:48:48 UTC
We need to be able to add an element onto ComplexType as follows:

<xs:complexType name="StreetNmbrType">
   <xs:annotation>
      <xs:documentation xml:lang="en">Street name; number on treet.
      </xs:documentation>
   </xs:annotation>
   <xs:simpleContent>
      <xs:extension base="StringLength0to64">
         <xs:attribute name="PO_Box" type="StringLength1to16">
            <xs:annotation>
               <xs:documentation xml:lang="en">Post Office Box number.
               </xs:documentation>
            </xs:annotation>
         </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
</xs:complexType>

Note that there is no compositor here.
Comment 2 Ayub Khan 2007-02-14 00:45:18 UTC
Fixed the axi code generator (551):

The outcome of this fix is the result of adding an element onto another element
that is of simple content will be transforming the simple content to complex
content as follows

<xs:complexType name="StreetNmbrType">
   <xs:annotation>
      <xs:documentation xml:lang="en">Street name; number on treet.
      </xs:documentation>
   </xs:annotation>
   <xs:complexContent>
      <xs:extension base="StringLength0to64">
         <xs:sequence>
           <xs:element name="newElement">
         </xs:sequence>
         <xs:attribute name="PO_Box" type="StringLength1to16">
            <xs:annotation>
               <xs:documentation xml:lang="en">Post Office Box number.
               </xs:documentation>
            </xs:annotation>
         </xs:attribute>
      </xs:extension>
    </xs:complexContent>
</xs:complexType>
Comment 3 htt 2007-02-15 00:42:48 UTC
Verified that two out of three are now fixed in 070214_13:
+ Go to and Delete are disabled ==> fixed.
+ newElement is not auto-selected for editing ==> not fixed.
+ there's no trace of it anywhere in other views ==> fixed.

For consistency, newly dropped elements should be auto-highlighted throughout
DV. Reopen issue as P3. 
Comment 4 Ayub Khan 2007-02-26 19:30:00 UTC
Sam,

Can you please take a look. If I try to add a newElement onto "StreetNmbrType"
on a simple schema the newElement is auto selected for editing. But on OTA this
do not work.

To try it on a simple schema.
1. Create a new empty schema
2. Switch to source view. Copy/paste

<xsd:complexType name="StreetNmbrType">
   <xsd:annotation>
      <xsd:documentation xml:lang="en">Street name; number on treet.
      </xsd:documentation>
   </xsd:annotation>
   <xsd:simpleContent>
      <xsd:extension base="StringLength0to64">
         <xsd:attribute name="PO_Box" type="StringLength1to16">
            <xsd:annotation>
               <xsd:documentation xml:lang="en">Post Office Box number.
               </xsd:documentation>
            </xsd:annotation>
         </xsd:attribute>
      </xsd:extension>
    </xsd:simpleContent>
</xsd:complexType>

inside the schema element.

3. 
Switch to DV. DnD an element into StreetNmbrType complex type. You can see that
the newElement is selected.

Note: In OTA also, if you do the same by DnD an element onto "StreetNmbrType"
complexType. This new element is auto selected.
Comment 5 Samaresh Panda 2007-03-05 08:22:54 UTC
We have another bug for this issue. See 96663. I'm marking this one as fixed.
I'll  add some more comment to the other one.
Comment 6 htt 2007-03-07 21:23:04 UTC
Verified in 070307_5.  Same comments as 'Thu Feb 15 00:42:48 +0000 2007.'