Re: [T5.2.6] When can a java.net.URL be returned from an event handler?

2012-10-22 Thread wout86
Ok, I'll add some more context here. 

The event handling code I'm talking about is actually invoked in a
component's /dispatchComponentEvent/ function. It is added as 'before'
advice on this function through a Tapestry Class Transformation.

Basically, the event handling code verifies a boolean and then either 
- lets the dispatchComponentEvent call proceed as normal (through
/invocation.proceed()/), 
- or handles the dispatchComponentEvent call itself (if !request.isXHR()):
it sets a java.net.URL object u as the ComponentEvent's result (through
/storeResult(u)/) and it overrides the event's result  (through
/overrideResult(true)/).


This code typically works, but there are cases in which I get the
aforementioned exception:
A component event handler method returned the value
http://www.url.here/aFolder. Return type java.net.URL can not be handled'.

I added some additional logging which gives the following result when the
exception occurs:

1. Event causing the user to be redirected: ComponentEvent[activate from
(self)] on XPage
Storing the redirectTarget (http://www.url.here/aFolder) as the
triggered event's result.

2. Event causing the user to be redirected: ComponentEvent[exception from
(self)] on XPage
Storing the redirectTarget (http://www.url.here/aFolder) as the
triggered event's result.

3. A component event handler method returned the value
http://www.url.here/aFolder. Return type java.net.URL can not be handled.


The logging shows that it's always the 'exception' event handling that
causes the URL failure. What causes the 'exception' event in the first place
is unclear to me...


Hopefully this description can give more insight in the problem?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-2-6-When-can-a-java-net-URL-be-returned-from-an-event-handler-tp5716618p5717120.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Can not get annotation instance on advised methods

2012-10-22 Thread Rural Hunter

Hi,

I have an annotation:
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Audit
{
String operate() default ;
String desc() default ;
int type();
int idParamIndex() default 0;
}

I put on some methods of my DAO services and advised them in AppModule:

DAOInterface:
@Audit(type=1)
public void delete(int id) throws Exception;

AppModule:
for (Method m : receiver.getInterface().getMethods())
{
if (m.getAnnotation(Audit.class) != null)
{
System.out.println(advising +m.getName());
receiver.adviseMethod(m, advice);
}
}

There is no problem and I can see the methods are advised by the 
System.out above. But in the advise method, I can not get the Audit 
annotation:

public void advise(MethodInvocation invocation)
{
String methodName = invocation.getMethod().getName();
Audit audit = invocation.getAnnotation(Audit.class);
System.out.println(method=+methodName+, audit=+audit);
invocation.proceed();
}

The above advise method is called and I can see the system.out is always 
like this: method=delete, audit=null. I need some information in the 
Audit annotation but why I can not get the annotation instance?



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



[T5.3]Zone parameter of a form null after ajax rendering?

2012-10-22 Thread Thomas Cucchietti
Hello,

Is the following behavior intended, as it may be a bug ?

With this structure :

t:zone t:id=zoneToRefresh id=zoneToRefresh
   t:delegate to=activeBlock/
/t:zone

t:block t:id=empty
   !-- empty block --
/t:block

t:block t:id=manageBlock
   t:form t:id=manageForm zone=zoneToRefresh
t:radiogroup t:value=manage
input type=radio t:type=radio t:value=true/
Yes
input type=radio t:type=radio t:value=false/
No
/t:radiogroup

t:submit value=Submit form/
   /t:form
/t:block

(I don't have included the button that refresh the zone the first time)

The method getActiveBlock() return the emptyBlock when the page initially
loads, then it returns the manageBlock once the refresh button is hit.

The problem is that the form contained in the manageBlock doesn't refresh
the zone in Ajax, and reload the whole page instead.

From what I've searched, it seems that, when the manage block is rendered,
the zone parameter of the manageForm is null (see line 356 of Form.class,
in beginRender method) whereas it should be valued with the zoneToRefresh.

I have already encoutered similar errors : the forms and actionlinks that
should fire ajax reloads, fire page reload instead when they have not been
rendered at the initial page loading.

Regards,
Thomas


Re: Can not get annotation instance on advised methods

2012-10-22 Thread Taha Siddiqi
Did you try invocation.getInstance().getAnnotation() ?

On Oct 22, 2012, at 1:15 PM, Rural Hunter wrote:

 Hi,
 
 I have an annotation:
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.METHOD)
 public @interface Audit
 {
String operate() default ;
String desc() default ;
int type();
int idParamIndex() default 0;
 }
 
 I put on some methods of my DAO services and advised them in AppModule:
 
 DAOInterface:
@Audit(type=1)
public void delete(int id) throws Exception;
 
 AppModule:
for (Method m : receiver.getInterface().getMethods())
{
if (m.getAnnotation(Audit.class) != null)
{
System.out.println(advising +m.getName());
receiver.adviseMethod(m, advice);
}
}
 
 There is no problem and I can see the methods are advised by the System.out 
 above. But in the advise method, I can not get the Audit annotation:
public void advise(MethodInvocation invocation)
{
String methodName = invocation.getMethod().getName();
Audit audit = invocation.getAnnotation(Audit.class);
System.out.println(method=+methodName+, audit=+audit);
invocation.proceed();
}
 
 The above advise method is called and I can see the system.out is always like 
 this: method=delete, audit=null. I need some information in the Audit 
 annotation but why I can not get the annotation instance?
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 


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



Re: [T5.3]Zone parameter of a form null after ajax rendering?

2012-10-22 Thread Thomas Cucchietti
I tried to manually link the zone to the form, but with no success.

@BeginRender
void fixZoneAjaxSupport() {
Link link = resources.createEventLink(manualLinkToZone, null);
clientBehaviorSupport.linkZone(manageForm, zoneToRefresh, link);
}


The linkzone in Tapestry.init() is updated and contains :

{
linkId : manageForm,
url : /my/url/to/page:manualLinkToZone,
zoneId : zoneToRefresh
}

However, as the manageForm has random generated number added to its client
id, it won't be taken into account...

Even if I inject the manageForm into my page, as it isn't initially present
in the page but only after a first zone update, it's null and I have no way
to know the exact client id of my form.

After some additional search (thanks markmail!), it seems that this
clientId will always be uniquefied as the form is contained in the zone.

Anybody has a clue on my first mail? or at least on the workaround I'm
trying to find?

Thomas

2012/10/22 Thomas Cucchietti thomas.cucchie...@gmail.com

 Hello,

 Is the following behavior intended, as it may be a bug ?

 With this structure :

 t:zone t:id=zoneToRefresh id=zoneToRefresh
t:delegate to=activeBlock/
 /t:zone

 t:block t:id=empty
!-- empty block --
 /t:block

 t:block t:id=manageBlock
t:form t:id=manageForm zone=zoneToRefresh
 t:radiogroup t:value=manage
 input type=radio t:type=radio t:value=true/
 Yes
 input type=radio t:type=radio t:value=false/
 No
 /t:radiogroup

 t:submit value=Submit form/
/t:form
 /t:block

 (I don't have included the button that refresh the zone the first time)

 The method getActiveBlock() return the emptyBlock when the page initially
 loads, then it returns the manageBlock once the refresh button is hit.

 The problem is that the form contained in the manageBlock doesn't refresh
 the zone in Ajax, and reload the whole page instead.

 From what I've searched, it seems that, when the manage block is rendered,
 the zone parameter of the manageForm is null (see line 356 of Form.class,
 in beginRender method) whereas it should be valued with the zoneToRefresh.

 I have already encoutered similar errors : the forms and actionlinks that
 should fire ajax reloads, fire page reload instead when they have not been
 rendered at the initial page loading.

 Regards,
 Thomas



Re: Can not get annotation instance on advised methods

2012-10-22 Thread Rural Hunter

于 2012/10/22 17:02, Taha Siddiqi 写道:

Did you try invocation.getInstance().getAnnotation() ?
What is that for? I read the API and seems it's not what I needed. My 
annotation is on methods being advised, not on the class instance. I 
also tried invocation.getMethod().getAnnotations() and it returns an 
empty array. I just googled and found an old post:

http://tapestry.1045711.n5.nabble.com/Plastic-amp-proxy-annotations-td4453361.html

Seems annotation is not copied for methods by plastic...If it's still 
true, is there anything else I can implement what I needed? My intention 
is to audit methods call on my DAO services, including user information 
from session, method names(or operation type: update/delete/insert etc.) 
and some parameters(to get record id etc.), which I planed to implement 
by service advising and annotation.


On Oct 22, 2012, at 1:15 PM, Rural Hunter wrote:


Hi,

I have an annotation:
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Audit
{
String operate() default ;
String desc() default ;
int type();
int idParamIndex() default 0;
}

I put on some methods of my DAO services and advised them in AppModule:

DAOInterface:
@Audit(type=1)
public void delete(int id) throws Exception;

AppModule:
for (Method m : receiver.getInterface().getMethods())
{
if (m.getAnnotation(Audit.class) != null)
{
System.out.println(advising +m.getName());
receiver.adviseMethod(m, advice);
}
}

There is no problem and I can see the methods are advised by the System.out 
above. But in the advise method, I can not get the Audit annotation:
public void advise(MethodInvocation invocation)
{
String methodName = invocation.getMethod().getName();
Audit audit = invocation.getAnnotation(Audit.class);
System.out.println(method=+methodName+, audit=+audit);
invocation.proceed();
}

The above advise method is called and I can see the system.out is always like this: 
method=delete, audit=null. I need some information in the Audit annotation 
but why I can not get the annotation instance?


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



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





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



Re: Can not get annotation instance on advised methods

2012-10-22 Thread Taha Siddiqi
May be get the annotation in the advisor implementation using 
MethodAdviceReceiver#getMethodAnnotation


On Oct 22, 2012, at 3:11 PM, Rural Hunter wrote:

 于 2012/10/22 17:02, Taha Siddiqi 写道:
 Did you try invocation.getInstance().getAnnotation() ?
 What is that for? I read the API and seems it's not what I needed. My 
 annotation is on methods being advised, not on the class instance. I also 
 tried invocation.getMethod().getAnnotations() and it returns an empty array. 
 I just googled and found an old post:
 http://tapestry.1045711.n5.nabble.com/Plastic-amp-proxy-annotations-td4453361.html
 
 Seems annotation is not copied for methods by plastic...If it's still true, 
 is there anything else I can implement what I needed? My intention is to 
 audit methods call on my DAO services, including user information from 
 session, method names(or operation type: update/delete/insert etc.) and some 
 parameters(to get record id etc.), which I planed to implement by service 
 advising and annotation.
 
 On Oct 22, 2012, at 1:15 PM, Rural Hunter wrote:
 
 Hi,
 
 I have an annotation:
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.METHOD)
 public @interface Audit
 {
String operate() default ;
String desc() default ;
int type();
int idParamIndex() default 0;
 }
 
 I put on some methods of my DAO services and advised them in AppModule:
 
 DAOInterface:
@Audit(type=1)
public void delete(int id) throws Exception;
 
 AppModule:
for (Method m : receiver.getInterface().getMethods())
{
if (m.getAnnotation(Audit.class) != null)
{
System.out.println(advising +m.getName());
receiver.adviseMethod(m, advice);
}
}
 
 There is no problem and I can see the methods are advised by the System.out 
 above. But in the advise method, I can not get the Audit annotation:
public void advise(MethodInvocation invocation)
{
String methodName = invocation.getMethod().getName();
Audit audit = invocation.getAnnotation(Audit.class);
System.out.println(method=+methodName+, audit=+audit);
invocation.proceed();
}
 
 The above advise method is called and I can see the system.out is always 
 like this: method=delete, audit=null. I need some information in the 
 Audit annotation but why I can not get the annotation instance?
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 


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



Re: Mixing parameters from component and page

2012-10-22 Thread Thiago H de Paula Figueiredo
In Tapestry, components and pages are supposed to be a black box, so doing  
something that involves a field from one page and a field from one  
component is bad practice. I would put the calculation inside the  
component.


On Sat, 20 Oct 2012 16:12:49 -0300, o1550762 o1550...@rtrtr.com wrote:

I have one component named PartofAddition.java and in it I have the  
following


public class PartOfAddition{
@Property
private int number;

@Property
private int picture;

public int getNumber()
{
 return number;
}

public int getPicture()
{
 return picture;
}
}
//PartOfAddition.tml

div class=section
div class=post_numberlabel${message:number}: /labelinput
t:type=int t:id=number t:validate=required size=4/input/div

div class=post_numberlabel${message:picture}: /labelinput
t:type=TextField t:id=picture t:validate=required
size=4/input/div


and page in which I try to call this component and along with some of the
fields declared in it and in PartOfAddition file, to compute some method.

public class ComputeAddition.java

@InjectComponent
private PartOfAddition partOfAddition;

@Parameter
private int number2;

public int computeIt(){
*//return addition of the two numbers, one from this page, and another  
from

the component PartOfAddition*
}


I have no idea how to implement this bolded. Any help is greatly
appreciated. Thanks in advance.
}



--
View this message in context:  
http://tapestry.1045711.n5.nabble.com/Mixing-parameters-from-component-and-page-tp5717094.html

Sent from the Tapestry - User mailing list archive at Nabble.com.

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




--
Thiago H. de Paula Figueiredo

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



Re: JSONLiteral breks zone refresh

2012-10-22 Thread bhorvat
Howard Lewis Ship wrote
 What if the function already existed on some global object?

The function should not exist anywhere before my code. Here is what happens. 
The page is loaded, I click a link which refreshes a zone and then it
reveals a textfield with autocomponent mixin. I am passing that JSONObject
to options of the autocomponent mixin that will assign a function to the
select event of the autocomponent (my idea is to submit the form on select -
well to submit what the users has selected)

public JSONObject getAutoUsersParams() { 
 JSONObject params = new JSONObject(); 
 params.put(select, new JSONLiteral(function (event,ui)
{alert(1)})); 
 return params; 
} 

However the zone is simply not refreshed. But to answer the original
question since the function is then inserted for the first time it does not
exist anywhere else. When I go to debug I can see that on the server side
everything happens as it should. Also the zone is refreshed if I dont pass
the JSONLiteral. Also if I set that the textfield is visible at first load
then the function is passed as it should, when I select the link to
hide/show the edit mode it hides it, but then it wont show it on my next
click.

So the problem is only when I want to refresh the zone and I pass the
JSONLiteral


Howard Lewis Ship wrote
  
 What if the JSONObject you pass in is not passed directly to autocommit
 code?

hm...since I am not that good with js I have no idea what autocommit code
is? Any suggestion how I can check this or what it is?


Howard Lewis Ship wrote
  
 So you pass what I call a spec, and it builds the options for the
 autocommit itself.  You don't specify a function, you specify a
 function name or reference. 

I am not quite positive what you want to explain to me here but if I
understood you correctly this approach is not good for me. I dont want to
execute the function when I refresh a zone I just want to pass the function
to the select event of the autocomplete mixin. So calling addScript and
passing a function sadly wont work for me


Howard Lewis Ship wrote
  
 I'm not exactly sure why the Ajax case fails; I suspect something in
 the Prototype portion of the pipeline is sanitizing the JSONObject to
 defeat what you are attempting. I always start in the Network tab, to
 see exactly what is being passed down to the client (I sometimes use
 curl from the command line just to be certain there isn't some browser
 caching getting in the way).

I am using jquery (probably should have mention this before). In the Network
tap I dont see anything wrong. Just that event is being triggered. However
in the console I do see some error 

Communication with the server failed: null t5-console-jquery.js:64
error t5-console-jquery.js:64
$.extend.invokeLogger tapestry-jquery.js:160
$.extend.error tapestry-jquery.js:120
$.tapestry.utils.ajaxFailureHandler tapestry-jquery.js:1103
fire jquery-1.7.2.js:1075
self.fireWith jquery-1.7.2.js:1193
done jquery-1.7.2.js:7540
callback jquery-1.7.2.js:8324
Ajax failure: Status 200 for #{request.url}: null 
Ajax failure: Status 200 for #{request.url}: null t5-console-jquery.js:56

The cash is definitely not the problem I have checked that 

tnx for help



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/JSONLiteral-breks-zone-refresh-tp5717101p5717128.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Tree and Form submission to Zone problem

2012-10-22 Thread Nicolas Bouillon
Hi,

We have got a problem with the Tree component.

In our tree element, we want to have a form included to allow to add a
new child to the current element. We have used the p:label attribute
to customize the rendering of the element, and we have included a form
inside, which must submit in XHR to a zone.

The problem all but the last item on the tree triggers a plain old
form submission with a full reload.
The last item trigger a XHR submit but for all the displayed items in
the tree at the time the page loads (so not taking into account the
dynamically expanded elements).

If you look at the source code generated at the bottom of the page,
you can see the linkId is always the same for each form element :

  linkZone : [
{
  linkId : form_2,
  url : /index.form/Pets,
  zoneId : zone
},
{
  linkId : form_2,
  url : /index.form/Games,
  zoneId : zone
},
{
  linkId : form_2,
  url : /index.form/Numbers,
  zoneId : zone
},
{
  linkId : form_2,
  url : /index.form/Last$0020element,
  zoneId : zone
}
  ],

I've setup a sample project on github at
https://github.com/bouil/tapestry-tree-test

The problem can be live tested at http://tapestry-tree-test.cloudfoundry.com/

Thank you for any help and workaround you could provide to solve this problem.

Nicolas.

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



Re: Calling specific object

2012-10-22 Thread o1550762
Thank you mr. Howard. :) It worked exactly how I wanted it to work.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Calling-specific-object-tp5717114p5717130.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: What happens when browser close or type new url from client side?

2012-10-22 Thread Thiago H de Paula Figueiredo

On Mon, 22 Oct 2012 11:30:14 -0200, dinesh707 dinesh...@gmail.com wrote:

Hi, i need to catch the page unload event and i need to work that with  
all the browsers. I wonder what really happens for the application  
server side when some one close the client. If i'm running a thread will  
it continue to run until it finished its job?


Hi!

These are two question which are't specific to Tapestry, the first is pure  
JavaScript and the second a Java web application one, so it shouldn't be  
posted here. But I'm in a good mood and I'll answer: yes, the server-side  
thread (the one who took the request or any other one) will continue to  
run.


--
Thiago H. de Paula Figueiredo

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



Re: [T5.3]Zone parameter of a form null after ajax rendering?

2012-10-22 Thread Thomas Cucchietti
I keep on trying a way to get this working.

In a previous discussion (see the end of Christian's answer
herehttp://markmail.org/thread/w6s3jtmwwfw6vfnx#query:+page:1+mid:jbwboaocfw4lkjqj+state:results),
a workaround for the null id could be the use of a HeartBeat to defer the
evaluation of the client id value.

had someone already given it a go?

2012/10/22 Thomas Cucchietti thomas.cucchie...@gmail.com

 I tried to manually link the zone to the form, but with no success.

 @BeginRender
 void fixZoneAjaxSupport() {
 Link link = resources.createEventLink(manualLinkToZone, null);
 clientBehaviorSupport.linkZone(manageForm, zoneToRefresh,
 link);
 }


 The linkzone in Tapestry.init() is updated and contains :

 {
 linkId : manageForm,
 url : /my/url/to/page:manualLinkToZone,
 zoneId : zoneToRefresh
 }

 However, as the manageForm has random generated number added to its client
 id, it won't be taken into account...

 Even if I inject the manageForm into my page, as it isn't initially
 present in the page but only after a first zone update, it's null and I
 have no way to know the exact client id of my form.

 After some additional search (thanks markmail!), it seems that this
 clientId will always be uniquefied as the form is contained in the zone.

 Anybody has a clue on my first mail? or at least on the workaround I'm
 trying to find?

 Thomas


 2012/10/22 Thomas Cucchietti thomas.cucchie...@gmail.com

 Hello,

 Is the following behavior intended, as it may be a bug ?

 With this structure :

 t:zone t:id=zoneToRefresh id=zoneToRefresh
t:delegate to=activeBlock/
 /t:zone

 t:block t:id=empty
!-- empty block --
 /t:block

 t:block t:id=manageBlock
t:form t:id=manageForm zone=zoneToRefresh
 t:radiogroup t:value=manage
 input type=radio t:type=radio t:value=true/
 Yes
 input type=radio t:type=radio t:value=false/
 No
 /t:radiogroup

 t:submit value=Submit form/
/t:form
 /t:block

 (I don't have included the button that refresh the zone the first time)

 The method getActiveBlock() return the emptyBlock when the page initially
 loads, then it returns the manageBlock once the refresh button is hit.

 The problem is that the form contained in the manageBlock doesn't refresh
 the zone in Ajax, and reload the whole page instead.

 From what I've searched, it seems that, when the manage block is
 rendered, the zone parameter of the manageForm is null (see line 356 of
 Form.class, in beginRender method) whereas it should be valued with the
 zoneToRefresh.

 I have already encoutered similar errors : the forms and actionlinks that
 should fire ajax reloads, fire page reload instead when they have not been
 rendered at the initial page loading.

 Regards,
 Thomas





Re: [T5.3]Zone parameter of a form null after ajax rendering?

2012-10-22 Thread Thiago H de Paula Figueiredo
Or provide explicit static ids instead of letting them be autogenerated by  
Tapestry.


On Mon, 22 Oct 2012 11:45:18 -0200, Thomas Cucchietti  
thomas.cucchie...@gmail.com wrote:



I keep on trying a way to get this working.

In a previous discussion (see the end of Christian's answer
herehttp://markmail.org/thread/w6s3jtmwwfw6vfnx#query:+page:1+mid:jbwboaocfw4lkjqj+state:results),
a workaround for the null id could be the use of a HeartBeat to defer the
evaluation of the client id value.

had someone already given it a go?

2012/10/22 Thomas Cucchietti thomas.cucchie...@gmail.com


I tried to manually link the zone to the form, but with no success.

@BeginRender
void fixZoneAjaxSupport() {
Link link = resources.createEventLink(manualLinkToZone, null);
clientBehaviorSupport.linkZone(manageForm, zoneToRefresh,
link);
}


The linkzone in Tapestry.init() is updated and contains :

{
linkId : manageForm,
url : /my/url/to/page:manualLinkToZone,
zoneId : zoneToRefresh
}

However, as the manageForm has random generated number added to its  
client

id, it won't be taken into account...

Even if I inject the manageForm into my page, as it isn't initially
present in the page but only after a first zone update, it's null and I
have no way to know the exact client id of my form.

After some additional search (thanks markmail!), it seems that this
clientId will always be uniquefied as the form is contained in the zone.

Anybody has a clue on my first mail? or at least on the workaround I'm
trying to find?

Thomas


2012/10/22 Thomas Cucchietti thomas.cucchie...@gmail.com


Hello,

Is the following behavior intended, as it may be a bug ?

With this structure :

t:zone t:id=zoneToRefresh id=zoneToRefresh
   t:delegate to=activeBlock/
/t:zone

t:block t:id=empty
   !-- empty block --
/t:block

t:block t:id=manageBlock
   t:form t:id=manageForm zone=zoneToRefresh
t:radiogroup t:value=manage
input type=radio t:type=radio t:value=true/
Yes
input type=radio t:type=radio t:value=false/
No
/t:radiogroup

t:submit value=Submit form/
   /t:form
/t:block

(I don't have included the button that refresh the zone the first time)

The method getActiveBlock() return the emptyBlock when the page  
initially

loads, then it returns the manageBlock once the refresh button is hit.

The problem is that the form contained in the manageBlock doesn't  
refresh

the zone in Ajax, and reload the whole page instead.

From what I've searched, it seems that, when the manage block is
rendered, the zone parameter of the manageForm is null (see line 356  
of

Form.class, in beginRender method) whereas it should be valued with the
zoneToRefresh.

I have already encoutered similar errors : the forms and actionlinks  
that
should fire ajax reloads, fire page reload instead when they have not  
been

rendered at the initial page loading.

Regards,
Thomas







--
Thiago H. de Paula Figueiredo

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



Re: [T5.3]Zone parameter of a form null after ajax rendering?

2012-10-22 Thread Thomas Cucchietti
Hello Thiago,

I did it by setting explicitely the id (on top of the t:id) parameter
of the form to manageForm, but it keeps adding some random value at the
end of this (for example manageForm_13a88baf8ea).

Something is missing for the clientid to be static?

2012/10/22 Thiago H de Paula Figueiredo thiag...@gmail.com

 Or provide explicit static ids instead of letting them be autogenerated by
 Tapestry.


 On Mon, 22 Oct 2012 11:45:18 -0200, Thomas Cucchietti 
 thomas.cucchie...@gmail.com wrote:

  I keep on trying a way to get this working.

 In a previous discussion (see the end of Christian's answer
 herehttp://markmail.org/**thread/w6s3jtmwwfw6vfnx#query:**
 +page:1+mid:jbwboaocfw4lkjqj+**state:resultshttp://markmail.org/thread/w6s3jtmwwfw6vfnx#query:+page:1+mid:jbwboaocfw4lkjqj+state:results
 ),

 a workaround for the null id could be the use of a HeartBeat to defer the
 evaluation of the client id value.

 had someone already given it a go?

 2012/10/22 Thomas Cucchietti thomas.cucchie...@gmail.com

  I tried to manually link the zone to the form, but with no success.

 @BeginRender
 void fixZoneAjaxSupport() {
 Link link = resources.createEventLink(**manualLinkToZone,
 null);
 clientBehaviorSupport.**linkZone(manageForm, zoneToRefresh,
 link);
 }


 The linkzone in Tapestry.init() is updated and contains :

 {
 linkId : manageForm,
 url : /my/url/to/page:**manualLinkToZone,
 zoneId : zoneToRefresh
 }

 However, as the manageForm has random generated number added to its
 client
 id, it won't be taken into account...

 Even if I inject the manageForm into my page, as it isn't initially
 present in the page but only after a first zone update, it's null and I
 have no way to know the exact client id of my form.

 After some additional search (thanks markmail!), it seems that this
 clientId will always be uniquefied as the form is contained in the zone.

 Anybody has a clue on my first mail? or at least on the workaround I'm
 trying to find?

 Thomas


 2012/10/22 Thomas Cucchietti thomas.cucchie...@gmail.com

  Hello,

 Is the following behavior intended, as it may be a bug ?

 With this structure :

 t:zone t:id=zoneToRefresh id=zoneToRefresh
t:delegate to=activeBlock/
 /t:zone

 t:block t:id=empty
!-- empty block --
 /t:block

 t:block t:id=manageBlock
t:form t:id=manageForm zone=zoneToRefresh
 t:radiogroup t:value=manage
 input type=radio t:type=radio t:value=true/
 Yes
 input type=radio t:type=radio t:value=false/
 No
 /t:radiogroup

 t:submit value=Submit form/
/t:form
 /t:block

 (I don't have included the button that refresh the zone the first time)

 The method getActiveBlock() return the emptyBlock when the page
 initially
 loads, then it returns the manageBlock once the refresh button is hit.

 The problem is that the form contained in the manageBlock doesn't
 refresh
 the zone in Ajax, and reload the whole page instead.

 From what I've searched, it seems that, when the manage block is
 rendered, the zone parameter of the manageForm is null (see line 356
 of
 Form.class, in beginRender method) whereas it should be valued with the
 zoneToRefresh.

 I have already encoutered similar errors : the forms and actionlinks
 that
 should fire ajax reloads, fire page reload instead when they have not
 been
 rendered at the initial page loading.

 Regards,
 Thomas





 --
 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




Using Spock Mocks with PageTester

2012-10-22 Thread Tony Nelson
Does anyone have an example of using Spock Mocks with PageTester?

I'd like to substitute Mocks for @Injected resources and I can't seem to find a 
way to make it happen.

Has anyone figured out a good way to do this?

Thanks in advance
-Tony




Since 1982, Starpoint Solutions has been a trusted source of human capital and 
solutions. We are committed to our clients, employees, environment, community 
and social concerns.  We foster an inclusive culture based on trust, respect, 
honesty and solid performance. Learn more about Starpoint and our social 
responsibility at http://www.starpoint.com/social_responsibility

This email message from Starpoint Solutions LLC is for the sole use of  the 
intended recipient(s) and may contain confidential and privileged  information. 
 Any unauthorized review, use, disclosure or distribution is prohibited.  If 
you are not the intended recipient, please contact the sender by reply email 
and destroy all copies of the original message.  Opinions, conclusions and 
other information in this message that do not relate to the official business 
of Starpoint Solutions shall be understood as neither given nor endorsed by it.

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



Re: Can not get annotation instance on advised methods

2012-10-22 Thread Rural Hunter
hmm...I think it won't work in any way trying to get the annotation from 
the method where plastic already removes the annotation...


于 2012/10/22 18:34, Taha Siddiqi 写道:

May be get the annotation in the advisor implementation using 
MethodAdviceReceiver#getMethodAnnotation


On Oct 22, 2012, at 3:11 PM, Rural Hunter wrote:


于 2012/10/22 17:02, Taha Siddiqi 写道:

Did you try invocation.getInstance().getAnnotation() ?

What is that for? I read the API and seems it's not what I needed. My 
annotation is on methods being advised, not on the class instance. I also tried 
invocation.getMethod().getAnnotations() and it returns an empty array. I just 
googled and found an old post:
http://tapestry.1045711.n5.nabble.com/Plastic-amp-proxy-annotations-td4453361.html

Seems annotation is not copied for methods by plastic...If it's still true, is 
there anything else I can implement what I needed? My intention is to audit 
methods call on my DAO services, including user information from session, 
method names(or operation type: update/delete/insert etc.) and some 
parameters(to get record id etc.), which I planed to implement by service 
advising and annotation.

On Oct 22, 2012, at 1:15 PM, Rural Hunter wrote:


Hi,

I have an annotation:
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Audit
{
String operate() default ;
String desc() default ;
int type();
int idParamIndex() default 0;
}

I put on some methods of my DAO services and advised them in AppModule:

DAOInterface:
@Audit(type=1)
public void delete(int id) throws Exception;

AppModule:
for (Method m : receiver.getInterface().getMethods())
{
if (m.getAnnotation(Audit.class) != null)
{
System.out.println(advising +m.getName());
receiver.adviseMethod(m, advice);
}
}

There is no problem and I can see the methods are advised by the System.out 
above. But in the advise method, I can not get the Audit annotation:
public void advise(MethodInvocation invocation)
{
String methodName = invocation.getMethod().getName();
Audit audit = invocation.getAnnotation(Audit.class);
System.out.println(method=+methodName+, audit=+audit);
invocation.proceed();
}

The above advise method is called and I can see the system.out is always like this: 
method=delete, audit=null. I need some information in the Audit annotation 
but why I can not get the annotation instance?


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


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




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



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





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



Re: Using Spock Mocks with PageTester

2012-10-22 Thread Alex Kotchnev
Tony,
  I use Testify to accomplish what you describe (
http://tapestrytestify.sourceforge.net/junit4.html) . I used it w/ EasyMock
mocks, but I assume it should be very similar to that.

Cheers - Alex K

On Mon, Oct 22, 2012 at 10:27 AM, Tony Nelson tnel...@starpoint.com wrote:

 Does anyone have an example of using Spock Mocks with PageTester?

 I'd like to substitute Mocks for @Injected resources and I can't seem to
 find a way to make it happen.

 Has anyone figured out a good way to do this?

 Thanks in advance
 -Tony




 Since 1982, Starpoint Solutions has been a trusted source of human capital
 and solutions. We are committed to our clients, employees, environment,
 community and social concerns.  We foster an inclusive culture based on
 trust, respect, honesty and solid performance. Learn more about Starpoint
 and our social responsibility at
 http://www.starpoint.com/social_responsibility

 This email message from Starpoint Solutions LLC is for the sole use of
  the intended recipient(s) and may contain confidential and privileged
  information.  Any unauthorized review, use, disclosure or distribution is
 prohibited.  If you are not the intended recipient, please contact the
 sender by reply email and destroy all copies of the original message.
  Opinions, conclusions and other information in this message that do not
 relate to the official business of Starpoint Solutions shall be understood
 as neither given nor endorsed by it.

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




Re: Using Spock Mocks with PageTester

2012-10-22 Thread Tony Nelson
I'll take a look at that.  Thank you very much for the suggestion.


On Oct 22, 2012, at 11:10 AM, Alex Kotchnev akoch...@gmail.com wrote:

 Tony,
  I use Testify to accomplish what you describe (
 http://tapestrytestify.sourceforge.net/junit4.html) . I used it w/ EasyMock
 mocks, but I assume it should be very similar to that.

 Cheers - Alex K

 On Mon, Oct 22, 2012 at 10:27 AM, Tony Nelson tnel...@starpoint.com wrote:

 Does anyone have an example of using Spock Mocks with PageTester?

 I'd like to substitute Mocks for @Injected resources and I can't seem to
 find a way to make it happen.

 Has anyone figured out a good way to do this?

 Thanks in advance
 -Tony




 Since 1982, Starpoint Solutions has been a trusted source of human capital
 and solutions. We are committed to our clients, employees, environment,
 community and social concerns.  We foster an inclusive culture based on
 trust, respect, honesty and solid performance. Learn more about Starpoint
 and our social responsibility at
 http://www.starpoint.com/social_responsibility

 This email message from Starpoint Solutions LLC is for the sole use of
 the intended recipient(s) and may contain confidential and privileged
 information.  Any unauthorized review, use, disclosure or distribution is
 prohibited.  If you are not the intended recipient, please contact the
 sender by reply email and destroy all copies of the original message.
 Opinions, conclusions and other information in this message that do not
 relate to the official business of Starpoint Solutions shall be understood
 as neither given nor endorsed by it.

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




Since 1982, Starpoint Solutions has been a trusted source of human capital and 
solutions. We are committed to our clients, employees, environment, community 
and social concerns.  We foster an inclusive culture based on trust, respect, 
honesty and solid performance. Learn more about Starpoint and our social 
responsibility at http://www.starpoint.com/social_responsibility

This email message from Starpoint Solutions LLC is for the sole use of  the 
intended recipient(s) and may contain confidential and privileged  information. 
 Any unauthorized review, use, disclosure or distribution is prohibited.  If 
you are not the intended recipient, please contact the sender by reply email 
and destroy all copies of the original message.  Opinions, conclusions and 
other information in this message that do not relate to the official business 
of Starpoint Solutions shall be understood as neither given nor endorsed by it.

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



Re: [T5.3]Zone parameter of a form null after ajax rendering?

2012-10-22 Thread Thomas Cucchietti
Still impossible to manage to have this zone update using the form inside
the zone.

From the browser console, I can see that the content of the partial render
response contains what is needed for the zone to be updated :

(...)
 inits : [{  formEventManager : [{
formId : manageForm_13a8936acde,  validate : {
 submit : true,blur : true  }}  ]
  },{  linkZone : [{  linkId :
manageForm_13a8936acde,  url : /my/page/url.manageform,
zoneId : zoneToRefresh}  ],
(...)

But this doesn't seem to be used.

2012/10/22 Thomas Cucchietti thomas.cucchie...@gmail.com

 Hello Thiago,

 I did it by setting explicitely the id (on top of the t:id) parameter
 of the form to manageForm, but it keeps adding some random value at the
 end of this (for example manageForm_13a88baf8ea).

 Something is missing for the clientid to be static?


 2012/10/22 Thiago H de Paula Figueiredo thiag...@gmail.com

 Or provide explicit static ids instead of letting them be autogenerated
 by Tapestry.


 On Mon, 22 Oct 2012 11:45:18 -0200, Thomas Cucchietti 
 thomas.cucchie...@gmail.com wrote:

  I keep on trying a way to get this working.

 In a previous discussion (see the end of Christian's answer
 herehttp://markmail.org/**thread/w6s3jtmwwfw6vfnx#query:**
 +page:1+mid:jbwboaocfw4lkjqj+**state:resultshttp://markmail.org/thread/w6s3jtmwwfw6vfnx#query:+page:1+mid:jbwboaocfw4lkjqj+state:results
 ),

 a workaround for the null id could be the use of a HeartBeat to defer the
 evaluation of the client id value.

 had someone already given it a go?

 2012/10/22 Thomas Cucchietti thomas.cucchie...@gmail.com

  I tried to manually link the zone to the form, but with no success.

 @BeginRender
 void fixZoneAjaxSupport() {
 Link link = resources.createEventLink(**manualLinkToZone,
 null);
 clientBehaviorSupport.**linkZone(manageForm, zoneToRefresh,
 link);
 }


 The linkzone in Tapestry.init() is updated and contains :

 {
 linkId : manageForm,
 url : /my/url/to/page:**manualLinkToZone,
 zoneId : zoneToRefresh
 }

 However, as the manageForm has random generated number added to its
 client
 id, it won't be taken into account...

 Even if I inject the manageForm into my page, as it isn't initially
 present in the page but only after a first zone update, it's null and I
 have no way to know the exact client id of my form.

 After some additional search (thanks markmail!), it seems that this
 clientId will always be uniquefied as the form is contained in the zone.

 Anybody has a clue on my first mail? or at least on the workaround I'm
 trying to find?

 Thomas


 2012/10/22 Thomas Cucchietti thomas.cucchie...@gmail.com

  Hello,

 Is the following behavior intended, as it may be a bug ?

 With this structure :

 t:zone t:id=zoneToRefresh id=zoneToRefresh
t:delegate to=activeBlock/
 /t:zone

 t:block t:id=empty
!-- empty block --
 /t:block

 t:block t:id=manageBlock
t:form t:id=manageForm zone=zoneToRefresh
 t:radiogroup t:value=manage
 input type=radio t:type=radio t:value=true/
 Yes
 input type=radio t:type=radio t:value=false/
 No
 /t:radiogroup

 t:submit value=Submit form/
/t:form
 /t:block

 (I don't have included the button that refresh the zone the first time)

 The method getActiveBlock() return the emptyBlock when the page
 initially
 loads, then it returns the manageBlock once the refresh button is hit.

 The problem is that the form contained in the manageBlock doesn't
 refresh
 the zone in Ajax, and reload the whole page instead.

 From what I've searched, it seems that, when the manage block is
 rendered, the zone parameter of the manageForm is null (see line 356
 of
 Form.class, in beginRender method) whereas it should be valued with the
 zoneToRefresh.

 I have already encoutered similar errors : the forms and actionlinks
 that
 should fire ajax reloads, fire page reload instead when they have not
 been
 rendered at the initial page loading.

 Regards,
 Thomas





 --
 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





Re: JSONLiteral breks zone refresh

2012-10-22 Thread Howard Lewis Ship
On Mon, Oct 22, 2012 at 4:39 AM, bhorvat horvat.z.bo...@gmail.com wrote:
 Howard Lewis Ship wrote
 What if the function already existed on some global object?

 The function should not exist anywhere before my code.

Well, change that.  Have you Ajax response load a library containing
the function.

 Here is what happens.
 The page is loaded, I click a link which refreshes a zone and then it
 reveals a textfield with autocomponent mixin. I am passing that JSONObject
 to options of the autocomponent mixin that will assign a function to the
 select event of the autocomponent (my idea is to submit the form on select -
 well to submit what the users has selected)

 public JSONObject getAutoUsersParams() {
  JSONObject params = new JSONObject();
  params.put(select, new JSONLiteral(function (event,ui)
 {alert(1)}));
  return params;
 }

 However the zone is simply not refreshed. But to answer the original
 question since the function is then inserted for the first time it does not
 exist anywhere else. When I go to debug I can see that on the server side
 everything happens as it should. Also the zone is refreshed if I dont pass
 the JSONLiteral. Also if I set that the textfield is visible at first load
 then the function is passed as it should, when I select the link to
 hide/show the edit mode it hides it, but then it wont show it on my next
 click.

 So the problem is only when I want to refresh the zone and I pass the
 JSONLiteral


 Howard Lewis Ship wrote

 What if the JSONObject you pass in is not passed directly to autocommit
 code?

 hm...since I am not that good with js I have no idea what autocommit code
 is? Any suggestion how I can check this or what it is?


 Howard Lewis Ship wrote

 So you pass what I call a spec, and it builds the options for the
 autocommit itself.  You don't specify a function, you specify a
 function name or reference.

 I am not quite positive what you want to explain to me here but if I
 understood you correctly this approach is not good for me. I dont want to
 execute the function when I refresh a zone I just want to pass the function
 to the select event of the autocomplete mixin. So calling addScript and
 passing a function sadly wont work for me


 Howard Lewis Ship wrote

 I'm not exactly sure why the Ajax case fails; I suspect something in
 the Prototype portion of the pipeline is sanitizing the JSONObject to
 defeat what you are attempting. I always start in the Network tab, to
 see exactly what is being passed down to the client (I sometimes use
 curl from the command line just to be certain there isn't some browser
 caching getting in the way).

 I am using jquery (probably should have mention this before). In the Network
 tap I dont see anything wrong. Just that event is being triggered. However
 in the console I do see some error

 Communication with the server failed: null t5-console-jquery.js:64
 error t5-console-jquery.js:64
 $.extend.invokeLogger tapestry-jquery.js:160
 $.extend.error tapestry-jquery.js:120
 $.tapestry.utils.ajaxFailureHandler tapestry-jquery.js:1103
 fire jquery-1.7.2.js:1075
 self.fireWith jquery-1.7.2.js:1193
 done jquery-1.7.2.js:7540
 callback jquery-1.7.2.js:8324
 Ajax failure: Status 200 for #{request.url}: null
 Ajax failure: Status 200 for #{request.url}: null t5-console-jquery.js:56

 The cash is definitely not the problem I have checked that

 tnx for help



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/JSONLiteral-breks-zone-refresh-tp5717101p5717128.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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




-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



Re: JSONLiteral breks zone refresh

2012-10-22 Thread bhorvat
Howard Lewis Ship wrote
 Well, change that.  Have you Ajax response load a library containing
 the function.

yea that is what I have done at the moment, I have added the code that needs
to be executed when a user selects something form the list. But this is hack
as I have overridden the original script to add my code. 

So obviously I need better solution as this a hack, which I was trying to do
by passing the function that I want to execute in the configuration which
breaks the zone refreshing 



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/JSONLiteral-breaks-zone-refresh-tapesty-jquery-tp5717101p5717142.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: JSONLiteral breks zone refresh

2012-10-22 Thread Thiago H de Paula Figueiredo
On Mon, 22 Oct 2012 14:48:13 -0200, bhorvat horvat.z.bo...@gmail.com  
wrote:



Howard Lewis Ship wrote

Well, change that.  Have you Ajax response load a library containing
the function.


yea that is what I have done at the moment, I have added the code that  
needs to be executed when a user selects something form the list. But  
this is hack as I have overridden the original script to add my code.


I'm sorry, but IMHO returning a whole JavaScript function from server-side  
dynamically instead of having this function already declared in a .js file  
and calling it is a hack.


--
Thiago H. de Paula Figueiredo

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



Re: JSONLiteral breks zone refresh

2012-10-22 Thread bhorvat
I agree, but still it is better then the alternative. 

Tapestry5-jquery team is providing the js file and if I override it then I
will have to make sure that next release from them is not broken in my
project as I have override one of their files.

What I want to do is just pass the function in the configuration for the
autocomponent. If you have any better ways to implement this please let me
know.

autocomplete that they use accepts the function as part of the configuration
and the way I can send them that is from the code using the JSONLiteral. I
have no idea how else can I pass the configuration without overriding their
autocomplete.js file that tapestry5-jquery team is using



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/JSONLiteral-breaks-zone-refresh-tapesty-jquery-tp5717101p5717144.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: JSONLiteral breks zone refresh

2012-10-22 Thread Chris Poulsen
Hi,

You could take this up with the tapestry5-jquery people in their
google group, i guess it is not impossible to provide a patch and get
it accepted by them.

-- 
Chris

On Mon, Oct 22, 2012 at 7:18 PM, bhorvat horvat.z.bo...@gmail.com wrote:
 I agree, but still it is better then the alternative.

 Tapestry5-jquery team is providing the js file and if I override it then I
 will have to make sure that next release from them is not broken in my
 project as I have override one of their files.

 What I want to do is just pass the function in the configuration for the
 autocomponent. If you have any better ways to implement this please let me
 know.

 autocomplete that they use accepts the function as part of the configuration
 and the way I can send them that is from the code using the JSONLiteral. I
 have no idea how else can I pass the configuration without overriding their
 autocomplete.js file that tapestry5-jquery team is using



 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/JSONLiteral-breaks-zone-refresh-tapesty-jquery-tp5717101p5717144.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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


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



Re: JSONLiteral breks zone refresh

2012-10-22 Thread bhorvat
Yea I have submitted an issue and will see what they say about it. 

If however anyone has any idea how to implement this so that it is not
related to the passing the function from the server code I would appreciate.

cheers



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/JSONLiteral-breaks-zone-refresh-tapesty-jquery-tp5717101p5717146.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Seeking Developers in Israel for Tapestry B2C application

2012-10-22 Thread Howard Lewis Ship
One of my clients is an Israeli start-up by the name of 5oosh
(pronounced five-oosh). Together we've been developing an innovative
and extensive B2C web app that, once launched, will introduce a set of
revolutionary new services to consumers of entertainment all across
the world. I cannot currently disclose the exact nature of the
services but suffice it to say that this really is an exciting venture
to be involved in.

5oosh is headquartered in Israel, and is currently looking to staff a
couple of local full time software-developer positions. Whoever fills
these positions will be personally trained and supervised by me, and
will get a chance to work with some of the latest and greatest
cutting-edge technologies and frameworks, including: Tapestry 5,
jQuery, Twitter Bootstrap, ActiveMQ, Hibernate, Git, Groovy, Geb,
Gradle, PostgreSQL, Flash, Flash Media Server, Backbone.js, Video.js,
Node.js  FFmpeg.

If you live in Israel, have at least 6 months of experience building
applications in Tapestry 5, and have at least two years of experience
as a Java developer, please send your CV to j...@5oosh.com. Experience
with any one of the above-listed technologies is of course a plus, so
please be sure to specify that in your CV.

As an added bonus (I hope) you'll get a chance to see what an
application built by the creator of Tapestry looks like, as well as
receive direct training and mentoring (*) from me.

(*) Working around the expected arrival of my daughter in February!

-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



Re: Can not get annotation instance on advised methods

2012-10-22 Thread Taha Siddiqi
May be I didn't get you but may be JpaTransactionAdvisorImpl can help. It uses 
@CommitAfter and checks the PersistenceContext using @PersistenceContext on the 
same method to get the context for which the method has to be advised. 


On Oct 22, 2012, at 8:22 PM, Rural Hunter wrote:

 hmm...I think it won't work in any way trying to get the annotation from the 
 method where plastic already removes the annotation...
 
 于 2012/10/22 18:34, Taha Siddiqi 写道:
 May be get the annotation in the advisor implementation using 
 MethodAdviceReceiver#getMethodAnnotation
 
 
 On Oct 22, 2012, at 3:11 PM, Rural Hunter wrote:
 
 于 2012/10/22 17:02, Taha Siddiqi 写道:
 Did you try invocation.getInstance().getAnnotation() ?
 What is that for? I read the API and seems it's not what I needed. My 
 annotation is on methods being advised, not on the class instance. I also 
 tried invocation.getMethod().getAnnotations() and it returns an empty 
 array. I just googled and found an old post:
 http://tapestry.1045711.n5.nabble.com/Plastic-amp-proxy-annotations-td4453361.html
 
 Seems annotation is not copied for methods by plastic...If it's still true, 
 is there anything else I can implement what I needed? My intention is to 
 audit methods call on my DAO services, including user information from 
 session, method names(or operation type: update/delete/insert etc.) and 
 some parameters(to get record id etc.), which I planed to implement by 
 service advising and annotation.
 On Oct 22, 2012, at 1:15 PM, Rural Hunter wrote:
 
 Hi,
 
 I have an annotation:
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.METHOD)
 public @interface Audit
 {
String operate() default ;
String desc() default ;
int type();
int idParamIndex() default 0;
 }
 
 I put on some methods of my DAO services and advised them in AppModule:
 
 DAOInterface:
@Audit(type=1)
public void delete(int id) throws Exception;
 
 AppModule:
for (Method m : receiver.getInterface().getMethods())
{
if (m.getAnnotation(Audit.class) != null)
{
System.out.println(advising +m.getName());
receiver.adviseMethod(m, advice);
}
}
 
 There is no problem and I can see the methods are advised by the 
 System.out above. But in the advise method, I can not get the Audit 
 annotation:
public void advise(MethodInvocation invocation)
{
String methodName = invocation.getMethod().getName();
Audit audit = invocation.getAnnotation(Audit.class);
System.out.println(method=+methodName+, audit=+audit);
invocation.proceed();
}
 
 The above advise method is called and I can see the system.out is always 
 like this: method=delete, audit=null. I need some information in the 
 Audit annotation but why I can not get the annotation instance?
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 


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



[ANN] JumpStart upgraded to Tapestry 5.3.6

2012-10-22 Thread Geoff Callender
Hi all,

JumpStart 6.3 is out. It features:

* Upgraded to use Tapestry 5.3.6.
* Upgraded to use tapestry5-jQuery 5.3.3.
* Fixes the create a fresh project feature (see the Tips page).

It's running in the usual place:

http://jumpstart.doublenegative.com.au/jumpstart

Please keep those comments and corrections coming!

Cheers,

Geoff


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



Re: [ANN] JumpStart upgraded to Tapestry 5.3.6

2012-10-22 Thread Howard Lewis Ship
Thanks, as always, for the terrific work!

On Mon, Oct 22, 2012 at 3:37 PM, Geoff Callender
geoff.callender.jumpst...@gmail.com wrote:
 Hi all,

 JumpStart 6.3 is out. It features:

 * Upgraded to use Tapestry 5.3.6.
 * Upgraded to use tapestry5-jQuery 5.3.3.
 * Fixes the create a fresh project feature (see the Tips page).

 It's running in the usual place:

 http://jumpstart.doublenegative.com.au/jumpstart

 Please keep those comments and corrections coming!

 Cheers,

 Geoff


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




-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



Re: [ANN] JumpStart upgraded to Tapestry 5.3.6

2012-10-22 Thread Geoff Callender
All for a good cause.

On 23/10/2012, at 9:52 AM, Howard Lewis Ship wrote:

 Thanks, as always, for the terrific work!
 
 On Mon, Oct 22, 2012 at 3:37 PM, Geoff Callender
 geoff.callender.jumpst...@gmail.com wrote:
 Hi all,
 
 JumpStart 6.3 is out. It features:
 
* Upgraded to use Tapestry 5.3.6.
* Upgraded to use tapestry5-jQuery 5.3.3.
* Fixes the create a fresh project feature (see the Tips page).
 
 It's running in the usual place:
 
http://jumpstart.doublenegative.com.au/jumpstart
 
 Please keep those comments and corrections coming!
 
 Cheers,
 
 Geoff
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 
 -- 
 Howard M. Lewis Ship
 
 Creator of Apache Tapestry
 
 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can get you up and productive in Tapestry fast!
 
 (971) 678-5210
 http://howardlewisship.com
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 


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



Re: [ANN] JumpStart upgraded to Tapestry 5.3.6

2012-10-22 Thread Bob Harner
Geoff, thanks for all your many improvements over the last several
versions. Month by month JumpStart becomes ever more valuable to the
Tapestry community.

One of the things I hope to do over the upcoming months is to provide many
more links to JumpStart within the official Tapestry documentation. So
often the very best illustration of Tapestry components and concepts is
right there in JumpStart.
On Oct 22, 2012 8:27 PM, Geoff Callender 
geoff.callender.jumpst...@gmail.com wrote:

 All for a good cause.

 On 23/10/2012, at 9:52 AM, Howard Lewis Ship wrote:

  Thanks, as always, for the terrific work!
 
  On Mon, Oct 22, 2012 at 3:37 PM, Geoff Callender
  geoff.callender.jumpst...@gmail.com wrote:
  Hi all,
 
  JumpStart 6.3 is out. It features:
 
 * Upgraded to use Tapestry 5.3.6.
 * Upgraded to use tapestry5-jQuery 5.3.3.
 * Fixes the create a fresh project feature (see the Tips page).
 
  It's running in the usual place:
 
 http://jumpstart.doublenegative.com.au/jumpstart
 
  Please keep those comments and corrections coming!
 
  Cheers,
 
  Geoff
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 
  --
  Howard M. Lewis Ship
 
  Creator of Apache Tapestry
 
  The source for Tapestry training, mentoring and support. Contact me to
  learn how I can get you up and productive in Tapestry fast!
 
  (971) 678-5210
  http://howardlewisship.com
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 


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




Re: [ANN] JumpStart upgraded to Tapestry 5.3.6

2012-10-22 Thread Geoff Callender
Well, that sounds like a vote of confidence. Thanks!

You're welcome to copy any example you like into the documentation - I see no 
harm in having duplication - but in cases where augmenting the doco with a live 
example would add value then by all means feel free to link to it.

BTW, Bob, your non-stop improvements to the documentation go largely unsung, so 
let me take this opportunity to shout out a big THANK YOU. The doco has come a 
long way and I, for one, really appreciate it.

Geoff

On 23/10/2012, at 12:34 PM, Bob Harner wrote:

 Geoff, thanks for all your many improvements over the last several
 versions. Month by month JumpStart becomes ever more valuable to the
 Tapestry community.
 
 One of the things I hope to do over the upcoming months is to provide many
 more links to JumpStart within the official Tapestry documentation. So
 often the very best illustration of Tapestry components and concepts is
 right there in JumpStart.
 On Oct 22, 2012 8:27 PM, Geoff Callender 
 geoff.callender.jumpst...@gmail.com wrote:
 
 All for a good cause.
 
 On 23/10/2012, at 9:52 AM, Howard Lewis Ship wrote:
 
 Thanks, as always, for the terrific work!
 
 On Mon, Oct 22, 2012 at 3:37 PM, Geoff Callender
 geoff.callender.jumpst...@gmail.com wrote:
 Hi all,
 
 JumpStart 6.3 is out. It features:
 
   * Upgraded to use Tapestry 5.3.6.
   * Upgraded to use tapestry5-jQuery 5.3.3.
   * Fixes the create a fresh project feature (see the Tips page).
 
 It's running in the usual place:
 
   http://jumpstart.doublenegative.com.au/jumpstart
 
 Please keep those comments and corrections coming!
 
 Cheers,
 
 Geoff
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 
 --
 Howard M. Lewis Ship
 
 Creator of Apache Tapestry
 
 The source for Tapestry training, mentoring and support. Contact me to
 learn how I can get you up and productive in Tapestry fast!
 
 (971) 678-5210
 http://howardlewisship.com
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 


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



Re: Can not get annotation instance on advised methods

2012-10-22 Thread Rural Hunter
No, it does not seems what I wanted. It's a pity that the annotation is 
lost in plastic class transformation. I have to find other ways. thanks 
anyway.


于 2012/10/23 2:16, Taha Siddiqi 写道:

May be I didn't get you but may be JpaTransactionAdvisorImpl can help. It uses 
@CommitAfter and checks the PersistenceContext using @PersistenceContext on the 
same method to get the context for which the method has to be advised.


On Oct 22, 2012, at 8:22 PM, Rural Hunter wrote:


hmm...I think it won't work in any way trying to get the annotation from the 
method where plastic already removes the annotation...

于 2012/10/22 18:34, Taha Siddiqi 写道:

May be get the annotation in the advisor implementation using 
MethodAdviceReceiver#getMethodAnnotation


On Oct 22, 2012, at 3:11 PM, Rural Hunter wrote:


于 2012/10/22 17:02, Taha Siddiqi 写道:

Did you try invocation.getInstance().getAnnotation() ?

What is that for? I read the API and seems it's not what I needed. My 
annotation is on methods being advised, not on the class instance. I also tried 
invocation.getMethod().getAnnotations() and it returns an empty array. I just 
googled and found an old post:
http://tapestry.1045711.n5.nabble.com/Plastic-amp-proxy-annotations-td4453361.html

Seems annotation is not copied for methods by plastic...If it's still true, is 
there anything else I can implement what I needed? My intention is to audit 
methods call on my DAO services, including user information from session, 
method names(or operation type: update/delete/insert etc.) and some 
parameters(to get record id etc.), which I planed to implement by service 
advising and annotation.

On Oct 22, 2012, at 1:15 PM, Rural Hunter wrote:


Hi,

I have an annotation:
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Audit
{
String operate() default ;
String desc() default ;
int type();
int idParamIndex() default 0;
}

I put on some methods of my DAO services and advised them in AppModule:

DAOInterface:
@Audit(type=1)
public void delete(int id) throws Exception;

AppModule:
for (Method m : receiver.getInterface().getMethods())
{
if (m.getAnnotation(Audit.class) != null)
{
System.out.println(advising +m.getName());
receiver.adviseMethod(m, advice);
}
}

There is no problem and I can see the methods are advised by the System.out 
above. But in the advise method, I can not get the Audit annotation:
public void advise(MethodInvocation invocation)
{
String methodName = invocation.getMethod().getName();
Audit audit = invocation.getAnnotation(Audit.class);
System.out.println(method=+methodName+, audit=+audit);
invocation.proceed();
}

The above advise method is called and I can see the system.out is always like this: 
method=delete, audit=null. I need some information in the Audit annotation 
but why I can not get the annotation instance?


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


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



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


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




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



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





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



How onActivate () will be called automatically

2012-10-22 Thread yaswanthbs
Hi All,
I have gone through a lot of portals, on how onActivate() will be called
automatically and how it takes the arguments. I found one i.e.,
*It allows the page to restore its internal state from data encoded into the
URL*
But I am not clear about this. 

I have one scenario
If I have two pages i.e., I am going from One.java to Two.java and when I am
in Two.java, I need to call onActivate() and it should access the argument
like one service class or some class.
Basically like this.
onActivate(MyOwnService service) {
// Here I need to access my service object
}

Regards,
Sai.





--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-onActivate-will-be-called-automatically-tp5717158.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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