Re: Tapestry 5 Mixins Remoting JSON

2007-05-08 Thread bjornharvold

WORKS GREAT!

:-D

-- 
View this message in context: 
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10384351
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry 5 Mixins Remoting JSON

2007-05-08 Thread Andreas Andreou

Better have getUrlFromClass generate a url for a {0} parameter (insted of
jsmith)
then (at runtime) have javascript that replaces {0} with whatever value you
want.

On 5/8/07, bjornharvold <[EMAIL PROTECTED]> wrote:



Thank you for the lightning response!

the parameter "jsmith" is of course the runtime text the user enters as
his
username so there is no way for me to hard code that into the
getUrlFromClass method. Javascript is the only thing that knows what the
username is at the time of checking. Can I use the getUrlFromClass, as
described before, have it generate the url on my template and then have
javascript append jsmith to the url?

So url I get from tapestry component:
var url = ${urlFromClass}

At runtime:
var url = ${urlFromClass} + "/" + username;

Would that work? And what can the method rpcTrigger expect as incoming
parameter for username?

thanks in advance
bjorn
--
View this message in context:
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10379890
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting


Re: Tapestry 5 Mixins Remoting JSON

2007-05-08 Thread Andreas Andreou

Just a small comment on this and a quick way to make it more elegant -
make it generate

href="yourlink/parameter1/parameter2" onclick="rpcFunction(this.href);retrurn
false"


On 5/8/07, Alexandru Dragomir <[EMAIL PROTECTED]> wrote:


The parameters should be in the "urlFromClass" above.

So you could have it like this :

public String getUrlFromClass() {
 return resources.createActionLink
("rpcTrigger",false,"jsmith").toString();

}

In my workspace i made a dirty ajax version of actionLink which generates
as  href attribute this :

href="javascript:rpcFunction('yourlink/parameter1/parameter2')"

instead of

href="yourlink/parameter1/parameter2"

So , the parameters should be passed in the same way you do it for
ActionLink component(and  you have 2 options :  use the actionLink
component
or build the link in your class as shown above). The only difference is
that
there is a javascript function that does the request.

Alex


On 5/8/07, bjornharvold <[EMAIL PROTECTED]> wrote:
>
>
> Alexandru,
>
> How could you add runtime parameters to this Ajax call? e.g. you want to
> call isUsernameAvailable with parameter "jsmith"?
>
> Thanks
> bjorn
> --
> View this message in context:
>
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10378474
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>





--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting


Re: Tapestry 5 Mixins Remoting JSON

2007-05-08 Thread bjornharvold

Thank you for the lightning response!

the parameter "jsmith" is of course the runtime text the user enters as his
username so there is no way for me to hard code that into the
getUrlFromClass method. Javascript is the only thing that knows what the
username is at the time of checking. Can I use the getUrlFromClass, as
described before, have it generate the url on my template and then have
javascript append jsmith to the url?

So url I get from tapestry component:
var url = ${urlFromClass}

At runtime:
var url = ${urlFromClass} + "/" + username;

Would that work? And what can the method rpcTrigger expect as incoming
parameter for username?

thanks in advance
bjorn
-- 
View this message in context: 
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10379890
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry 5 Mixins Remoting JSON

2007-05-08 Thread Alexandru Dragomir

The parameters should be in the "urlFromClass" above.

So you could have it like this :

public String getUrlFromClass() {
return resources.createActionLink("rpcTrigger",false,"jsmith").toString();

}

In my workspace i made a dirty ajax version of actionLink which generates
as  href attribute this :

href="javascript:rpcFunction('yourlink/parameter1/parameter2')"

instead of

href="yourlink/parameter1/parameter2"

So , the parameters should be passed in the same way you do it for
ActionLink component(and  you have 2 options :  use the actionLink component
or build the link in your class as shown above). The only difference is that
there is a javascript function that does the request.

Alex


On 5/8/07, bjornharvold <[EMAIL PROTECTED]> wrote:



Alexandru,

How could you add runtime parameters to this Ajax call? e.g. you want to
call isUsernameAvailable with parameter "jsmith"?

Thanks
bjorn
--
View this message in context:
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10378474
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Tapestry 5 Mixins Remoting JSON

2007-05-08 Thread bjornharvold

Alexandru,

How could you add runtime parameters to this Ajax call? e.g. you want to
call isUsernameAvailable with parameter "jsmith"?

Thanks
bjorn
-- 
View this message in context: 
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10378474
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry 5 Mixins Remoting JSON

2007-05-02 Thread Alexandru Dragomir

The function rpcFunction() is the async part.

I'm using dojo , so the function looks like :

function rpcFunction() {
   var kw = {
   url:"${urlFromClass}",
   load:function(type, data, evt) {
// do what you want with "data" retrieved from server
side
},
   method: "GET",
   mimetype:"text/json"
   };
   dojo.io.bind(kw);
}

Alex


On 5/2/07, Bill Holloway <[EMAIL PROTECTED]> wrote:


Also, what do you do with yourUrl once you have it?  In addition, the
JSONRpcClient constructor expects to be talking to a servlet.  T5 is a
ServletFilter.

Bill

On 5/2/07, bjornharvold <[EMAIL PROTECTED]> wrote:
>
> That's great but is this asynchronous?
>
>
> Alexandru Dragomir wrote:
> >
> > Yes , you could do like this :
> >
> > template:
> >
> >
> >
> > 
> >
> >rpcFunction() {
> > var yourUrl=${urlFromClass}
> >.
> >}
> > 
> >
> >
> > component class :
> >
> > @Inject
> > private ComponentResources resources;
> >
> > public String getUrlFromClass() {
> >  return resources.createActionLInk("rpcTrigger",false).toString();
> > }
> >
> > StreamResponse onRpcTrigger() {
> >  //build your json object and wrapp it in a StreamResponse
> > return streamResponse;
> > }
> >
> > hope i haven't forgot  anything.
> >
> > Alex
> >
> >
> > On 5/2/07, bjornharvold <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >> Sounds interesting. I looked at component events. Are you saying that
you
> >> can
> >> invoke a component action based on a javascript event such as
> >> "mouseDown"?
> >> To me it seems that you can only invoke based on a submit action. I
want
> >> the
> >> UI, through AJAX, to talk to some service and get JSON data back. The
URL
> >> to
> >> the json data could be as simple as a link to a jsp that creates the
json
> >> data string.
> >>
> >> When I meant jsonrpc-bridge I meant the specific open source
> >> implementation
> >> here: http://oss.metaparadigm.com/jsonrpc/index.html
> >>
> >>
> >> Alexandru Dragomir wrote:
> >> >
> >> > I didn't get what you meant by jsonrpc bridge.
> >> > The way i do it and it works fine is implementing an "onAction"
method
> >> > that
> >> > returns StreamResponse :
> >> >
> >> > StreamResponse onActionFromYourComp() {}
> >> >
> >> > The method returns a json object wrapped by the StreamResponse.
> >> > Mixins are useful when you want to add new ajax behavior to already
> >> > existent
> >> > "non ajax" aware components(if i'm not wrong.. ).
> >> >
> >> > hope it helps,
> >> > Alex
> >> >
> >> >
> >> > On 5/1/07, bjornharvold <[EMAIL PROTECTED]> wrote:
> >> >>
> >> >>
> >> >> I have a front-end that wants JSON data from the back-end. Using a
> >> >> regular
> >> >> webapp I would integrate JSON-RPC. I started out doing this with
my t5
> >> >> app
> >> >> and quickly realized I had to write something to put the jsonrpc
> >> bridge
> >> >> in
> >> >> the session (like a listener) and then some component that would
have
> >> >> access
> >> >> to the session and use the bridge. Then I thought of the mixins,
which
> >> I
> >> >> admittedly don't yet fully understand. but then again I guess
it's
> >> >> not
> >> >> fully implemented either ;-)
> >> >>
> >> >> How would something like auto-complete and validation be done with
t5
> >> >> using
> >> >> mixins or is it still better to use jsonrpc as I described
above?
> >> I
> >> >> am
> >> >> looking at the mixin page and don't really find anything useful
there.
> >> >>
> >> >> thx
> >> >> bjorn
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10274739
> >> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >>
-
> >> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10291531
> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
> --
> View this message in context:
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10293059
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
"The future is here.  It's just not evenly distributed yet."

 -- Traditional

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Tapestry 5 Mixins Remoting JSON

2007-05-02 Thread Bill Holloway

Also, what do you do with yourUrl once you have it?  In addition, the
JSONRpcClient constructor expects to be talking to a servlet.  T5 is a
ServletFilter.

Bill

On 5/2/07, bjornharvold <[EMAIL PROTECTED]> wrote:


That's great but is this asynchronous?


Alexandru Dragomir wrote:
>
> Yes , you could do like this :
>
> template:
>
>
>
> 
>
>rpcFunction() {
> var yourUrl=${urlFromClass}
>.
>}
> 
>
>
> component class :
>
> @Inject
> private ComponentResources resources;
>
> public String getUrlFromClass() {
>  return resources.createActionLInk("rpcTrigger",false).toString();
> }
>
> StreamResponse onRpcTrigger() {
>  //build your json object and wrapp it in a StreamResponse
> return streamResponse;
> }
>
> hope i haven't forgot  anything.
>
> Alex
>
>
> On 5/2/07, bjornharvold <[EMAIL PROTECTED]> wrote:
>>
>>
>> Sounds interesting. I looked at component events. Are you saying that you
>> can
>> invoke a component action based on a javascript event such as
>> "mouseDown"?
>> To me it seems that you can only invoke based on a submit action. I want
>> the
>> UI, through AJAX, to talk to some service and get JSON data back. The URL
>> to
>> the json data could be as simple as a link to a jsp that creates the json
>> data string.
>>
>> When I meant jsonrpc-bridge I meant the specific open source
>> implementation
>> here: http://oss.metaparadigm.com/jsonrpc/index.html
>>
>>
>> Alexandru Dragomir wrote:
>> >
>> > I didn't get what you meant by jsonrpc bridge.
>> > The way i do it and it works fine is implementing an "onAction" method
>> > that
>> > returns StreamResponse :
>> >
>> > StreamResponse onActionFromYourComp() {}
>> >
>> > The method returns a json object wrapped by the StreamResponse.
>> > Mixins are useful when you want to add new ajax behavior to already
>> > existent
>> > "non ajax" aware components(if i'm not wrong.. ).
>> >
>> > hope it helps,
>> > Alex
>> >
>> >
>> > On 5/1/07, bjornharvold <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >> I have a front-end that wants JSON data from the back-end. Using a
>> >> regular
>> >> webapp I would integrate JSON-RPC. I started out doing this with my t5
>> >> app
>> >> and quickly realized I had to write something to put the jsonrpc
>> bridge
>> >> in
>> >> the session (like a listener) and then some component that would have
>> >> access
>> >> to the session and use the bridge. Then I thought of the mixins, which
>> I
>> >> admittedly don't yet fully understand. but then again I guess it's
>> >> not
>> >> fully implemented either ;-)
>> >>
>> >> How would something like auto-complete and validation be done with t5
>> >> using
>> >> mixins.... or is it still better to use jsonrpc as I described above?
>> I
>> >> am
>> >> looking at the mixin page and don't really find anything useful there.
>> >>
>> >> thx
>> >> bjorn
>> >> --
>> >> View this message in context:
>> >>
>> 
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10274739
>> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> -
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> 
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10291531
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>

--
View this message in context: 
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10293059
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
"The future is here.  It's just not evenly distributed yet."

-- Traditional

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry 5 Mixins Remoting JSON

2007-05-02 Thread bjornharvold

That's great but is this asynchronous?


Alexandru Dragomir wrote:
> 
> Yes , you could do like this :
> 
> template:
> 
> 
> 
> 
> 
>rpcFunction() {
> var yourUrl=${urlFromClass}
>.
>}
> 
> 
> 
> component class :
> 
> @Inject
> private ComponentResources resources;
> 
> public String getUrlFromClass() {
>  return resources.createActionLInk("rpcTrigger",false).toString();
> }
> 
> StreamResponse onRpcTrigger() {
>  //build your json object and wrapp it in a StreamResponse
> return streamResponse;
> }
> 
> hope i haven't forgot  anything.
> 
> Alex
> 
> 
> On 5/2/07, bjornharvold <[EMAIL PROTECTED]> wrote:
>>
>>
>> Sounds interesting. I looked at component events. Are you saying that you
>> can
>> invoke a component action based on a javascript event such as
>> "mouseDown"?
>> To me it seems that you can only invoke based on a submit action. I want
>> the
>> UI, through AJAX, to talk to some service and get JSON data back. The URL
>> to
>> the json data could be as simple as a link to a jsp that creates the json
>> data string.
>>
>> When I meant jsonrpc-bridge I meant the specific open source
>> implementation
>> here: http://oss.metaparadigm.com/jsonrpc/index.html
>>
>>
>> Alexandru Dragomir wrote:
>> >
>> > I didn't get what you meant by jsonrpc bridge.
>> > The way i do it and it works fine is implementing an "onAction" method
>> > that
>> > returns StreamResponse :
>> >
>> > StreamResponse onActionFromYourComp() {}
>> >
>> > The method returns a json object wrapped by the StreamResponse.
>> > Mixins are useful when you want to add new ajax behavior to already
>> > existent
>> > "non ajax" aware components(if i'm not wrong.. ).
>> >
>> > hope it helps,
>> > Alex
>> >
>> >
>> > On 5/1/07, bjornharvold <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >> I have a front-end that wants JSON data from the back-end. Using a
>> >> regular
>> >> webapp I would integrate JSON-RPC. I started out doing this with my t5
>> >> app
>> >> and quickly realized I had to write something to put the jsonrpc
>> bridge
>> >> in
>> >> the session (like a listener) and then some component that would have
>> >> access
>> >> to the session and use the bridge. Then I thought of the mixins, which
>> I
>> >> admittedly don't yet fully understand. but then again I guess it's
>> >> not
>> >> fully implemented either ;-)
>> >>
>> >> How would something like auto-complete and validation be done with t5
>> >> using
>> >> mixins.... or is it still better to use jsonrpc as I described above?
>> I
>> >> am
>> >> looking at the mixin page and don't really find anything useful there.
>> >>
>> >> thx
>> >> bjorn
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10274739
>> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> -
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10291531
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10293059
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry 5 Mixins Remoting JSON

2007-05-02 Thread Alexandru Dragomir

Yes , you could do like this :

template:





  rpcFunction() {
   var yourUrl=${urlFromClass}
  .
  }



component class :

@Inject
private ComponentResources resources;

public String getUrlFromClass() {
return resources.createActionLInk("rpcTrigger",false).toString();
}

StreamResponse onRpcTrigger() {
//build your json object and wrapp it in a StreamResponse
   return streamResponse;
}

hope i haven't forgot  anything.

Alex


On 5/2/07, bjornharvold <[EMAIL PROTECTED]> wrote:



Sounds interesting. I looked at component events. Are you saying that you
can
invoke a component action based on a javascript event such as "mouseDown"?
To me it seems that you can only invoke based on a submit action. I want
the
UI, through AJAX, to talk to some service and get JSON data back. The URL
to
the json data could be as simple as a link to a jsp that creates the json
data string.

When I meant jsonrpc-bridge I meant the specific open source
implementation
here: http://oss.metaparadigm.com/jsonrpc/index.html


Alexandru Dragomir wrote:
>
> I didn't get what you meant by jsonrpc bridge.
> The way i do it and it works fine is implementing an "onAction" method
> that
> returns StreamResponse :
>
> StreamResponse onActionFromYourComp() {}
>
> The method returns a json object wrapped by the StreamResponse.
> Mixins are useful when you want to add new ajax behavior to already
> existent
> "non ajax" aware components(if i'm not wrong.. ).
>
> hope it helps,
> Alex
>
>
> On 5/1/07, bjornharvold <[EMAIL PROTECTED]> wrote:
>>
>>
>> I have a front-end that wants JSON data from the back-end. Using a
>> regular
>> webapp I would integrate JSON-RPC. I started out doing this with my t5
>> app
>> and quickly realized I had to write something to put the jsonrpc bridge
>> in
>> the session (like a listener) and then some component that would have
>> access
>> to the session and use the bridge. Then I thought of the mixins, which
I
>> admittedly don't yet fully understand. but then again I guess it's
>> not
>> fully implemented either ;-)
>>
>> How would something like auto-complete and validation be done with t5
>> using
>> mixins.... or is it still better to use jsonrpc as I described above? I
>> am
>> looking at the mixin page and don't really find anything useful there.
>>
>> thx
>> bjorn
>> --
>> View this message in context:
>>
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10274739
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10291531
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Tapestry 5 Mixins Remoting JSON

2007-05-02 Thread bjornharvold

Sounds interesting. I looked at component events. Are you saying that you can
invoke a component action based on a javascript event such as "mouseDown"?
To me it seems that you can only invoke based on a submit action. I want the
UI, through AJAX, to talk to some service and get JSON data back. The URL to
the json data could be as simple as a link to a jsp that creates the json
data string.

When I meant jsonrpc-bridge I meant the specific open source implementation
here: http://oss.metaparadigm.com/jsonrpc/index.html
 

Alexandru Dragomir wrote:
> 
> I didn't get what you meant by jsonrpc bridge.
> The way i do it and it works fine is implementing an "onAction" method
> that
> returns StreamResponse :
> 
> StreamResponse onActionFromYourComp() {}
> 
> The method returns a json object wrapped by the StreamResponse.
> Mixins are useful when you want to add new ajax behavior to already
> existent
> "non ajax" aware components(if i'm not wrong.. ).
> 
> hope it helps,
> Alex
> 
> 
> On 5/1/07, bjornharvold <[EMAIL PROTECTED]> wrote:
>>
>>
>> I have a front-end that wants JSON data from the back-end. Using a
>> regular
>> webapp I would integrate JSON-RPC. I started out doing this with my t5
>> app
>> and quickly realized I had to write something to put the jsonrpc bridge
>> in
>> the session (like a listener) and then some component that would have
>> access
>> to the session and use the bridge. Then I thought of the mixins, which I
>> admittedly don't yet fully understand. but then again I guess it's
>> not
>> fully implemented either ;-)
>>
>> How would something like auto-complete and validation be done with t5
>> using
>> mixins or is it still better to use jsonrpc as I described above? I
>> am
>> looking at the mixin page and don't really find anything useful there.
>>
>> thx
>> bjorn
>> --
>> View this message in context:
>> http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10274739
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10291531
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry 5 Mixins Remoting JSON

2007-05-02 Thread Alexandru Dragomir

I didn't get what you meant by jsonrpc bridge.
The way i do it and it works fine is implementing an "onAction" method that
returns StreamResponse :

StreamResponse onActionFromYourComp() {}

The method returns a json object wrapped by the StreamResponse.
Mixins are useful when you want to add new ajax behavior to already existent
"non ajax" aware components(if i'm not wrong.. ).

hope it helps,
Alex


On 5/1/07, bjornharvold <[EMAIL PROTECTED]> wrote:



I have a front-end that wants JSON data from the back-end. Using a regular
webapp I would integrate JSON-RPC. I started out doing this with my t5 app
and quickly realized I had to write something to put the jsonrpc bridge in
the session (like a listener) and then some component that would have
access
to the session and use the bridge. Then I thought of the mixins, which I
admittedly don't yet fully understand. but then again I guess it's not
fully implemented either ;-)

How would something like auto-complete and validation be done with t5
using
mixins or is it still better to use jsonrpc as I described above? I am
looking at the mixin page and don't really find anything useful there.

thx
bjorn
--
View this message in context:
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10274739
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Tapestry 5 Mixins Remoting JSON

2007-05-01 Thread bjornharvold

I have a front-end that wants JSON data from the back-end. Using a regular
webapp I would integrate JSON-RPC. I started out doing this with my t5 app
and quickly realized I had to write something to put the jsonrpc bridge in
the session (like a listener) and then some component that would have access
to the session and use the bridge. Then I thought of the mixins, which I
admittedly don't yet fully understand. but then again I guess it's not
fully implemented either ;-)

How would something like auto-complete and validation be done with t5 using
mixins or is it still better to use jsonrpc as I described above? I am
looking at the mixin page and don't really find anything useful there.

thx
bjorn
-- 
View this message in context: 
http://www.nabble.com/Tapestry-5-Mixins-Remoting-JSON-tf3676880.html#a10274739
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]