Dwr conversion

View: New views
19 Messages — Rating Filter:   Alert me  

Dwr conversion

by douggiefox :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I'm having some issues with DWR.

On my javascript side I've created an object that looks like this:

            var quotationParameters = {
                groupSize: 1,
                memberParameters: [{name:'paul'},{name:'matthew'}]
            };


This is being correctly passed through to my Grails service, I have a signature that looks like this:

def createQuotation(QuotationParameters quotationParameters)

I can access quotationParameters.groupSize no problem.  However, when I try and access memberParameters I'm get references rather than values.  I try and access it like this:

quotationParameters.memberParameters.each {
        println it.name
};

Things go horribly wrong at the println.  The value of name seems to be an object reference ({name:reference:c0-e2}) rather than the value of name.

I'm not sure if I need to include a signature, and if so how to format it?

Not really quite sure where to head.  Any ideas?

Best DF

           

Re: Dwr conversion

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How does the object look?

Regards

On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <paul@...> wrote:

Hi

I'm having some issues with DWR.

On my javascript side I've created an object that looks like this:

            var quotationParameters = {
                groupSize: 1,
                memberParameters: [{name:'paul'},{name:'matthew'}]
            };


This is being correctly passed through to my Grails service, I have a
signature that looks like this:

def createQuotation(QuotationParameters quotationParameters)

I can access quotationParameters.groupSize no problem.  However, when I try
and access memberParameters I'm get references rather than values.  I try
and access it like this:

quotationParameters.memberParameters.each {
        println it.name
};

Things go horribly wrong at the println.  The value of name seems to be an
object reference ({name:reference:c0-e2}) rather than the value of name.

I'm not sure if I need to include a signature, and if so how to format it?

Not really quite sure where to head.  Any ideas?

Best DF

           

--
View this message in context: http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: Dwr conversion

by douggiefox :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I assume you mean the classes?

They're grails domain classes looking like this:

class QuotationParameters {
    Integer groupSize

    static hasMany = [memberParameters:MemberParameters]

    static constraints = {
    }
}

class MemberParameters {

    String name

    static constraints = {
    }
}

So QuotationParameters has a "set" of MemberParameters.  And it's access to the MemberParameters that I'm having trouble with.

Thanks

DF

XMaNIaC wrote:
How does the object look?
Regards

On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <paul@javabytes.co.uk> wrote:

>
> Hi
>
> I'm having some issues with DWR.
>
> On my javascript side I've created an object that looks like this:
>
>             var quotationParameters = {
>                 groupSize: 1,
>                 memberParameters: [{name:'paul'},{name:'matthew'}]
>             };
>
>
> This is being correctly passed through to my Grails service, I have a
> signature that looks like this:
>
> def createQuotation(QuotationParameters quotationParameters)
>
> I can access quotationParameters.groupSize no problem.  However, when I try
> and access memberParameters I'm get references rather than values.  I try
> and access it like this:
>
> quotationParameters.memberParameters.each {
>         println it.name
> };
>
> Things go horribly wrong at the println.  The value of name seems to be an
> object reference ({name:reference:c0-e2}) rather than the value of name.
>
> I'm not sure if I need to include a signature, and if so how to format it?
>
> Not really quite sure where to head.  Any ideas?
>
> Best DF
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
> Sent from the DWR - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> For additional commands, e-mail: users-help@dwr.dev.java.net
>
>

Re: Dwr conversion

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

DWR won't be able to figure that kind of dynamic mappings without help. See class mappers in the converter documentation.

Regards

On Fri, Oct 2, 2009 at 11:24 AM, douggiefox <paul@...> wrote:

I assume you mean the classes?

They're grails domain classes looking like this:

class QuotationParameters {
   Integer groupSize

   static hasMany = [memberParameters:MemberParameters]

   static constraints = {
   }
}

class MemberParameters {

   String name

   static constraints = {
   }
}

So QuotationParameters has a "set" of MemberParameters.  And it's access to
the MemberParameters that I'm having trouble with.

Thanks

DF


XMaNIaC wrote:
>
> How does the object look?
> Regards
>
> On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <paul@...> wrote:
>
>>
>> Hi
>>
>> I'm having some issues with DWR.
>>
>> On my javascript side I've created an object that looks like this:
>>
>>             var quotationParameters = {
>>                 groupSize: 1,
>>                 memberParameters: [{name:'paul'},{name:'matthew'}]
>>             };
>>
>>
>> This is being correctly passed through to my Grails service, I have a
>> signature that looks like this:
>>
>> def createQuotation(QuotationParameters quotationParameters)
>>
>> I can access quotationParameters.groupSize no problem.  However, when I
>> try
>> and access memberParameters I'm get references rather than values.  I try
>> and access it like this:
>>
>> quotationParameters.memberParameters.each {
>>         println it.name
>> };
>>
>> Things go horribly wrong at the println.  The value of name seems to be
>> an
>> object reference ({name:reference:c0-e2}) rather than the value of name.
>>
>> I'm not sure if I need to include a signature, and if so how to format
>> it?
>>
>> Not really quite sure where to head.  Any ideas?
>>
>> Best DF
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: Dwr conversion

by douggiefox :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

Thanks for the pointer.  I don't seem to be getting anywhere very quickly.  Could anyone give me a pointer?  I'm just not clear on how to format a class mapper.

Best

DF


XMaNIaC wrote:
DWR won't be able to figure that kind of dynamic mappings without help. See
class mappers in the converter documentation.
Regards

On Fri, Oct 2, 2009 at 11:24 AM, douggiefox <paul@javabytes.co.uk> wrote:

>
> I assume you mean the classes?
>
> They're grails domain classes looking like this:
>
> class QuotationParameters {
>    Integer groupSize
>
>    static hasMany = [memberParameters:MemberParameters]
>
>    static constraints = {
>    }
> }
>
> class MemberParameters {
>
>    String name
>
>    static constraints = {
>    }
> }
>
> So QuotationParameters has a "set" of MemberParameters.  And it's access to
> the MemberParameters that I'm having trouble with.
>
> Thanks
>
> DF
>
>
> XMaNIaC wrote:
> >
> > How does the object look?
> > Regards
> >
> > On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <paul@javabytes.co.uk> wrote:
> >
> >>
> >> Hi
> >>
> >> I'm having some issues with DWR.
> >>
> >> On my javascript side I've created an object that looks like this:
> >>
> >>             var quotationParameters = {
> >>                 groupSize: 1,
> >>                 memberParameters: [{name:'paul'},{name:'matthew'}]
> >>             };
> >>
> >>
> >> This is being correctly passed through to my Grails service, I have a
> >> signature that looks like this:
> >>
> >> def createQuotation(QuotationParameters quotationParameters)
> >>
> >> I can access quotationParameters.groupSize no problem.  However, when I
> >> try
> >> and access memberParameters I'm get references rather than values.  I
> try
> >> and access it like this:
> >>
> >> quotationParameters.memberParameters.each {
> >>         println it.name
> >> };
> >>
> >> Things go horribly wrong at the println.  The value of name seems to be
> >> an
> >> object reference ({name:reference:c0-e2}) rather than the value of name.
> >>
> >> I'm not sure if I need to include a signature, and if so how to format
> >> it?
> >>
> >> Not really quite sure where to head.  Any ideas?
> >>
> >> Best DF
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
> Sent from the DWR - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> For additional commands, e-mail: users-help@dwr.dev.java.net
>
>

Re: Dwr conversion

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Add a javascript="Whatever" to the converter declaration and create the JS object like:

var myobj = new Whatever();

instead of using:

var o = {};

This, of course, applies to nested objects as well.

Regards

On Fri, Oct 2, 2009 at 11:58 AM, douggiefox <paul@...> wrote:

Hi

Thanks for the pointer.  I don't seem to be getting anywhere very quickly.
Could anyone give me a pointer?  I'm just not clear on how to format a class
mapper.

Best

DF



XMaNIaC wrote:
>
> DWR won't be able to figure that kind of dynamic mappings without help.
> See
> class mappers in the converter documentation.
> Regards
>
> On Fri, Oct 2, 2009 at 11:24 AM, douggiefox <paul@...> wrote:
>
>>
>> I assume you mean the classes?
>>
>> They're grails domain classes looking like this:
>>
>> class QuotationParameters {
>>    Integer groupSize
>>
>>    static hasMany = [memberParameters:MemberParameters]
>>
>>    static constraints = {
>>    }
>> }
>>
>> class MemberParameters {
>>
>>    String name
>>
>>    static constraints = {
>>    }
>> }
>>
>> So QuotationParameters has a "set" of MemberParameters.  And it's access
>> to
>> the MemberParameters that I'm having trouble with.
>>
>> Thanks
>>
>> DF
>>
>>
>> XMaNIaC wrote:
>> >
>> > How does the object look?
>> > Regards
>> >
>> > On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <paul@...>
>> wrote:
>> >
>> >>
>> >> Hi
>> >>
>> >> I'm having some issues with DWR.
>> >>
>> >> On my javascript side I've created an object that looks like this:
>> >>
>> >>             var quotationParameters = {
>> >>                 groupSize: 1,
>> >>                 memberParameters: [{name:'paul'},{name:'matthew'}]
>> >>             };
>> >>
>> >>
>> >> This is being correctly passed through to my Grails service, I have a
>> >> signature that looks like this:
>> >>
>> >> def createQuotation(QuotationParameters quotationParameters)
>> >>
>> >> I can access quotationParameters.groupSize no problem.  However, when
>> I
>> >> try
>> >> and access memberParameters I'm get references rather than values.  I
>> try
>> >> and access it like this:
>> >>
>> >> quotationParameters.memberParameters.each {
>> >>         println it.name
>> >> };
>> >>
>> >> Things go horribly wrong at the println.  The value of name seems to
>> be
>> >> an
>> >> object reference ({name:reference:c0-e2}) rather than the value of
>> name.
>> >>
>> >> I'm not sure if I need to include a signature, and if so how to format
>> >> it?
>> >>
>> >> Not really quite sure where to head.  Any ideas?
>> >>
>> >> Best DF
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
>> >> Sent from the DWR - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@...
>> >> For additional commands, e-mail: users-help@...
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: Dwr conversion

by douggiefox :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

So near yet so far...

My Javascript's now looking like this:

var member = new MemberParameters();
member.name = 'paul';
var quotationParameters = new QuotationParameters();
quotationParameters.groupSize = 1;
quotationParameters.memberParameters = new Array();
quotationParameters.memberParameters[0] = member;

Which all seems fine.  I've run this through Firebug and everything is as I expect.

Unfortunately, the remote function now fails to fire.  It's defined as:

def createQuotation(QuotationParameters quotationParameters)

Any more ideas?  Funny thing is when I defined the objects as o={} the method fired correctly.

Thanks for the help so far.

Best DF


XMaNIaC wrote:
Add a javascript="Whatever" to the converter declaration and create the JS
object like:
var myobj = new Whatever();

instead of using:

var o = {};

This, of course, applies to nested objects as well.

Regards

On Fri, Oct 2, 2009 at 11:58 AM, douggiefox <paul@javabytes.co.uk> wrote:

>
> Hi
>
> Thanks for the pointer.  I don't seem to be getting anywhere very quickly.
> Could anyone give me a pointer?  I'm just not clear on how to format a
> class
> mapper.
>
> Best
>
> DF
>
>
>
> XMaNIaC wrote:
> >
> > DWR won't be able to figure that kind of dynamic mappings without help.
> > See
> > class mappers in the converter documentation.
> > Regards
> >
> > On Fri, Oct 2, 2009 at 11:24 AM, douggiefox <paul@javabytes.co.uk>
> wrote:
> >
> >>
> >> I assume you mean the classes?
> >>
> >> They're grails domain classes looking like this:
> >>
> >> class QuotationParameters {
> >>    Integer groupSize
> >>
> >>    static hasMany = [memberParameters:MemberParameters]
> >>
> >>    static constraints = {
> >>    }
> >> }
> >>
> >> class MemberParameters {
> >>
> >>    String name
> >>
> >>    static constraints = {
> >>    }
> >> }
> >>
> >> So QuotationParameters has a "set" of MemberParameters.  And it's access
> >> to
> >> the MemberParameters that I'm having trouble with.
> >>
> >> Thanks
> >>
> >> DF
> >>
> >>
> >> XMaNIaC wrote:
> >> >
> >> > How does the object look?
> >> > Regards
> >> >
> >> > On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <paul@javabytes.co.uk>
> >> wrote:
> >> >
> >> >>
> >> >> Hi
> >> >>
> >> >> I'm having some issues with DWR.
> >> >>
> >> >> On my javascript side I've created an object that looks like this:
> >> >>
> >> >>             var quotationParameters = {
> >> >>                 groupSize: 1,
> >> >>                 memberParameters: [{name:'paul'},{name:'matthew'}]
> >> >>             };
> >> >>
> >> >>
> >> >> This is being correctly passed through to my Grails service, I have a
> >> >> signature that looks like this:
> >> >>
> >> >> def createQuotation(QuotationParameters quotationParameters)
> >> >>
> >> >> I can access quotationParameters.groupSize no problem.  However, when
> >> I
> >> >> try
> >> >> and access memberParameters I'm get references rather than values.  I
> >> try
> >> >> and access it like this:
> >> >>
> >> >> quotationParameters.memberParameters.each {
> >> >>         println it.name
> >> >> };
> >> >>
> >> >> Things go horribly wrong at the println.  The value of name seems to
> >> be
> >> >> an
> >> >> object reference ({name:reference:c0-e2}) rather than the value of
> >> name.
> >> >>
> >> >> I'm not sure if I need to include a signature, and if so how to
> format
> >> >> it?
> >> >>
> >> >> Not really quite sure where to head.  Any ideas?
> >> >>
> >> >> Best DF
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
> Sent from the DWR - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> For additional commands, e-mail: users-help@dwr.dev.java.net
>
>

Re: Dwr conversion

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What's the Java generated for this declaration?

static hasMany = [memberParameters:MemberParameters]

If it is a list you're in the right track but if it's a map you must change the JS generation

Regards

On Fri, Oct 2, 2009 at 2:16 PM, douggiefox <paul@...> wrote:

Hi

So near yet so far...

My Javascript's now looking like this:

var member = new MemberParameters();
member.name = 'paul';
var quotationParameters = new QuotationParameters();
quotationParameters.groupSize = 1;
quotationParameters.memberParameters = new Array();
quotationParameters.memberParameters[0] = member;

Which all seems fine.  I've run this through Firebug and everything is as I
expect.

Unfortunately, the remote function now fails to fire.  It's defined as:

def createQuotation(QuotationParameters quotationParameters)

Any more ideas?  Funny thing is when I defined the objects as o={} the
method fired correctly.

Thanks for the help so far.

Best DF



XMaNIaC wrote:
>
> Add a javascript="Whatever" to the converter declaration and create the JS
> object like:
> var myobj = new Whatever();
>
> instead of using:
>
> var o = {};
>
> This, of course, applies to nested objects as well.
>
> Regards
>
> On Fri, Oct 2, 2009 at 11:58 AM, douggiefox <paul@...> wrote:
>
>>
>> Hi
>>
>> Thanks for the pointer.  I don't seem to be getting anywhere very
>> quickly.
>> Could anyone give me a pointer?  I'm just not clear on how to format a
>> class
>> mapper.
>>
>> Best
>>
>> DF
>>
>>
>>
>> XMaNIaC wrote:
>> >
>> > DWR won't be able to figure that kind of dynamic mappings without help.
>> > See
>> > class mappers in the converter documentation.
>> > Regards
>> >
>> > On Fri, Oct 2, 2009 at 11:24 AM, douggiefox <paul@...>
>> wrote:
>> >
>> >>
>> >> I assume you mean the classes?
>> >>
>> >> They're grails domain classes looking like this:
>> >>
>> >> class QuotationParameters {
>> >>    Integer groupSize
>> >>
>> >>    static hasMany = [memberParameters:MemberParameters]
>> >>
>> >>    static constraints = {
>> >>    }
>> >> }
>> >>
>> >> class MemberParameters {
>> >>
>> >>    String name
>> >>
>> >>    static constraints = {
>> >>    }
>> >> }
>> >>
>> >> So QuotationParameters has a "set" of MemberParameters.  And it's
>> access
>> >> to
>> >> the MemberParameters that I'm having trouble with.
>> >>
>> >> Thanks
>> >>
>> >> DF
>> >>
>> >>
>> >> XMaNIaC wrote:
>> >> >
>> >> > How does the object look?
>> >> > Regards
>> >> >
>> >> > On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <paul@...>
>> >> wrote:
>> >> >
>> >> >>
>> >> >> Hi
>> >> >>
>> >> >> I'm having some issues with DWR.
>> >> >>
>> >> >> On my javascript side I've created an object that looks like this:
>> >> >>
>> >> >>             var quotationParameters = {
>> >> >>                 groupSize: 1,
>> >> >>                 memberParameters: [{name:'paul'},{name:'matthew'}]
>> >> >>             };
>> >> >>
>> >> >>
>> >> >> This is being correctly passed through to my Grails service, I have
>> a
>> >> >> signature that looks like this:
>> >> >>
>> >> >> def createQuotation(QuotationParameters quotationParameters)
>> >> >>
>> >> >> I can access quotationParameters.groupSize no problem.  However,
>> when
>> >> I
>> >> >> try
>> >> >> and access memberParameters I'm get references rather than values.
>> I
>> >> try
>> >> >> and access it like this:
>> >> >>
>> >> >> quotationParameters.memberParameters.each {
>> >> >>         println it.name
>> >> >> };
>> >> >>
>> >> >> Things go horribly wrong at the println.  The value of name seems
>> to
>> >> be
>> >> >> an
>> >> >> object reference ({name:reference:c0-e2}) rather than the value of
>> >> name.
>> >> >>
>> >> >> I'm not sure if I need to include a signature, and if so how to
>> format
>> >> >> it?
>> >> >>
>> >> >> Not really quite sure where to head.  Any ideas?
>> >> >>
>> >> >> Best DF
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
>> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: users-unsubscribe@...
>> >> >> For additional commands, e-mail: users-help@...
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
>> >> Sent from the DWR - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@...
>> >> For additional commands, e-mail: users-help@...
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Dwr-conversion-tp25711053p25714817.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: Dwr conversion

by douggiefox :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

static hasMany = [memberParameters:MemberParameters]

creates a HashSet which indeed contains a Map.

What are you suggesting by changing the JS generation?

Best DF

XMaNIaC wrote:
What's the Java generated for this declaration?
static hasMany = [memberParameters:MemberParameters]

If it is a list you're in the right track but if it's a map you must change
the JS generation

Regards

On Fri, Oct 2, 2009 at 2:16 PM, douggiefox <paul@javabytes.co.uk> wrote:

>
> Hi
>
> So near yet so far...
>
> My Javascript's now looking like this:
>
> var member = new MemberParameters();
> member.name = 'paul';
> var quotationParameters = new QuotationParameters();
> quotationParameters.groupSize = 1;
> quotationParameters.memberParameters = new Array();
> quotationParameters.memberParameters[0] = member;
>
> Which all seems fine.  I've run this through Firebug and everything is as I
> expect.
>
> Unfortunately, the remote function now fails to fire.  It's defined as:
>
> def createQuotation(QuotationParameters quotationParameters)
>
> Any more ideas?  Funny thing is when I defined the objects as o={} the
> method fired correctly.
>
> Thanks for the help so far.
>
> Best DF
>
>
>
> XMaNIaC wrote:
> >
> > Add a javascript="Whatever" to the converter declaration and create the
> JS
> > object like:
> > var myobj = new Whatever();
> >
> > instead of using:
> >
> > var o = {};
> >
> > This, of course, applies to nested objects as well.
> >
> > Regards
> >
> > On Fri, Oct 2, 2009 at 11:58 AM, douggiefox <paul@javabytes.co.uk>
> wrote:
> >
> >>
> >> Hi
> >>
> >> Thanks for the pointer.  I don't seem to be getting anywhere very
> >> quickly.
> >> Could anyone give me a pointer?  I'm just not clear on how to format a
> >> class
> >> mapper.
> >>
> >> Best
> >>
> >> DF
> >>
> >>
> >>
> >> XMaNIaC wrote:
> >> >
> >> > DWR won't be able to figure that kind of dynamic mappings without
> help.
> >> > See
> >> > class mappers in the converter documentation.
> >> > Regards
> >> >
> >> > On Fri, Oct 2, 2009 at 11:24 AM, douggiefox <paul@javabytes.co.uk>
> >> wrote:
> >> >
> >> >>
> >> >> I assume you mean the classes?
> >> >>
> >> >> They're grails domain classes looking like this:
> >> >>
> >> >> class QuotationParameters {
> >> >>    Integer groupSize
> >> >>
> >> >>    static hasMany = [memberParameters:MemberParameters]
> >> >>
> >> >>    static constraints = {
> >> >>    }
> >> >> }
> >> >>
> >> >> class MemberParameters {
> >> >>
> >> >>    String name
> >> >>
> >> >>    static constraints = {
> >> >>    }
> >> >> }
> >> >>
> >> >> So QuotationParameters has a "set" of MemberParameters.  And it's
> >> access
> >> >> to
> >> >> the MemberParameters that I'm having trouble with.
> >> >>
> >> >> Thanks
> >> >>
> >> >> DF
> >> >>
> >> >>
> >> >> XMaNIaC wrote:
> >> >> >
> >> >> > How does the object look?
> >> >> > Regards
> >> >> >
> >> >> > On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <paul@javabytes.co.uk>
> >> >> wrote:
> >> >> >
> >> >> >>
> >> >> >> Hi
> >> >> >>
> >> >> >> I'm having some issues with DWR.
> >> >> >>
> >> >> >> On my javascript side I've created an object that looks like this:
> >> >> >>
> >> >> >>             var quotationParameters = {
> >> >> >>                 groupSize: 1,
> >> >> >>                 memberParameters: [{name:'paul'},{name:'matthew'}]
> >> >> >>             };
> >> >> >>
> >> >> >>
> >> >> >> This is being correctly passed through to my Grails service, I
> have
> >> a
> >> >> >> signature that looks like this:
> >> >> >>
> >> >> >> def createQuotation(QuotationParameters quotationParameters)
> >> >> >>
> >> >> >> I can access quotationParameters.groupSize no problem.  However,
> >> when
> >> >> I
> >> >> >> try
> >> >> >> and access memberParameters I'm get references rather than values.
> >> I
> >> >> try
> >> >> >> and access it like this:
> >> >> >>
> >> >> >> quotationParameters.memberParameters.each {
> >> >> >>         println it.name
> >> >> >> };
> >> >> >>
> >> >> >> Things go horribly wrong at the println.  The value of name seems
> >> to
> >> >> be
> >> >> >> an
> >> >> >> object reference ({name:reference:c0-e2}) rather than the value of
> >> >> name.
> >> >> >>
> >> >> >> I'm not sure if I need to include a signature, and if so how to
> >> format
> >> >> >> it?
> >> >> >>
> >> >> >> Not really quite sure where to head.  Any ideas?
> >> >> >>
> >> >> >> Best DF
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> --
> >> >> >> View this message in context:
> >> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
> >> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >> >> >>
> >> >> >>
> >> >> >>
> >> ---------------------------------------------------------------------
> >> >> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> >> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Dwr-conversion-tp25711053p25714817.html
> Sent from the DWR - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> For additional commands, e-mail: users-help@dwr.dev.java.net
>
>

Re: Dwr conversion

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The map syntax is something like:

var map = {};
map["key"]  = value;

Regards

On Fri, Oct 2, 2009 at 2:41 PM, douggiefox <paul@...> wrote:

Hi

static hasMany = [memberParameters:MemberParameters]

creates a HashSet which indeed contains a Map.

What are you suggesting by changing the JS generation?

Best DF


XMaNIaC wrote:
>
> What's the Java generated for this declaration?
> static hasMany = [memberParameters:MemberParameters]
>
> If it is a list you're in the right track but if it's a map you must
> change
> the JS generation
>
> Regards
>
> On Fri, Oct 2, 2009 at 2:16 PM, douggiefox <paul@...> wrote:
>
>>
>> Hi
>>
>> So near yet so far...
>>
>> My Javascript's now looking like this:
>>
>> var member = new MemberParameters();
>> member.name = 'paul';
>> var quotationParameters = new QuotationParameters();
>> quotationParameters.groupSize = 1;
>> quotationParameters.memberParameters = new Array();
>> quotationParameters.memberParameters[0] = member;
>>
>> Which all seems fine.  I've run this through Firebug and everything is as
>> I
>> expect.
>>
>> Unfortunately, the remote function now fails to fire.  It's defined as:
>>
>> def createQuotation(QuotationParameters quotationParameters)
>>
>> Any more ideas?  Funny thing is when I defined the objects as o={} the
>> method fired correctly.
>>
>> Thanks for the help so far.
>>
>> Best DF
>>
>>
>>
>> XMaNIaC wrote:
>> >
>> > Add a javascript="Whatever" to the converter declaration and create the
>> JS
>> > object like:
>> > var myobj = new Whatever();
>> >
>> > instead of using:
>> >
>> > var o = {};
>> >
>> > This, of course, applies to nested objects as well.
>> >
>> > Regards
>> >
>> > On Fri, Oct 2, 2009 at 11:58 AM, douggiefox <paul@...>
>> wrote:
>> >
>> >>
>> >> Hi
>> >>
>> >> Thanks for the pointer.  I don't seem to be getting anywhere very
>> >> quickly.
>> >> Could anyone give me a pointer?  I'm just not clear on how to format a
>> >> class
>> >> mapper.
>> >>
>> >> Best
>> >>
>> >> DF
>> >>
>> >>
>> >>
>> >> XMaNIaC wrote:
>> >> >
>> >> > DWR won't be able to figure that kind of dynamic mappings without
>> help.
>> >> > See
>> >> > class mappers in the converter documentation.
>> >> > Regards
>> >> >
>> >> > On Fri, Oct 2, 2009 at 11:24 AM, douggiefox <paul@...>
>> >> wrote:
>> >> >
>> >> >>
>> >> >> I assume you mean the classes?
>> >> >>
>> >> >> They're grails domain classes looking like this:
>> >> >>
>> >> >> class QuotationParameters {
>> >> >>    Integer groupSize
>> >> >>
>> >> >>    static hasMany = [memberParameters:MemberParameters]
>> >> >>
>> >> >>    static constraints = {
>> >> >>    }
>> >> >> }
>> >> >>
>> >> >> class MemberParameters {
>> >> >>
>> >> >>    String name
>> >> >>
>> >> >>    static constraints = {
>> >> >>    }
>> >> >> }
>> >> >>
>> >> >> So QuotationParameters has a "set" of MemberParameters.  And it's
>> >> access
>> >> >> to
>> >> >> the MemberParameters that I'm having trouble with.
>> >> >>
>> >> >> Thanks
>> >> >>
>> >> >> DF
>> >> >>
>> >> >>
>> >> >> XMaNIaC wrote:
>> >> >> >
>> >> >> > How does the object look?
>> >> >> > Regards
>> >> >> >
>> >> >> > On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <paul@...>
>> >> >> wrote:
>> >> >> >
>> >> >> >>
>> >> >> >> Hi
>> >> >> >>
>> >> >> >> I'm having some issues with DWR.
>> >> >> >>
>> >> >> >> On my javascript side I've created an object that looks like
>> this:
>> >> >> >>
>> >> >> >>             var quotationParameters = {
>> >> >> >>                 groupSize: 1,
>> >> >> >>                 memberParameters:
>> [{name:'paul'},{name:'matthew'}]
>> >> >> >>             };
>> >> >> >>
>> >> >> >>
>> >> >> >> This is being correctly passed through to my Grails service, I
>> have
>> >> a
>> >> >> >> signature that looks like this:
>> >> >> >>
>> >> >> >> def createQuotation(QuotationParameters quotationParameters)
>> >> >> >>
>> >> >> >> I can access quotationParameters.groupSize no problem.  However,
>> >> when
>> >> >> I
>> >> >> >> try
>> >> >> >> and access memberParameters I'm get references rather than
>> values.
>> >> I
>> >> >> try
>> >> >> >> and access it like this:
>> >> >> >>
>> >> >> >> quotationParameters.memberParameters.each {
>> >> >> >>         println it.name
>> >> >> >> };
>> >> >> >>
>> >> >> >> Things go horribly wrong at the println.  The value of name
>> seems
>> >> to
>> >> >> be
>> >> >> >> an
>> >> >> >> object reference ({name:reference:c0-e2}) rather than the value
>> of
>> >> >> name.
>> >> >> >>
>> >> >> >> I'm not sure if I need to include a signature, and if so how to
>> >> format
>> >> >> >> it?
>> >> >> >>
>> >> >> >> Not really quite sure where to head.  Any ideas?
>> >> >> >>
>> >> >> >> Best DF
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> --
>> >> >> >> View this message in context:
>> >> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
>> >> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> ---------------------------------------------------------------------
>> >> >> >> To unsubscribe, e-mail: users-unsubscribe@...
>> >> >> >> For additional commands, e-mail: users-help@...
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
>> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: users-unsubscribe@...
>> >> >> For additional commands, e-mail: users-help@...
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
>> >> Sent from the DWR - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@...
>> >> For additional commands, e-mail: users-help@...
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Dwr-conversion-tp25711053p25714817.html
>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Dwr-conversion-tp25711053p25715165.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: Dwr conversion

by douggiefox :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

Are you suggesting something like this?

var member = {};
member["name"]  = 'paul';
var quotationParameters = {};
quotationParameters["groupSize"] = 1;
quotationParameters["memberParameters"] = new Array();
quotationParameters["memberParameters"][0] = member;

That puts me back exactly where I started :-(  I'm sure I've misunderstood you?

Best DF

XMaNIaC wrote:
The map syntax is something like:
var map = {};
map["key"]  = value;

Regards

On Fri, Oct 2, 2009 at 2:41 PM, douggiefox <paul@javabytes.co.uk> wrote:

>
> Hi
>
> static hasMany = [memberParameters:MemberParameters]
>
> creates a HashSet which indeed contains a Map.
>
> What are you suggesting by changing the JS generation?
>
> Best DF
>
>
> XMaNIaC wrote:
> >
> > What's the Java generated for this declaration?
> > static hasMany = [memberParameters:MemberParameters]
> >
> > If it is a list you're in the right track but if it's a map you must
> > change
> > the JS generation
> >
> > Regards
> >
> > On Fri, Oct 2, 2009 at 2:16 PM, douggiefox <paul@javabytes.co.uk> wrote:
> >
> >>
> >> Hi
> >>
> >> So near yet so far...
> >>
> >> My Javascript's now looking like this:
> >>
> >> var member = new MemberParameters();
> >> member.name = 'paul';
> >> var quotationParameters = new QuotationParameters();
> >> quotationParameters.groupSize = 1;
> >> quotationParameters.memberParameters = new Array();
> >> quotationParameters.memberParameters[0] = member;
> >>
> >> Which all seems fine.  I've run this through Firebug and everything is
> as
> >> I
> >> expect.
> >>
> >> Unfortunately, the remote function now fails to fire.  It's defined as:
> >>
> >> def createQuotation(QuotationParameters quotationParameters)
> >>
> >> Any more ideas?  Funny thing is when I defined the objects as o={} the
> >> method fired correctly.
> >>
> >> Thanks for the help so far.
> >>
> >> Best DF
> >>
> >>
> >>
> >> XMaNIaC wrote:
> >> >
> >> > Add a javascript="Whatever" to the converter declaration and create
> the
> >> JS
> >> > object like:
> >> > var myobj = new Whatever();
> >> >
> >> > instead of using:
> >> >
> >> > var o = {};
> >> >
> >> > This, of course, applies to nested objects as well.
> >> >
> >> > Regards
> >> >
> >> > On Fri, Oct 2, 2009 at 11:58 AM, douggiefox <paul@javabytes.co.uk>
> >> wrote:
> >> >
> >> >>
> >> >> Hi
> >> >>
> >> >> Thanks for the pointer.  I don't seem to be getting anywhere very
> >> >> quickly.
> >> >> Could anyone give me a pointer?  I'm just not clear on how to format
> a
> >> >> class
> >> >> mapper.
> >> >>
> >> >> Best
> >> >>
> >> >> DF
> >> >>
> >> >>
> >> >>
> >> >> XMaNIaC wrote:
> >> >> >
> >> >> > DWR won't be able to figure that kind of dynamic mappings without
> >> help.
> >> >> > See
> >> >> > class mappers in the converter documentation.
> >> >> > Regards
> >> >> >
> >> >> > On Fri, Oct 2, 2009 at 11:24 AM, douggiefox <paul@javabytes.co.uk>
> >> >> wrote:
> >> >> >
> >> >> >>
> >> >> >> I assume you mean the classes?
> >> >> >>
> >> >> >> They're grails domain classes looking like this:
> >> >> >>
> >> >> >> class QuotationParameters {
> >> >> >>    Integer groupSize
> >> >> >>
> >> >> >>    static hasMany = [memberParameters:MemberParameters]
> >> >> >>
> >> >> >>    static constraints = {
> >> >> >>    }
> >> >> >> }
> >> >> >>
> >> >> >> class MemberParameters {
> >> >> >>
> >> >> >>    String name
> >> >> >>
> >> >> >>    static constraints = {
> >> >> >>    }
> >> >> >> }
> >> >> >>
> >> >> >> So QuotationParameters has a "set" of MemberParameters.  And it's
> >> >> access
> >> >> >> to
> >> >> >> the MemberParameters that I'm having trouble with.
> >> >> >>
> >> >> >> Thanks
> >> >> >>
> >> >> >> DF
> >> >> >>
> >> >> >>
> >> >> >> XMaNIaC wrote:
> >> >> >> >
> >> >> >> > How does the object look?
> >> >> >> > Regards
> >> >> >> >
> >> >> >> > On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <
> paul@javabytes.co.uk>
> >> >> >> wrote:
> >> >> >> >
> >> >> >> >>
> >> >> >> >> Hi
> >> >> >> >>
> >> >> >> >> I'm having some issues with DWR.
> >> >> >> >>
> >> >> >> >> On my javascript side I've created an object that looks like
> >> this:
> >> >> >> >>
> >> >> >> >>             var quotationParameters = {
> >> >> >> >>                 groupSize: 1,
> >> >> >> >>                 memberParameters:
> >> [{name:'paul'},{name:'matthew'}]
> >> >> >> >>             };
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> This is being correctly passed through to my Grails service, I
> >> have
> >> >> a
> >> >> >> >> signature that looks like this:
> >> >> >> >>
> >> >> >> >> def createQuotation(QuotationParameters quotationParameters)
> >> >> >> >>
> >> >> >> >> I can access quotationParameters.groupSize no problem.
>  However,
> >> >> when
> >> >> >> I
> >> >> >> >> try
> >> >> >> >> and access memberParameters I'm get references rather than
> >> values.
> >> >> I
> >> >> >> try
> >> >> >> >> and access it like this:
> >> >> >> >>
> >> >> >> >> quotationParameters.memberParameters.each {
> >> >> >> >>         println it.name
> >> >> >> >> };
> >> >> >> >>
> >> >> >> >> Things go horribly wrong at the println.  The value of name
> >> seems
> >> >> to
> >> >> >> be
> >> >> >> >> an
> >> >> >> >> object reference ({name:reference:c0-e2}) rather than the value
> >> of
> >> >> >> name.
> >> >> >> >>
> >> >> >> >> I'm not sure if I need to include a signature, and if so how to
> >> >> format
> >> >> >> >> it?
> >> >> >> >>
> >> >> >> >> Not really quite sure where to head.  Any ideas?
> >> >> >> >>
> >> >> >> >> Best DF
> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> --
> >> >> >> >> View this message in context:
> >> >> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
> >> >> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> >> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> >> >> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >> >> >> >>
> >> >> >> >>
> >> >> >> >
> >> >> >> >
> >> >> >>
> >> >> >> --
> >> >> >> View this message in context:
> >> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
> >> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >> >> >>
> >> >> >>
> >> >> >>
> >> ---------------------------------------------------------------------
> >> >> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> >> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Dwr-conversion-tp25711053p25714817.html
> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Dwr-conversion-tp25711053p25715165.html
> Sent from the DWR - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> For additional commands, e-mail: users-help@dwr.dev.java.net
>
>

Re: Dwr conversion

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No, no. Beans must be created using the mapped object. Maps are not beans and are defined using the map syntax. It's a mix of both

Regards

On Fri, Oct 2, 2009 at 4:52 PM, douggiefox <paul@...> wrote:

Hi

Are you suggesting something like this?

var member = {};
member["name"]  = 'paul';
var quotationParameters = {};
quotationParameters["groupSize"] = 1;
quotationParameters["memberParameters"] = new Array();
quotationParameters["memberParameters"][0] = member;

That puts me back exactly where I started :-(  I'm sure I've misunderstood
you?

Best DF


XMaNIaC wrote:
>
> The map syntax is something like:
> var map = {};
> map["key"]  = value;
>
> Regards
>
> On Fri, Oct 2, 2009 at 2:41 PM, douggiefox <paul@...> wrote:
>
>>
>> Hi
>>
>> static hasMany = [memberParameters:MemberParameters]
>>
>> creates a HashSet which indeed contains a Map.
>>
>> What are you suggesting by changing the JS generation?
>>
>> Best DF
>>
>>
>> XMaNIaC wrote:
>> >
>> > What's the Java generated for this declaration?
>> > static hasMany = [memberParameters:MemberParameters]
>> >
>> > If it is a list you're in the right track but if it's a map you must
>> > change
>> > the JS generation
>> >
>> > Regards
>> >
>> > On Fri, Oct 2, 2009 at 2:16 PM, douggiefox <paul@...>
>> wrote:
>> >
>> >>
>> >> Hi
>> >>
>> >> So near yet so far...
>> >>
>> >> My Javascript's now looking like this:
>> >>
>> >> var member = new MemberParameters();
>> >> member.name = 'paul';
>> >> var quotationParameters = new QuotationParameters();
>> >> quotationParameters.groupSize = 1;
>> >> quotationParameters.memberParameters = new Array();
>> >> quotationParameters.memberParameters[0] = member;
>> >>
>> >> Which all seems fine.  I've run this through Firebug and everything is
>> as
>> >> I
>> >> expect.
>> >>
>> >> Unfortunately, the remote function now fails to fire.  It's defined
>> as:
>> >>
>> >> def createQuotation(QuotationParameters quotationParameters)
>> >>
>> >> Any more ideas?  Funny thing is when I defined the objects as o={} the
>> >> method fired correctly.
>> >>
>> >> Thanks for the help so far.
>> >>
>> >> Best DF
>> >>
>> >>
>> >>
>> >> XMaNIaC wrote:
>> >> >
>> >> > Add a javascript="Whatever" to the converter declaration and create
>> the
>> >> JS
>> >> > object like:
>> >> > var myobj = new Whatever();
>> >> >
>> >> > instead of using:
>> >> >
>> >> > var o = {};
>> >> >
>> >> > This, of course, applies to nested objects as well.
>> >> >
>> >> > Regards
>> >> >
>> >> > On Fri, Oct 2, 2009 at 11:58 AM, douggiefox <paul@...>
>> >> wrote:
>> >> >
>> >> >>
>> >> >> Hi
>> >> >>
>> >> >> Thanks for the pointer.  I don't seem to be getting anywhere very
>> >> >> quickly.
>> >> >> Could anyone give me a pointer?  I'm just not clear on how to
>> format
>> a
>> >> >> class
>> >> >> mapper.
>> >> >>
>> >> >> Best
>> >> >>
>> >> >> DF
>> >> >>
>> >> >>
>> >> >>
>> >> >> XMaNIaC wrote:
>> >> >> >
>> >> >> > DWR won't be able to figure that kind of dynamic mappings without
>> >> help.
>> >> >> > See
>> >> >> > class mappers in the converter documentation.
>> >> >> > Regards
>> >> >> >
>> >> >> > On Fri, Oct 2, 2009 at 11:24 AM, douggiefox
>> <paul@...>
>> >> >> wrote:
>> >> >> >
>> >> >> >>
>> >> >> >> I assume you mean the classes?
>> >> >> >>
>> >> >> >> They're grails domain classes looking like this:
>> >> >> >>
>> >> >> >> class QuotationParameters {
>> >> >> >>    Integer groupSize
>> >> >> >>
>> >> >> >>    static hasMany = [memberParameters:MemberParameters]
>> >> >> >>
>> >> >> >>    static constraints = {
>> >> >> >>    }
>> >> >> >> }
>> >> >> >>
>> >> >> >> class MemberParameters {
>> >> >> >>
>> >> >> >>    String name
>> >> >> >>
>> >> >> >>    static constraints = {
>> >> >> >>    }
>> >> >> >> }
>> >> >> >>
>> >> >> >> So QuotationParameters has a "set" of MemberParameters.  And
>> it's
>> >> >> access
>> >> >> >> to
>> >> >> >> the MemberParameters that I'm having trouble with.
>> >> >> >>
>> >> >> >> Thanks
>> >> >> >>
>> >> >> >> DF
>> >> >> >>
>> >> >> >>
>> >> >> >> XMaNIaC wrote:
>> >> >> >> >
>> >> >> >> > How does the object look?
>> >> >> >> > Regards
>> >> >> >> >
>> >> >> >> > On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <
>> paul@...>
>> >> >> >> wrote:
>> >> >> >> >
>> >> >> >> >>
>> >> >> >> >> Hi
>> >> >> >> >>
>> >> >> >> >> I'm having some issues with DWR.
>> >> >> >> >>
>> >> >> >> >> On my javascript side I've created an object that looks like
>> >> this:
>> >> >> >> >>
>> >> >> >> >>             var quotationParameters = {
>> >> >> >> >>                 groupSize: 1,
>> >> >> >> >>                 memberParameters:
>> >> [{name:'paul'},{name:'matthew'}]
>> >> >> >> >>             };
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >> This is being correctly passed through to my Grails service,
>> I
>> >> have
>> >> >> a
>> >> >> >> >> signature that looks like this:
>> >> >> >> >>
>> >> >> >> >> def createQuotation(QuotationParameters quotationParameters)
>> >> >> >> >>
>> >> >> >> >> I can access quotationParameters.groupSize no problem.
>>  However,
>> >> >> when
>> >> >> >> I
>> >> >> >> >> try
>> >> >> >> >> and access memberParameters I'm get references rather than
>> >> values.
>> >> >> I
>> >> >> >> try
>> >> >> >> >> and access it like this:
>> >> >> >> >>
>> >> >> >> >> quotationParameters.memberParameters.each {
>> >> >> >> >>         println it.name
>> >> >> >> >> };
>> >> >> >> >>
>> >> >> >> >> Things go horribly wrong at the println.  The value of name
>> >> seems
>> >> >> to
>> >> >> >> be
>> >> >> >> >> an
>> >> >> >> >> object reference ({name:reference:c0-e2}) rather than the
>> value
>> >> of
>> >> >> >> name.
>> >> >> >> >>
>> >> >> >> >> I'm not sure if I need to include a signature, and if so how
>> to
>> >> >> format
>> >> >> >> >> it?
>> >> >> >> >>
>> >> >> >> >> Not really quite sure where to head.  Any ideas?
>> >> >> >> >>
>> >> >> >> >> Best DF
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >> --
>> >> >> >> >> View this message in context:
>> >> >> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
>> >> >> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> >> >> To unsubscribe, e-mail: users-unsubscribe@...
>> >> >> >> >> For additional commands, e-mail: users-help@...
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >
>> >> >> >> >
>> >> >> >>
>> >> >> >> --
>> >> >> >> View this message in context:
>> >> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
>> >> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> ---------------------------------------------------------------------
>> >> >> >> To unsubscribe, e-mail: users-unsubscribe@...
>> >> >> >> For additional commands, e-mail: users-help@...
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
>> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: users-unsubscribe@...
>> >> >> For additional commands, e-mail: users-help@...
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Dwr-conversion-tp25711053p25714817.html
>> >> Sent from the DWR - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@...
>> >> For additional commands, e-mail: users-help@...
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Dwr-conversion-tp25711053p25715165.html
>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Dwr-conversion-tp25711053p25716510.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: Dwr conversion

by douggiefox :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

Think I should clarify.  

static hasMany = [memberParameters:MemberParameters]

results in a HashSet.  So for my domain classes means quotationParameters ends up with a set of memberParameters.

With all the experimentation, from your help, I end up with, if I define quotationParameters as o={} my exposed service method is found, quotationParameters is correctly defined but memberParameters has the fields defined but their values are object references and not the true values.

If I define quotationParameters and memberParameters as 0=new QuotationParameter() etc DWR fails to find the service method.

Best DF
   
XMaNIaC wrote:
No, no. Beans must be created using the mapped object. Maps are not beans
and are defined using the map syntax. It's a mix of both
Regards

On Fri, Oct 2, 2009 at 4:52 PM, douggiefox <paul@javabytes.co.uk> wrote:

>
> Hi
>
> Are you suggesting something like this?
>
> var member = {};
> member["name"]  = 'paul';
> var quotationParameters = {};
> quotationParameters["groupSize"] = 1;
> quotationParameters["memberParameters"] = new Array();
> quotationParameters["memberParameters"][0] = member;
>
> That puts me back exactly where I started :-(  I'm sure I've misunderstood
> you?
>
> Best DF
>
>
> XMaNIaC wrote:
> >
> > The map syntax is something like:
> > var map = {};
> > map["key"]  = value;
> >
> > Regards
> >
> > On Fri, Oct 2, 2009 at 2:41 PM, douggiefox <paul@javabytes.co.uk> wrote:
> >
> >>
> >> Hi
> >>
> >> static hasMany = [memberParameters:MemberParameters]
> >>
> >> creates a HashSet which indeed contains a Map.
> >>
> >> What are you suggesting by changing the JS generation?
> >>
> >> Best DF
> >>
> >>
> >> XMaNIaC wrote:
> >> >
> >> > What's the Java generated for this declaration?
> >> > static hasMany = [memberParameters:MemberParameters]
> >> >
> >> > If it is a list you're in the right track but if it's a map you must
> >> > change
> >> > the JS generation
> >> >
> >> > Regards
> >> >
> >> > On Fri, Oct 2, 2009 at 2:16 PM, douggiefox <paul@javabytes.co.uk>
> >> wrote:
> >> >
> >> >>
> >> >> Hi
> >> >>
> >> >> So near yet so far...
> >> >>
> >> >> My Javascript's now looking like this:
> >> >>
> >> >> var member = new MemberParameters();
> >> >> member.name = 'paul';
> >> >> var quotationParameters = new QuotationParameters();
> >> >> quotationParameters.groupSize = 1;
> >> >> quotationParameters.memberParameters = new Array();
> >> >> quotationParameters.memberParameters[0] = member;
> >> >>
> >> >> Which all seems fine.  I've run this through Firebug and everything
> is
> >> as
> >> >> I
> >> >> expect.
> >> >>
> >> >> Unfortunately, the remote function now fails to fire.  It's defined
> >> as:
> >> >>
> >> >> def createQuotation(QuotationParameters quotationParameters)
> >> >>
> >> >> Any more ideas?  Funny thing is when I defined the objects as o={}
> the
> >> >> method fired correctly.
> >> >>
> >> >> Thanks for the help so far.
> >> >>
> >> >> Best DF
> >> >>
> >> >>
> >> >>
> >> >> XMaNIaC wrote:
> >> >> >
> >> >> > Add a javascript="Whatever" to the converter declaration and create
> >> the
> >> >> JS
> >> >> > object like:
> >> >> > var myobj = new Whatever();
> >> >> >
> >> >> > instead of using:
> >> >> >
> >> >> > var o = {};
> >> >> >
> >> >> > This, of course, applies to nested objects as well.
> >> >> >
> >> >> > Regards
> >> >> >
> >> >> > On Fri, Oct 2, 2009 at 11:58 AM, douggiefox <paul@javabytes.co.uk>
> >> >> wrote:
> >> >> >
> >> >> >>
> >> >> >> Hi
> >> >> >>
> >> >> >> Thanks for the pointer.  I don't seem to be getting anywhere very
> >> >> >> quickly.
> >> >> >> Could anyone give me a pointer?  I'm just not clear on how to
> >> format
> >> a
> >> >> >> class
> >> >> >> mapper.
> >> >> >>
> >> >> >> Best
> >> >> >>
> >> >> >> DF
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> XMaNIaC wrote:
> >> >> >> >
> >> >> >> > DWR won't be able to figure that kind of dynamic mappings
> without
> >> >> help.
> >> >> >> > See
> >> >> >> > class mappers in the converter documentation.
> >> >> >> > Regards
> >> >> >> >
> >> >> >> > On Fri, Oct 2, 2009 at 11:24 AM, douggiefox
> >> <paul@javabytes.co.uk>
> >> >> >> wrote:
> >> >> >> >
> >> >> >> >>
> >> >> >> >> I assume you mean the classes?
> >> >> >> >>
> >> >> >> >> They're grails domain classes looking like this:
> >> >> >> >>
> >> >> >> >> class QuotationParameters {
> >> >> >> >>    Integer groupSize
> >> >> >> >>
> >> >> >> >>    static hasMany = [memberParameters:MemberParameters]
> >> >> >> >>
> >> >> >> >>    static constraints = {
> >> >> >> >>    }
> >> >> >> >> }
> >> >> >> >>
> >> >> >> >> class MemberParameters {
> >> >> >> >>
> >> >> >> >>    String name
> >> >> >> >>
> >> >> >> >>    static constraints = {
> >> >> >> >>    }
> >> >> >> >> }
> >> >> >> >>
> >> >> >> >> So QuotationParameters has a "set" of MemberParameters.  And
> >> it's
> >> >> >> access
> >> >> >> >> to
> >> >> >> >> the MemberParameters that I'm having trouble with.
> >> >> >> >>
> >> >> >> >> Thanks
> >> >> >> >>
> >> >> >> >> DF
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> XMaNIaC wrote:
> >> >> >> >> >
> >> >> >> >> > How does the object look?
> >> >> >> >> > Regards
> >> >> >> >> >
> >> >> >> >> > On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <
> >> paul@javabytes.co.uk>
> >> >> >> >> wrote:
> >> >> >> >> >
> >> >> >> >> >>
> >> >> >> >> >> Hi
> >> >> >> >> >>
> >> >> >> >> >> I'm having some issues with DWR.
> >> >> >> >> >>
> >> >> >> >> >> On my javascript side I've created an object that looks like
> >> >> this:
> >> >> >> >> >>
> >> >> >> >> >>             var quotationParameters = {
> >> >> >> >> >>                 groupSize: 1,
> >> >> >> >> >>                 memberParameters:
> >> >> [{name:'paul'},{name:'matthew'}]
> >> >> >> >> >>             };
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >> This is being correctly passed through to my Grails service,
> >> I
> >> >> have
> >> >> >> a
> >> >> >> >> >> signature that looks like this:
> >> >> >> >> >>
> >> >> >> >> >> def createQuotation(QuotationParameters quotationParameters)
> >> >> >> >> >>
> >> >> >> >> >> I can access quotationParameters.groupSize no problem.
> >>  However,
> >> >> >> when
> >> >> >> >> I
> >> >> >> >> >> try
> >> >> >> >> >> and access memberParameters I'm get references rather than
> >> >> values.
> >> >> >> I
> >> >> >> >> try
> >> >> >> >> >> and access it like this:
> >> >> >> >> >>
> >> >> >> >> >> quotationParameters.memberParameters.each {
> >> >> >> >> >>         println it.name
> >> >> >> >> >> };
> >> >> >> >> >>
> >> >> >> >> >> Things go horribly wrong at the println.  The value of name
> >> >> seems
> >> >> >> to
> >> >> >> >> be
> >> >> >> >> >> an
> >> >> >> >> >> object reference ({name:reference:c0-e2}) rather than the
> >> value
> >> >> of
> >> >> >> >> name.
> >> >> >> >> >>
> >> >> >> >> >> I'm not sure if I need to include a signature, and if so how
> >> to
> >> >> >> format
> >> >> >> >> >> it?
> >> >> >> >> >>
> >> >> >> >> >> Not really quite sure where to head.  Any ideas?
> >> >> >> >> >>
> >> >> >> >> >> Best DF
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >> --
> >> >> >> >> >> View this message in context:
> >> >> >> >> >>
> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
> >> >> >> >> >> Sent from the DWR - Users mailing list archive at
> Nabble.com.
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >>
> >> ---------------------------------------------------------------------
> >> >> >> >> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> >> >> >> >> For additional commands, e-mail:
> users-help@dwr.dev.java.net
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >
> >> >> >> >> >
> >> >> >> >>
> >> >> >> >> --
> >> >> >> >> View this message in context:
> >> >> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
> >> >> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >> >> >> >>
> >> >> >> >>
> >> >> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> >> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> >> >> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >> >> >> >>
> >> >> >> >>
> >> >> >> >
> >> >> >> >
> >> >> >>
> >> >> >> --
> >> >> >> View this message in context:
> >> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
> >> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >> >> >>
> >> >> >>
> >> >> >>
> >> ---------------------------------------------------------------------
> >> >> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> >> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >> >> >>
> >> >> >>
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/Dwr-conversion-tp25711053p25714817.html
> >> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Dwr-conversion-tp25711053p25715165.html
> >> Sent from the DWR - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> >> For additional commands, e-mail: users-help@dwr.dev.java.net
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Dwr-conversion-tp25711053p25716510.html
> Sent from the DWR - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> For additional commands, e-mail: users-help@dwr.dev.java.net
>
>

Re: Dwr conversion

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Send us your dwr configuration (dwr.xml).

douggiefox wrote:

> Hi
>
> Think I should clarify.  
>
> static hasMany = [memberParameters:MemberParameters]
>
> results in a HashSet.  So for my domain classes means quotationParameters
> ends up with a set of memberParameters.
>
> With all the experimentation, from your help, I end up with, if I define
> quotationParameters as o={} my exposed service method is found,
> quotationParameters is correctly defined but memberParameters has the fields
> defined but their values are object references and not the true values.
>
> If I define quotationParameters and memberParameters as 0=new
> QuotationParameter() etc DWR fails to find the service method.
>
> Best DF
>    
>
> XMaNIaC wrote:
>  
>> No, no. Beans must be created using the mapped object. Maps are not beans
>> and are defined using the map syntax. It's a mix of both
>> Regards
>>
>> On Fri, Oct 2, 2009 at 4:52 PM, douggiefox <paul@...> wrote:
>>
>>    
>>> Hi
>>>
>>> Are you suggesting something like this?
>>>
>>> var member = {};
>>> member["name"]  = 'paul';
>>> var quotationParameters = {};
>>> quotationParameters["groupSize"] = 1;
>>> quotationParameters["memberParameters"] = new Array();
>>> quotationParameters["memberParameters"][0] = member;
>>>
>>> That puts me back exactly where I started :-(  I'm sure I've
>>> misunderstood
>>> you?
>>>
>>> Best DF
>>>
>>>
>>> XMaNIaC wrote:
>>>      
>>>> The map syntax is something like:
>>>> var map = {};
>>>> map["key"]  = value;
>>>>
>>>> Regards
>>>>
>>>> On Fri, Oct 2, 2009 at 2:41 PM, douggiefox <paul@...>
>>>>        
>>> wrote:
>>>      
>>>>> Hi
>>>>>
>>>>> static hasMany = [memberParameters:MemberParameters]
>>>>>
>>>>> creates a HashSet which indeed contains a Map.
>>>>>
>>>>> What are you suggesting by changing the JS generation?
>>>>>
>>>>> Best DF
>>>>>
>>>>>
>>>>> XMaNIaC wrote:
>>>>>          
>>>>>> What's the Java generated for this declaration?
>>>>>> static hasMany = [memberParameters:MemberParameters]
>>>>>>
>>>>>> If it is a list you're in the right track but if it's a map you must
>>>>>> change
>>>>>> the JS generation
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> On Fri, Oct 2, 2009 at 2:16 PM, douggiefox <paul@...>
>>>>>>            
>>>>> wrote:
>>>>>          
>>>>>>> Hi
>>>>>>>
>>>>>>> So near yet so far...
>>>>>>>
>>>>>>> My Javascript's now looking like this:
>>>>>>>
>>>>>>> var member = new MemberParameters();
>>>>>>> member.name = 'paul';
>>>>>>> var quotationParameters = new QuotationParameters();
>>>>>>> quotationParameters.groupSize = 1;
>>>>>>> quotationParameters.memberParameters = new Array();
>>>>>>> quotationParameters.memberParameters[0] = member;
>>>>>>>
>>>>>>> Which all seems fine.  I've run this through Firebug and everything
>>>>>>>              
>>> is
>>>      
>>>>> as
>>>>>          
>>>>>>> I
>>>>>>> expect.
>>>>>>>
>>>>>>> Unfortunately, the remote function now fails to fire.  It's defined
>>>>>>>              
>>>>> as:
>>>>>          
>>>>>>> def createQuotation(QuotationParameters quotationParameters)
>>>>>>>
>>>>>>> Any more ideas?  Funny thing is when I defined the objects as o={}
>>>>>>>              
>>> the
>>>      
>>>>>>> method fired correctly.
>>>>>>>
>>>>>>> Thanks for the help so far.
>>>>>>>
>>>>>>> Best DF
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> XMaNIaC wrote:
>>>>>>>              
>>>>>>>> Add a javascript="Whatever" to the converter declaration and
>>>>>>>>                
>>> create
>>>      
>>>>> the
>>>>>          
>>>>>>> JS
>>>>>>>              
>>>>>>>> object like:
>>>>>>>> var myobj = new Whatever();
>>>>>>>>
>>>>>>>> instead of using:
>>>>>>>>
>>>>>>>> var o = {};
>>>>>>>>
>>>>>>>> This, of course, applies to nested objects as well.
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> On Fri, Oct 2, 2009 at 11:58 AM, douggiefox
>>>>>>>>                
>>> <paul@...>
>>>      
>>>>>>> wrote:
>>>>>>>              
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> Thanks for the pointer.  I don't seem to be getting anywhere
>>>>>>>>>                  
>>> very
>>>      
>>>>>>>>> quickly.
>>>>>>>>> Could anyone give me a pointer?  I'm just not clear on how to
>>>>>>>>>                  
>>>>> format
>>>>> a
>>>>>          
>>>>>>>>> class
>>>>>>>>> mapper.
>>>>>>>>>
>>>>>>>>> Best
>>>>>>>>>
>>>>>>>>> DF
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>                  
>>>>>>>>>> DWR won't be able to figure that kind of dynamic mappings
>>>>>>>>>>                    
>>> without
>>>      
>>>>>>> help.
>>>>>>>              
>>>>>>>>>> See
>>>>>>>>>> class mappers in the converter documentation.
>>>>>>>>>> Regards
>>>>>>>>>>
>>>>>>>>>> On Fri, Oct 2, 2009 at 11:24 AM, douggiefox
>>>>>>>>>>                    
>>>>> <paul@...>
>>>>>          
>>>>>>>>> wrote:
>>>>>>>>>                  
>>>>>>>>>>> I assume you mean the classes?
>>>>>>>>>>>
>>>>>>>>>>> They're grails domain classes looking like this:
>>>>>>>>>>>
>>>>>>>>>>> class QuotationParameters {
>>>>>>>>>>>    Integer groupSize
>>>>>>>>>>>
>>>>>>>>>>>    static hasMany = [memberParameters:MemberParameters]
>>>>>>>>>>>
>>>>>>>>>>>    static constraints = {
>>>>>>>>>>>    }
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> class MemberParameters {
>>>>>>>>>>>
>>>>>>>>>>>    String name
>>>>>>>>>>>
>>>>>>>>>>>    static constraints = {
>>>>>>>>>>>    }
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> So QuotationParameters has a "set" of MemberParameters.  And
>>>>>>>>>>>                      
>>>>> it's
>>>>>          
>>>>>>>>> access
>>>>>>>>>                  
>>>>>>>>>>> to
>>>>>>>>>>> the MemberParameters that I'm having trouble with.
>>>>>>>>>>>
>>>>>>>>>>> Thanks
>>>>>>>>>>>
>>>>>>>>>>> DF
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>>>                      
>>>>>>>>>>>> How does the object look?
>>>>>>>>>>>> Regards
>>>>>>>>>>>>
>>>>>>>>>>>> On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <
>>>>>>>>>>>>                        
>>>>> paul@...>
>>>>>          
>>>>>>>>>>> wrote:
>>>>>>>>>>>                      
>>>>>>>>>>>>> Hi
>>>>>>>>>>>>>
>>>>>>>>>>>>> I'm having some issues with DWR.
>>>>>>>>>>>>>
>>>>>>>>>>>>> On my javascript side I've created an object that looks
>>>>>>>>>>>>>                          
>>> like
>>>      
>>>>>>> this:
>>>>>>>              
>>>>>>>>>>>>>             var quotationParameters = {
>>>>>>>>>>>>>                 groupSize: 1,
>>>>>>>>>>>>>                 memberParameters:
>>>>>>>>>>>>>                          
>>>>>>> [{name:'paul'},{name:'matthew'}]
>>>>>>>              
>>>>>>>>>>>>>             };
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> This is being correctly passed through to my Grails
>>>>>>>>>>>>>                          
>>> service,
>>>      
>>>>> I
>>>>>          
>>>>>>> have
>>>>>>>              
>>>>>>>>> a
>>>>>>>>>                  
>>>>>>>>>>>>> signature that looks like this:
>>>>>>>>>>>>>
>>>>>>>>>>>>> def createQuotation(QuotationParameters
>>>>>>>>>>>>>                          
>>> quotationParameters)
>>>      
>>>>>>>>>>>>> I can access quotationParameters.groupSize no problem.
>>>>>>>>>>>>>                          
>>>>>  However,
>>>>>          
>>>>>>>>> when
>>>>>>>>>                  
>>>>>>>>>>> I
>>>>>>>>>>>                      
>>>>>>>>>>>>> try
>>>>>>>>>>>>> and access memberParameters I'm get references rather than
>>>>>>>>>>>>>                          
>>>>>>> values.
>>>>>>>              
>>>>>>>>> I
>>>>>>>>>                  
>>>>>>>>>>> try
>>>>>>>>>>>                      
>>>>>>>>>>>>> and access it like this:
>>>>>>>>>>>>>
>>>>>>>>>>>>> quotationParameters.memberParameters.each {
>>>>>>>>>>>>>         println it.name
>>>>>>>>>>>>> };
>>>>>>>>>>>>>
>>>>>>>>>>>>> Things go horribly wrong at the println.  The value of
>>>>>>>>>>>>>                          
>>> name
>>>      
>>>>>>> seems
>>>>>>>              
>>>>>>>>> to
>>>>>>>>>                  
>>>>>>>>>>> be
>>>>>>>>>>>                      
>>>>>>>>>>>>> an
>>>>>>>>>>>>> object reference ({name:reference:c0-e2}) rather than the
>>>>>>>>>>>>>                          
>>>>> value
>>>>>          
>>>>>>> of
>>>>>>>              
>>>>>>>>>>> name.
>>>>>>>>>>>                      
>>>>>>>>>>>>> I'm not sure if I need to include a signature, and if so
>>>>>>>>>>>>>                          
>>> how
>>>      
>>>>> to
>>>>>          
>>>>>>>>> format
>>>>>>>>>                  
>>>>>>>>>>>>> it?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Not really quite sure where to head.  Any ideas?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Best DF
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>>>
>>>>>>>>>>>>>                          
>>> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
>>>      
>>>>>>>>>>>>> Sent from the DWR - Users mailing list archive at
>>>>>>>>>>>>>                          
>>> Nabble.com.
>>>      
>>>>>>>>>>>>>
>>>>>>>>>>>>>                          
>>>>> ---------------------------------------------------------------------
>>>>>          
>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>>>>>>>> For additional commands, e-mail:
>>>>>>>>>>>>>                          
>>> users-help@...
>>>      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>                        
>>>>>>>>>>> --
>>>>>>>>>>> View this message in context:
>>>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
>>>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>> ---------------------------------------------------------------------
>>>      
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>                    
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                  
>>>>> ---------------------------------------------------------------------
>>>>>          
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                  
>>>>>>>>                
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25714817.html
>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>> ---------------------------------------------------------------------
>>>      
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>            
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25715165.html
>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>> For additional commands, e-mail: users-help@...
>>>>>
>>>>>
>>>>>          
>>>>        
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Dwr-conversion-tp25711053p25716510.html
>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@...
>>> For additional commands, e-mail: users-help@...
>>>
>>>
>>>      
>>    
>
>  



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4478 (20091003) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Dwr conversion

by douggiefox :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

It's configured in Grails;

  def dwrconfig = {

      service(name:'quotationService', javascript:'QuotationService') {
                        exclude('setMetaClass,getMetaClass,setProperty,getProperty')
                }

        convert(converter:'bean',match:'com.xxx.phc.QuotationParameters', javascript:"QuotationParameters")
        convert(converter:'bean',match:'com.xxx.MemberParameters', javascript:"MemberParameters")

    }

Best DF

davidmarginian wrote:
Send us your dwr configuration (dwr.xml).

douggiefox wrote:
> Hi
>
> Think I should clarify.  
>
> static hasMany = [memberParameters:MemberParameters]
>
> results in a HashSet.  So for my domain classes means quotationParameters
> ends up with a set of memberParameters.
>
> With all the experimentation, from your help, I end up with, if I define
> quotationParameters as o={} my exposed service method is found,
> quotationParameters is correctly defined but memberParameters has the fields
> defined but their values are object references and not the true values.
>
> If I define quotationParameters and memberParameters as 0=new
> QuotationParameter() etc DWR fails to find the service method.
>
> Best DF
>    
>
> XMaNIaC wrote:
>  
>> No, no. Beans must be created using the mapped object. Maps are not beans
>> and are defined using the map syntax. It's a mix of both
>> Regards
>>
>> On Fri, Oct 2, 2009 at 4:52 PM, douggiefox <paul@javabytes.co.uk> wrote:
>>
>>    
>>> Hi
>>>
>>> Are you suggesting something like this?
>>>
>>> var member = {};
>>> member["name"]  = 'paul';
>>> var quotationParameters = {};
>>> quotationParameters["groupSize"] = 1;
>>> quotationParameters["memberParameters"] = new Array();
>>> quotationParameters["memberParameters"][0] = member;
>>>
>>> That puts me back exactly where I started :-(  I'm sure I've
>>> misunderstood
>>> you?
>>>
>>> Best DF
>>>
>>>
>>> XMaNIaC wrote:
>>>      
>>>> The map syntax is something like:
>>>> var map = {};
>>>> map["key"]  = value;
>>>>
>>>> Regards
>>>>
>>>> On Fri, Oct 2, 2009 at 2:41 PM, douggiefox <paul@javabytes.co.uk>
>>>>        
>>> wrote:
>>>      
>>>>> Hi
>>>>>
>>>>> static hasMany = [memberParameters:MemberParameters]
>>>>>
>>>>> creates a HashSet which indeed contains a Map.
>>>>>
>>>>> What are you suggesting by changing the JS generation?
>>>>>
>>>>> Best DF
>>>>>
>>>>>
>>>>> XMaNIaC wrote:
>>>>>          
>>>>>> What's the Java generated for this declaration?
>>>>>> static hasMany = [memberParameters:MemberParameters]
>>>>>>
>>>>>> If it is a list you're in the right track but if it's a map you must
>>>>>> change
>>>>>> the JS generation
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> On Fri, Oct 2, 2009 at 2:16 PM, douggiefox <paul@javabytes.co.uk>
>>>>>>            
>>>>> wrote:
>>>>>          
>>>>>>> Hi
>>>>>>>
>>>>>>> So near yet so far...
>>>>>>>
>>>>>>> My Javascript's now looking like this:
>>>>>>>
>>>>>>> var member = new MemberParameters();
>>>>>>> member.name = 'paul';
>>>>>>> var quotationParameters = new QuotationParameters();
>>>>>>> quotationParameters.groupSize = 1;
>>>>>>> quotationParameters.memberParameters = new Array();
>>>>>>> quotationParameters.memberParameters[0] = member;
>>>>>>>
>>>>>>> Which all seems fine.  I've run this through Firebug and everything
>>>>>>>              
>>> is
>>>      
>>>>> as
>>>>>          
>>>>>>> I
>>>>>>> expect.
>>>>>>>
>>>>>>> Unfortunately, the remote function now fails to fire.  It's defined
>>>>>>>              
>>>>> as:
>>>>>          
>>>>>>> def createQuotation(QuotationParameters quotationParameters)
>>>>>>>
>>>>>>> Any more ideas?  Funny thing is when I defined the objects as o={}
>>>>>>>              
>>> the
>>>      
>>>>>>> method fired correctly.
>>>>>>>
>>>>>>> Thanks for the help so far.
>>>>>>>
>>>>>>> Best DF
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> XMaNIaC wrote:
>>>>>>>              
>>>>>>>> Add a javascript="Whatever" to the converter declaration and
>>>>>>>>                
>>> create
>>>      
>>>>> the
>>>>>          
>>>>>>> JS
>>>>>>>              
>>>>>>>> object like:
>>>>>>>> var myobj = new Whatever();
>>>>>>>>
>>>>>>>> instead of using:
>>>>>>>>
>>>>>>>> var o = {};
>>>>>>>>
>>>>>>>> This, of course, applies to nested objects as well.
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> On Fri, Oct 2, 2009 at 11:58 AM, douggiefox
>>>>>>>>                
>>> <paul@javabytes.co.uk>
>>>      
>>>>>>> wrote:
>>>>>>>              
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> Thanks for the pointer.  I don't seem to be getting anywhere
>>>>>>>>>                  
>>> very
>>>      
>>>>>>>>> quickly.
>>>>>>>>> Could anyone give me a pointer?  I'm just not clear on how to
>>>>>>>>>                  
>>>>> format
>>>>> a
>>>>>          
>>>>>>>>> class
>>>>>>>>> mapper.
>>>>>>>>>
>>>>>>>>> Best
>>>>>>>>>
>>>>>>>>> DF
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>                  
>>>>>>>>>> DWR won't be able to figure that kind of dynamic mappings
>>>>>>>>>>                    
>>> without
>>>      
>>>>>>> help.
>>>>>>>              
>>>>>>>>>> See
>>>>>>>>>> class mappers in the converter documentation.
>>>>>>>>>> Regards
>>>>>>>>>>
>>>>>>>>>> On Fri, Oct 2, 2009 at 11:24 AM, douggiefox
>>>>>>>>>>                    
>>>>> <paul@javabytes.co.uk>
>>>>>          
>>>>>>>>> wrote:
>>>>>>>>>                  
>>>>>>>>>>> I assume you mean the classes?
>>>>>>>>>>>
>>>>>>>>>>> They're grails domain classes looking like this:
>>>>>>>>>>>
>>>>>>>>>>> class QuotationParameters {
>>>>>>>>>>>    Integer groupSize
>>>>>>>>>>>
>>>>>>>>>>>    static hasMany = [memberParameters:MemberParameters]
>>>>>>>>>>>
>>>>>>>>>>>    static constraints = {
>>>>>>>>>>>    }
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> class MemberParameters {
>>>>>>>>>>>
>>>>>>>>>>>    String name
>>>>>>>>>>>
>>>>>>>>>>>    static constraints = {
>>>>>>>>>>>    }
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> So QuotationParameters has a "set" of MemberParameters.  And
>>>>>>>>>>>                      
>>>>> it's
>>>>>          
>>>>>>>>> access
>>>>>>>>>                  
>>>>>>>>>>> to
>>>>>>>>>>> the MemberParameters that I'm having trouble with.
>>>>>>>>>>>
>>>>>>>>>>> Thanks
>>>>>>>>>>>
>>>>>>>>>>> DF
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>>>                      
>>>>>>>>>>>> How does the object look?
>>>>>>>>>>>> Regards
>>>>>>>>>>>>
>>>>>>>>>>>> On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <
>>>>>>>>>>>>                        
>>>>> paul@javabytes.co.uk>
>>>>>          
>>>>>>>>>>> wrote:
>>>>>>>>>>>                      
>>>>>>>>>>>>> Hi
>>>>>>>>>>>>>
>>>>>>>>>>>>> I'm having some issues with DWR.
>>>>>>>>>>>>>
>>>>>>>>>>>>> On my javascript side I've created an object that looks
>>>>>>>>>>>>>                          
>>> like
>>>      
>>>>>>> this:
>>>>>>>              
>>>>>>>>>>>>>             var quotationParameters = {
>>>>>>>>>>>>>                 groupSize: 1,
>>>>>>>>>>>>>                 memberParameters:
>>>>>>>>>>>>>                          
>>>>>>> [{name:'paul'},{name:'matthew'}]
>>>>>>>              
>>>>>>>>>>>>>             };
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> This is being correctly passed through to my Grails
>>>>>>>>>>>>>                          
>>> service,
>>>      
>>>>> I
>>>>>          
>>>>>>> have
>>>>>>>              
>>>>>>>>> a
>>>>>>>>>                  
>>>>>>>>>>>>> signature that looks like this:
>>>>>>>>>>>>>
>>>>>>>>>>>>> def createQuotation(QuotationParameters
>>>>>>>>>>>>>                          
>>> quotationParameters)
>>>      
>>>>>>>>>>>>> I can access quotationParameters.groupSize no problem.
>>>>>>>>>>>>>                          
>>>>>  However,
>>>>>          
>>>>>>>>> when
>>>>>>>>>                  
>>>>>>>>>>> I
>>>>>>>>>>>                      
>>>>>>>>>>>>> try
>>>>>>>>>>>>> and access memberParameters I'm get references rather than
>>>>>>>>>>>>>                          
>>>>>>> values.
>>>>>>>              
>>>>>>>>> I
>>>>>>>>>                  
>>>>>>>>>>> try
>>>>>>>>>>>                      
>>>>>>>>>>>>> and access it like this:
>>>>>>>>>>>>>
>>>>>>>>>>>>> quotationParameters.memberParameters.each {
>>>>>>>>>>>>>         println it.name
>>>>>>>>>>>>> };
>>>>>>>>>>>>>
>>>>>>>>>>>>> Things go horribly wrong at the println.  The value of
>>>>>>>>>>>>>                          
>>> name
>>>      
>>>>>>> seems
>>>>>>>              
>>>>>>>>> to
>>>>>>>>>                  
>>>>>>>>>>> be
>>>>>>>>>>>                      
>>>>>>>>>>>>> an
>>>>>>>>>>>>> object reference ({name:reference:c0-e2}) rather than the
>>>>>>>>>>>>>                          
>>>>> value
>>>>>          
>>>>>>> of
>>>>>>>              
>>>>>>>>>>> name.
>>>>>>>>>>>                      
>>>>>>>>>>>>> I'm not sure if I need to include a signature, and if so
>>>>>>>>>>>>>                          
>>> how
>>>      
>>>>> to
>>>>>          
>>>>>>>>> format
>>>>>>>>>                  
>>>>>>>>>>>>> it?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Not really quite sure where to head.  Any ideas?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Best DF
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>>>
>>>>>>>>>>>>>                          
>>> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
>>>      
>>>>>>>>>>>>> Sent from the DWR - Users mailing list archive at
>>>>>>>>>>>>>                          
>>> Nabble.com.
>>>      
>>>>>>>>>>>>>
>>>>>>>>>>>>>                          
>>>>> ---------------------------------------------------------------------
>>>>>          
>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>>>>>>>>>>>>> For additional commands, e-mail:
>>>>>>>>>>>>>                          
>>> users-help@dwr.dev.java.net
>>>      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>                        
>>>>>>>>>>> --
>>>>>>>>>>> View this message in context:
>>>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
>>>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>> ---------------------------------------------------------------------
>>>      
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>>>>>>>>>>> For additional commands, e-mail: users-help@dwr.dev.java.net
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                      
>>>>>>>>>>                    
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                  
>>>>> ---------------------------------------------------------------------
>>>>>          
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>>>>>>>>> For additional commands, e-mail: users-help@dwr.dev.java.net
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                  
>>>>>>>>                
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25714817.html
>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>> ---------------------------------------------------------------------
>>>      
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>>>>>>> For additional commands, e-mail: users-help@dwr.dev.java.net
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>            
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25715165.html
>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>>>>> For additional commands, e-mail: users-help@dwr.dev.java.net
>>>>>
>>>>>
>>>>>          
>>>>        
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Dwr-conversion-tp25711053p25716510.html
>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>>> For additional commands, e-mail: users-help@dwr.dev.java.net
>>>
>>>
>>>      
>>    
>
>  



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4478 (20091003) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
For additional commands, e-mail: users-help@dwr.dev.java.net

Re: Dwr conversion

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Send:
1) The Java code for the remote method you are calling, and any
parameters that method takes.
2) The JavaScript you are using to build the parameters.


douggiefox wrote:

> Hi
>
> It's configured in Grails;
>
>   def dwrconfig = {
>
>       service(name:'quotationService', javascript:'QuotationService') {
> exclude('setMetaClass,getMetaClass,setProperty,getProperty')
> }
>
>         convert(converter:'bean',match:'com.xxx.phc.QuotationParameters',
> javascript:"QuotationParameters")
>         convert(converter:'bean',match:'com.xxx.MemberParameters',
> javascript:"MemberParameters")
>
>     }
>
> Best DF
>
>
> davidmarginian wrote:
>  
>> Send us your dwr configuration (dwr.xml).
>>
>> douggiefox wrote:
>>    
>>> Hi
>>>
>>> Think I should clarify.  
>>>
>>> static hasMany = [memberParameters:MemberParameters]
>>>
>>> results in a HashSet.  So for my domain classes means quotationParameters
>>> ends up with a set of memberParameters.
>>>
>>> With all the experimentation, from your help, I end up with, if I define
>>> quotationParameters as o={} my exposed service method is found,
>>> quotationParameters is correctly defined but memberParameters has the
>>> fields
>>> defined but their values are object references and not the true values.
>>>
>>> If I define quotationParameters and memberParameters as 0=new
>>> QuotationParameter() etc DWR fails to find the service method.
>>>
>>> Best DF
>>>    
>>>
>>> XMaNIaC wrote:
>>>  
>>>      
>>>> No, no. Beans must be created using the mapped object. Maps are not
>>>> beans
>>>> and are defined using the map syntax. It's a mix of both
>>>> Regards
>>>>
>>>> On Fri, Oct 2, 2009 at 4:52 PM, douggiefox <paul@...> wrote:
>>>>
>>>>    
>>>>        
>>>>> Hi
>>>>>
>>>>> Are you suggesting something like this?
>>>>>
>>>>> var member = {};
>>>>> member["name"]  = 'paul';
>>>>> var quotationParameters = {};
>>>>> quotationParameters["groupSize"] = 1;
>>>>> quotationParameters["memberParameters"] = new Array();
>>>>> quotationParameters["memberParameters"][0] = member;
>>>>>
>>>>> That puts me back exactly where I started :-(  I'm sure I've
>>>>> misunderstood
>>>>> you?
>>>>>
>>>>> Best DF
>>>>>
>>>>>
>>>>> XMaNIaC wrote:
>>>>>      
>>>>>          
>>>>>> The map syntax is something like:
>>>>>> var map = {};
>>>>>> map["key"]  = value;
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> On Fri, Oct 2, 2009 at 2:41 PM, douggiefox <paul@...>
>>>>>>        
>>>>>>            
>>>>> wrote:
>>>>>      
>>>>>          
>>>>>>> Hi
>>>>>>>
>>>>>>> static hasMany = [memberParameters:MemberParameters]
>>>>>>>
>>>>>>> creates a HashSet which indeed contains a Map.
>>>>>>>
>>>>>>> What are you suggesting by changing the JS generation?
>>>>>>>
>>>>>>> Best DF
>>>>>>>
>>>>>>>
>>>>>>> XMaNIaC wrote:
>>>>>>>          
>>>>>>>              
>>>>>>>> What's the Java generated for this declaration?
>>>>>>>> static hasMany = [memberParameters:MemberParameters]
>>>>>>>>
>>>>>>>> If it is a list you're in the right track but if it's a map you must
>>>>>>>> change
>>>>>>>> the JS generation
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> On Fri, Oct 2, 2009 at 2:16 PM, douggiefox <paul@...>
>>>>>>>>            
>>>>>>>>                
>>>>>>> wrote:
>>>>>>>          
>>>>>>>              
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> So near yet so far...
>>>>>>>>>
>>>>>>>>> My Javascript's now looking like this:
>>>>>>>>>
>>>>>>>>> var member = new MemberParameters();
>>>>>>>>> member.name = 'paul';
>>>>>>>>> var quotationParameters = new QuotationParameters();
>>>>>>>>> quotationParameters.groupSize = 1;
>>>>>>>>> quotationParameters.memberParameters = new Array();
>>>>>>>>> quotationParameters.memberParameters[0] = member;
>>>>>>>>>
>>>>>>>>> Which all seems fine.  I've run this through Firebug and everything
>>>>>>>>>              
>>>>>>>>>                  
>>>>> is
>>>>>      
>>>>>          
>>>>>>> as
>>>>>>>          
>>>>>>>              
>>>>>>>>> I
>>>>>>>>> expect.
>>>>>>>>>
>>>>>>>>> Unfortunately, the remote function now fails to fire.  It's defined
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>> as:
>>>>>>>          
>>>>>>>              
>>>>>>>>> def createQuotation(QuotationParameters quotationParameters)
>>>>>>>>>
>>>>>>>>> Any more ideas?  Funny thing is when I defined the objects as o={}
>>>>>>>>>              
>>>>>>>>>                  
>>>>> the
>>>>>      
>>>>>          
>>>>>>>>> method fired correctly.
>>>>>>>>>
>>>>>>>>> Thanks for the help so far.
>>>>>>>>>
>>>>>>>>> Best DF
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>> Add a javascript="Whatever" to the converter declaration and
>>>>>>>>>>                
>>>>>>>>>>                    
>>>>> create
>>>>>      
>>>>>          
>>>>>>> the
>>>>>>>          
>>>>>>>              
>>>>>>>>> JS
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>> object like:
>>>>>>>>>> var myobj = new Whatever();
>>>>>>>>>>
>>>>>>>>>> instead of using:
>>>>>>>>>>
>>>>>>>>>> var o = {};
>>>>>>>>>>
>>>>>>>>>> This, of course, applies to nested objects as well.
>>>>>>>>>>
>>>>>>>>>> Regards
>>>>>>>>>>
>>>>>>>>>> On Fri, Oct 2, 2009 at 11:58 AM, douggiefox
>>>>>>>>>>                
>>>>>>>>>>                    
>>>>> <paul@...>
>>>>>      
>>>>>          
>>>>>>>>> wrote:
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> Hi
>>>>>>>>>>>
>>>>>>>>>>> Thanks for the pointer.  I don't seem to be getting anywhere
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>> very
>>>>>      
>>>>>          
>>>>>>>>>>> quickly.
>>>>>>>>>>> Could anyone give me a pointer?  I'm just not clear on how to
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>> format
>>>>>>> a
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> class
>>>>>>>>>>> mapper.
>>>>>>>>>>>
>>>>>>>>>>> Best
>>>>>>>>>>>
>>>>>>>>>>> DF
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>> DWR won't be able to figure that kind of dynamic mappings
>>>>>>>>>>>>                    
>>>>>>>>>>>>                        
>>>>> without
>>>>>      
>>>>>          
>>>>>>>>> help.
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>> See
>>>>>>>>>>>> class mappers in the converter documentation.
>>>>>>>>>>>> Regards
>>>>>>>>>>>>
>>>>>>>>>>>> On Fri, Oct 2, 2009 at 11:24 AM, douggiefox
>>>>>>>>>>>>                    
>>>>>>>>>>>>                        
>>>>>>> <paul@...>
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> wrote:
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> I assume you mean the classes?
>>>>>>>>>>>>>
>>>>>>>>>>>>> They're grails domain classes looking like this:
>>>>>>>>>>>>>
>>>>>>>>>>>>> class QuotationParameters {
>>>>>>>>>>>>>    Integer groupSize
>>>>>>>>>>>>>
>>>>>>>>>>>>>    static hasMany = [memberParameters:MemberParameters]
>>>>>>>>>>>>>
>>>>>>>>>>>>>    static constraints = {
>>>>>>>>>>>>>    }
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> class MemberParameters {
>>>>>>>>>>>>>
>>>>>>>>>>>>>    String name
>>>>>>>>>>>>>
>>>>>>>>>>>>>    static constraints = {
>>>>>>>>>>>>>    }
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> So QuotationParameters has a "set" of MemberParameters.  And
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>> it's
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> access
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> to
>>>>>>>>>>>>> the MemberParameters that I'm having trouble with.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks
>>>>>>>>>>>>>
>>>>>>>>>>>>> DF
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>> How does the object look?
>>>>>>>>>>>>>> Regards
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <
>>>>>>>>>>>>>>                        
>>>>>>>>>>>>>>                            
>>>>>>> paul@...>
>>>>>>>          
>>>>>>>              
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> Hi
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I'm having some issues with DWR.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On my javascript side I've created an object that looks
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> like
>>>>>      
>>>>>          
>>>>>>>>> this:
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>>>>             var quotationParameters = {
>>>>>>>>>>>>>>>                 groupSize: 1,
>>>>>>>>>>>>>>>                 memberParameters:
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>> [{name:'paul'},{name:'matthew'}]
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>>>>             };
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> This is being correctly passed through to my Grails
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> service,
>>>>>      
>>>>>          
>>>>>>> I
>>>>>>>          
>>>>>>>              
>>>>>>>>> have
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> a
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>>>> signature that looks like this:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> def createQuotation(QuotationParameters
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> quotationParameters)
>>>>>      
>>>>>          
>>>>>>>>>>>>>>> I can access quotationParameters.groupSize no problem.
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>  However,
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> when
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> I
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> try
>>>>>>>>>>>>>>> and access memberParameters I'm get references rather than
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>> values.
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> I
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> try
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> and access it like this:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> quotationParameters.memberParameters.each {
>>>>>>>>>>>>>>>         println it.name
>>>>>>>>>>>>>>> };
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Things go horribly wrong at the println.  The value of
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> name
>>>>>      
>>>>>          
>>>>>>>>> seems
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> to
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> be
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> an
>>>>>>>>>>>>>>> object reference ({name:reference:c0-e2}) rather than the
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>> value
>>>>>>>          
>>>>>>>              
>>>>>>>>> of
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>> name.
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> I'm not sure if I need to include a signature, and if so
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> how
>>>>>      
>>>>>          
>>>>>>> to
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> format
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>>>> it?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Not really quite sure where to head.  Any ideas?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Best DF
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
>>>>>      
>>>>>          
>>>>>>>>>>>>>>> Sent from the DWR - Users mailing list archive at
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> Nabble.com.
>>>>>      
>>>>>          
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>> ---------------------------------------------------------------------
>>>>>>>          
>>>>>>>              
>>>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>>>>>>>>>> For additional commands, e-mail:
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> users-help@...
>>>>>      
>>>>>          
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>                        
>>>>>>>>>>>>>>                            
>>>>>>>>>>>>> --
>>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
>>>>>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>> ---------------------------------------------------------------------
>>>>>      
>>>>>          
>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>                    
>>>>>>>>>>>>                        
>>>>>>>>>>> --
>>>>>>>>>>> View this message in context:
>>>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
>>>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>> ---------------------------------------------------------------------
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>                
>>>>>>>>>>                    
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25714817.html
>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>              
>>>>>>>>>                  
>>>>> ---------------------------------------------------------------------
>>>>>      
>>>>>          
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>            
>>>>>>>>                
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25715165.html
>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>
>>>>>>>
>>>>>>>          
>>>>>>>              
>>>>>>        
>>>>>>            
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25716510.html
>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>> For additional commands, e-mail: users-help@...
>>>>>
>>>>>
>>>>>      
>>>>>          
>>>>    
>>>>        
>>>  
>>>      
>>
>> __________ Information from ESET NOD32 Antivirus, version of virus
>> signature database 4478 (20091003) __________
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>>
>>    
>
>  



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4479 (20091004) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Dwr conversion

by douggiefox :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

The remote grails service looks like this:

def createQuotation(QuotationParameters quotationParameters) {
      log.info("in createQuotation")

      def quotations = []
   quotationParameters.memberParameters.each {
        def member = [:]
        member.name = it.name
        quotations.add(member);
      };

      def results = [:]

      results.put("totalCount", 1);
      results.put("items", quotations);

      return results

The JS looks like this:

var member = new MemberParameters();
member.name = 'paul';
var quotationParameters = new QuotationParameters();
quotationParameters.groupSize = 1;
quotationParameters.memberParameters = new Array();
quotationParameters.memberParameters[0] = member;

Best DF

davidmarginian wrote:
Send:
1) The Java code for the remote method you are calling, and any
parameters that method takes.
2) The JavaScript you are using to build the parameters.


douggiefox wrote:
> Hi
>
> It's configured in Grails;
>
>   def dwrconfig = {
>
>       service(name:'quotationService', javascript:'QuotationService') {
> exclude('setMetaClass,getMetaClass,setProperty,getProperty')
> }
>
>         convert(converter:'bean',match:'com.xxx.phc.QuotationParameters',
> javascript:"QuotationParameters")
>         convert(converter:'bean',match:'com.xxx.MemberParameters',
> javascript:"MemberParameters")
>
>     }
>
> Best DF
>
>
> davidmarginian wrote:
>  
>> Send us your dwr configuration (dwr.xml).
>>
>> douggiefox wrote:
>>    
>>> Hi
>>>
>>> Think I should clarify.  
>>>
>>> static hasMany = [memberParameters:MemberParameters]
>>>
>>> results in a HashSet.  So for my domain classes means quotationParameters
>>> ends up with a set of memberParameters.
>>>
>>> With all the experimentation, from your help, I end up with, if I define
>>> quotationParameters as o={} my exposed service method is found,
>>> quotationParameters is correctly defined but memberParameters has the
>>> fields
>>> defined but their values are object references and not the true values.
>>>
>>> If I define quotationParameters and memberParameters as 0=new
>>> QuotationParameter() etc DWR fails to find the service method.
>>>
>>> Best DF
>>>    
>>>
>>> XMaNIaC wrote:
>>>  
>>>      
>>>> No, no. Beans must be created using the mapped object. Maps are not
>>>> beans
>>>> and are defined using the map syntax. It's a mix of both
>>>> Regards
>>>>
>>>> On Fri, Oct 2, 2009 at 4:52 PM, douggiefox <paul@javabytes.co.uk> wrote:
>>>>
>>>>    
>>>>        
>>>>> Hi
>>>>>
>>>>> Are you suggesting something like this?
>>>>>
>>>>> var member = {};
>>>>> member["name"]  = 'paul';
>>>>> var quotationParameters = {};
>>>>> quotationParameters["groupSize"] = 1;
>>>>> quotationParameters["memberParameters"] = new Array();
>>>>> quotationParameters["memberParameters"][0] = member;
>>>>>
>>>>> That puts me back exactly where I started :-(  I'm sure I've
>>>>> misunderstood
>>>>> you?
>>>>>
>>>>> Best DF
>>>>>
>>>>>
>>>>> XMaNIaC wrote:
>>>>>      
>>>>>          
>>>>>> The map syntax is something like:
>>>>>> var map = {};
>>>>>> map["key"]  = value;
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> On Fri, Oct 2, 2009 at 2:41 PM, douggiefox <paul@javabytes.co.uk>
>>>>>>        
>>>>>>            
>>>>> wrote:
>>>>>      
>>>>>          
>>>>>>> Hi
>>>>>>>
>>>>>>> static hasMany = [memberParameters:MemberParameters]
>>>>>>>
>>>>>>> creates a HashSet which indeed contains a Map.
>>>>>>>
>>>>>>> What are you suggesting by changing the JS generation?
>>>>>>>
>>>>>>> Best DF
>>>>>>>
>>>>>>>
>>>>>>> XMaNIaC wrote:
>>>>>>>          
>>>>>>>              
>>>>>>>> What's the Java generated for this declaration?
>>>>>>>> static hasMany = [memberParameters:MemberParameters]
>>>>>>>>
>>>>>>>> If it is a list you're in the right track but if it's a map you must
>>>>>>>> change
>>>>>>>> the JS generation
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> On Fri, Oct 2, 2009 at 2:16 PM, douggiefox <paul@javabytes.co.uk>
>>>>>>>>            
>>>>>>>>                
>>>>>>> wrote:
>>>>>>>          
>>>>>>>              
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> So near yet so far...
>>>>>>>>>
>>>>>>>>> My Javascript's now looking like this:
>>>>>>>>>
>>>>>>>>> var member = new MemberParameters();
>>>>>>>>> member.name = 'paul';
>>>>>>>>> var quotationParameters = new QuotationParameters();
>>>>>>>>> quotationParameters.groupSize = 1;
>>>>>>>>> quotationParameters.memberParameters = new Array();
>>>>>>>>> quotationParameters.memberParameters[0] = member;
>>>>>>>>>
>>>>>>>>> Which all seems fine.  I've run this through Firebug and everything
>>>>>>>>>              
>>>>>>>>>                  
>>>>> is
>>>>>      
>>>>>          
>>>>>>> as
>>>>>>>          
>>>>>>>              
>>>>>>>>> I
>>>>>>>>> expect.
>>>>>>>>>
>>>>>>>>> Unfortunately, the remote function now fails to fire.  It's defined
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>> as:
>>>>>>>          
>>>>>>>              
>>>>>>>>> def createQuotation(QuotationParameters quotationParameters)
>>>>>>>>>
>>>>>>>>> Any more ideas?  Funny thing is when I defined the objects as o={}
>>>>>>>>>              
>>>>>>>>>                  
>>>>> the
>>>>>      
>>>>>          
>>>>>>>>> method fired correctly.
>>>>>>>>>
>>>>>>>>> Thanks for the help so far.
>>>>>>>>>
>>>>>>>>> Best DF
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>> Add a javascript="Whatever" to the converter declaration and
>>>>>>>>>>                
>>>>>>>>>>                    
>>>>> create
>>>>>      
>>>>>          
>>>>>>> the
>>>>>>>          
>>>>>>>              
>>>>>>>>> JS
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>> object like:
>>>>>>>>>> var myobj = new Whatever();
>>>>>>>>>>
>>>>>>>>>> instead of using:
>>>>>>>>>>
>>>>>>>>>> var o = {};
>>>>>>>>>>
>>>>>>>>>> This, of course, applies to nested objects as well.
>>>>>>>>>>
>>>>>>>>>> Regards
>>>>>>>>>>
>>>>>>>>>> On Fri, Oct 2, 2009 at 11:58 AM, douggiefox
>>>>>>>>>>                
>>>>>>>>>>                    
>>>>> <paul@javabytes.co.uk>
>>>>>      
>>>>>          
>>>>>>>>> wrote:
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> Hi
>>>>>>>>>>>
>>>>>>>>>>> Thanks for the pointer.  I don't seem to be getting anywhere
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>> very
>>>>>      
>>>>>          
>>>>>>>>>>> quickly.
>>>>>>>>>>> Could anyone give me a pointer?  I'm just not clear on how to
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>> format
>>>>>>> a
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> class
>>>>>>>>>>> mapper.
>>>>>>>>>>>
>>>>>>>>>>> Best
>>>>>>>>>>>
>>>>>>>>>>> DF
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>> DWR won't be able to figure that kind of dynamic mappings
>>>>>>>>>>>>                    
>>>>>>>>>>>>                        
>>>>> without
>>>>>      
>>>>>          
>>>>>>>>> help.
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>> See
>>>>>>>>>>>> class mappers in the converter documentation.
>>>>>>>>>>>> Regards
>>>>>>>>>>>>
>>>>>>>>>>>> On Fri, Oct 2, 2009 at 11:24 AM, douggiefox
>>>>>>>>>>>>                    
>>>>>>>>>>>>                        
>>>>>>> <paul@javabytes.co.uk>
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> wrote:
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> I assume you mean the classes?
>>>>>>>>>>>>>
>>>>>>>>>>>>> They're grails domain classes looking like this:
>>>>>>>>>>>>>
>>>>>>>>>>>>> class QuotationParameters {
>>>>>>>>>>>>>    Integer groupSize
>>>>>>>>>>>>>
>>>>>>>>>>>>>    static hasMany = [memberParameters:MemberParameters]
>>>>>>>>>>>>>
>>>>>>>>>>>>>    static constraints = {
>>>>>>>>>>>>>    }
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> class MemberParameters {
>>>>>>>>>>>>>
>>>>>>>>>>>>>    String name
>>>>>>>>>>>>>
>>>>>>>>>>>>>    static constraints = {
>>>>>>>>>>>>>    }
>>>>>>>>>>>>> }
>>>>>>>>>>>>>
>>>>>>>>>>>>> So QuotationParameters has a "set" of MemberParameters.  And
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>> it's
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> access
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> to
>>>>>>>>>>>>> the MemberParameters that I'm having trouble with.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks
>>>>>>>>>>>>>
>>>>>>>>>>>>> DF
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>> How does the object look?
>>>>>>>>>>>>>> Regards
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <
>>>>>>>>>>>>>>                        
>>>>>>>>>>>>>>                            
>>>>>>> paul@javabytes.co.uk>
>>>>>>>          
>>>>>>>              
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> Hi
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I'm having some issues with DWR.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On my javascript side I've created an object that looks
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> like
>>>>>      
>>>>>          
>>>>>>>>> this:
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>>>>             var quotationParameters = {
>>>>>>>>>>>>>>>                 groupSize: 1,
>>>>>>>>>>>>>>>                 memberParameters:
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>> [{name:'paul'},{name:'matthew'}]
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>>>>             };
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> This is being correctly passed through to my Grails
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> service,
>>>>>      
>>>>>          
>>>>>>> I
>>>>>>>          
>>>>>>>              
>>>>>>>>> have
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> a
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>>>> signature that looks like this:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> def createQuotation(QuotationParameters
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> quotationParameters)
>>>>>      
>>>>>          
>>>>>>>>>>>>>>> I can access quotationParameters.groupSize no problem.
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>  However,
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> when
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> I
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> try
>>>>>>>>>>>>>>> and access memberParameters I'm get references rather than
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>> values.
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> I
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> try
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> and access it like this:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> quotationParameters.memberParameters.each {
>>>>>>>>>>>>>>>         println it.name
>>>>>>>>>>>>>>> };
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Things go horribly wrong at the println.  The value of
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> name
>>>>>      
>>>>>          
>>>>>>>>> seems
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> to
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> be
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> an
>>>>>>>>>>>>>>> object reference ({name:reference:c0-e2}) rather than the
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>> value
>>>>>>>          
>>>>>>>              
>>>>>>>>> of
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>> name.
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> I'm not sure if I need to include a signature, and if so
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> how
>>>>>      
>>>>>          
>>>>>>> to
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> format
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>>>> it?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Not really quite sure where to head.  Any ideas?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Best DF
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
>>>>>      
>>>>>          
>>>>>>>>>>>>>>> Sent from the DWR - Users mailing list archive at
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> Nabble.com.
>>>>>      
>>>>>          
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>> ---------------------------------------------------------------------
>>>>>>>          
>>>>>>>              
>>>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>>>>>>>>>>>>>>> For additional commands, e-mail:
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>> users-help@dwr.dev.java.net
>>>>>      
>>>>>          
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>                        
>>>>>>>>>>>>>>                            
>>>>>>>>>>>>> --
>>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
>>>>>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>> ---------------------------------------------------------------------
>>>>>      
>>>>>          
>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>>>>>>>>>>>>> For additional commands, e-mail: users-help@dwr.dev.java.net
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>                    
>>>>>>>>>>>>                        
>>>>>>>>>>> --
>>>>>>>>>>> View this message in context:
>>>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
>>>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>> ---------------------------------------------------------------------
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>>>>>>>>>>> For additional commands, e-mail: users-help@dwr.dev.java.net
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>                
>>>>>>>>>>                    
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25714817.html
>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>              
>>>>>>>>>                  
>>>>> ---------------------------------------------------------------------
>>>>>      
>>>>>          
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>>>>>>>>> For additional commands, e-mail: users-help@dwr.dev.java.net
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>            
>>>>>>>>                
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25715165.html
>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>>>>>>> For additional commands, e-mail: users-help@dwr.dev.java.net
>>>>>>>
>>>>>>>
>>>>>>>          
>>>>>>>              
>>>>>>        
>>>>>>            
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25716510.html
>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>>>>> For additional commands, e-mail: users-help@dwr.dev.java.net
>>>>>
>>>>>
>>>>>      
>>>>>          
>>>>    
>>>>        
>>>  
>>>      
>>
>> __________ Information from ESET NOD32 Antivirus, version of virus
>> signature database 4478 (20091003) __________
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
>> For additional commands, e-mail: users-help@dwr.dev.java.net
>>
>>
>>
>>    
>
>  



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4479 (20091004) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
For additional commands, e-mail: users-help@dwr.dev.java.net

Re: Dwr conversion

by davidmarginian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am just not familiar with grails/groovy.  You are going to have to
debug this on your own unless someone else can help.  I would suggest
looking at the logs and trying to place some breakpoints on the server
to see where the problem is.

douggiefox wrote:

> Hi
>
> The remote grails service looks like this:
>
> def createQuotation(QuotationParameters quotationParameters) {
>       log.info("in createQuotation")
>
>       def quotations = []
>    quotationParameters.memberParameters.each {
>         def member = [:]
>         member.name = it.name
>         quotations.add(member);
>       };
>
>       def results = [:]
>
>       results.put("totalCount", 1);
>       results.put("items", quotations);
>
>       return results
>
> The JS looks like this:
>
> var member = new MemberParameters();
> member.name = 'paul';
> var quotationParameters = new QuotationParameters();
> quotationParameters.groupSize = 1;
> quotationParameters.memberParameters = new Array();
> quotationParameters.memberParameters[0] = member;
>
> Best DF
>
>
> davidmarginian wrote:
>  
>> Send:
>> 1) The Java code for the remote method you are calling, and any
>> parameters that method takes.
>> 2) The JavaScript you are using to build the parameters.
>>
>>
>> douggiefox wrote:
>>    
>>> Hi
>>>
>>> It's configured in Grails;
>>>
>>>   def dwrconfig = {
>>>
>>>       service(name:'quotationService', javascript:'QuotationService') {
>>> exclude('setMetaClass,getMetaClass,setProperty,getProperty')
>>> }
>>>
>>>         convert(converter:'bean',match:'com.xxx.phc.QuotationParameters',
>>> javascript:"QuotationParameters")
>>>         convert(converter:'bean',match:'com.xxx.MemberParameters',
>>> javascript:"MemberParameters")
>>>
>>>     }
>>>
>>> Best DF
>>>
>>>
>>> davidmarginian wrote:
>>>  
>>>      
>>>> Send us your dwr configuration (dwr.xml).
>>>>
>>>> douggiefox wrote:
>>>>    
>>>>        
>>>>> Hi
>>>>>
>>>>> Think I should clarify.  
>>>>>
>>>>> static hasMany = [memberParameters:MemberParameters]
>>>>>
>>>>> results in a HashSet.  So for my domain classes means
>>>>> quotationParameters
>>>>> ends up with a set of memberParameters.
>>>>>
>>>>> With all the experimentation, from your help, I end up with, if I
>>>>> define
>>>>> quotationParameters as o={} my exposed service method is found,
>>>>> quotationParameters is correctly defined but memberParameters has the
>>>>> fields
>>>>> defined but their values are object references and not the true values.
>>>>>
>>>>> If I define quotationParameters and memberParameters as 0=new
>>>>> QuotationParameter() etc DWR fails to find the service method.
>>>>>
>>>>> Best DF
>>>>>    
>>>>>
>>>>> XMaNIaC wrote:
>>>>>  
>>>>>      
>>>>>          
>>>>>> No, no. Beans must be created using the mapped object. Maps are not
>>>>>> beans
>>>>>> and are defined using the map syntax. It's a mix of both
>>>>>> Regards
>>>>>>
>>>>>> On Fri, Oct 2, 2009 at 4:52 PM, douggiefox <paul@...>
>>>>>> wrote:
>>>>>>
>>>>>>    
>>>>>>        
>>>>>>            
>>>>>>> Hi
>>>>>>>
>>>>>>> Are you suggesting something like this?
>>>>>>>
>>>>>>> var member = {};
>>>>>>> member["name"]  = 'paul';
>>>>>>> var quotationParameters = {};
>>>>>>> quotationParameters["groupSize"] = 1;
>>>>>>> quotationParameters["memberParameters"] = new Array();
>>>>>>> quotationParameters["memberParameters"][0] = member;
>>>>>>>
>>>>>>> That puts me back exactly where I started :-(  I'm sure I've
>>>>>>> misunderstood
>>>>>>> you?
>>>>>>>
>>>>>>> Best DF
>>>>>>>
>>>>>>>
>>>>>>> XMaNIaC wrote:
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>> The map syntax is something like:
>>>>>>>> var map = {};
>>>>>>>> map["key"]  = value;
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> On Fri, Oct 2, 2009 at 2:41 PM, douggiefox <paul@...>
>>>>>>>>        
>>>>>>>>            
>>>>>>>>                
>>>>>>> wrote:
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> static hasMany = [memberParameters:MemberParameters]
>>>>>>>>>
>>>>>>>>> creates a HashSet which indeed contains a Map.
>>>>>>>>>
>>>>>>>>> What are you suggesting by changing the JS generation?
>>>>>>>>>
>>>>>>>>> Best DF
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>> What's the Java generated for this declaration?
>>>>>>>>>> static hasMany = [memberParameters:MemberParameters]
>>>>>>>>>>
>>>>>>>>>> If it is a list you're in the right track but if it's a map you
>>>>>>>>>> must
>>>>>>>>>> change
>>>>>>>>>> the JS generation
>>>>>>>>>>
>>>>>>>>>> Regards
>>>>>>>>>>
>>>>>>>>>> On Fri, Oct 2, 2009 at 2:16 PM, douggiefox <paul@...>
>>>>>>>>>>            
>>>>>>>>>>                
>>>>>>>>>>                    
>>>>>>>>> wrote:
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> Hi
>>>>>>>>>>>
>>>>>>>>>>> So near yet so far...
>>>>>>>>>>>
>>>>>>>>>>> My Javascript's now looking like this:
>>>>>>>>>>>
>>>>>>>>>>> var member = new MemberParameters();
>>>>>>>>>>> member.name = 'paul';
>>>>>>>>>>> var quotationParameters = new QuotationParameters();
>>>>>>>>>>> quotationParameters.groupSize = 1;
>>>>>>>>>>> quotationParameters.memberParameters = new Array();
>>>>>>>>>>> quotationParameters.memberParameters[0] = member;
>>>>>>>>>>>
>>>>>>>>>>> Which all seems fine.  I've run this through Firebug and
>>>>>>>>>>> everything
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>> is
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>> as
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> I
>>>>>>>>>>> expect.
>>>>>>>>>>>
>>>>>>>>>>> Unfortunately, the remote function now fails to fire.  It's
>>>>>>>>>>> defined
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>> as:
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> def createQuotation(QuotationParameters quotationParameters)
>>>>>>>>>>>
>>>>>>>>>>> Any more ideas?  Funny thing is when I defined the objects as
>>>>>>>>>>> o={}
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>> the
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> method fired correctly.
>>>>>>>>>>>
>>>>>>>>>>> Thanks for the help so far.
>>>>>>>>>>>
>>>>>>>>>>> Best DF
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>> Add a javascript="Whatever" to the converter declaration and
>>>>>>>>>>>>                
>>>>>>>>>>>>                    
>>>>>>>>>>>>                        
>>>>>>> create
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>> the
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> JS
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>> object like:
>>>>>>>>>>>> var myobj = new Whatever();
>>>>>>>>>>>>
>>>>>>>>>>>> instead of using:
>>>>>>>>>>>>
>>>>>>>>>>>> var o = {};
>>>>>>>>>>>>
>>>>>>>>>>>> This, of course, applies to nested objects as well.
>>>>>>>>>>>>
>>>>>>>>>>>> Regards
>>>>>>>>>>>>
>>>>>>>>>>>> On Fri, Oct 2, 2009 at 11:58 AM, douggiefox
>>>>>>>>>>>>                
>>>>>>>>>>>>                    
>>>>>>>>>>>>                        
>>>>>>> <paul@...>
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> wrote:
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> Hi
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks for the pointer.  I don't seem to be getting anywhere
>>>>>>>>>>>>>                  
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>> very
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>>>>>> quickly.
>>>>>>>>>>>>> Could anyone give me a pointer?  I'm just not clear on how to
>>>>>>>>>>>>>                  
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>> format
>>>>>>>>> a
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>> class
>>>>>>>>>>>>> mapper.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Best
>>>>>>>>>>>>>
>>>>>>>>>>>>> DF
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>>>>>                  
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>> DWR won't be able to figure that kind of dynamic mappings
>>>>>>>>>>>>>>                    
>>>>>>>>>>>>>>                        
>>>>>>>>>>>>>>                            
>>>>>>> without
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> help.
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>>> See
>>>>>>>>>>>>>> class mappers in the converter documentation.
>>>>>>>>>>>>>> Regards
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Fri, Oct 2, 2009 at 11:24 AM, douggiefox
>>>>>>>>>>>>>>                    
>>>>>>>>>>>>>>                        
>>>>>>>>>>>>>>                            
>>>>>>>>> <paul@...>
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>                  
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> I assume you mean the classes?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> They're grails domain classes looking like this:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> class QuotationParameters {
>>>>>>>>>>>>>>>    Integer groupSize
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>    static hasMany = [memberParameters:MemberParameters]
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>    static constraints = {
>>>>>>>>>>>>>>>    }
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> class MemberParameters {
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>    String name
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>    static constraints = {
>>>>>>>>>>>>>>>    }
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> So QuotationParameters has a "set" of MemberParameters.  And
>>>>>>>>>>>>>>>                      
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>> it's
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>> access
>>>>>>>>>>>>>                  
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> to
>>>>>>>>>>>>>>> the MemberParameters that I'm having trouble with.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thanks
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> DF
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> XMaNIaC wrote:
>>>>>>>>>>>>>>>                      
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>> How does the object look?
>>>>>>>>>>>>>>>> Regards
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <
>>>>>>>>>>>>>>>>                        
>>>>>>>>>>>>>>>>                            
>>>>>>>>>>>>>>>>                                
>>>>>>>>> paul@...>
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>                      
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>> Hi
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I'm having some issues with DWR.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On my javascript side I've created an object that looks
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>> like
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> this:
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>>>>>>             var quotationParameters = {
>>>>>>>>>>>>>>>>>                 groupSize: 1,
>>>>>>>>>>>>>>>>>                 memberParameters:
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>>>>>> [{name:'paul'},{name:'matthew'}]
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>>>>>>             };
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> This is being correctly passed through to my Grails
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>> service,
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>> I
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> have
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> a
>>>>>>>>>>>>>                  
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>> signature that looks like this:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> def createQuotation(QuotationParameters
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>> quotationParameters)
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>>>>>>>>>> I can access quotationParameters.groupSize no problem.
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>>>>  However,
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>> when
>>>>>>>>>>>>>                  
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> I
>>>>>>>>>>>>>>>                      
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>> try
>>>>>>>>>>>>>>>>> and access memberParameters I'm get references rather than
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>>>>>> values.
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> I
>>>>>>>>>>>>>                  
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> try
>>>>>>>>>>>>>>>                      
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>> and access it like this:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> quotationParameters.memberParameters.each {
>>>>>>>>>>>>>>>>>         println it.name
>>>>>>>>>>>>>>>>> };
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Things go horribly wrong at the println.  The value of
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>> name
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> seems
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>> to
>>>>>>>>>>>>>                  
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>>                      
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>> an
>>>>>>>>>>>>>>>>> object reference ({name:reference:c0-e2}) rather than the
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>>>> value
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>> of
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>>>>>> name.
>>>>>>>>>>>>>>>                      
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>> I'm not sure if I need to include a signature, and if so
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>> how
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>> to
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>> format
>>>>>>>>>>>>>                  
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>> it?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Not really quite sure where to head.  Any ideas?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Best DF
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>>>>>>>>>> Sent from the DWR - Users mailing list archive at
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>> Nabble.com.
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>>>>>>>>>>>> For additional commands, e-mail:
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>> users-help@...
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>>>>                                  
>>>>>>>>>>>>>>>>                        
>>>>>>>>>>>>>>>>                            
>>>>>>>>>>>>>>>>                                
>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
>>>>>>>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>                      
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>> ---------------------------------------------------------------------
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>>>>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>                      
>>>>>>>>>>>>>>>                          
>>>>>>>>>>>>>>>                              
>>>>>>>>>>>>>>                    
>>>>>>>>>>>>>>                        
>>>>>>>>>>>>>>                            
>>>>>>>>>>>>> --
>>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
>>>>>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>                  
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>                  
>>>>>>>>>>>>>                      
>>>>>>>>>>>>>                          
>>>>>>>>>>>>                
>>>>>>>>>>>>                    
>>>>>>>>>>>>                        
>>>>>>>>>>> --
>>>>>>>>>>> View this message in context:
>>>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25714817.html
>>>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>> ---------------------------------------------------------------------
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>              
>>>>>>>>>>>                  
>>>>>>>>>>>                      
>>>>>>>>>>            
>>>>>>>>>>                
>>>>>>>>>>                    
>>>>>>>>> --
>>>>>>>>> View this message in context:
>>>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25715165.html
>>>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>          
>>>>>>>>>              
>>>>>>>>>                  
>>>>>>>>        
>>>>>>>>            
>>>>>>>>                
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/Dwr-conversion-tp25711053p25716510.html
>>>>>>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>>>>> For additional commands, e-mail: users-help@...
>>>>>>>
>>>>>>>
>>>>>>>      
>>>>>>>          
>>>>>>>              
>>>>>>    
>>>>>>        
>>>>>>            
>>>>>  
>>>>>      
>>>>>          
>>>> __________ Information from ESET NOD32 Antivirus, version of virus
>>>> signature database 4478 (20091003) __________
>>>>
>>>> The message was checked by ESET NOD32 Antivirus.
>>>>
>>>> http://www.eset.com
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@...
>>>> For additional commands, e-mail: users-help@...
>>>>
>>>>
>>>>
>>>>    
>>>>        
>>>  
>>>      
>>
>> __________ Information from ESET NOD32 Antivirus, version of virus
>> signature database 4479 (20091004) __________
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
>>
>>    
>
>  



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4479 (20091004) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Dwr conversion

by Lance Java :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've never used groovy either... since groovy classes are compiled to java classes, can you send us the result of
   groovyObject.getClass().getMethods() [however you do that in groovy]
 
Cheers,
Lance.

2009/10/4 David Marginian <david@...>
I am just not familiar with grails/groovy.  You are going to have to debug this on your own unless someone else can help.  I would suggest looking at the logs and trying to place some breakpoints on the server to see where the problem is.


douggiefox wrote:
Hi

The remote grails service looks like this:

def createQuotation(QuotationParameters quotationParameters) {
     log.info("in createQuotation")

     def quotations = []
  quotationParameters.memberParameters.each {
       def member = [:]
       member.name = it.name
       quotations.add(member);
     };

     def results = [:]

     results.put("totalCount", 1);
     results.put("items", quotations);

     return results

The JS looks like this:

var member = new MemberParameters();
member.name = 'paul';
var quotationParameters = new QuotationParameters();
quotationParameters.groupSize = 1;
quotationParameters.memberParameters = new Array();
quotationParameters.memberParameters[0] = member;

Best DF


davidmarginian wrote:
 
Send:
1) The Java code for the remote method you are calling, and any parameters that method takes.
2) The JavaScript you are using to build the parameters.


douggiefox wrote:
   
Hi

It's configured in Grails;

 def dwrconfig = {

       service(name:'quotationService', javascript:'QuotationService') {
                       exclude('setMetaClass,getMetaClass,setProperty,getProperty')
               }

       convert(converter:'bean',match:'com.xxx.phc.QuotationParameters',
javascript:"QuotationParameters")
       convert(converter:'bean',match:'com.xxx.MemberParameters',
javascript:"MemberParameters")

   }

Best DF


davidmarginian wrote:
       
Send us your dwr configuration (dwr.xml).

douggiefox wrote:
           
Hi

Think I should clarify.  
static hasMany = [memberParameters:MemberParameters]

results in a HashSet.  So for my domain classes means
quotationParameters
ends up with a set of memberParameters.

With all the experimentation, from your help, I end up with, if I
define
quotationParameters as o={} my exposed service method is found,
quotationParameters is correctly defined but memberParameters has the
fields
defined but their values are object references and not the true values.

If I define quotationParameters and memberParameters as 0=new
QuotationParameter() etc DWR fails to find the service method.

Best DF
 
XMaNIaC wrote:
                 
No, no. Beans must be created using the mapped object. Maps are not
beans
and are defined using the map syntax. It's a mix of both
Regards

On Fri, Oct 2, 2009 at 4:52 PM, douggiefox <paul@...>
wrote:

                       
Hi

Are you suggesting something like this?

var member = {};
member["name"]  = 'paul';
var quotationParameters = {};
quotationParameters["groupSize"] = 1;
quotationParameters["memberParameters"] = new Array();
quotationParameters["memberParameters"][0] = member;

That puts me back exactly where I started :-(  I'm sure I've
misunderstood
you?

Best DF


XMaNIaC wrote:
                             
The map syntax is something like:
var map = {};
map["key"]  = value;

Regards

On Fri, Oct 2, 2009 at 2:41 PM, douggiefox <paul@...>
                                   
wrote:
                             
Hi

static hasMany = [memberParameters:MemberParameters]

creates a HashSet which indeed contains a Map.

What are you suggesting by changing the JS generation?

Best DF


XMaNIaC wrote:
                                         
What's the Java generated for this declaration?
static hasMany = [memberParameters:MemberParameters]

If it is a list you're in the right track but if it's a map you
must
change
the JS generation

Regards

On Fri, Oct 2, 2009 at 2:16 PM, douggiefox <paul@...>
                                               
wrote:
                                         
Hi

So near yet so far...

My Javascript's now looking like this:

var member = new MemberParameters();
member.name = 'paul';
var quotationParameters = new QuotationParameters();
quotationParameters.groupSize = 1;
quotationParameters.memberParameters = new Array();
quotationParameters.memberParameters[0] = member;

Which all seems fine.  I've run this through Firebug and
everything
                                                     
is
                             
as
                                         
I
expect.

Unfortunately, the remote function now fails to fire.  It's
defined
                                                     
as:
                                         
def createQuotation(QuotationParameters quotationParameters)

Any more ideas?  Funny thing is when I defined the objects as
o={}
                                                     
the
                             
method fired correctly.

Thanks for the help so far.

Best DF



XMaNIaC wrote:
                                                     
Add a javascript="Whatever" to the converter declaration and
                                                           
create
                             
the
                                         
JS
                                                     
object like:
var myobj = new Whatever();

instead of using:

var o = {};

This, of course, applies to nested objects as well.

Regards

On Fri, Oct 2, 2009 at 11:58 AM, douggiefox
                                                           
<paul@...>
                             
wrote:
                                                     
Hi

Thanks for the pointer.  I don't seem to be getting anywhere
                                                                 
very
                             
quickly.
Could anyone give me a pointer?  I'm just not clear on how to
                                                                 
format
a
                                         
class
mapper.

Best

DF



XMaNIaC wrote:
                                                                 
DWR won't be able to figure that kind of dynamic mappings
                                                                       
without
                             
help.
                                                     
See
class mappers in the converter documentation.
Regards

On Fri, Oct 2, 2009 at 11:24 AM, douggiefox
                                                                       
<paul@...>
                                         
wrote:
                                                                 
I assume you mean the classes?

They're grails domain classes looking like this:

class QuotationParameters {
  Integer groupSize

  static hasMany = [memberParameters:MemberParameters]

  static constraints = {
  }
}

class MemberParameters {

  String name

  static constraints = {
  }
}

So QuotationParameters has a "set" of MemberParameters.  And
                                                                             
it's
                                         
access
                                                                 
to
the MemberParameters that I'm having trouble with.

Thanks

DF


XMaNIaC wrote:
                                                                             
How does the object look?
Regards

On Fri, Oct 2, 2009 at 8:37 AM, douggiefox <
                                                                                   
paul@...>
                                         
wrote:
                                                                             
Hi

I'm having some issues with DWR.

On my javascript side I've created an object that looks
                                                                                         
like
                             
this:
                                                     
           var quotationParameters = {
               groupSize: 1,
               memberParameters:
                                                                                         
[{name:'paul'},{name:'matthew'}]
                                                     
           };


This is being correctly passed through to my Grails
                                                                                         
service,
                             
I
                                         
have
                                                     
a
                                                                 
signature that looks like this:

def createQuotation(QuotationParameters
                                                                                         
quotationParameters)
                             
I can access quotationParameters.groupSize no problem.
                                                                                         
 However,
                                         
when
                                                                 
I
                                                                             
try
and access memberParameters I'm get references rather than
                                                                                         
values.
                                                     
I
                                                                 
try
                                                                             
and access it like this:

quotationParameters.memberParameters.each {
       println it.name
};

Things go horribly wrong at the println.  The value of
                                                                                         
name
                             
seems
                                                     
to
                                                                 
be
                                                                             
an
object reference ({name:reference:c0-e2}) rather than the
                                                                                         
value
                                         
of
                                                     
name.
                                                                             
I'm not sure if I need to include a signature, and if so
                                                                                         
how
                             
to
                                         
format
                                                                 
it?

Not really quite sure where to head.  Any ideas?

Best DF



--
View this message in context:

                                                                                         
http://www.nabble.com/Dwr-conversion-tp25711053p25711053.html
                             
Sent from the DWR - Users mailing list archive at
                                                                                         
Nabble.com.
                             
                                                                                         
---------------------------------------------------------------------
                                         
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail:
                                                                                         
users-help@...
                             
                                                                                         
                                                                                   
--
View this message in context:
http://www.nabble.com/Dwr-conversion-tp25711053p25712815.html
Sent from the DWR - Users mailing list archive at Nabble.com.



                                                                             
---------------------------------------------------------------------
                             
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


                                                                             
                                                                       
--
View this message in context:
http://www.nabble.com/Dwr-conversion-tp25711053p25713233.html
Sent from the DWR - Users mailing list archive at Nabble.com.



                                                                 
---------------------------------------------------------------------
                                         
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


                                                                 
                                                           
--
View this message in context:
http://www.nabble.com/Dwr-conversion-tp25711053p25714817.html
Sent from the DWR - Users mailing list archive at Nabble.com.



                                                     
---------------------------------------------------------------------
                             
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


                                                     
                                               
--
View this message in context:
http://www.nabble.com/Dwr-conversion-tp25711053p25715165.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


                                         
                                   
--
View this message in context:
http://www.nabble.com/Dwr-conversion-tp25711053p25716510.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


                             
                       
                 
__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4478 (20091003) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



           
       

__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4479 (20091004) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



   

 



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4479 (20091004) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...