Re: component parameter binding question

2009-03-04 Thread dhning
Are you using latest t5 snapshot or 5.0.X.X release?

If latest snapshot, just use like context=[user.id,user.name]
If not, there are 2 ways:
1. Do in java
public Object [] getContextValue() {
return new Object[2]{user.id, user.name};
}
2. Use list binding in t5commons library 
http://code.google.com/p/tapestry5-components/

Thanks

DH


- Original Message - 
From: 丁振波 zenberg.d...@gmail.com
To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, March 04, 2009 3:34 PM
Subject: component parameter binding question


 Hello guys, below is my case code:
 
 t:parameter name=nameCell
   t:pagelink page=edit context=user.id${user.name}/t:pagelink
 /t:parameter
 
 my question is, how can I pass mutil param value in context , is there any 
 format like user.id; user.name? 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 


Re: Q: deprecated for createActionLink method in ComponentResources ?

2009-03-04 Thread Kristian Marinkovic
hi,

_resource.createEventLink() is the replacement

g,
kris



dwi ardi irawan penyihirke...@gmail.com 
04.03.2009 08:43
Bitte antworten an
Tapestry users users@tapestry.apache.org


An
Tapestry users users@tapestry.apache.org
Kopie

Thema
Q: deprecated for createActionLink method in ComponentResources ?






Hi...
could anyone help me bout this deprecated method
is there any replacement for this method ??
I tried it for my JFreeChart on TapestryIt Works
but i feel so uncomfortable using this deprecated method.

please help me

.

@Inject
private ComponentResources _resources;

@Inject
private TypeCoercer _coercer;

public Link getChart3(){
// deprecated method for createActionLink
return _resources.createActionLink(chart, false, new
Object[]{200,200,aa,39,bb,12,cc,12,dd,4});
}

.




thnx u

-- 
http://dwiardiirawan.com
cos everyone could be extraordinary...lighten up !



Re: Q: deprecated for createActionLink method in ComponentResources ?

2009-03-04 Thread dwi ardi irawan
Thnx U

On Wed, Mar 4, 2009 at 3:26 PM, Kristian Marinkovic 
kristian.marinko...@porsche.co.at wrote:

 hi,

 _resource.createEventLink() is the replacement

 g,
 kris



 dwi ardi irawan penyihirke...@gmail.com
 04.03.2009 08:43
 Bitte antworten an
 Tapestry users users@tapestry.apache.org


 An
 Tapestry users users@tapestry.apache.org
 Kopie

 Thema
 Q: deprecated for createActionLink method in ComponentResources ?






 Hi...
 could anyone help me bout this deprecated method
 is there any replacement for this method ??
 I tried it for my JFreeChart on TapestryIt Works
 but i feel so uncomfortable using this deprecated method.

 please help me

 .

 @Inject
private ComponentResources _resources;

@Inject
private TypeCoercer _coercer;

public Link getChart3(){
// deprecated method for createActionLink
return _resources.createActionLink(chart, false, new
 Object[]{200,200,aa,39,bb,12,cc,12,dd,4});
}

 .




 thnx u

 --
 http://dwiardiirawan.com
 cos everyone could be extraordinary...lighten up !




-- 
http://dwiardiirawan.blogspot.com
cos everyone could be extraordinary...lighten up !


Re: component parameter binding question

2009-03-04 Thread dhning
welcome:)

Like t:actionlink t:id=delete context=contextValueDelete/t:actionlink
Since context is prop binding, it will map getContextValue() method in java.

Thanks,

DH


- Original Message - 
From: 丁振波 zenberg.d...@gmail.com
To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, March 04, 2009 5:23 PM
Subject: Re: component parameter binding question


 Thanks for your reply :)
 
 I used 5.0.18 release version. What param should set in tml's context field 
 when I use the way do in java?
 
 t:parameter name=delete
   t:actionlink t:id=delete context=???Delete/t:actionlink
 /t:parameter
 
 
 
 - Original Message - 
 From: dhning ningd...@gmail.com
 To: Tapestry users users@tapestry.apache.org
 Sent: Wednesday, March 04, 2009 4:15 PM
 Subject: Re: component parameter binding question
 
 
 Are you using latest t5 snapshot or 5.0.X.X release?

 If latest snapshot, just use like context=[user.id,user.name]
 If not, there are 2 ways:
 1. Do in java
 public Object [] getContextValue() {
return new Object[2]{user.id, user.name};
 }
 2. Use list binding in t5commons library 
 http://code.google.com/p/tapestry5-components/

 Thanks

 DH


 - Original Message - 
 From: 丁振波 zenberg.d...@gmail.com
 To: Tapestry users users@tapestry.apache.org
 Sent: Wednesday, March 04, 2009 3:34 PM
 Subject: component parameter binding question


 Hello guys, below is my case code:

 t:parameter name=nameCell
   t:pagelink page=edit context=user.id${user.name}/t:pagelink
 /t:parameter

 my question is, how can I pass mutil param value in context , is there 
 any
 format like user.id; user.name?


 -
 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: component parameter binding question

2009-03-04 Thread 丁振波

Got it! thanks!

- Original Message - 
From: dhning ningd...@gmail.com

To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, March 04, 2009 5:28 PM
Subject: Re: component parameter binding question



welcome:)

Like t:actionlink t:id=delete 
context=contextValueDelete/t:actionlink
Since context is prop binding, it will map getContextValue() method in 
java.


Thanks,

DH


- Original Message - 
From: 丁振波 zenberg.d...@gmail.com

To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, March 04, 2009 5:23 PM
Subject: Re: component parameter binding question



Thanks for your reply :)

I used 5.0.18 release version. What param should set in tml's context 
field

when I use the way do in java?

t:parameter name=delete
  t:actionlink t:id=delete context=???Delete/t:actionlink
/t:parameter



- Original Message - 
From: dhning ningd...@gmail.com

To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, March 04, 2009 4:15 PM
Subject: Re: component parameter binding question



Are you using latest t5 snapshot or 5.0.X.X release?

If latest snapshot, just use like context=[user.id,user.name]
If not, there are 2 ways:
1. Do in java
public Object [] getContextValue() {
   return new Object[2]{user.id, user.name};
}
2. Use list binding in t5commons library
http://code.google.com/p/tapestry5-components/

Thanks

DH


- Original Message - 
From: 丁振波 zenberg.d...@gmail.com

To: Tapestry users users@tapestry.apache.org
Sent: Wednesday, March 04, 2009 3:34 PM
Subject: component parameter binding question



Hello guys, below is my case code:

t:parameter name=nameCell
  t:pagelink page=edit context=user.id${user.name}/t:pagelink
/t:parameter

my question is, how can I pass mutil param value in context , is there
any
format like user.id; user.name?


-
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: component parameter binding question

2009-03-04 Thread Thiago H. de Paula Figueiredo
On Wed, Mar 4, 2009 at 5:15 AM, dhning ningd...@gmail.com wrote:

 1. Do in java
 public Object [] getContextValue() {
    return new Object[2]{user.id, user.name};
 }

You can also return a List.

-- 
Thiago

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



Re: templates changes from tapestry 4.1 to tapestry 5

2009-03-04 Thread Thiago H. de Paula Figueiredo
On Wed, Mar 4, 2009 at 11:18 AM, Ivano Luberti lube...@archicoop.it wrote:
 Can someone explain me wether I'm wrong or not ? I really hope I am.

You're wrong! :D

You can use components using have two different sintaxes:
t:componentname (the one used in most examples) or div
t:type=ComponentName (the one I use almost exclusively). Take a
look at the Invisible instrumentation section of
http://tapestry.apache.org/tapestry5/guide/templates.html.

-- 
Thiago

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



hi, about the remotelink minixs

2009-03-04 Thread nile black
hi
   i write a simple minixs call remotelink, it look like grails's
remotelink.
   maybe minixs greate!

you can simple use

a href=# t:id=showme
t:type=actionlink t:update=result
t:mixins=remotelinkaction/a
a href=# t:page=index
t:type=pagelink t:update=result t:mixins=remotelinkpage/a
div id=resultresult will show here./div

   but i confused by the return.
   My first question is : what should ajax action return? json? html
fragment? xml?

   One of t5's benefit is you can use dreamweaver edit the tml”.
In example code, pagelink work fine. because it return html. but
actionlink is not perfect.
My seconde question is : how to return  html fragment in action.



Nile Black
-
每天一个小时debian.


remotelink.js
Description: JavaScript source
-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Tapestry 5.1 session invalidate misbehaving

2009-03-04 Thread Peter Stavrinides
Hi, 

The following code worked in all versions before 5.1, but now I get the 
exception listed below:
@Inject
private Request request;

@InjectPage 
private Home homePage;

@OnEvent(component = signOut)
Object onEventFromSignOut() {
try {

request.getSession(false).invalidate();
homePage.setIsSignOut(true); 
return homePage; 
} catch (Throwable e) {
// 
}  
return null;
}

 - com.albourne.web.components.hf.Header (112) 
org.apache.tapestry5.ioc.internal.util.TapestryException: getAttributeNames: 
Session already invalidated
at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:935)
at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.containingPageDidAttach(ComponentPageElementImpl.java:733)
at 
org.apache.tapestry5.internal.structure.PageImpl.attached(PageImpl.java:144)
at 
org.apache.tapestry5.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:55)
at $RequestPageCache_11fd1d95dc7.get($RequestPageCache_11fd1d95dc7.java)
at $RequestPageCache_11fd1d95db0.get($RequestPageCache_11fd1d95db0.java)
at 
org.apache.tapestry5.internal.services.ComponentSourceImpl.getPage(ComponentSourceImpl.java:79)
at 
$ComponentSource_11fd1d95dbe.getPage($ComponentSource_11fd1d95dbe.java)
at 
com.albourne.web.components.hf.Header._$read_inject_page_homePage(Header.java)
at 
com.albourne.web.components.hf.Header.onEventFromSignOut(Header.java:106)
at 
com.albourne.web.components.hf.Header.dispatchComponentEvent(Header.java)
at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:889)
at 
org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1068)
at 
org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:75)
at 
org.apache.tapestry5.internal.services.ImmediateActionRenderResponseFilter.handle(ImmediateActionRenderResponseFilter.java:42)
at 
$ComponentEventRequestHandler_11fd1d95e24.handle($ComponentEventRequestHandler_11fd1d95e24.java)
at 
org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
at 
$ComponentEventRequestHandler_11fd1d95e24.handle($ComponentEventRequestHandler_11fd1d95e24.java)
at 
org.apache.tapestry5.services.TapestryModule$35.handle(TapestryModule.java:2085)
at 
$ComponentEventRequestHandler_11fd1d95e24.handle($ComponentEventRequestHandler_11fd1d95e24.java)
at 
$ComponentEventRequestHandler_11fd1d95dae.handle($ComponentEventRequestHandler_11fd1d95dae.java)
at 
org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43)
at 
$ComponentRequestHandler_11fd1d95da7.handleComponentEvent($ComponentRequestHandler_11fd1d95da7.java)
at 
org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:138)
at $Dispatcher_11fd1d95da9.dispatch($Dispatcher_11fd1d95da9.java)
at $Dispatcher_11fd1d95d9b.dispatch($Dispatcher_11fd1d95d9b.java)
at 
org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:242)
at 
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
at $RequestHandler_11fd1d95d9c.service($RequestHandler_11fd1d95d9c.java)
at 
org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:760)
at $RequestHandler_11fd1d95d9c.service($RequestHandler_11fd1d95d9c.java)
at 
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:750)
at $RequestHandler_11fd1d95d9c.service($RequestHandler_11fd1d95d9c.java)
at 
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85)
at $RequestHandler_11fd1d95d9c.service($RequestHandler_11fd1d95d9c.java)
at 
com.albourne.web.services.PageAccessController.service(PageAccessController.java:186)
at $RequestHandler_11fd1d95d9c.service($RequestHandler_11fd1d95d9c.java)
at com.albourne.web.services.AppModule$3.service(AppModule.java:211)
at $RequestFilter_11fd1d95d99.service($RequestFilter_11fd1d95d99.java)
at $RequestHandler_11fd1d95d9c.service($RequestHandler_11fd1d95d9c.java)
at 
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90)
at 
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81)
at 

Re: Q: deprecated for createActionLink method in ComponentResources ?

2009-03-04 Thread Howard Lewis Ship
So the JavaDoc saying use createEventLink() instead wasn't clear
enough for you?

On Tue, Mar 3, 2009 at 11:43 PM, dwi ardi irawan
penyihirke...@gmail.com wrote:
 Hi...
 could anyone help me bout this deprecated method
 is there any replacement for this method ??
 I tried it for my JFreeChart on TapestryIt Works
 but i feel so uncomfortable using this deprecated method.

 please help me

 .

 @Inject
    private ComponentResources _resources;

   �...@inject
    private TypeCoercer _coercer;

    public Link getChart3(){
        // deprecated method for createActionLink
        return _resources.createActionLink(chart, false, new
 Object[]{200,200,aa,39,bb,12,cc,12,dd,4});
    }

 .




 thnx u

 --
 http://dwiardiirawan.com
 cos everyone could be extraordinary...lighten up !




-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



Re: [OT] Problem using eclipse+maven+jetty

2009-03-04 Thread Szemere Szemere
Just to complete my story, I've got JNDI working again by reverting to a
prior version of the maven-jetty-plugin. I forced maven to use version 6.1.7
(by adding a version tag), viz:

groupIdorg.mortbay.jetty/groupId
artifactIdmaven-jetty-plugin/artifactId
version6.1.7/version


Re: Any T5's tree component hint?

2009-03-04 Thread Otho
Hi all!

My answer to a question was rejected as spam. Is this a temporal or a
permanent issue? The error message follows:


This is an automatically generated Delivery Status Notification

Delivery to the following recipient failed permanently:

users@tapestry.apache.org

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the recipient
domain. We recommend contacting the other email provider for further
information about the cause of this error. The error that the other server
returned was: 552 552 spam score (5.0) exceeded threshold (state 18).

  - Original message -

MIME-Version: 1.0
Received: by 10.220.85.130 with SMTP id o2mr2729330vcl.80.1236177536385;
Wed,
   04 Mar 2009 06:38:56 -0800 (PST)
In-Reply-To: cd9e8aef114f4490ad581b042dd17...@dzbpc
References: cd9e8aef114f4490ad581b042dd17...@dzbpc
Date: Wed, 4 Mar 2009 15:38:56 +0100
Message-ID: 6347384b0903040638l2aa98a92kb8220f45b6219...@mail.gmail.com
Subject: Re: Any T5's tree component hint?
From: Otho taa...@googlemail.com
To: Tapestry users users@tapestry.apache.org
Content-Type: multipart/alternative; boundary=0016e6465284ef837b04644c029a

--0016e6465284ef837b04644c029a
Content-Type: text/plain; charset=ISO-2022-JP
Content-Transfer-Encoding: 7bit

You saw the treegrid component linked on Tapestry's homepage?

http://code.google.com/p/tapestry5-treegrid/


Re: templates changes from tapestry 4.1 to tapestry 5

2009-03-04 Thread Ivano Luberti
pheeew !
Thanks for the quick answer to all of you.

I was afraid I had made one of the biggest mistake in my life.

But can you tell me why the choice to abandon the old syntax has been
taken:  to me from the web designer point of view it is still the most
clean way to implement the call to tapestry.


Thiago H. de Paula Figueiredo ha scritto:
 On Wed, Mar 4, 2009 at 11:18 AM, Ivano Luberti lube...@archicoop.it wrote:
   
 Can someone explain me wether I'm wrong or not ? I really hope I am.
 

 You're wrong! :D

 You can use components using have two different sintaxes:
 t:componentname (the one used in most examples) or div
 t:type=ComponentName (the one I use almost exclusively). Take a
 look at the Invisible instrumentation section of
 http://tapestry.apache.org/tapestry5/guide/templates.html.

   

-- 
==
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==


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



Re: Invoking a custom show javascript method for a Zone

2009-03-04 Thread Dave Greggory

yeah I tried both show and update methods, didn't really work.

I finally got it to work by just adding the following to my event link.

onclick=editWindow.show('editWindow'); resizeWindow(500, 500);

So right after (or is it before) it calls the event method it also shows the 
Window. Not ideal and it could potentially, show the window before Ajax event 
could return the Zone content inside the window, but seems to work.

Tapestry certainly requires a lot of effort to get small things done.

Thanks Thiago for the Ajax.Responder recommendation, I'll look into it.





- Original Message 
From: Thiago H. de Paula Figueiredo thiag...@gmail.com
To: Tapestry users users@tapestry.apache.org
Sent: Tuesday, March 3, 2009 10:33:44 PM
Subject: Re: Invoking a custom show javascript method for a Zone

Em Wed, 04 Mar 2009 00:25:35 -0300, Fernando Padilla f...@alum.mit.edu 
escreveu:

 so you maybe you should set both?

Maybe we should file a JIRA for another parameter for Zone-supported 
components? One to specify a callback (or set of callbacks) to AJAX requests?

Have you guys tried Ajax.Responders.register(responder)? Documentation at 
http://www.prototypejs.org/api/ajax/. It is a way to provide some global 
callback functions to made through Ajax.Request, Ajax.Updater and 
Ajax.PeriodicalUpdater.

--Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

-
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: PAGE Lifecycle vs COMPONENT render cycle

2009-03-04 Thread Luther Baker
If Block Edit isn't a page and it isn't a component ... is there a
predictable way to initialize it each time it is requested?

In my case, I have a Hibernate entity ... with a reference @ManyToOne - to
another entity. It is this child entity that has an edit block associated
with it. When I go to EDIT the parent entity, I need to load all possible
children entities into a select drop down and pick from them.

Therefore, I need to refresh that edit block drop down each time it
displays. Since I registered this block with the App Module - I don't
explicitly reference it in the actual page displaying the BeanEditForm. Does
that make sense? The BeanEditForm is instantiating the edit block behind the
scenes.

So, in the Java class associated with my edit block, I provide the model, I
provide the encoder ... and I want to query for the latest list of enties.
The Wiki example implements by the encoder and the model in the
GenericSelectModel ... and then provides values as the model and encoder.
If getValues queries the database and provides both the model and the
encoder -- it gets invoked 2 times (the t:Select model and encoder
parameters).

So, I separated them - so I literally have a getModel and a getEncoder. Now,
if I can't depend on events with this app block - I could put the query in
one of these two - and I can see one hit before the other - but is that
order guaranteed? If so - maybe I could compensate by checking a flag in
either method and loading the list as necessary - but all that seems like a
hack.

It seems that my edit block needs a prepare event of some sort, and then the
getModel and getEncoder methods are not burdened with also deciding if the
data is present.

Whoa - hope that wasn't too hard to follow. Please remember, I'm learning
more about Tapestry all the time - so please erase all this and set me
straight with the 'right' way. I seem to be going down a rabbit hole here if
events don't apply to app blocks.

On that note, pageAttached is currently firing in my EditBlock.java class.
Were you implying (in an early post) that I should depend on that in all
cases? That I'm just lucky here? I didn't quite understand this comment:

 A block is not a page nor a component. @PageAttached just worked because
you declared it inside a page.

since literally, void pageAttached() is declared and implemented in the
BlockEdit.java - and not literally the page. declared it inside a page
confuses me.

Does that long explanation make sense? I really appreciate all of your time
and input. Sorry for the long, belabored windedness :)

Thanks,

-Luther





On Tue, Mar 3, 2009 at 10:42 PM, Luther Baker lutherba...@gmail.com wrote:

  Writing blocks for BeanEditForm/BeanEditor is a very confusing place to
 learn about them. ;)

 Yes -- necessity *is* the mother of invention :)

 Thanks for the explanation regarding blocks - I'm off to try some
 experiments now.

 Thanks again T.

 -Luther




 On Tue, Mar 3, 2009 at 9:15 PM, Thiago H. de Paula Figueiredo 
 thiag...@gmail.com wrote:

 Em Wed, 04 Mar 2009 00:00:28 -0300, Luther Baker lutherba...@gmail.com
 escreveu:

  I took a look and found this page on COMPONENT rendering:
 http://tapestry.apache.org/tapestry5/guide/rendering.html and I tried
 the
 literal method
void setupRender


 In which class have you declared this method? If it was the page where you
 put your edit and view blocks (let's call it BlocksPage), it wouldn't work,
 as BlocksPage is never rendered (never requested), just blocks and
 components declared inside it are. BlocksPage just exists because all
 Tapestry blocks needs to be declared inside some page.

  Does an edit block act like a page and not a component?


 A block is not a page nor a component. @PageAttached just worked because
 you declared it inside a page.

  And, am I missing something or is a PAGE lifecycle signficantly different
 than a COMPONENT lifecycle?


 A page is a component. It has the component lifecycle plus some events of
 its own.

  I had read and made the assumptions that  PAGEs
 were actually COMPONENTs themselves and because they are special maybe I
 could see a PAGE having *additional* lifecycle methods -


 This is absolutely correct.

  but I wasn't ready for none of the COMPONENT lifecycle methods to trip.


 Again: a page used just to provide blocks does not react to component
 lifecycle events because it is not being rendered (it was not requested),
 just one of its blocks.

 I strongly suggest you to learn about events in Tapestry using writing
 very normal page (one that really renders HTML) and writing a simple
 component. Writing blocks for BeanEditForm/BeanEditor is a very confusing
 place to learn about them. ;)

 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago

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

Services injection and decoration problems

2009-03-04 Thread Andrea Chiumenti
Hello,
I'm trying to integrate dojo into Tapestry5

For this purpose I've crated a DojoPage annotation that handels  dojo
initializations script and then I've decorated
PageMarkupRenderer renderPageMarkup method, and this works.

I'm finding the next step more difficult also because I'm new to T5.

What I need is do create a DojoRequire annotation for components and pages.

Then I don't know how and where to inspect component  and page classes
for this annotation.

I've tried to
@Inject
public ComponentResources componentResources;

unfortunately this doesn't work inside my decorator work because it's
per-thread... I think.

So I'd appreciate any help very much.

Thanks in advance,
Andrea Chiumenti

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



Re: PAGE Lifecycle vs COMPONENT render cycle

2009-03-04 Thread Thiago H. de Paula Figueiredo
Em Wed, 04 Mar 2009 13:52:22 -0300, Luther Baker lutherba...@gmail.com  
escreveu:



If Block Edit isn't a page and it isn't a component ... is there a
predictable way to initialize it each time it is requested?
In my case, I have a Hibernate entity ... with a reference @ManyToOne -  
to another entity. It is this child entity that has an edit block  
associated

with it. When I go to EDIT the parent entity, I need to load all possible
children entities into a select drop down and pick from them.


Forget about events in this case.
Do it the easy way: you have to pass a SelectModel to the Select component  
though the model parameter.

Something like:

select t:type=Select t:model=entityModel ...

Just do your initialization inside the getEntityModel() method:

SelectModel getEntityModel() {
// fetch children entities
// populate SelectModel
return selectModel;
}


Therefore, I need to refresh that edit block drop down each time it
displays. Since I registered this block with the App Module - I don't
explicitly reference it in the actual page displaying the BeanEditForm.  
Does that make sense? The BeanEditForm is instantiating the edit block  
behind the scenes.


You're right. You don't need to use a lifecycle event to refresh the  
Select component because the model is requested everytime it (Select) is  
rendered.


So, I separated them - so I literally have a getModel and a getEncoder.  
Now, if I can't depend on events with this app block - I could put the  
query in one of these two - and I can see one hit before the other - but  
is that

order guaranteed?


Your encoder shouldn't depend on a pre-fetched list. Just fetch the  
encoded object in your encoder.


On that note, pageAttached is currently firing in my EditBlock.java  
class.


It is expected. Your page is activated when BeanEditForm gets a component  
from it.



Were you implying (in an early post) that I should depend on that in all
cases?


I don't even know what you mean here, but the answer is no. :)
That I'm just lucky here? I didn't quite understand this comment:


since literally, void pageAttached() is declared and implemented in the
BlockEdit.java - and not literally the page. declared it inside a page
confuses me.


BlockEdit is a page that is not used as a regular page. Regular pages are  
requested though HTTP. BlockEdit is used just to declare blocks.


Again: stop understanding lifecycle events in BlockEdit for a while and  
try to learn them on regular pages and components.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: templates changes from tapestry 4.1 to tapestry 5

2009-03-04 Thread Thiago H. de Paula Figueiredo
Em Wed, 04 Mar 2009 13:18:46 -0300, Ivano Luberti lube...@archicoop.it  
escreveu:



pheeew !
Thanks for the quick answer to all of you.


You're welcome!


I was afraid I had made one of the biggest mistake in my life.


Maybe you just made one of the best decisions in your life.. :)


But can you tell me why the choice to abandon the old syntax has been
taken:  to me from the web designer point of view it is still the most
clean way to implement the call to tapestry.


Tapestry 5 haven't really abondened the old syntax, besides $content$ and  
$remove$, but they're easily replaced with simple components.
I guess Howard (Tapestry creator and main developer) just wanted to create  
another syntax, one that is friendlier with XML editors (namespaces). I  
never use the t:componentName syntax in pages and almost never in  
components and I'm quite happy with it. :)


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: Services injection and decoration problems

2009-03-04 Thread Thiago H. de Paula Figueiredo
Em Wed, 04 Mar 2009 15:13:34 -0300, Andrea Chiumenti kium...@gmail.com  
escreveu:


What I need is do create a DojoRequire annotation for components and  
pages.


Wouldn't a mixin be a better way to do that? You can inject the component  
using @InjectContainer.



Then I don't know how and where to inspect component  and page classes
for this annotation.


Again, a mixin is very likely to be what you need.



I've tried to
@Inject
public ComponentResources componentResources;


ComponentResources is not a Tapestry-IoC service, so you can't inject it  
in your service. It is specially handled by Tapestry.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: PAGE Lifecycle vs COMPONENT render cycle

2009-03-04 Thread Luther Baker

 Your encoder shouldn't depend on a pre-fetched list. Just fetch the encoded
 object in your encoder.


... my encoder implements this method:

public T toValue(String clientValue)

So in my case, the encoder needs data from the database. I've spent cpu
cycles in getModel() to pull a list of items. It seems like I should
leverage that list when I hydrate the object back from it's screen
representation to an actual object ... no?

I guess - I could inject a dao or connection to the database into the
ValueEncoder - but on first glance, that seems like overkill ... but - maybe
I just need to get comfortable with it. Iv'e got the list right there. It
can't have changed eh?

To sum up, the main issue here is that the object I'm 'toValue'ing exists in
the dbase (and in the model). The Wiki example for GenericSelectModel
queries the database two times but I think it is redundant to do so.

But again, if thats what the framework wants me to do - I'll work with it. I
just needed to explore every option here to make sure I wasn't missing some
BlockEdit event ... it seems natural when components and pages have events
eh? But as natrual as I might intuit it, I do realize from your conversation
that Blocks just aren't made or implemented that way.






  On that note, pageAttached is currently firing in my EditBlock.java class.


 It is expected. Your page is activated when BeanEditForm gets a component
 from it.



My confusion here stems from my understanding that the edit block is NOT a
page and you' ve mentioned a few times Your page is activatated ... and the
event fires. I understand that event fires - but shouldn't it be handled by
the PAGE and not the Edit Block?

When a page includes a component - does the component suddenly handle that
page's events? Likewise, I'm confused how the edit block (which is not a
page or a component) is getting the pageAttached event. I understand it is a
page event - I just don't understand why the Edit Block is handling it. Does
it fire in the Page.java as well? Is there a diagram or somethign to see
this?



 BlockEdit is a page that is not used as a regular page. Regular pages are
 requested though HTTP. BlockEdit is used just to declare blocks.

 Again: stop understanding lifecycle events in BlockEdit for a while and try
 to learn them on regular pages and components.


Remember here, my goal right now is not to understand events per se but to
get my custom select drop down working ... and it is indeed getting void
pageAttached -- so that is why I must proceed down understanding lifecycle
events for BlockEdit.

Learning about events for pages and components is fine - but I need to know
exactly how that applies to my current issue with the Edit Block. That is
what I am practicing :)

Thanks again,

-Luther


Re: PAGE Lifecycle vs COMPONENT render cycle

2009-03-04 Thread Luther Baker
Thiago,

You are like superman on this forum.

Thanks for spending so much time here ... I for one don't know what I'd do
without these discussions.

I know it is a tangent but I've posted to other groups like the Grails
nabble group and NEVER EVER get any responses. A framework is worthless to
me if I can't quickly get into a feedback loop of sorts when I run into
problem. Keeping this forum so active has a lot of intangible benefits for
Tapestry world domination and I just thought it'd be worth saying.

Keep up the good work and thanks again for all the time you spend here.

-Luther




On Wed, Mar 4, 2009 at 12:27 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Wed, 04 Mar 2009 13:52:22 -0300, Luther Baker lutherba...@gmail.com
 escreveu:

  If Block Edit isn't a page and it isn't a component ... is there a
 predictable way to initialize it each time it is requested?
 In my case, I have a Hibernate entity ... with a reference @ManyToOne - to
 another entity. It is this child entity that has an edit block associated
 with it. When I go to EDIT the parent entity, I need to load all possible
 children entities into a select drop down and pick from them.


 Forget about events in this case.
 Do it the easy way: you have to pass a SelectModel to the Select component
 though the model parameter.
 Something like:

 select t:type=Select t:model=entityModel ...

 Just do your initialization inside the getEntityModel() method:

 SelectModel getEntityModel() {
// fetch children entities
// populate SelectModel
return selectModel;
 }

  Therefore, I need to refresh that edit block drop down each time it
 displays. Since I registered this block with the App Module - I don't
 explicitly reference it in the actual page displaying the BeanEditForm.
 Does that make sense? The BeanEditForm is instantiating the edit block
 behind the scenes.


 You're right. You don't need to use a lifecycle event to refresh the Select
 component because the model is requested everytime it (Select) is rendered.

  So, I separated them - so I literally have a getModel and a getEncoder.
 Now, if I can't depend on events with this app block - I could put the query
 in one of these two - and I can see one hit before the other - but is that
 order guaranteed?


 Your encoder shouldn't depend on a pre-fetched list. Just fetch the encoded
 object in your encoder.

  On that note, pageAttached is currently firing in my EditBlock.java class.


 It is expected. Your page is activated when BeanEditForm gets a component
 from it.

  Were you implying (in an early post) that I should depend on that in all
 cases?


 I don't even know what you mean here, but the answer is no. :)
 That I'm just lucky here? I didn't quite understand this comment:

  since literally, void pageAttached() is declared and implemented in the
 BlockEdit.java - and not literally the page. declared it inside a page
 confuses me.


 BlockEdit is a page that is not used as a regular page. Regular pages are
 requested though HTTP. BlockEdit is used just to declare blocks.

 Again: stop understanding lifecycle events in BlockEdit for a while and try
 to learn them on regular pages and components.


 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago

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




Re: PAGE Lifecycle vs COMPONENT render cycle

2009-03-04 Thread Thiago H. de Paula Figueiredo
Em Wed, 04 Mar 2009 16:50:21 -0300, Luther Baker lutherba...@gmail.com  
escreveu:



... my encoder implements this method:
public T toValue(String clientValue)

So in my case, the encoder needs data from the database. I've spent cpu
cycles in getModel() to pull a list of items. It seems like I should
leverage that list when I hydrate the object back from it's screen
representation to an actual object ... no?


No. toValue() is only invoked when the form is submitted. The list loading  
happens in another request. It is not a good idea to keep the list on  
memory bacause each user session would have an enormous size. By the way,  
you can use Hibernate cache features to deal with that instead of  
implementing it yourself.



I guess - I could inject a dao or connection to the database into the
ValueEncoder - but on first glance, that seems like overkill ...


It is not. Service injection is very cheap. And tapestry-hibernate already  
provides a ValueEncoder for each entity class.



I just need to get comfortable with it. Iv'e got the list right there. It
can't have changed eh?


You're doing (bad, IMHO) premature optimization, and it is the root of all  
evil. (I just love this quote :)).


To sum up, the main issue here is that the object I'm 'toValue'ing  
exists in the dbase (and in the model). The Wiki example for  
GenericSelectModel

queries the database two times but I think it is redundant to do so.


Again: each ValueEncoder method is invoked in different requests and it's  
not a good idea to put object lists in memory (session).


But again, if thats what the framework wants me to do - I'll work with  
it.


The framework does not tell you what to do: it just encourages you to  
follow some proven paths, but you can choose to not follow them.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: Services injection and decoration problems

2009-03-04 Thread Andrea Chiumenti
Thank you, this solves a lot of things
kiuma

On Wed, Mar 4, 2009 at 7:36 PM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:
 Em Wed, 04 Mar 2009 15:13:34 -0300, Andrea Chiumenti kium...@gmail.com
 escreveu:

 What I need is do create a DojoRequire annotation for components and
 pages.

 Wouldn't a mixin be a better way to do that? You can inject the component
 using @InjectContainer.

 Then I don't know how and where to inspect component  and page classes
 for this annotation.

 Again, a mixin is very likely to be what you need.


 I've tried to
 @Inject
 public ComponentResources componentResources;

 ComponentResources is not a Tapestry-IoC service, so you can't inject it in
 your service. It is specially handled by Tapestry.

 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago

 -
 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: PAGE Lifecycle vs COMPONENT render cycle

2009-03-04 Thread Luther Baker
 By the way, you can use Hibernate cache features to deal with that instead
of implementing it yourself.

Ahh ... I knew this ... but it is something I need to read up on.


 Again: each ValueEncoder method is invoked in different requests and it's
not a good idea to put object lists in memory (session).

Ok - I saw them both (model and encoder) retrieved at page load but I missed
its invocation on submit. This approach makes sense to me then.


 You're doing (bad, IMHO) premature optimization, and it is the root of all
evil. (I just love this quote :)).

Ohhh . well thanks for the warning! There are some obvious baddies I try
to avoid right away and this looked like double work - but I need to get my
head around hibernate caching a bit more.


 The framework does not tell you what to do: it just encourages you to
follow some proven paths, but you can choose to not follow them.

Thanks for helping illuminate the path.


Thanks,

-Luther



On Wed, Mar 4, 2009 at 2:00 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Wed, 04 Mar 2009 16:50:21 -0300, Luther Baker lutherba...@gmail.com
 escreveu:

  ... my encoder implements this method:
public T toValue(String clientValue)

 So in my case, the encoder needs data from the database. I've spent cpu
 cycles in getModel() to pull a list of items. It seems like I should
 leverage that list when I hydrate the object back from it's screen
 representation to an actual object ... no?


 No. toValue() is only invoked when the form is submitted. The list loading
 happens in another request. It is not a good idea to keep the list on memory
 bacause each user session would have an enormous size. By the way, you can
 use Hibernate cache features to deal with that instead of implementing it
 yourself.

  I guess - I could inject a dao or connection to the database into the
 ValueEncoder - but on first glance, that seems like overkill ...


 It is not. Service injection is very cheap. And tapestry-hibernate already
 provides a ValueEncoder for each entity class.

  I just need to get comfortable with it. Iv'e got the list right there. It
 can't have changed eh?


 You're doing (bad, IMHO) premature optimization, and it is the root of all
 evil. (I just love this quote :)).

  To sum up, the main issue here is that the object I'm 'toValue'ing exists
 in the dbase (and in the model). The Wiki example for GenericSelectModel
 queries the database two times but I think it is redundant to do so.


 Again: each ValueEncoder method is invoked in different requests and it's
 not a good idea to put object lists in memory (session).

  But again, if thats what the framework wants me to do - I'll work with it.


 The framework does not tell you what to do: it just encourages you to
 follow some proven paths, but you can choose to not follow them.


 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago

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




Re: Tapestry 5.1 session invalidate misbehaving

2009-03-04 Thread Robert Zeigler
Try switching the order of homePage.setIsSignOut(true) and  
request.getSession(false).invalidate();
It looks like the homePage is being lazily evaluated right there, and  
the page load is failing; if you switch the order, I think you'll be  
set.


Robert

On Mar 4, 2009, at 3/48:39 AM , Peter Stavrinides wrote:


Hi,

The following code worked in all versions before 5.1, but now I get  
the exception listed below:

@Inject
private Request request;

@InjectPage
private Home homePage;

@OnEvent(component = signOut)
Object onEventFromSignOut() {
try {

request.getSession(false).invalidate();
homePage.setIsSignOut(true);
return homePage;
} catch (Throwable e) {
//
}
return null;
}

- com.albourne.web.components.hf.Header (112)  
org.apache.tapestry5.ioc.internal.util.TapestryException:  
getAttributeNames: Session already invalidated
	at  
org 
.apache 
.tapestry5 
.internal 
.structure 
.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:935)
	at  
org 
.apache 
.tapestry5 
.internal 
.structure 
.ComponentPageElementImpl 
.containingPageDidAttach(ComponentPageElementImpl.java:733)
	at  
org 
.apache.tapestry5.internal.structure.PageImpl.attached(PageImpl.java: 
144)
	at  
org 
.apache 
.tapestry5 
.internal 
.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:55)
	at  
$RequestPageCache_11fd1d95dc7.get($RequestPageCache_11fd1d95dc7.java)
	at  
$RequestPageCache_11fd1d95db0.get($RequestPageCache_11fd1d95db0.java)
	at  
org 
.apache 
.tapestry5 
.internal 
.services.ComponentSourceImpl.getPage(ComponentSourceImpl.java:79)
	at  
$ 
ComponentSource_11fd1d95dbe.getPage($ComponentSource_11fd1d95dbe.java)
	at com.albourne.web.components.hf.Header._ 
$read_inject_page_homePage(Header.java)
	at  
com.albourne.web.components.hf.Header.onEventFromSignOut(Header.java: 
106)
	at  
com 
.albourne.web.components.hf.Header.dispatchComponentEvent(Header.java)
	at  
org 
.apache 
.tapestry5 
.internal 
.structure 
.ComponentPageElementImpl 
.dispatchEvent(ComponentPageElementImpl.java:889)
	at  
org 
.apache 
.tapestry5 
.internal 
.structure 
.ComponentPageElementImpl 
.triggerContextEvent(ComponentPageElementImpl.java:1068)
	at  
org 
.apache 
.tapestry5 
.internal 
.services 
.ComponentEventRequestHandlerImpl 
.handle(ComponentEventRequestHandlerImpl.java:75)
	at  
org 
.apache 
.tapestry5 
.internal 
.services 
.ImmediateActionRenderResponseFilter 
.handle(ImmediateActionRenderResponseFilter.java:42)
	at  
$ 
ComponentEventRequestHandler_11fd1d95e24 
.handle($ComponentEventRequestHandler_11fd1d95e24.java)
	at  
org 
.apache 
.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42)
	at  
$ 
ComponentEventRequestHandler_11fd1d95e24 
.handle($ComponentEventRequestHandler_11fd1d95e24.java)
	at org.apache.tapestry5.services.TapestryModule 
$35.handle(TapestryModule.java:2085)
	at  
$ 
ComponentEventRequestHandler_11fd1d95e24 
.handle($ComponentEventRequestHandler_11fd1d95e24.java)
	at  
$ 
ComponentEventRequestHandler_11fd1d95dae 
.handle($ComponentEventRequestHandler_11fd1d95dae.java)
	at  
org 
.apache 
.tapestry5 
.internal 
.services 
.ComponentRequestHandlerTerminator 
.handleComponentEvent(ComponentRequestHandlerTerminator.java:43)
	at  
$ 
ComponentRequestHandler_11fd1d95da7 
.handleComponentEvent($ComponentRequestHandler_11fd1d95da7.java)
	at  
org 
.apache 
.tapestry5 
.internal 
.services 
.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:138)

at $Dispatcher_11fd1d95da9.dispatch($Dispatcher_11fd1d95da9.java)
at $Dispatcher_11fd1d95d9b.dispatch($Dispatcher_11fd1d95d9b.java)
	at org.apache.tapestry5.services.TapestryModule 
$RequestHandlerTerminator.service(TapestryModule.java:242)
	at  
org 
.apache 
.tapestry5 
.internal 
.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
	at  
$RequestHandler_11fd1d95d9c.service($RequestHandler_11fd1d95d9c.java)
	at org.apache.tapestry5.services.TapestryModule 
$4.service(TapestryModule.java:760)
	at  
$RequestHandler_11fd1d95d9c.service($RequestHandler_11fd1d95d9c.java)
	at org.apache.tapestry5.services.TapestryModule 
$3.service(TapestryModule.java:750)
	at  
$RequestHandler_11fd1d95d9c.service($RequestHandler_11fd1d95d9c.java)
	at  
org 
.apache 
.tapestry5 
.internal.services.StaticFilesFilter.service(StaticFilesFilter.java: 
85)
	at  
$RequestHandler_11fd1d95d9c.service($RequestHandler_11fd1d95d9c.java)
	at  
com 
.albourne 
.web.services.PageAccessController.service(PageAccessController.java: 
186)
	at  
$RequestHandler_11fd1d95d9c.service($RequestHandler_11fd1d95d9c.java)

at com.albourne.web.services.AppModule$3.service(AppModule.java:211)
	at  
$RequestFilter_11fd1d95d99.service($RequestFilter_11fd1d95d99.java)
	at  
$RequestHandler_11fd1d95d9c.service($RequestHandler_11fd1d95d9c.java)
	at 

@Inject'ing Generic Services

2009-03-04 Thread Luther Baker
The following is illegal Java ... so I cannot bind the following in my
AppModule:

binder.bind(ValueEncoderMovie.class,
GenericValueEncoderMovie.class);
binder.bind(ValueEncoderVideo.class,
GenericValueEncoderVideo.class);
binder.bind(ValueEncoderBook.class,
GenericValueEncoderBook.class);
binder.bind(ValueEncoderSong.class,
GenericValueEncoderSong.class);

Instead, I put the following into my AppModule:

binder.bind(ValueEncoder.class, GenericValueEncoder.class);

Can I safely @Inject this encoder into multiple/different pages?

class MoviePage
{
@Inject
private ValueEncoderMovie encoder;


class VideoPage
{
@Inject
private ValueEncoderVideo encoder;


If this is safe, although I only bound one instance, does it create a new
instance of the service for each GenericParameter type?



What should happen with something like this:

binder.bind(AbstractSelectModel.class, GenericSelectModel.class);


when there is no left-hand Generic to infer the Generic Parameter from:

class VideoPage
{
@Inject
private AbstractSelectModel model;



-Luther


Re: @Inject'ing Generic Services

2009-03-04 Thread Thiago H. de Paula Figueiredo
Em Wed, 04 Mar 2009 21:47:31 -0300, Luther Baker lutherba...@gmail.com  
escreveu:



Can I safely @Inject this encoder into multiple/different pages?
class MoviePage
{
@Inject
private ValueEncoderMovie encoder;


Java does not let you do that because of the way it implemented generics.  
Anyway, Select (and maybe some other components) use ValueEncoderSource to  
get a ValueEncoder for a given type. Take a look at  
TapestryModule.contributeValueEncoderSource().



If this is safe, although I only bound one instance, does it create a new
instance of the service for each GenericParameter type?


It wouldn't work like you want.


What should happen with something like this:
binder.bind(AbstractSelectModel.class, GenericSelectModel.class);
when there is no left-hand Generic to infer the Generic Parameter from:
class VideoPage
{
@Inject
private AbstractSelectModel model;


I guess this would work. But I suggest you to use  
binder.bind(GenericSelectModel.class) (without the left-hand) and then  
@Inject it like any other service.


This is a purely Tapestry-IoC thing, not exactly a Tapestry-Core (web  
framework) issue. You can read more about injection and services at  
http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html. I'm just  
parroting what's written there. :)


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: @Inject'ing Generic Services

2009-03-04 Thread Luther Baker
Explicit discussion about generics and ioc eludes me on that page - but I'll
keep looking around.

Thanks.

-Luther



On Wed, Mar 4, 2009 at 7:01 PM, Thiago H. de Paula Figueiredo 
thiag...@gmail.com wrote:

 Em Wed, 04 Mar 2009 21:47:31 -0300, Luther Baker lutherba...@gmail.com
 escreveu:

  Can I safely @Inject this encoder into multiple/different pages?
 class MoviePage
 {
@Inject
private ValueEncoderMovie encoder;


 Java does not let you do that because of the way it implemented generics.
 Anyway, Select (and maybe some other components) use ValueEncoderSource to
 get a ValueEncoder for a given type. Take a look at
 TapestryModule.contributeValueEncoderSource().

  If this is safe, although I only bound one instance, does it create a new
 instance of the service for each GenericParameter type?


 It wouldn't work like you want.

  What should happen with something like this:
binder.bind(AbstractSelectModel.class, GenericSelectModel.class);
 when there is no left-hand Generic to infer the Generic Parameter from:
 class VideoPage
 {
@Inject
private AbstractSelectModel model;


 I guess this would work. But I suggest you to use
 binder.bind(GenericSelectModel.class) (without the left-hand) and then
 @Inject it like any other service.

 This is a purely Tapestry-IoC thing, not exactly a Tapestry-Core (web
 framework) issue. You can read more about injection and services at
 http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html. I'm just
 parroting what's written there. :)

 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago

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




T5: alternative template

2009-03-04 Thread Angelo Chen

Hi,

I know T5 always team up template with java class using the same name, say,
MyCars.java, then you need a MyCars.tml, is it possible we can have
MyCarsAqua.tml, MyCarsClassic,tml, and we can programatically chose which
tml to be rendered at runtime? this will bring a degree of configurability
to the app, what do you think?

Angelo
-- 
View this message in context: 
http://www.nabble.com/T5%3A-alternative-template-tp22343366p22343366.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: T5: alternative template

2009-03-04 Thread Thiago H. de Paula Figueiredo
Em Wed, 04 Mar 2009 22:17:07 -0300, Angelo Chen  
angelochen...@yahoo.com.hk escreveu:



Hi,


Hi!

I know T5 always team up template with java class using the same name,  
say, MyCars.java, then you need a MyCars.tml, is it possible we can have

MyCarsAqua.tml, MyCarsClassic,tml, and we can programatically chose which
tml to be rendered at runtime?


What exactly changes from one version to another?
By the way, you can @InjectPage the other version, choose programatically  
the one you want and redirect to the chosen one by returning it in  
onActivate().


this will bring a degree of configurability to the app, what do you  
think?


I don't think it is a good idea. This would break something I love: the  
1:1 relationship between page class and template and Tapestry.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: T5: alternative template

2009-03-04 Thread Angelo Chen

Hi Thiago,

Thanks, Inject page is an option, it will look like this:

localhost/mycars
localhost/mycarsaqua

is there a way that, even I inject MyCarAqua, its url still
localhost/mycars?






Thiago H. de Paula Figueiredo wrote:
 
 Em Wed, 04 Mar 2009 22:17:07 -0300, Angelo Chen  
 angelochen...@yahoo.com.hk escreveu:
 
 Hi,
 
 Hi!
 
 I know T5 always team up template with java class using the same name,  
 say, MyCars.java, then you need a MyCars.tml, is it possible we can have
 MyCarsAqua.tml, MyCarsClassic,tml, and we can programatically chose which
 tml to be rendered at runtime?
 
 What exactly changes from one version to another?
 By the way, you can @InjectPage the other version, choose programatically  
 the one you want and redirect to the chosen one by returning it in  
 onActivate().
 
 this will bring a degree of configurability to the app, what do you  
 think?
 
 I don't think it is a good idea. This would break something I love: the  
 1:1 relationship between page class and template and Tapestry.
 
 -- 
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-alternative-template-tp22343366p22344065.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: T5: alternative template

2009-03-04 Thread Thiago H. de Paula Figueiredo
Em Wed, 04 Mar 2009 23:23:14 -0300, Angelo Chen  
angelochen...@yahoo.com.hk escreveu:



Hi Thiago,


Hi!



Thanks, Inject page is an option, it will look like this:
localhost/mycars
localhost/mycarsaqua


You're right . . .


is there a way that, even I inject MyCarAqua, its url still
localhost/mycars?


I've never actually tried it, but I would create a block (or component) in  
each alternate page, create a getter that returns this block, inject the  
alternate pages in MyCars and use the Delegate component to render the  
block. This is similar to how BeanEditFrom/BeanEditor works: it renders  
components and blocks that are located in other pages.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



T5: not all hibernate records saving

2009-03-04 Thread Jsherwood

Hello,
 
I have a page that you load an excel file and read each line converting it to 
records.
 
It works fine with no errors anywhere but out of 15855 lines it only actually 
puts in 11272 records but my count on the loop shows 15855 and I cannot figure 
out why these records are not saving with no errors being produced.
 
This is my basic logic(I have tried @CommitAfter but using 
_session.beginTransaction and commit at each save actually produced some errors 
I was able to fix that @CommitAfter did not)
 
Loop Lines{
 ReadLine{
readCells(line)
}}
 
 
 
readCells(line){
   loopCells{
  read cell and put in corresponding field
  fields that link, check if the field is in the foreign table, if not add 
it and put id in field
   }
}
 
Again I have tried using @CommitAfter however using the beingTransaction/commit 
around each save produced more errors IE: invalid date format in a date field 
etc. but now there are NO errors being thrown.
 
Are there errors I cannot see somehow?
 
Thanks,
--James
 
 
 


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



Re: templates changes from tapestry 4.1 to tapestry 5

2009-03-04 Thread Howard Lewis Ship
A well established Tapestry style in Tap3 + Tap4 was:

if jwcid=@Conditional condition=whatever ... /if

I really liked that style, especially for teaching Tapestry and wanted
to allow something that immediately understandable but even more
concise.

On Wed, Mar 4, 2009 at 10:33 AM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:
 Em Wed, 04 Mar 2009 13:18:46 -0300, Ivano Luberti lube...@archicoop.it
 escreveu:

 pheeew !
 Thanks for the quick answer to all of you.

 You're welcome!

 I was afraid I had made one of the biggest mistake in my life.

 Maybe you just made one of the best decisions in your life.. :)

 But can you tell me why the choice to abandon the old syntax has been
 taken:  to me from the web designer point of view it is still the most
 clean way to implement the call to tapestry.

 Tapestry 5 haven't really abondened the old syntax, besides $content$ and
 $remove$, but they're easily replaced with simple components.
 I guess Howard (Tapestry creator and main developer) just wanted to create
 another syntax, one that is friendlier with XML editors (namespaces). I
 never use the t:componentName syntax in pages and almost never in
 components and I'm quite happy with it. :)

 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago

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





-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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