Hi Mario, When you deserialize Data on the client side, you are creating an instance of Data which tries to create create ULCCheckBox member and fails because ULCCheckBox (and its parent ULCComponent and the classes needed to ULCComponent i.e. ClientContext) are not present on the client side. Hence the exception.
The question is why does your Data contain a ULC server-side widget ULCCheckBox and why does it have to be sent to the client? Your Data class should just have the model, i.e. the value of the checkbox. I hope this helps. Thanks and regards, Janak >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] Behalf Of Mario H. >Castillo >Sent: Friday, October 06, 2006 6:07 AM >To: [EMAIL PROTECTED] Com >Subject: [ULC-developer] private ULC visual class and coder > > >Hi Janak, > >I have the following class and corresponding coder and hopefully you might >have some clues for me: > >public class Data { > > private ULCCheckBox checkBox; > > public Data() { > checkBox = new ULCCheckBox(); > checkBox.setOpaque(true); > } > > public void setValue(Object value) { > if (value == null) > checkBox.setSelected(false); // Gibts hier kein State?? > else > checkBox.setSelected(((Boolean) value).booleanValue()); > } > > public Object getValue() { > return checkBox.isSelected(); > } >} > >CODER > >public class DataCoder implements IStreamCoder { > > public String getPeerClassName() { > return Data.class.getName(); > } > > public void writeObject(IObjectOutputStream out, Object data) { > Data c = (Data) data; > try { > out.writeObject(c.getValue()); > } catch (IOException e) { > e.printStackTrace(); } > > } > > public Object readObject(IObjectInputStream in) throws IOException { > Object o= (Object)in.readObject(); > > Data p= new Data(); <+++++++++++++++++++ Executes here and gives >exception!!!!! > p.setValue(o); > return p; > } >} > >Is the ClientContext null??? Or is it something else you think? > >Mario > >19 05.10.2006 20:35:02.440 1,000 SEVERE Thread[ULC Communication >Controller >Thread,6,main] com.ulcjava.base.client.UISession$k_ run exception occured >[com.ulcjava.base.client.ConnectorException: error while sending requests > at >com.ulcjava.base.development.DevelopmentConnector.sendRequests(Deve >lopmentConnector.java:0) > at com.ulcjava.base.client.UISession$k_.run(UISession$k_.java:11) > at java.lang.Thread.run(Thread.java:595) >Caused by: java.lang.NullPointerException > at >com.ulcjava.base.application.ClientContext.getFont(ClientContext.java:37) > at com.ulcjava.base.application.ULCComponent.<init>(ULCComponent.java:127) > at >com.ulcjava.base.application.ULCAbstractButton.<init>(ULCAbstractBu >tton.java:51) > at >com.ulcjava.base.application.ULCAbstractButton.<init>(ULCAbstractBu >tton.java:52) > at >com.ulcjava.base.application.ULCToggleButton.<init>(ULCToggleButton >.java:41) > at com.ulcjava.base.application.ULCCheckBox.<init>(ULCCheckBox.java:7) > at com.ulcjava.base.application.ULCCheckBox.<init>(ULCCheckBox.java:80) > at >ch.abacus.lib.ui.propertyinspector.display.renderer.BooleanRenderer >.<init>(BooleanRenderer.java:43) > at >mo.ide.ulc.shared.propertyinspector.DCBooleanRenderer.<init>(DCBool >eanRenderer.java:32) > >_______________________________________________ >ULC-developer mailing list >[email protected] >http://lists.canoo.com/mailman/listinfo/ulc-developer _______________________________________________ ULC-developer mailing list [email protected] http://lists.canoo.com/mailman/listinfo/ulc-developer
