You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by jeffrey ai <jf...@gmail.com> on 2008/02/19 20:35:23 UTC
T5 5.0.10: ComponentResources.createActionLink broke after
upgrade from 5.0.6 to 5.0.10
Hi All,
I am experiencing a error of using "ComponentResources.createActionLink"
after upgrade from 5.0.6 to 5.0.10. The code used to work now broke.
The Stack Trace is :
==================
Caused by: java.lang.NullPointerException
at
org.apache.tapestry.internal.services.LinkFactoryImpl.collectActivationContextForPage(LinkFactoryImpl.java:217)
at
org.apache.tapestry.internal.services.LinkFactoryImpl.createActionLink(LinkFactoryImpl.java:129)
at
$LinkFactory_11832fc661e.createActionLink($LinkFactory_11832fc661e.java)
at
org.apache.tapestry.internal.structure.PageImpl.createActionLink(PageImpl.java:156)
at
org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.createActionLink(InternalComponentResourcesImpl.java:123)
at
net.memberdirect.mdsb.pages.trial.DemoActionLink.onActionFromLink1(DemoActionLink.java:18)
....
==================
The code snippet is:
===============
public class DemoActionLink
{
@Inject
private ComponentResources componentResources;
@SuppressWarnings("unused")
private Object onActionFromLink1()
{
// Some Business logic
// Navigation logic
return this.componentResources.createActionLink( "Link2", false );
}
@SuppressWarnings("unused")
private Object onLink2()
{
// Some Business logic
// Navigation logic
}
}
======================
What I noticed in 5.0.10 source code is that
"ComponentResources.createActionLink" is either called from "beginRender" or
"afterRender" method only. Does that imply that we cannot use it in event
handlers?
Cheers,
Jeffrey Ai
--
View this message in context: http://www.nabble.com/T5-5.0.10%3A---ComponentResources.createActionLink-broke-after-upgrade-from-5.0.6-to-5.0.10-tp15562416p15562416.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5 5.0.10: ComponentResources.createActionLink broke after
upgrade from 5.0.6 to 5.0.10
Posted by jeffrey ai <jf...@gmail.com>.
Right. The javadoc of "createActionLink" doesn't tell anything when it
should be used.
To my opinion, it makes sense to allow it be used in event handler methods.
Cheers,
Jeffrey Ai
--
View this message in context: http://www.nabble.com/T5-5.0.10%3A---ComponentResources.createActionLink-broke-after-upgrade-from-5.0.6-to-5.0.10-tp15562416p15594398.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5 5.0.10: ComponentResources.createActionLink broke after
upgrade from 5.0.6 to 5.0.10
Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,
I have exactly the same problem, I make a simple class to test, it works in
5.0.7, but fails in 5.0.9 and 10:
page class:
public class TestPage1 {
@Inject
private ComponentResources resources;
private Object[] _objs;
public Class onActivate(Object[] obj) {
_objs = obj;
return null;
}
public Object[] onPassivate() {
return _objs;
}
Link onActionFromDelete(Long id) {
String deleteLink = resources.createActionLink("DeleteConfirm",
false, id).toURI(); // this call fails
return null;
}
public String onDeleteConfirm(Long id) {
return null;
}
}
template:
<t:ActionLink t:id="Delete" context="1">Delete me</t:ActionLink>
jeffrey ai wrote:
>
> Hi All,
>
> I am experiencing a error of using "ComponentResources.createActionLink"
> after upgrade from 5.0.6 to 5.0.10. The code used to work now broke.
>
>
>
--
View this message in context: http://www.nabble.com/T5-5.0.10%3A---ComponentResources.createActionLink-broke-after-upgrade-from-5.0.6-to-5.0.10-tp15562416p15584097.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5 5.0.10: ComponentResources.createActionLink broke after
upgrade from 5.0.6 to 5.0.10
Posted by Angelo Chen <an...@yahoo.com.hk>.
i post a jira for this:
https://issues.apache.org/jira/browse/TAPESTRY-2184
https://issues.apache.org/jira/browse/TAPESTRY-2184
Davor Hrg wrote:
>
> plese post a JIRA issue
>
>
>
--
View this message in context: http://www.nabble.com/T5-5.0.10%3A---ComponentResources.createActionLink-broke-after-upgrade-from-5.0.6-to-5.0.10-tp15562416p15606735.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5 5.0.10: ComponentResources.createActionLink broke after upgrade from 5.0.6 to 5.0.10
Posted by Davor Hrg <hr...@gmail.com>.
plese post a JIRA issue
On Feb 20, 2008 10:04 PM, Davor Hrg <hr...@gmail.com> wrote:
> this looks like a bug...
>
> to go arround it you can call:
> private void onActionFromLink1()
> {
> // Some Business logic
> // Navigation logic
> this.componentResources.triggerEvent( "Link2", null,null );
> }
> but beware this will not generate anothers request,
> and any hibernate session will be the same for onActionFromLink1
> and for onLink2
>
> Davor Hrg
>
>
> On Feb 20, 2008 6:40 PM, jeffrey ai <jf...@gmail.com> wrote:
> >
> > Sorry, I don't quite get how is that related.
> > In this case, I am not using onActivate and onPassivate at all.
> > I am just trying to get an action link in an event handler method.
> >
> > Cheers,
> > Jeffrey Ai
> >
> >
> > quick guess ....
> > are you returning any null values in onPassivate ?
> >
> > Davor Hrg
> >
> > --
> > View this message in context: http://www.nabble.com/T5-5.0.10%3A---ComponentResources.createActionLink-broke-after-upgrade-from-5.0.6-to-5.0.10-tp15562416p15594441.html
> >
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5 5.0.10: ComponentResources.createActionLink broke after upgrade from 5.0.6 to 5.0.10
Posted by Davor Hrg <hr...@gmail.com>.
this looks like a bug...
to go arround it you can call:
private void onActionFromLink1()
{
// Some Business logic
// Navigation logic
this.componentResources.triggerEvent( "Link2", null,null );
}
but beware this will not generate anothers request,
and any hibernate session will be the same for onActionFromLink1
and for onLink2
Davor Hrg
On Feb 20, 2008 6:40 PM, jeffrey ai <jf...@gmail.com> wrote:
>
> Sorry, I don't quite get how is that related.
> In this case, I am not using onActivate and onPassivate at all.
> I am just trying to get an action link in an event handler method.
>
> Cheers,
> Jeffrey Ai
>
>
> quick guess ....
> are you returning any null values in onPassivate ?
>
> Davor Hrg
>
> --
> View this message in context: http://www.nabble.com/T5-5.0.10%3A---ComponentResources.createActionLink-broke-after-upgrade-from-5.0.6-to-5.0.10-tp15562416p15594441.html
>
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5 5.0.10: ComponentResources.createActionLink broke after
upgrade from 5.0.6 to 5.0.10
Posted by jeffrey ai <jf...@gmail.com>.
Sorry, I don't quite get how is that related.
In this case, I am not using onActivate and onPassivate at all.
I am just trying to get an action link in an event handler method.
Cheers,
Jeffrey Ai
quick guess ....
are you returning any null values in onPassivate ?
Davor Hrg
--
View this message in context: http://www.nabble.com/T5-5.0.10%3A---ComponentResources.createActionLink-broke-after-upgrade-from-5.0.6-to-5.0.10-tp15562416p15594441.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: T5 5.0.10: ComponentResources.createActionLink broke after upgrade from 5.0.6 to 5.0.10
Posted by Davor Hrg <hr...@gmail.com>.
quick guess ....
are you returning any null values in onPassivate ?
Davor Hrg
On Feb 19, 2008 8:35 PM, jeffrey ai <jf...@gmail.com> wrote:
>
> Hi All,
>
> I am experiencing a error of using "ComponentResources.createActionLink"
> after upgrade from 5.0.6 to 5.0.10. The code used to work now broke.
>
> The Stack Trace is :
> ==================
>
> Caused by: java.lang.NullPointerException
> at
> org.apache.tapestry.internal.services.LinkFactoryImpl.collectActivationContextForPage(LinkFactoryImpl.java:217)
> at
> org.apache.tapestry.internal.services.LinkFactoryImpl.createActionLink(LinkFactoryImpl.java:129)
> at
> $LinkFactory_11832fc661e.createActionLink($LinkFactory_11832fc661e.java)
> at
> org.apache.tapestry.internal.structure.PageImpl.createActionLink(PageImpl.java:156)
> at
> org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.createActionLink(InternalComponentResourcesImpl.java:123)
> at
> net.memberdirect.mdsb.pages.trial.DemoActionLink.onActionFromLink1(DemoActionLink.java:18)
> ....
> ==================
>
> The code snippet is:
> ===============
> public class DemoActionLink
> {
> @Inject
> private ComponentResources componentResources;
>
> @SuppressWarnings("unused")
> private Object onActionFromLink1()
> {
> // Some Business logic
>
> // Navigation logic
> return this.componentResources.createActionLink( "Link2", false );
> }
>
> @SuppressWarnings("unused")
> private Object onLink2()
> {
> // Some Business logic
>
> // Navigation logic
> }
> }
>
> ======================
>
> What I noticed in 5.0.10 source code is that
> "ComponentResources.createActionLink" is either called from "beginRender" or
> "afterRender" method only. Does that imply that we cannot use it in event
> handlers?
>
> Cheers,
> Jeffrey Ai
>
> --
> View this message in context: http://www.nabble.com/T5-5.0.10%3A---ComponentResources.createActionLink-broke-after-upgrade-from-5.0.6-to-5.0.10-tp15562416p15562416.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org