-
FEATURED COMPONENTS
First time here? Check out the FAQ!
The constraint message is not showing in panel component.
Here's my sample code. My objective is when user clicked submit button
it should focus to component with constraint. However, the constraint message
is not showing.
<zk>
<zscript>
String[] data = new String[200];
for(int j=0; j < data.length; ++j) {
data = "option "+j;
}
ListModel strset = new SimpleListModel(data);
void test() {
uiDecimalbox.focus();
uiDecimalbox.getValue();
}
</zscript>
<window title="Test Wrong Value Exception" border="normal" width="1200px" height="600px">
<panel style="margin-left:10px" width="1200px" height="600px"
title="TEST PANEL"
border="normal" visible="true">
<panelchildren
style='background:white;background:white;overflow:auto;'>
<decimalbox id="uiDecimalbox" constraint="no empty" />
<listbox model="${strset}" width="200px">
<listhead>
<listheader label="TEST ITEMS" sort="auto"/>
</listhead>
</listbox>
<button label="submit" onClick="test()"/>
</panelchildren>
</panel>
</window>
</zk>
Hi,
In your case, why not specify a proper height to the listbox ?
In some of the modern browsers, except IE, I can't see the button below the listbox.
as jumper said, following works for me.
<zk> <zscript><![CDATA[ String[] data = new String[200]; for(int j=0; j < data.length; ++j) { data = "option "+j; } ListModel strset = new SimpleListModel(data); void test() { uiDecimalbox.focus(); uiDecimalbox.getValue(); } ]]></zscript> <window title="Test Wrong Value Exception" border="normal" width="1200px" height="600px"> <panel style="margin-left:10px" width="1200px" height="600px" title="TEST PANEL" border="normal" visible="true"> <panelchildren style='background:white;background:white;overflow:auto;'> <decimalbox id="uiDecimalbox" constraint="no empty" /> <listbox model="${strset}" width="200px" rows="20"> <listhead> <listheader label="TEST ITEMS" sort="auto"/> </listhead> </listbox> <button label="submit" onClick="test()"/> </panelchildren> </panel> </window> </zk>
I intentionally placed the submit button at the bottom of my page. My objective is what if my component with constraint is in top of the page wherein is no longer can be seen. The only way I can think of is to focus first the component (top page) and see if constraint message will appear. The codes that I presented is just similar to my program except that prior to the listbox there are still more components that makes my submit button at the bottom of the page.
This is working if I am not using panel.
Thanks,
It seems to be a timing issue, please post it to bugs-list.
I post a bug here
Please follow it.
Asked: 2008-11-08 00:58:30 +0800
Seen: 281 times
Last updated: Nov 14 '08