Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-5727

org.zkoss.zk.ui.UiException: Unsupported child for grid: <Text null>

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 10.0.0-Beta
    • General
    • None

      Steps to Reproduce

      When using a Java subclass of a built-in component, say

      public class FooGrid extends org.zkoss.zul.Grid {
      
      ..
      
      }
      

      and a ZUL

      <?component name="foogrid" extends="grid" class="foo.FooGrid"?>
      

      whitespace in the ZUL file between <foogrid>[whitespace]</foogrid> results in Exception

      while the original grid works fine.

      Current Result

      org.zkoss.zk.ui.UiException: Unsupported child for grid: <Text null>
          at org.zkoss.zul.Grid.beforeChildAdded(Grid.java:1410)
          at zk.customcontrols.stubgrid.StubGrid.beforeChildAdded(StubGrid.java:27)
          at org.zkoss.zk.ui.AbstractComponent.insertBefore(AbstractComponent.java:1361)
          at org.zkoss.zul.Grid.insertBefore(Grid.java:1443)

      Expected Result

      Just ignore the whitespace, it's XML

      Debug Information

       

      Workaround

      Add

      public void beforeChildAdded(Component child, Component refChild) {
              if (child instanceof Text)

      {             // just ignore, ZK inserts empty Text nodes without reason         }

      else

      {             super.beforeChildAdded(child, refChild);         }

          }

        1. FooGrid.java
          0.1 kB
        2. zk-5727.zul
          0.1 kB

            hawk hawk
            chemFelix chemFelix
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: