Prevent double submission w/linkSubmit

2010-12-03 Thread David Rees
I'm having problems figuring out how to prevent double clicks with a linkSubmit.

With a regular submit, you can just disable the submit button after
observing a FORM_PREPARE_FOR_SUBMIT_EVENT, but this doesn't seem to
work for a linkSubmit element.

Using T5.1.0.8-SNAPSHOT.

Any ideas?  Have also tried stopping the event but that doesn't seem
to do anything.

-Dave

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



[ANNOUNCEMENT] tapestry-resteasy 0.2.1 released!

2010-12-03 Thread Kalle Korhonen
Hey, wouldn't it be great if you could just reload your RESTful
service classes live while developing them? Oh that's right, that's
exactly what tapestry-resteasy 0.2.1 allows you to do! This is T5.2.x
specific maintenance release, updating the JAX-RS dependency to JBoss'
resteasy GA release 2.0.1. Read more at
http://tynamo.org/tapestry-resteasy+guide.

Release notes (from http://jira.codehaus.org/browse/TYNAMO/fixforversion/16916):

Improvement

* [TYNAMO-64] - Live Class Reloading for REST services

Enjoy,
Tynamo Team

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



Re: select model - focus goes to item with value 0!

2010-12-03 Thread hese


Changing the value variable from long to Long solved it!

The problem was long being a primitive time, was getting initialized with 0,
and therefore automatically selecting the label with value 0.

Thanks Thiago!!

-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/select-model-focus-goes-to-item-with-value-0-tp3291510p3291551.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: select model - focus goes to item with value 0!

2010-12-03 Thread Thiago H. de Paula Figueiredo

On Fri, 03 Dec 2010 18:23:20 -0200, hese <1024h...@gmail.com> wrote:


Hi,


Hi!


I am populating a select model using OptionModelImpl.
The problem is when the page loads, the item with value=0 is getting the
focus automatically.  I want the focus to stay on the first item in the
list.  Why is this happening?


This is defined by the Select componet. OptionModel just represent the  
options.
Select component marks the current value of the edited property as the  
initial value. You're probably editing an int field. Set it to the first  
option before the form is rendered or, better yet, use Integer instead of  
int.
Also make sure the object you use as the value in the OptionModel  
implements toString() correctly.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
Coordenador e professor da Especialização em Engenharia de Software com  
Ênfase em Java da Faculdade Pitágoras

http://www.arsmachina.com.br

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



select model - focus goes to item with value 0!

2010-12-03 Thread hese

Hi,

I am populating a select model using OptionModelImpl. 

The problem is when the page loads, the item with value=0 is getting the
focus automatically.  I want the focus to stay on the first item in the
list.  Why is this happening?

for (Iterator it =idNames.keySet().iterator(); it.hasNext(); ) {
Long id = it.next();
optionModelList.add(new OptionModelImpl(idNames.get(id), id));
}

Any ideas?
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/select-model-focus-goes-to-item-with-value-0-tp3291510p3291510.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: Default value for @Persist'd object

2010-12-03 Thread Rich M

Hi,

I don't believe so, source for @Persist only seems to support the value 
parameter to set the persistence type (client,session,flash). The 
approach I use is to set any persisted values I want defaults for in a 
pre-render stage (BeginRender usually). I like to group them all in one 
method. Of course your wrapper methods idea seems fine if you prefer a 
method-per-object convention.


-Rich

On 12/03/2010 09:39 AM, Richard Hill wrote:

Hi,

I was wondering whether it's possible to set or define a default value
for an object that is @Persist'd?

e.g something equivalent to:

public Object getPersistedObject() {

   if (object == null) {
   object = new Object();
   object.setSomeValues(...);
   }
   return object;
}

Obviously I can provide my own wrapper method(s) akin to the above for
accessing anything that's @Persist'd, just wondering whether there was
anything built into T5?

Thanks Richard.




-
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: First Tapestry app with Hibernate

2010-12-03 Thread Everton Agner
He meant the Maven Plugin for Eclipse : m2eclipse

___
Everton Agner Ramos


2010/12/3 robnangle 

>
> No i am using the normal eclipse ide.
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/First-Tapestry-app-with-Hibernate-tp3285845p3291024.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: scripting

2010-12-03 Thread Thiago H. de Paula Figueiredo
On Fri, 03 Dec 2010 13:12:15 -0200, Angelo C.   
wrote:



Hi,


Hi!

I need some scripting functions in t5 app, what are the options  
available?
looks like Groovy is easier, I have included the groovy-all-minimal into  
the app, but how to use it? looking for a sample usage, say just a  
service class in Groovy returning a string 'Hello', and how to call this  
from a page class so that it could be rendered to the browser? thanks,


This isn't specific to Tapestry. Just try to find out how you can invoke  
Groovy code from Java. Another option is to use JavaScript (Rhino).


By the way, you can write page, component, mixin and service classes in  
Groovy and Scala (which is not a scripting language, I know. :)).


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: First Tapestry app with Hibernate

2010-12-03 Thread robnangle

No i am using the normal eclipse ide.
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/First-Tapestry-app-with-Hibernate-tp3285845p3291024.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



T5: scripting

2010-12-03 Thread Angelo C.

Hi,

I need some scripting functions in t5 app, what are the options available?
looks like Groovy is easier, I have included the groovy-all-minimal into the
app, but how to use it? looking for a sample usage, say just a service class
in Groovy returning a string 'Hello', and how to call this from a page class
so that it could be rendered to the browser? thanks,

Angelo
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-scripting-tp3291002p3291002.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



Default value for @Persist'd object

2010-12-03 Thread Richard Hill

Hi,

I was wondering whether it's possible to set or define a default value
for an object that is @Persist'd?

e.g something equivalent to:

public Object getPersistedObject() {

  if (object == null) {
  object = new Object();
  object.setSomeValues(...);
  }
  return object;
}

Obviously I can provide my own wrapper method(s) akin to the above for
accessing anything that's @Persist'd, just wondering whether there was
anything built into T5?

Thanks Richard.




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



Re: dynamic component id?

2010-12-03 Thread Thiago H. de Paula Figueiredo
On Fri, 03 Dec 2010 11:05:31 -0200, Christian Koller  
 wrote:


Yes that's exactly what I face. What I would need is more than one  
instance of the component and each instance with his own session value,  
independent from the other instances.

But I guess this isn't possible.


You only need to rethink your approach. Instead of using @Persist, pass  
the iteration number as a parameter. @Inject Request and then get and set  
the value directly into the Session using some logic in the session  
attribute names.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



dynamic component id?

2010-12-03 Thread Christian Koller
Hi all

Thank you for your answers.
I don't mean any client id related stuff. I mean the id of the component.

> The explanation is not correct. You have a single TimeSlot component instance 
> in your template which is rendered n times. Instead of relying in @Persist 
> inside the component, pass the info as a parameter.


Yes that's exactly what I face. What I would need is more than one instance of 
the component and each instance with his own session value, independent from 
the other instances.

But I guess this isn't possible.


On 03.12.2010, at 13:11, Thiago H. de Paula Figueiredo wrote:

> On Fri, 03 Dec 2010 09:54:54 -0200, Christian Koller 
>  wrote:
> 
>> Any ideas how to solve this?
> 
> Tapestry components ids are static, period. HTML ids are dynamic.
> 
>> If I use a literal as the id, then it works, but then all the generated 
>> timeSlot components within the loop will have the same id.
>> If I use afterwards the persist annotation within the timeSlot component all 
>> the generated timeSlots share this session value because the id is the same.
> 
> The explanation is not correct. You have a single TimeSlot component instance 
> in your template which is rendered n times. Instead of relying in @Persist 
> inside the component, pass the info as a parameter.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and 
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 

Christian Koller
Sofwareentwickler
 
net mobile Schweiz AG
Seestrasse 45
CH ñ 8702 Zollikon
 
Tel: + 41 (0) 44 918 99 99
Fax: + 41 (0) 44 918 99 98
Direkt:  + 41 (0) 44 918 99 72

Mail: christian.kol...@net-m.ch
Web:  www.net-m.ch


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



Re: dynamic component id?

2010-12-03 Thread Antonio Fernández

Hi !

You could try with ...





( TimeSlot.tml )



...this clientId property is generated in the Java.Side with the following
method ( at SetupRender )

( TimeSlot.java  )

@Property
 private String myClientId;

@Inject
private ComponentResources componentResources;

@Inject
private RenderSupport renderSupport;

@SetupRender
void setupRender() {
myClientId = renderSupport.allocateClientId(componentResources);
}

... and you will have a sequence of DOM IDs generated : "myTimeSlot_1", 
"myTimeSlot_2", 


That´s all ,

Best Regards,

--
Antonio Miguel Fernández Rodríguez
Jaraxa Software, SL
Administrator, Software analyst
Cel. +34 607 78 86 85
www.jaraxa.com



El 03/12/2010 12:52, Joost Schouten (ml) escribió:
 It sounds like you are confusing the t:id with the html dom id. I 
think you are looking for:


xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>






Cheers,
Joost



On 3/12/10 12:54 PM, Christian Koller wrote:

I have the following template:

xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>






But Tapestry calls out:
Component id 'prop:index' is not valid; component ids must be valid 
Java identifiers: start with a letter, and consist of letters, 
numbers and underscores.


Is it not possible to use a property as id?

If I use a literal as the id, then it works, but then all the 
generated timeSlot components within the loop will have the same id.
If I use afterwards the persist annotation within the timeSlot 
component all the generated timeSlots share this session value 
because the id is the same.


Any ideas how to solve this?
Thank you
chris
-
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: dynamic component id?

2010-12-03 Thread Thiago H. de Paula Figueiredo
On Fri, 03 Dec 2010 09:54:54 -0200, Christian Koller  
 wrote:



Any ideas how to solve this?


Tapestry components ids are static, period. HTML ids are dynamic.

If I use a literal as the id, then it works, but then all the generated  
timeSlot components within the loop will have the same id.
If I use afterwards the persist annotation within the timeSlot component  
all the generated timeSlots share this session value because the id is  
the same.


The explanation is not correct. You have a single TimeSlot component  
instance in your template which is rendered n times. Instead of relying in  
@Persist inside the component, pass the info as a parameter.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: dynamic component id?

2010-12-03 Thread Kristian Marinkovic
i guess it is about the dynamically generated id of the html element ... 
the component should implement the interface ClientElement.
If it does you can call the method getClientId to obtain the id that is 
used in the generated html.

g,
kris




Von:Everton Agner 
An: Tapestry users 
Datum:  03.12.2010 12:57
Betreff:Re: dynamic component id?



I believe he didn't misunderstood... the real problem is "which approach
should he get to work with dynamic components?".

Actually, I didn't need to use this yet but always wondered too.

___
Everton Agner Ramos


2010/12/3 Joost Schouten (ml) 

>  It sounds like you are confusing the t:id with the html dom id. I think
> you are looking for:
>
>
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd
> ">
>
> t:type="calendar/timeSlot"/>
>
> 
>
> Cheers,
> Joost
>
>
>
>
> On 3/12/10 12:54 PM, Christian Koller wrote:
>
>> I have the following template:
>>
>> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
>>
>>
>>
>> 
>>
>> But Tapestry calls out:
>> Component id 'prop:index' is not valid; component ids must be valid 
Java
>> identifiers: start with a letter, and consist of letters, numbers and
>> underscores.
>>
>> Is it not possible to use a property as id?
>>
>> If I use a literal as the id, then it works, but then all the generated
>> timeSlot components within the loop will have the same id.
>> If I use afterwards the persist annotation within the timeSlot 
component
>> all the generated timeSlots share this session value because the id is 
the
>> same.
>>
>> Any ideas how to solve this?
>> Thank you
>> chris
>> -
>> 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: dynamic component id?

2010-12-03 Thread Everton Agner
I believe he didn't misunderstood... the real problem is "which approach
should he get to work with dynamic components?".

Actually, I didn't need to use this yet but always wondered too.

___
Everton Agner Ramos


2010/12/3 Joost Schouten (ml) 

>  It sounds like you are confusing the t:id with the html dom id. I think
> you are looking for:
>
>
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd
> ">
>
> t:type="calendar/timeSlot"/>
>
> 
>
> Cheers,
> Joost
>
>
>
>
> On 3/12/10 12:54 PM, Christian Koller wrote:
>
>> I have the following template:
>>
>> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>
>>
>>
>>
>> 
>>
>> But Tapestry calls out:
>> Component id 'prop:index' is not valid; component ids must be valid Java
>> identifiers: start with a letter, and consist of letters, numbers and
>> underscores.
>>
>> Is it not possible to use a property as id?
>>
>> If I use a literal as the id, then it works, but then all the generated
>> timeSlot components within the loop will have the same id.
>> If I use afterwards the persist annotation within the timeSlot component
>> all the generated timeSlots share this session value because the id is the
>> same.
>>
>> Any ideas how to solve this?
>> Thank you
>> chris
>> -
>> 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: dynamic component id?

2010-12-03 Thread Joost Schouten (ml)
 It sounds like you are confusing the t:id with the html dom id. I 
think you are looking for:


http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>





Cheers,
Joost



On 3/12/10 12:54 PM, Christian Koller wrote:

I have the following template:

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>





But Tapestry calls out:
Component id 'prop:index' is not valid; component ids must be valid Java 
identifiers: start with a letter, and consist of letters, numbers and 
underscores.

Is it not possible to use a property as id?

If I use a literal as the id, then it works, but then all the generated 
timeSlot components within the loop will have the same id.
If I use afterwards the persist annotation within the timeSlot component all 
the generated timeSlots share this session value because the id is the same.

Any ideas how to solve this?
Thank you
chris
-
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



dynamic component id?

2010-12-03 Thread Christian Koller
I have the following template:

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>





But Tapestry calls out:
Component id 'prop:index' is not valid; component ids must be valid Java 
identifiers: start with a letter, and consist of letters, numbers and 
underscores.

Is it not possible to use a property as id?

If I use a literal as the id, then it works, but then all the generated 
timeSlot components within the loop will have the same id.
If I use afterwards the persist annotation within the timeSlot component all 
the generated timeSlots share this session value because the id is the same.

Any ideas how to solve this?
Thank you
chris
-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org