From: Joachim S. <Joa...@be...> - 2006-02-01 13:32:32
|
Hi Timo, I'm not really sure what your suggestion is. The contentType attribute = for the combobox tells the framework the static type of the elements in the= list, so that you can work with type information. For the edit field, it is a little bit different, because at the end, y= ou will need a string which can be edited. So, there is no need to specifi= y the final type. On the other hand, which type should the contentType attribute specify? Maybe what you need, is a notation for class casts in the xml expressio= n. This could be integrated. However, instead of such a cast notation, so could always use a method. Here is an example, how I'm using the edit field to edit numbers. Maybe= this helps you. <edit value=3D"conv.double2strNK2(getCustomer.getWeight)" setValue=3D"getCustomer.setWeight(conv.str2doubleNK2(?value))"/> The controller then has to implement at least "conv" and "getCustomer".= The result type of "getWeight" must match the argument type of "double2strN= K2". Regards, Joachim ----------------------------------------------------- Dr. Joachim Schmid Beck et al. projects GmbH Theresienh=F6he 13, D-80339 M=FCnchen Phone: +49 / 89 / 54 42 53 - 29 Mobile: +49 /163 / 54 42 529 = "Timo Meinen" = <me...@gm...> = = To 31.01.2006 17:37 Joachim Schmid = <Joa...@be...> = = cc gui...@li...= Subj= ect Re: [Gui4j-user] Casting objects= in edit-fields = = = = = = = Hallo Jochen, at first, thank you for the fastest maillinglist answer, I ever got. 3 Minutes, wow. ;-) The conversion method won't help me: My "Gui-Classes" extends a, let's call it Gui-Base-Class. Every GUI has= to implement a method called getEditEntity, which is the editable entity i= n this view. Of course, every GUI-class represents a different Entity, so the return= type of getEditEntity is different in every class. I declared an abstract method getEditEntity in Gui-Base-Class, to verif= y, that every class provides this method. In deed, it is only a marker-met= hod. Perhaps I have to use generics to customize the return type. Never used= generics, so far. Could you imagine to add contentType-tag to edit-component and do a gui4j-internal casting? Using comboBoxes this works wonderful. A new Feature-Request. :-) Thank you Timo -- Gl=FCck Auf Timo (MAIL) me...@gm... (ICQ) 10201138 (AIM) TimoLiebtEffi (JAB) tim...@ja... Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko! Satte Provisionen f=FCr GMX Partner: http://www.gmx.net/de/go/partner = |