Hi Ernst

The ULCTextLookupField/UITextLookupField classes are a little inconsistent in 
their usage of convert methods. You need to change the following line in the 
UITextLookField.handleSetErrorForeground() method

  fErrorForeground = (args != null) ? new Color(args.get("r", -1), 
args.get("g", -1), args.get("b", -1)) : Color.red;

to

  fErrorForeground =  (args != null) ? convertColorFromAnything(args) : 
Color.red;

Otherwise the conversion of colors to Anythings and vice versa does not work.

I hope this helps.

Cheers
Rolf

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Plüss Ernst,
Bedag
Sent: Freitag, 30. Juni 2006 13:44
To: [EMAIL PROTECTED]
Subject: AW: [ULC-developer] Getting LookupTextField to work in ULC 6.1


Hi Rolf

I changed the UILookupTextField to:

public class UILookupTextField extends UITextField {
        
  class BasicLookupTextField extends BasicTextField {

        public boolean isManagingFocus() {
                return true;
        }
          
  }

  .......

  protected Object createBasicObject(Object[] arg0) {
                return new BasicLookupTextField();
  } 

  .......
}

Now I get the following exception:

1        30.06.2006 13:37:06.009        1'000   SEVERE  
Thread[AWT-EventQueue-1,6,main] com.ulcjava.base.client.UISession       b       
got exception while processing  
[com.ulcjava.base.shared.internal.IllegalStateException: Operation only allowed 
on Anythings of type 'Map'
        at com.ulcjava.base.shared.internal.Anything.c(Anything.java:49)
        at com.ulcjava.base.shared.internal.Anything.get(Anything.java:259)
        at 
com.canoo.ulc.community.lookup.client.UILookupTextField.handleSetErrorForeground(UILookupTextField.java:248)
        at 
com.canoo.ulc.community.lookup.client.UILookupTextField.restoreState(UILookupTextField.java:112)
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144)
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133)
        at com.ulcjava.base.client.UISession.find(UISession.java:263)
        at com.ulcjava.base.client.UISession.getManaged(UISession.java:167)
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:50)
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:82)
        at com.ulcjava.base.client.UIProxy.b(UIProxy.java:171)
        at com.ulcjava.base.client.UIProxy.a(UIProxy.java:18)
        at com.ulcjava.base.client.UIProxy.restoreState(UIProxy.java:156)
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144)
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133)
        at com.ulcjava.base.client.UISession.find(UISession.java:263)
        at com.ulcjava.base.client.UISession.getManaged(UISession.java:167)
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:50)
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:82)
        at com.ulcjava.base.client.UIProxy.b(UIProxy.java:171)
        at com.ulcjava.base.client.UIProxy.a(UIProxy.java:18)
        at com.ulcjava.base.client.UIProxy.restoreState(UIProxy.java:156)
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144)
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133)
        at com.ulcjava.base.client.UISession.find(UISession.java:263)
        at com.ulcjava.base.client.UISession.getManaged(UISession.java:167)
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:50)
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:82)
        at com.ulcjava.base.client.UIProxy.b(UIProxy.java:171)
        at com.ulcjava.base.client.UIProxy.a(UIProxy.java:18)
        at com.ulcjava.base.client.UIProxy.restoreState(UIProxy.java:156)
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144)
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133)
        at com.ulcjava.base.client.UISession.handleRequest(UISession.java:6)
        at com.ulcjava.base.client.UISession.b(UISession.java:173)
        at com.ulcjava.base.client.UISession.access$1600(UISession.java:180)
        at com.ulcjava.base.client.UISession$1.run(UISession$1.java:1)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at 
com.ulcjava.base.client.FilteringEventQueue.dispatchEvent(FilteringEventQueue.java:6)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
]
2        30.06.2006 13:37:06.071        900     WARNING Thread[ULC 
Communication Controller Thread,6,main]      com.ulcjava.base.server.ULCSession 
     a       Exception received from client: 
com.ulcjava.base.shared.internal.IllegalStateException: Operation only allowed 
on Anythings of type 'Map'
        at com.ulcjava.base.shared.internal.Anything.c(Anything.java:49)
        at com.ulcjava.base.shared.internal.Anything.get(Anything.java:259)
        at 
com.canoo.ulc.community.lookup.client.UILookupTextField.handleSetErrorForeground(UILookupTextField.java:248)
        at 
com.canoo.ulc.community.lookup.client.UILookupTextField.restoreState(UILookupTextField.java:112)
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144)
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133)
        at com.ulcjava.base.client.UISession.find(UISession.java:263)
        at com.ulcjava.base.client.UISession.getManaged(UISession.java:167)
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:50)
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:82)
        at com.ulcjava.base.client.UIProxy.b(UIProxy.java:171)
        at com.ulcjava.base.client.UIProxy.a(UIProxy.java:18)
        at com.ulcjava.base.client.UIProxy.restoreState(UIProxy.java:156)
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144)
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133)
        at com.ulcjava.base.client.UISession.find(UISession.java:263)
        at com.ulcjava.base.client.UISession.getManaged(UISession.java:167)
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:50)
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:82)
        at com.ulcjava.base.client.UIProxy.b(UIProxy.java:171)
        at com.ulcjava.base.client.UIProxy.a(UIProxy.java:18)
        at com.ulcjava.base.client.UIProxy.restoreState(UIProxy.java:156)
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144)
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133)
        at com.ulcjava.base.client.UISession.find(UISession.java:263)
        at com.ulcjava.base.client.UISession.getManaged(UISession.java:167)
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:50)
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:82)
        at com.ulcjava.base.client.UIProxy.b(UIProxy.java:171)
        at com.ulcjava.base.client.UIProxy.a(UIProxy.java:18)
        at com.ulcjava.base.client.UIProxy.restoreState(UIProxy.java:156)
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144)
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133)
        at com.ulcjava.base.client.UISession.handleRequest(UISession.java:6)
        at com.ulcjava.base.client.UISession.b(UISession.java:173)
        at com.ulcjava.base.client.UISession.access$1600(UISession.java:180)
        at com.ulcjava.base.client.UISession$1.run(UISession$1.java:1)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at 
com.ulcjava.base.client.FilteringEventQueue.dispatchEvent(FilteringEventQueue.java:6)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
        

Any ideas?
Ernst




-----Ursprüngliche Nachricht-----
Von: Rolf Pfenninger [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 30. Juni 2006 13:13
An: Plüss Ernst, Bedag; [EMAIL PROTECTED]
Betreff: RE: [ULC-developer] Getting LookupTextField to work in ULC 6.1

Hi Ernst

This NPE seems to be due to the fact that the basic object is not correctly 
created. PatchedUITextField still uses the template method 
createTextComponent() that was deprecated in 6.0 and has been removed in 6.1. 
That's why the basic object is not created at all.

Now, with 6.1 there is no need for the PatchedUITextField class anymore 
(because the separation between object creation and configuration has been 
cleaned up). You should be able to inherit directly from UITextField and 
override createBasicObject() instead.

I hope this helps.

Cheers
Rolf


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Plüss Ernst, Bedag
Sent: Freitag, 30. Juni 2006 10:54
To: [EMAIL PROTECTED]
Subject: [ULC-developer] Getting LookupTextField to work in ULC 6.1


Hi All 
I'm struggling with getting the LookupTextField of the code community to work 
with ULC 6.1. 
In order to get it compiling I had to change the following lines of 
UILookupTextField: 
  public void setForegroundColor(int red, int green, int blue, int alpha, 
boolean refresh) 
  { 
    super.setForegroundColor(red, green, blue, alpha, refresh); 
    fForeground = getTextComponent().getForeground(); 
  } 
To 
  public void setForegroundColor(Color inColor) 
  { 
    super.setForegroundColor(inColor); 
    fForeground = getTextComponent().getForeground(); 
  } 
Unfortunately if I try to start the ULCLookupTextFieldSample I'm getting the 
following error: 
1        30.06.2006 10:45:38.377        1'000   SEVERE  
Thread[AWT-EventQueue-1,6,main] com.ulcjava.base.client.UISession       b       
got exception while processing  [java.lang.NullPointerException
        at 
com.ulcjava.base.client.UITextComponent.preInitializeState(UITextComponent.java:119)
 
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:83) 
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133) 
        at com.ulcjava.base.client.UISession.find(UISession.java:263) 
        at com.ulcjava.base.client.UISession.getManaged(UISession.java:167) 
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:50) 
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:82) 
        at com.ulcjava.base.client.UIProxy.b(UIProxy.java:171) 
        at com.ulcjava.base.client.UIProxy.a(UIProxy.java:18) 
        at com.ulcjava.base.client.UIProxy.restoreState(UIProxy.java:156) 
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144) 
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133) 
        at com.ulcjava.base.client.UISession.find(UISession.java:263) 
        at com.ulcjava.base.client.UISession.getManaged(UISession.java:167) 
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:50) 
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:82) 
        at com.ulcjava.base.client.UIProxy.b(UIProxy.java:171) 
        at com.ulcjava.base.client.UIProxy.a(UIProxy.java:18) 
        at com.ulcjava.base.client.UIProxy.restoreState(UIProxy.java:156) 
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144) 
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133) 
        at com.ulcjava.base.client.UISession.find(UISession.java:263) 
        at com.ulcjava.base.client.UISession.getManaged(UISession.java:167) 
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:50) 
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:82) 
        at com.ulcjava.base.client.UIProxy.b(UIProxy.java:171) 
        at com.ulcjava.base.client.UIProxy.a(UIProxy.java:18) 
        at com.ulcjava.base.client.UIProxy.restoreState(UIProxy.java:156) 
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144) 
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133) 
        at com.ulcjava.base.client.UISession.handleRequest(UISession.java:6) 
        at com.ulcjava.base.client.UISession.b(UISession.java:173) 
        at com.ulcjava.base.client.UISession.access$1600(UISession.java:180) 
        at com.ulcjava.base.client.UISession$1.run(UISession$1.java:1) 
        at java.awt.event.InvocationEvent.dispatch(Unknown Source) 
        at java.awt.EventQueue.dispatchEvent(Unknown Source) 
        at 
com.ulcjava.base.client.FilteringEventQueue.dispatchEvent(FilteringEventQueue.java:6)
 
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown 
Source) 
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
        at java.awt.EventDispatchThread.run(Unknown Source) 
] 
2        30.06.2006 10:45:38.423        900     WARNING Thread[ULC 
Communication Controller Thread,6,main]      com.ulcjava.base.server.ULCSession 
     a       Exception received from client: java.lang.NullPointerException
        at 
com.ulcjava.base.client.UITextComponent.preInitializeState(UITextComponent.java:119)
 
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:83) 
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133) 
        at com.ulcjava.base.client.UISession.find(UISession.java:263) 
        at com.ulcjava.base.client.UISession.getManaged(UISession.java:167) 
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:50) 
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:82) 
        at com.ulcjava.base.client.UIProxy.b(UIProxy.java:171) 
        at com.ulcjava.base.client.UIProxy.a(UIProxy.java:18) 
        at com.ulcjava.base.client.UIProxy.restoreState(UIProxy.java:156) 
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144) 
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133) 
        at com.ulcjava.base.client.UISession.find(UISession.java:263) 
        at com.ulcjava.base.client.UISession.getManaged(UISession.java:167) 
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:50) 
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:82) 
        at com.ulcjava.base.client.UIProxy.b(UIProxy.java:171) 
        at com.ulcjava.base.client.UIProxy.a(UIProxy.java:18) 
        at com.ulcjava.base.client.UIProxy.restoreState(UIProxy.java:156) 
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144) 
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133) 
        at com.ulcjava.base.client.UISession.find(UISession.java:263) 
        at com.ulcjava.base.client.UISession.getManaged(UISession.java:167) 
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:50) 
        at com.ulcjava.base.client.UIProxy.c(UIProxy.java:82) 
        at com.ulcjava.base.client.UIProxy.b(UIProxy.java:171) 
        at com.ulcjava.base.client.UIProxy.a(UIProxy.java:18) 
        at com.ulcjava.base.client.UIProxy.restoreState(UIProxy.java:156) 
        at com.ulcjava.base.client.UIProxy.init(UIProxy.java:144) 
        at com.ulcjava.base.client.UISession.newInstance(UISession.java:133) 
        at com.ulcjava.base.client.UISession.handleRequest(UISession.java:6) 
        at com.ulcjava.base.client.UISession.b(UISession.java:173) 
        at com.ulcjava.base.client.UISession.access$1600(UISession.java:180) 
        at com.ulcjava.base.client.UISession$1.run(UISession$1.java:1) 
        at java.awt.event.InvocationEvent.dispatch(Unknown Source) 
        at java.awt.EventQueue.dispatchEvent(Unknown Source) 
        at 
com.ulcjava.base.client.FilteringEventQueue.dispatchEvent(FilteringEventQueue.java:6)
 
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown 
Source) 
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
        at java.awt.EventDispatchThread.run(Unknown Source) 
        
Any ideas about what I have to change in order to cope with thie NPE? 
TIA 
Ernst Plüss
Bedag Informatik AG
Abteilung GF GBA
Gutenbergstrasse 1
3012 Bern 
Telefon:        +41 (0)31 633 21 21 (direkt 633 25 89)
E-Mail:         mailto:[EMAIL PROTECTED]
www.bedag.ch
_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developerP°z÷¥¢—«™¨¥Šx%ŠËT,'^½éh¥êåŠËlq©è¡Ê&†Ûiÿùb²Ûjz(r‰¿™¨¥™©ÿ–+-Šwèþé\uëޖŠ^

Reply via email to