Re: How to change HTML form action? Or is there any better option?

2013-03-30 Thread Dmitry Gusev
So, the onPassivate() didn't worked, there's no context in the form's
action... looking for another options.

On Sat, Mar 30, 2013 at 12:23 AM, Thiago H de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Fri, 29 Mar 2013 16:38:22 -0300, Dmitry Gusev dmitry.gu...@gmail.com
 wrote:

  Well, yes, I probably have to implement onPassivate() and this will
 restore activation context. I haven't think about that, thanks for
 mentioning.


 ;)


  Anyway, its just I don't need to involve the page with its
 activate/passivate logic for this action -- the registrationForm
 component is completely independent.


 That's exactly how it should be: independent.


 --
 Thiago H. de Paula Figueiredo

 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org




-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: How to change HTML form action? Or is there any better option?

2013-03-30 Thread Bård Magnus Kvalheim
Hi dmitry. Think the activation context for forms is in a hidden field ,
possibly serialized.

Magnus
-sent from mobile
Den 30. mars 2013 09:30 skrev Dmitry Gusev dmitry.gu...@gmail.com
følgende:

 So, the onPassivate() didn't worked, there's no context in the form's
 action... looking for another options.

 On Sat, Mar 30, 2013 at 12:23 AM, Thiago H de Paula Figueiredo 
 thiag...@gmail.com wrote:

  On Fri, 29 Mar 2013 16:38:22 -0300, Dmitry Gusev dmitry.gu...@gmail.com
 
  wrote:
 
   Well, yes, I probably have to implement onPassivate() and this will
  restore activation context. I haven't think about that, thanks for
  mentioning.
 
 
  ;)
 
 
   Anyway, its just I don't need to involve the page with its
  activate/passivate logic for this action -- the registrationForm
  component is completely independent.
 
 
  That's exactly how it should be: independent.
 
 
  --
  Thiago H. de Paula Figueiredo
 
  --**--**-
  To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org
 users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 


 --
 Dmitry Gusev

 AnjLab Team
 http://anjlab.com



Re: How to change HTML form action? Or is there any better option?

2013-03-30 Thread Dmitry Gusev
I've ended up with mixin solution (I named it Sticky Forms) to replace both
form's action URL and linkZone URL that is used with Ajax form submissions:

https://gist.github.com/dmitrygusev/5276919

In my Layout I have a delegate to registerPage that provides a block with
registrationForm:

t:delegate to=registerPage.registrationBlock /

And also I have to register all these sticky forms in AppModule (see the
gist link).

This works well, though its more a hack, because it uses internal API and
may only be compatible with version 5.3.6.


On Sat, Mar 30, 2013 at 6:19 PM, Bård Magnus Kvalheim mag...@kvalheim.euwrote:

 Hi dmitry. Think the activation context for forms is in a hidden field ,
 possibly serialized.

 Magnus
 -sent from mobile
 Den 30. mars 2013 09:30 skrev Dmitry Gusev dmitry.gu...@gmail.com
 følgende:

  So, the onPassivate() didn't worked, there's no context in the form's
  action... looking for another options.
 
  On Sat, Mar 30, 2013 at 12:23 AM, Thiago H de Paula Figueiredo 
  thiag...@gmail.com wrote:
 
   On Fri, 29 Mar 2013 16:38:22 -0300, Dmitry Gusev 
 dmitry.gu...@gmail.com
  
   wrote:
  
Well, yes, I probably have to implement onPassivate() and this will
   restore activation context. I haven't think about that, thanks for
   mentioning.
  
  
   ;)
  
  
Anyway, its just I don't need to involve the page with its
   activate/passivate logic for this action -- the registrationForm
   component is completely independent.
  
  
   That's exactly how it should be: independent.
  
  
   --
   Thiago H. de Paula Figueiredo
  
  
 --**--**-
   To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org
  users-unsubscr...@tapestry.apache.org
   For additional commands, e-mail: users-h...@tapestry.apache.org
  
  
 
 
  --
  Dmitry Gusev
 
  AnjLab Team
  http://anjlab.com
 




-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Query Mobile Tapestry

2013-03-30 Thread Alexander Sommer
Hi!

I am trying to build a mobile web app based on jquery mobile. For that
reason, I need to reuse my services built with tapestry - which turned out
not being as trivial as expected.

I was reading in the forum (eg
http://mail-archives.apache.org/mod_mbox/tapestry-users/201201.mbox/%3ccd6ed1fa-1e5c-4cbb-a6e9-67eeb842e...@mail-nic-00.intern.albourne.com%3E),
that jquery is complicating (correct me if this is not true!!) things due
to prototype used in tapestry. For that reason, I would like to try a 100%
clean approach - my web app client should not be depended on tapestry
(GUI!) at all, I just want to use my tapestry services.

one service for example is:

http://www.airwriting.com/mobile/public:getLocalGroups?lat=48.15lng=16.3

which is returning valid json. (check for non believers http://jsonlint.com/
)

BUT

if I want to use this service, I run into the crossDomain problem with
javascript, because my mobile webapp for example is (for testing purposes)
hosted here: http://www.learnclip.com/airwritingweb/ (so not on
airwriting.com)

Now, I see two options to solve this crossDomain issue;

*A.*
Run the web app build with jquery on the same domain. - how can I do this?
Is it possible to copy the whole web app project just to some tapestry
folder and tell tapestry that it should ignore that folder - but still
making it accessable from the outside? eg. via
www.airwriting.com/mobile/jquery ?

*B.*
if i got it right (http://api.jquery.com/jQuery.getJSON/), the function

$.getJSON in

jquery mobile needs  a ?jsoncallback=? parameter, in my case

http://www.airwriting.com/mobile/public:getLocalGroups?lat=48.15lng=16.3?jsoncallback=
?

but I really have no idea how I have to handle the jsoncallback in my
service method:

private final String CONTENT_TYPE = application/javascript;

public StreamResponse onGetLocalGroups(){
Double latitude = Double.parseDouble(request.getParameter(lat));
Double longitude = Double.parseDouble(request.getParameter(lng));

ListGroup groups = groupService.getGroupsOnLocation(new
GeoPoint(latitude, longitude).toPoint(), limit, offset);

JSONArray jsGroups = new JSONArray();
for( Group group : groups ){
jsGroups.put(group.toJSON());
}
return new TextStreamResponse(CONTENT_TYPE, jsGroups.toString());
}
http://www.airwriting.com/mobile/public:getLocalGroups?lat=48.15lng=16.3

just calling (from a not airwriting.com domain)

script
(function() {
  var url = 
http://www.airwriting.com/mobile/public:getLocalGroups?lat=48.15lng=16.3;;
  $.getJSON( url, {
format: json
  })
  .done(function( data ) {
$.each( data.items, function( i, item ) {

   alert (item);

});
  });
})();
/script



DOES NOT WORK - so i guess it has something to do with the callback.
Reading me deeper into the jsonP theory, my understanding focuses on the
need for writing somekind of filter in the filterrequestchain for handling
this kind of crossDomain request. puh.. (
http://code.google.com/p/jsonp-java/)


any help is highly appreciated.. thx,
alex


further, good links:
http://json-p.org/
http://alotaiba.github.com/FlyJSONP/#!/demo