-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi!
I've tried the following:
<zk> <window title="w1"> <textbox popup="popup" /> <popup id='popup'> <label value='p1' /> </popup> </window> <window title="w2"> <textbox popup="popup" /> <popup id='popup'> <label value='p2' /> </popup> </window> </zk>
Must it really work like that? Should not windows be actual independent id spaces?
With kind regards
César Varona
Hi Bobo,
thanks for the info. I also think it's a quite unconvincing explanation but alas! so be it.
With kind regards
César Varona
I asked the same question a long time ago, and got the answer that it was implemented this way to make it easier for the developer. I disagree because I think how id spaces and components work should be homogeneous. I guess it is too late to change this behavior now though, or a lot of applications will stop working.
-Bobo
I prepared this other test hoping it would shed some light on the subject:
<zk> <window id='w1' title="w1"> <textbox context="popup" /> <popup id='popup'> <label value='p1' /> <button label='Display names in id space'> <attribute name='onClick'> StringBuffer sb = new StringBuffer(); sb.append( "Components in id space " ).append( spaceOwner ).append( ' ' ).append( spaceOwner.getUuid() ).append( ":\n" ); for( c: spaceOwner.getFellows() ) { sb.append( c ).append( ' ' ).append( c.getUuid() ).append( ", \n" ); } sb.append( "that's all" ); alert( sb.toString() ); </attribute> </button> </popup> <button label='Display names in id space'> <attribute name='onClick'> StringBuffer sb = new StringBuffer(); sb.append( "Components in id space " ).append( spaceOwner ).append( ' ' ).append( spaceOwner.getUuid() ).append( ":\n" ); for( c: spaceOwner.getFellows() ) { sb.append( c ).append( ' ' ).append( c.getUuid() ).append( ", \n" ); } sb.append( "that's all" ); alert( sb.toString() ); </attribute> </button> <button label='Tell me which component is the parent to the popup' onClick='alert( spaceOwner.getFellow( "popup" ).getParent().toString() )' /> </window> <window id='w2' title="w2"> <textbox context="popup" /> <popup id='popup'> <label value='p2' /> <button label='Display names in id space'> <attribute name='onClick'> StringBuffer sb = new StringBuffer(); sb.append( "Components in id space " ).append( spaceOwner ).append( ' ' ).append( spaceOwner.getUuid() ).append( ":\n" ); for( c: spaceOwner.getFellows() ) { sb.append( c ).append( ' ' ).append( c.getUuid() ).append( ", \n" ); } sb.append( "that's all" ); alert( sb.toString() ); </attribute> </button> </popup> <button label='Tell me which component is the parent to the popup' onClick='alert( spaceOwner.getFellow( "popup" ).getParent().toString() )' /> </window> </zk>
With kind regards
César Varona
Asked: 2008-12-19 14:56:18 +0800
Seen: 145 times
Last updated: Dec 23 '08