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)
else
{ super.beforeChildAdded(child, refChild); }}