[T5] How to get actionlink clientId in onAction?

2008-06-05 Thread Jun Tsai
I want to get ActionLink clientId.How to get ? thanks

-- 
regards,
Jun Tsai


Tapestry 5 server side validation

2008-06-05 Thread ice96

Hello, 
I have problems with tapestry 5 server side validations. First o all there
is my code:
package org.example.myapp.model;

import org.apache.tapestry.beaneditor.NonVisual;
import org.apache.tapestry.beaneditor.Validate;

public class User {
private int id;
private String name;
private String surname;


public int getId() {
return id;
}
@NonVisual
public void setId(int id) {
this.id = id;
}
@Validate("required")
public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

@Validate("required")
public String getSurname() {
return surname;
}

public void setSurname(String surname) {
this.surname = surname;
}
}



package org.example.myapp.pages;

import org.example.myapp.model.User;

public class Register {
private User user;

public User getUser() {
return user;
}

public void setUser(User user) {
this.user = user;
}

public Object onSubmit()
{
return Start.class;
}

}


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

Register Page


myapp Start Page

 This is the start page for this application, a good place to
start your modifications.
Just to prove this is live: 









After disabling java script validation stop working. Some times after page
refresh I can see validatio messanges, but not after click submit button. I
have tested on firefox 3  and opera (in linux)
-- 
View this message in context: 
http://www.nabble.com/Tapestry-5-server-side-validation-tp17680152p17680152.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: external POST link to spring security

2008-06-05 Thread pavla

Hi all,

I'm trying to integrate spring (acegi) security 2.0 with my Tapestry 5
application. I have an tapestry page with login form and want to send data
from login form to spring security filters. 
On login page I use something like this:

public Object onSubmitFromLoginForm() {

getUserName;
getPassword;
create URL ...
/j_spring_security_check?j_username=someUserName&j_password=somePassword 
return URL;

}

This works, but the problem is that I want request to spring security filter
to be sent with POST method. So could you please advise how to tell Tapestry
to use POST instead of GET or any other suggestions how to send data (with
POST method) from my tapestry login page to spring security filters - simply
need a way how to create "external POST link".

Thanks for any help. Pavla




-- 
View this message in context: 
http://www.nabble.com/T5%3A-external-POST-link-to-spring-security-tp17680013p17680013.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Migration of T4 to T5

2008-06-05 Thread Daniel Jue
I don't think any tools are being created to do this.

--However--, there has been a recent change in T5 which should allow you to
run T4 and T5 codebases together, so you can migrate incrementally.  I am
not sure if anyone is taking advantage of this yet--It should be in Tapestry
5.0.12.  It was discussed on the list within the last month.



On Thu, Jun 5, 2008 at 4:46 PM, Ben Dotte <[EMAIL PROTECTED]> wrote:

> Hey,
>
> Sorry if I might have missed something for this already, but I was
> curious what is or will be out there to migrate a T4.1 app to T5. I
> know Jesse had mentioned he was planning to create an upgrade path
> from one of the T4 versions but I have not heard about any progress on
> this yet.
>
> We're running a big T4.1.5 app and contemplating an upgrade sometime
> in the near future but the task looks pretty daunting at this point,
> to say the least.
>
> I have read some e-mails on the list about upgrade experiences, which
> are definitely appreciated, but I'm interested now about whether any
> tools are out there or expected to be created which might help to ease
> the transition a little. I expect quite a lot of it will need to be
> hand-migrated, but any automation would certainly be nice.
>
> Thanks,
> Ben
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Migration of T4 to T5

2008-06-05 Thread Ben Dotte
Hey,

Sorry if I might have missed something for this already, but I was
curious what is or will be out there to migrate a T4.1 app to T5. I
know Jesse had mentioned he was planning to create an upgrade path
from one of the T4 versions but I have not heard about any progress on
this yet.

We're running a big T4.1.5 app and contemplating an upgrade sometime
in the near future but the task looks pretty daunting at this point,
to say the least.

I have read some e-mails on the list about upgrade experiences, which
are definitely appreciated, but I'm interested now about whether any
tools are out there or expected to be created which might help to ease
the transition a little. I expect quite a lot of it will need to be
hand-migrated, but any automation would certainly be nice.

Thanks,
Ben

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 ajax zone changing

2008-06-05 Thread Janko Muzykant

Thiago H. de Paula Figueiredo wrote on 05 Jun 2008 15:26:58 MET:

> On Thu, 05 Jun 2008 11:18:53 -0300, Janko Muzykant <[EMAIL PROTECTED]>
> wrote:
>
> > Hi Markus,
> > thanks for links, but this unfortunately does not solve the
> > problem. i will
> > try to highlight my case. commiting the form currenlty we have no
> > possibility to select destination zone other when that one assigned in
> > "form" element (eg. ), right?
>
> Not quite. :) The t:zone parameter defines what zone will be
> updated. The return value of the event handler method defines what
> content (a Zone or  Block) will be used to update that zone.
>
yup, that is what i called 'destination zone' :)  its conent may be
updated dynamically by returned Block or Zone but i
would like to choose quite different destination (depending on clicked
button). and that's my problem :)

greetins,
jm.

-- 
Signature missing...


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5 onActivate

2008-06-05 Thread maxthesecond

I have a page with many components all them throwing events and actions.

I started implementing the onActivate if not loged then go login pattern

As events and actions where added I've noticed that I have to check if the
user is loged in every event handler.

I expected the onActivate method to be the first allways called giving you a
chance to switch page or whatever

Does it exist such method? OnPageActivateBeforeRender

I'm a bit confused regarding the state diagram of the requests in tapestry

Thanks
-- 
View this message in context: 
http://www.nabble.com/T5-onActivate-tp17673637p17673637.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 if component

2008-06-05 Thread maxthesecond

Thanks Filip for your answer I did as you said and worked OK.
Though, relaying on the state of the property makes me feel less
confident...(tipical I don't see where the value comes from paranoia)
-- 
View this message in context: 
http://www.nabble.com/T5-if-component-tp17667375p17673104.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 ajax zone changing

2008-06-05 Thread Thiago H de Paula Figueiredo
On Thu, 05 Jun 2008 11:18:53 -0300, Janko Muzykant <[EMAIL PROTECTED]>  
wrote:



Hi Markus,
thanks for links, but this unfortunately does not solve the problem. i  
will

try to highlight my case. commiting the form currenlty we have no
possibility to select destination zone other when that one assigned in
"form" element (eg. ), right?


Not quite. :) The t:zone parameter defines what zone will be updated. The  
return value of the event handler method defines what content (a Zone or  
Block) will be used to update that zone.


Thiago

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 ajax zone changing

2008-06-05 Thread Janko Muzykant

Hi Markus,
thanks for links, but this unfortunately does not solve the problem. i will
try to highlight my case. commiting the form currenlty we have no
possibility to select destination zone other when that one assigned in
"form" element (eg. ), right? so how to refresh
different zones depending on different commit buttons? eg. i would like
commit button A to refresh zone_A and commit button B to refresh zone_B.

thanks again,
jm.





Marcus-11 wrote:
> 
> Hi Janko,
> 
> maybe this help
> 
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ZoneDemo.tml?view=markup
> http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ZoneDemo.java?view=markup
> 
> Marcus
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5-ajax-zone-changing-tp17598853p17670934.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: need some help to resolve some strange Form/ValidationTracker behaviour

2008-06-05 Thread Kristian Marinkovic
hi,

can somebody tell my why my simple page below displays my error
message after i refresh my page? (CTRL-R or F5)

first i submit the form and the error message gets displayed as expected.
but when i refresh the page the error will still be displayed again. since 

5.0.12-SNAPSHOT the Form component saves the current ValidationTracker
using the flash persistence strategy and therefore i assumed the form will 

always have a new ValidationTracker instance on a refresh. during 
debugging i realized that the same ValidationTracker instance is used for
the whole session. Neither passing in an own ValidationTracker (using
flash persistence) changed the behaviour.

am i missing something?  am i  doing  something wrong? do i still have
to clear the validationTracker manually?

i'm using latest 5.0.12-SNAPSHOT + Jetty to run my example

g, kris

public class Page
{
  @Component
  private Form form;
 
  @Component
  private Errors errors;
 
  @Component(parameters={"value=value"})
  private TextField field;
 
  @Component
  private Submit submit;
 
  @Property
  private String value;

  void onValidateFormFromForm()
  {
form.recordError("error with value: " + value);
  }
}

Re: T5 if component

2008-06-05 Thread Marcelo Lotif
Hi,
This is a known issue, there's a JIRA for it and it's marked to fix
for the 5.1 version:

https://issues.apache.org/jira/browse/TAPESTRY-1624


And i'm using the t5c library to do the ognl job:

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

http://87.193.218.134:8080/t5c-demo/ognlbindingpage

2008/6/5 Filip S. Adamsen <[EMAIL PROTECTED]>:
> Hi,
>
> This doesn't really concern the If component, but rather the framework
> itself. You cannot call methods with arguments through the prop: binding
> prefix, at least not yet.
>
> What you should do is to make sure the current value of the loop is bound to
> a page property that you can check in a page method that returns a boolean:
>
>  @Property
>  private Node node;
>
>  public boolean isNodeSelected() {
>return nodeSelected.getIdentifier() == node.getIdentifier();
>  }
>
> Your If will then simply become
>
>  ...
>
> Hope this helps.
>
> -Filip
>
> On 2008-06-05 13:05, maxthesecond wrote:
>>
>>
>> Is it possible to send parameters to the if component?
>>
>> I'm in a loop component and I would like to do something like this:
>>
>> > currentNode="node">
>>> context="node.identifier">
>>   
>>  ${node.name}  
>>  ${node.name} 
>> 
>> 
>>
>>
>> And then in the java code:
>>
>> boolean Testj(int nodeid){if(nodeid==nodeSelected) return true; return
>> false; }
>>
>>
>> Is there any way to do the trick?
>>
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Atenciosamente,
Marcelo Lotif

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 if component

2008-06-05 Thread Filip S. Adamsen

Hi,

This doesn't really concern the If component, but rather the framework 
itself. You cannot call methods with arguments through the prop: binding 
prefix, at least not yet.


What you should do is to make sure the current value of the loop is 
bound to a page property that you can check in a page method that 
returns a boolean:


  @Property
  private Node node;

  public boolean isNodeSelected() {
return nodeSelected.getIdentifier() == node.getIdentifier();
  }

Your If will then simply become

  ...

Hope this helps.

-Filip

On 2008-06-05 13:05, maxthesecond wrote:



Is it possible to send parameters to the if component?

I'm in a loop component and I would like to do something like this:


  
  
context="node.identifier">
   
  ${node.name} 
  
  ${node.name} 
   
  
 




And then in the java code:

boolean Testj(int nodeid){if(nodeid==nodeSelected) return true; return
false; }


Is there any way to do the trick?





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5 if component

2008-06-05 Thread maxthesecond



Is it possible to send parameters to the if component?

I'm in a loop component and I would like to do something like this:


  
  
   
  ${node.name} 
  
  ${node.name} 
   
  
 



And then in the java code:

boolean Testj(int nodeid){if(nodeid==nodeSelected) return true; return
false; }


Is there any way to do the trick?



-- 
View this message in context: 
http://www.nabble.com/T5-if-component-tp17667375p17667375.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Zone component - Having a progress indicator.

2008-06-05 Thread Jun Tsai
2008/2/10 César Lesc <[EMAIL PROTECTED]>:

> I think T5 is using prototype to make ajax calls, you can use the
> Ajax.Resonders.register to register JS functions that monitor the Ajax
> activity.
>
> César.
>



Thank you very much!

>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
regards,
Jun Tsai


T5: Dynamically extending volatile list

2008-06-05 Thread grashopper

Hi,

I'd like to implement a form to edit elements of a collection. The contained
list is fetched onActivate of the submit request as well, so the loop is
marked as volatile.

The critical part, I'm not able to get to work, is where I add a new Element
(virtually on client side) to the list.
I do not want to add the colletion to the session because this is imho not
where it belongs. It is much more to be passed from request to request. Just
for the redirect after the post it should be passed through the flash scope.

The adding of the new element is triggered by a  button in the form (which
has to be submitted fully as well to not loose any info that has been
entered in paralllel). After the next  Submit the collection is refeched
from db (because volatile) and tapestry tries to update the collection with
the content of the request, but since the collection in the request contains
more elements than the one that got loaded, it throws a
NoSuchElementException. 

How do I fix this without throwing the collection into the session ?


The template:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>



  
  Element:
  input:
  
  


  
  


   
--
The page class:
public class CollectionTest {
@Inject
private Facade _facade;

@Inject
private ComponentResources _resources;

@Persist("flash")
private List _collection;

private Element iter;

public void onActivate() {
if ( _collection == null ) {
collection = _facade.getCollection(..);
}
}

public void cleanupRender() {
_resources.discardPersistentFieldChanges();
}

public void onSelectedFromAddElement() {
_collection.add(new Element());
}

public void onSelectedFromSave() {
//_facade.store(_collection, ..);
}

public List getCollection() {
return _collection;
}

public void setCollection(List collection) {
_collection = collection;
}

public Element getIter() {
return iter;
}

public void setIter(Element iter) {
this.iter = iter;
}
}
-- 
View this message in context: 
http://www.nabble.com/T5%3A-Dynamically-extending-volatile-list-tp17666544p17666544.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]