T5.3.6 AfterRenderTemplate getElement returns element of parent component

2012-12-05 Thread Azudio Developer
Hi,

I'm seeing something that doesn't look right - possibly user error.

I have a component structure like this:

MyPage
->TopBar (c)
-> NavItem (c)

In the NavItem.java I have an render phase method:
@AfterRenderTemplate
void afterRender(MarkupWriter writer) {
log.debug(writer.getElement().toString());
}

Which produces in the log:
Item 1

The TopBar component TML has the  element and the NavItem TML has the  
so I would expect the getElement call to return the NavItem 

Can anyone confirm if this is the expected behaviour and if so how do I get the 
element in my NavItem.


NavItem.tml

http://tapestry.apache.org/schema/tapestry_5_3.xsd"; 
xmlns:p="tapestry:parameter">
${label}
 

Thanks in advance,
Adam.

Re: [5.3.6] Tapestry's minimal dependencies

2012-12-05 Thread Thiago H de Paula Figueiredo
On Wed, 05 Dec 2012 19:01:11 -0200, Michael Prescott  
 wrote:



If you've used maven for that much, you're nearly there.  All you have to
do is declare the jars you need as  in the pom.xml, and then
'mvn install' will produce you a .war file with all the jars in it.


Yep!


You can use command 'mvn eclipse:eclipse' to create the project's
.classpath file, so you don't need to maintain the Eclipse build path
yourself.


Please don't do that. Just use m2e (the Maven plugin for Eclipse, which is  
bundled into Eclipse itself for at least a couple of versions yet). It  
will automatically update your project configuration when you change your  
pom.xml. The plugin was quite bad in the past, but it's now very good.


--
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: [5.3.6] Tapestry's minimal dependencies

2012-12-05 Thread Howard Lewis Ship
Also, use Gradle, not Maven. It will save you incredible amounts of grief.


On Wed, Dec 5, 2012 at 1:01 PM, Michael Prescott <
michael.r.presc...@gmail.com> wrote:

> If you've used maven for that much, you're nearly there.  All you have to
> do is declare the jars you need as  in the pom.xml, and then
> 'mvn install' will produce you a .war file with all the jars in it.
>
> You can use command 'mvn eclipse:eclipse' to create the project's
> .classpath file, so you don't need to maintain the Eclipse build path
> yourself.
>
>
> On 5 December 2012 15:56, Muhammad Gelbana  wrote:
>
> > I'm not good with maven so I'd like to be more independent of it
> whenever I
> > can. I practically use it only for creating a tapestry project
> (quickstart)
> > and packaging war files.
> >
> > I'm not saying maven is not good at what it does, I guess it is but I'm
> > just not good with it.
> >
> > On Wed, Dec 5, 2012 at 10:43 PM, Thiago H de Paula Figueiredo <
> > thiag...@gmail.com> wrote:
> >
> > > On Wed, 05 Dec 2012 18:40:40 -0200, Muhammad Gelbana <
> > m.gelb...@gmail.com>
> > > wrote:
> > >
> > >  I'm trying to package my application (war) and deploy it into tomcat.
> I
> > >> don't know how to do that while my app depends on many other jar files
> > >> that are not included using maven but only through the regular eclipse
> > >> build-path configuration.
> > >>
> > >
> > > What about adding this other JAR files through Maven too?
> > >
> > >
> > > --
> > > Thiago H. de Paula Figueiredo
> > >
> > >
> --**--**-
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<
> > users-unsubscr...@tapestry.apache.org>
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >
> >
>



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


Re: [5.3.6] Tapestry's minimal dependencies

2012-12-05 Thread Michael Prescott
If you've used maven for that much, you're nearly there.  All you have to
do is declare the jars you need as  in the pom.xml, and then
'mvn install' will produce you a .war file with all the jars in it.

You can use command 'mvn eclipse:eclipse' to create the project's
.classpath file, so you don't need to maintain the Eclipse build path
yourself.


On 5 December 2012 15:56, Muhammad Gelbana  wrote:

> I'm not good with maven so I'd like to be more independent of it whenever I
> can. I practically use it only for creating a tapestry project (quickstart)
> and packaging war files.
>
> I'm not saying maven is not good at what it does, I guess it is but I'm
> just not good with it.
>
> On Wed, Dec 5, 2012 at 10:43 PM, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Wed, 05 Dec 2012 18:40:40 -0200, Muhammad Gelbana <
> m.gelb...@gmail.com>
> > wrote:
> >
> >  I'm trying to package my application (war) and deploy it into tomcat. I
> >> don't know how to do that while my app depends on many other jar files
> >> that are not included using maven but only through the regular eclipse
> >> build-path configuration.
> >>
> >
> > What about adding this other JAR files through Maven too?
> >
> >
> > --
> > Thiago H. de Paula Figueiredo
> >
> > --**--**-
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<
> users-unsubscr...@tapestry.apache.org>
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>


Re: [5.3.6] Tapestry's minimal dependencies

2012-12-05 Thread Muhammad Gelbana
I'm not good with maven so I'd like to be more independent of it whenever I
can. I practically use it only for creating a tapestry project (quickstart)
and packaging war files.

I'm not saying maven is not good at what it does, I guess it is but I'm
just not good with it.

On Wed, Dec 5, 2012 at 10:43 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 05 Dec 2012 18:40:40 -0200, Muhammad Gelbana 
> wrote:
>
>  I'm trying to package my application (war) and deploy it into tomcat. I
>> don't know how to do that while my app depends on many other jar files
>> that are not included using maven but only through the regular eclipse
>> build-path configuration.
>>
>
> What about adding this other JAR files through Maven too?
>
>
> --
> Thiago H. de Paula Figueiredo
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: [5.3.6] Tapestry's minimal dependencies

2012-12-05 Thread Thiago H de Paula Figueiredo
On Wed, 05 Dec 2012 18:40:40 -0200, Muhammad Gelbana   
wrote:



I'm trying to package my application (war) and deploy it into tomcat. I
don't know how to do that while my app depends on many other jar files  
that are not included using maven but only through the regular eclipse

build-path configuration.


What about adding this other JAR files through Maven too?

--
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: [5.3.6] Tapestry's minimal dependencies

2012-12-05 Thread Muhammad Gelbana
I'm trying to package my application (war) and deploy it into tomcat. I
don't know how to do that while my app depends on many other jar files that
are not included using maven but only through the regular eclipse
build-path configuration.

On Wed, Dec 5, 2012 at 9:03 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 05 Dec 2012 16:23:28 -0200, Muhammad Gelbana 
> wrote:
>
>  Thanks a lot that helped a lot.
>>
>> I believe the error message could be a bit more explanatory ?
>>
>
> Nope. That exception is thrown by code deep inside the JVM, in a package
> that we shouldn't use.
>
>
>  And don't you agree that tapestry's download should only contain minimal
>> dependencies ?
>> Or at least locate extra dependencies within a separate folder ?
>>
>
> Your last suggestion looks good to me, first doesn't. Anyway, most people
> today use some dependency manager such as Maven, Ivy or Gradle, so they
> don't need to worry about it.
>
>
> --
> Thiago H. de Paula Figueiredo
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Zone inside loop problem

2012-12-05 Thread Geoff Callender
When activated during an AJAX request, the component has no state. In 
onSuccessFromKomentar(int materijalID) you should probably set this.materijalID.

On 05/12/2012, at 8:39 PM, dodjavola wrote:

> Hey folks :)
> I have another big issue. I have component, with zone, and form that
> refreshes the zone. When I put component inside loop, it shows only last
> zone. I generated unique ID for every zone. In page source, I can see that
> every zone get's right ID, but it doesn't return right on submit. Is there
> anyway to return zone by id?
> 
> Here is my code:
> 
>   
>   Comments   
>   
>materijalID="materijalID"> 
>  
>   
>cols="40">
>
>   
> 
> 
> public class Comments 
> { 
>   @Parameter(required=true)
>   @Property
>   private int materijalID;
> 
>   @SessionState
>   @Property
>   private User user;
>   
>   @Inject
>   private Session session;
>   
>   @Property
>   private String comment;
>   
>   @InjectComponent
>   private Zone commentZone;
>   
>   @CommitAfter
>public Object onSuccessFromKomentar(int materijalID)
>{  
>   Komentar k = new Komentar();
>   Date d = new Date();
>   Materijal m =
> (Materijal)session.createCriteria(Materijal.class).add(Restrictions.eq("materijalID",
> materijalID)).list().get(0);
>   k.setMaterijal(m);
>   k.setKorisnikID(this.user.getID());
>   k.setDatumUnosa(d);
>   k.setDatumModifikacije(d);
>   k.setKomentar(this.comment);
>   session.save(k);
>   this.comment = "";
>   return this.commentZone.getBody();
>}
>   
>   public String getZoneId()
>   {
>   return "Zone_" + this.materijalID;
>   }
> }
> 
> Thanks in advance
> 
> 
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Zone-inside-loop-problem-tp5718497.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: Tapestry + Hibernate optimistic locking

2012-12-05 Thread Geoff Callender
So your situation is that you are updating non-detached entities and usually 
(but possibly not always) want optimistic locking. This can be handled on a 
case-by-case basis without altering Hibernate's internals. Look for 
"bulkEditPersonsByDTOs" in:

http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloop1

It's using JPA but the technique is the same (and in this case JPA is 
implemented with Hibernate by the demo's container, JBoss).

Cheers,

Geoff

On 06/12/2012, at 1:51 AM, nquirynen wrote:

> Just for the interested:
> 
> After some more research I found that setting the version manually (which is
> not recommended by Hibernate) didn't work because of what is described here: 
> https://forum.hibernate.org/viewtopic.php?p=2293177&sid=2969aa867c7086b4a3c7a68bda853690#p2293177
> 
> It's a really old post, but the solution he provides in that thread seems to
> work and feels like the most clean solution to me. Also I cannot find alot
> about this topic, and especially no real response from the Hibernate team
> themself.
> 
> So what I have now:
> 
> 1) Hidden field for the entities version
> 2) implementation of FlushEntityEventListener with onFlushDirty() method
> containing a check on the version which throws a StaleObjectStateException
> when needed
> 
> 
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Tapestry-Hibernate-optimistic-locking-tp5718413p5718501.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: [5.3.6] Tapestry's minimal dependencies

2012-12-05 Thread Thiago H de Paula Figueiredo
On Wed, 05 Dec 2012 16:23:28 -0200, Muhammad Gelbana   
wrote:



Thanks a lot that helped a lot.

I believe the error message could be a bit more explanatory ?


Nope. That exception is thrown by code deep inside the JVM, in a package  
that we shouldn't use.


And don't you agree that tapestry's download should only contain minimal  
dependencies ?

Or at least locate extra dependencies within a separate folder ?


Your last suggestion looks good to me, first doesn't. Anyway, most people  
today use some dependency manager such as Maven, Ivy or Gradle, so they  
don't need to worry about it.


--
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: [5.3.6] Tapestry's minimal dependencies

2012-12-05 Thread Muhammad Gelbana
Thanks a lot that helped a lot.

I believe the error message could be a bit more explanatory ? And don't you
agree that tapestry's download should only contain minimal dependencies ?
Or at least locate extra dependencies within a separate folder ?

Thanks again.

On Wed, Dec 5, 2012 at 2:29 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Tue, 04 Dec 2012 19:47:53 -0200, Muhammad Gelbana 
> wrote:
>
>  I'm trying to narrow down tapestry's minimal dependcies as I'm having
>> some issues with deploying my app into tomcat.
>>
>
> Why don't you use Maven for that? Check http://maven.apache.org/**
> plugins/maven-dependency-**plugin/tree-mojo.html
> .
>
>
>  I believe the mentioned JARs are the minimal that tapestry needs to run,
>> but what about these two:
>>
>> tapestry-javadoc-5.3.6.jar
>> tapestry-jmx-5.3.6.jar
>>
>> Does tapestry need them to basically operate ?
>>
>
> tapestry-javadoc is used for generating documentation and tapestry-jmx is
> only used if you want to expose Tapestry stuff in JMX, so no, Tapestry
> don't need them.
>
> --
> Thiago H. de Paula Figueiredo
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Tapestry + Hibernate optimistic locking

2012-12-05 Thread nquirynen
Just for the interested:

After some more research I found that setting the version manually (which is
not recommended by Hibernate) didn't work because of what is described here: 
https://forum.hibernate.org/viewtopic.php?p=2293177&sid=2969aa867c7086b4a3c7a68bda853690#p2293177

It's a really old post, but the solution he provides in that thread seems to
work and feels like the most clean solution to me. Also I cannot find alot
about this topic, and especially no real response from the Hibernate team
themself.

So what I have now:

1) Hidden field for the entities version
2) implementation of FlushEntityEventListener with onFlushDirty() method
containing a check on the version which throws a StaleObjectStateException
when needed



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-Hibernate-optimistic-locking-tp5718413p5718501.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: Zone inside loop problem

2012-12-05 Thread Thiago H de Paula Figueiredo
On Wed, 05 Dec 2012 08:40:42 -0200, Cezary Biernacki   
wrote:



You need to use Tapestry's t:submit component, not plain HTML input tag.


Actually, you only need to use the Submit component when you have more  
than one submit button and you need to know which one was clicked.  
Otherwise, a  can and should be used.


--
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: Does Tapestry implements this ${id} by default ?

2012-12-05 Thread Thiago H de Paula Figueiredo
On Tue, 04 Dec 2012 22:35:57 -0200, bhorvat   
wrote:



Hm That might be possible I do have filtering set in maven like this



src/main/resources
true



and the component tml is under that folder. I am impressive that you have
thought of that.


That's the only other thing usually used in Tapestry projects that uses  
${} expansions. In addition, the printed id is a Maven project id, so  
there was nothing impressive.



Thanks for assistance


:D

--
Thiago H. de Paula Figueiredo

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



Zone inside loop problem

2012-12-05 Thread dodjavola
Hey folks :)
I have another big issue. I have component, with zone, and form that
refreshes the zone. When I put component inside loop, it shows only last
zone. I generated unique ID for every zone. In page source, I can see that
every zone get's right ID, but it doesn't return right on submit. Is there
anyway to return zone by id?

Here is my code:

  
Comments   

 
   


 



public class Comments 
{   
@Parameter(required=true)
@Property
private int materijalID;

@SessionState
@Property
private User user;

@Inject
private Session session;

@Property
private String comment;

@InjectComponent
private Zone commentZone;

@CommitAfter
public Object onSuccessFromKomentar(int materijalID)
{  
Komentar k = new Komentar();
Date d = new Date();
Materijal m =
(Materijal)session.createCriteria(Materijal.class).add(Restrictions.eq("materijalID",
materijalID)).list().get(0);
k.setMaterijal(m);
k.setKorisnikID(this.user.getID());
k.setDatumUnosa(d);
k.setDatumModifikacije(d);
k.setKomentar(this.comment);
session.save(k);
this.comment = "";
return this.commentZone.getBody();
}

public String getZoneId()
{
return "Zone_" + this.materijalID;
}
}

Thanks in advance



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Zone-inside-loop-problem-tp5718497.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: Get selected item from loop

2012-12-05 Thread dodjavola
Tnx, I solved the problem :D



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Get-selected-item-from-loop-tp5718460p5718496.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