|
View:
New views
10 Messages
—
Rating Filter:
Alert me
|
|
|
DWR and EnumHi guys.
I have class *public class* Event { *public enum* EventType {TYPE1, TYPE2}; *private *EventType type; * public *EventType getEventType() { *return this*.type; } } I've defined this class as converter, and during work it fails with: No converter found for Event.EventType. So client recieves Event objects with type == null. Could you please advise me anything? -- Andrew Dashin --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: DWR and Enum
dwr.xml
<allow> <convert converter="enum" match="mypackage.EventType"/> </allow> Cheers, Lance. Andrew Dashin wrote: Hi guys. |
|
|
Re: DWR and EnumLance пишет:
> dwr.xml > > <allow> > <convert converter="enum" match="mypackage.EventType"/> > </allow> > > Cheers, > Lance. > > Andrew Dashin wrote: >> Hi guys. >> >> I have class >> >> *public class* Event { >> >> *public enum* EventType {TYPE1, TYPE2}; >> >> *private *EventType type; >> >> * public *EventType getEventType() { >> *return this*.type; >> } >> >> } >> >> I've defined this class as converter, and during work it fails with: >> No converter found for Event.EventType. >> So client recieves Event objects with type == null. >> >> Could you please advise me anything? >> inner class of Event - it doesn't work. Even if I try <allow> <convert converter="enum" match="Event.EventType"/> </allow> So I've made it as a separate class. But anyway it is interesting if there is a way to make it work as an inner class. -- Andrew Dashin --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: DWR and Enum
In your example, EventType is not
static. Therefore for EventType to exist, an Event must exist.
Try declaring your inner enum as static. public class Event { public static enum EventType {TYPE1, TYPE2 }; Andrew Dashin wrote: Lance пишет: |
|
|
Re: DWR and EnumLance пишет:
> In your example, EventType is not static. Therefore for EventType to > exist, an Event must exist. > Try declaring your inner enum as static. > > public class Event { > public *static* enum EventType {TYPE1, TYPE2 }; > > > Andrew Dashin wrote: >> Lance пишет: >>> dwr.xml >>> >>> <allow> >>> <convert converter="enum" match="mypackage.EventType"/> >>> </allow> >>> >>> Cheers, >>> Lance. >>> >>> Andrew Dashin wrote: >>>> Hi guys. >>>> >>>> I have class >>>> >>>> *public class* Event { >>>> >>>> *public enum* EventType {TYPE1, TYPE2}; >>>> >>>> *private *EventType type; >>>> >>>> * public *EventType getEventType() { >>>> *return this*.type; >>>> } >>>> >>>> } >>>> >>>> I've defined this class as converter, and during work it fails with: >>>> No converter found for Event.EventType. >>>> So client recieves Event objects with type == null. >>>> >>>> Could you please advise me anything? >>>> >> This works only when EventType is in a separate file, but when it is >> an inner class of Event - it doesn't work. >> Even if I try >> <allow> >> <convert converter="enum" match="Event.EventType"/> >> </allow> >> >> So I've made it as a separate class. But anyway it is interesting if >> there is a way to make it work as an inner class. >> -- Andrew Dashin --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: DWR and Enum
Ok, last try.
Enum must be static, use "$" instead of "." <allow> <convert converter="enum" match="Event$EventType"/> </allow> Should work. Andrew Dashin wrote: Lance пишет: |
|
|
Re: DWR and EnumThis is working but is it possible to use wildcards for including any inner class in a package ??
like this : <convert converter="enum" match="mypackage.*$*"/> or do we have to configure a convert for each inner class ??
|
|
|
Re: DWR and EnumUsually ** matches all classes but I have not been following the conversation
Regards
On Wed, Oct 21, 2009 at 7:38 PM, nbourdeau <nbourdeau@...> wrote:
|
|
|
Re: DWR and EnumOk thank you. I'll try this.
|
|
|
Re: DWR and EnumYou can be forgiven for not following this... it's from many months ago... possibly a year. I'm not sure that wildcard matching maches inner classes (or inner enums)... I could be wrong.
2009/10/21 Jose Noheda <jose.noheda@...> Usually ** matches all classes but I have not been following the conversation |
| Free embeddable forum powered by Nabble | Forum Help |