Re: multiple context values

2009-04-02 Thread Thiago H. de Paula Figueiredo
On Wed, Apr 1, 2009 at 7:45 PM, Filip S. Adamsen f...@fsadev.com wrote:
 What about contributing a ValueEncoder that converts between a ProductId
 and a String? I haven't needed to work with composite primary keys, so I
 can't say if it'd work, but it's worth a shot.

This is a more reusable solution than the one I've suggested before,
so that's the one I recommend. ;)

-- 
Thiago

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



Re: multiple context values

2009-04-02 Thread Howard Lewis Ship
Marcelo has the right answer for Tapestry 5.0.18:  you must create a
property of your page to assemble the context values into a List or
array.

In 5.1, there's new property expression syntax for creating a list:

  context=[ productId, categoryId ]

On Mon, Apr 28, 2008 at 8:53 AM, Leon Derks leon.de...@cumquat.nl wrote:
 How can I add multiple context values to an actionlink?

 For example a productId and a categoryId?





 -
 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



Re: multiple context values

2009-04-01 Thread Fernanda C. Carmo

I have an object Product and it has a composite primary key (ProductId).

How can I put this object Product in actionlink's context value?

Thank's!!!


Geoff Callender-2 wrote:
 
 You need the list binding prefix so you can do this:   
 t:context=list:p.productId, p.categoryId.  It's available 2 ways  
 that I know of:
 
 1. You can add it to your project by hand from
 http://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefix
 2. You can get it for free by including the t5components in your  
 project: http://code.google.com/p/tapestry5-components/
 
 Cheers,
 
 Geoff
 http://files.doublenegative.com.au/jumpstart/
 
 On 29/04/2008, at 3:09 AM, Marcelo Lotif wrote:
 
 I was just caught by this problem some time ago, and in the tapestry
 site they recommend this:

 public Object[] getAccountContext()
 {
return new Object[] { account.companyId, account.id };
 }

 Object onActionFromDelete(long companyId, long accountId){
 //...
 }

 p
 [t:actionlink t:id=delete context=accountContextdelete/ 
 t:actionlink
 /p

 see:
 http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/ActionLink.html


 2008/4/28 Manuel Corrales manuelcorra...@gmail.com:
 I think you can separate the values with commas like this:

 t:context=p.productId, p.categoryId

 Good luck!




 On Mon, Apr 28, 2008 at 12:53 PM, Leon Derks  
 leon.de...@cumquat.nl wrote:

 How can I add multiple context values to an actionlink?

 For example a productId and a categoryId?





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






 -- 
 Atenciosamente,
 Marcelo Lotif

 -
 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
 
 
 


-
Fernanda Cristina do Carmo
System Analyst and Java Developer
MSN/GoogleTalk: fernanda.ca...@gmail.com

-- 
View this message in context: 
http://www.nabble.com/multiple-context-values-tp16941976p22834770.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: multiple context values

2009-04-01 Thread Thiago H. de Paula Figueiredo
Em Wed, 01 Apr 2009 18:35:53 -0300, Fernanda C. Carmo  
fernanda.ca...@gmail.com escreveu:



I have an object Product and it has a composite primary key (ProductId).
How can I put this object Product in actionlink's context value?


Hi!

Create a method that return a List containig the values thatt comprise the  
composite primary key. ;) This works in any Tapestry version.
Use EventContext as the only parameter of onActivate or any other event  
handler method.
By the way, in new code, avoid composite primary keys. It's not worth the  
trouble.


--
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: multiple context values

2009-04-01 Thread Filip S. Adamsen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

What about contributing a ValueEncoder that converts between a ProductId
and a String? I haven't needed to work with composite primary keys, so I
can't say if it'd work, but it's worth a shot.

/Filip

On 2009-04-02 00:33, Thiago H. de Paula Figueiredo wrote:
 Em Wed, 01 Apr 2009 18:35:53 -0300, Fernanda C. Carmo
 fernanda.ca...@gmail.com escreveu:
 
 I have an object Product and it has a composite primary key (ProductId).
 How can I put this object Product in actionlink's context value?
 
 Hi!
 
 Create a method that return a List containig the values thatt comprise
 the composite primary key. ;) This works in any Tapestry version.
 Use EventContext as the only parameter of onActivate or any other event
 handler method.
 By the way, in new code, avoid composite primary keys. It's not worth
 the trouble.
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEcBAEBAgAGBQJJ0+6AAAoJEEfiH7PpjaMngogH/jK+fjLs1Q01kukoVAA/V/rb
A2FW5oB8T9sik+OL/gRueSF8eV0z00j/lYaZ8F/p+sbIetSy16CCn0XnPUOYagx6
JBBWplsSDgHG62NnpO5+RzYBPmF4gLh4gOYrGo+WIaZcT/ZK9ohWrcLfF9V0IQrw
ciBcdxb1VToJF51qmtHnG4EcMORNkyd0gzElX1FpBVLiiJUOb4+CWRhLdEasF0nu
muKNA0zuZd85C3w2K7yWt15NBR8HRg3jJ/Xa54vHAq8OQ+1hFhkJLFck9PGIYrt3
HCQHqKbJxPYOgd3JVamrTSszqjnhVriVNHKfD8H8LfUb0/dBxDaclx88KTY0Oy8=
=EgqM
-END PGP SIGNATURE-

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



Re: multiple context values

2008-04-29 Thread Geoff Callender
You need the list binding prefix so you can do this:   
t:context=list:p.productId, p.categoryId.  It's available 2 ways  
that I know of:


1. You can add it to your project by hand from 
http://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefix
2. You can get it for free by including the t5components in your  
project: http://code.google.com/p/tapestry5-components/


Cheers,

Geoff
http://files.doublenegative.com.au/jumpstart/

On 29/04/2008, at 3:09 AM, Marcelo Lotif wrote:


I was just caught by this problem some time ago, and in the tapestry
site they recommend this:

public Object[] getAccountContext()
{
   return new Object[] { account.companyId, account.id };
}

Object onActionFromDelete(long companyId, long accountId){
//...
}

p
[t:actionlink t:id=delete context=accountContextdelete/ 
t:actionlink

/p

see: 
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/ActionLink.html


2008/4/28 Manuel Corrales [EMAIL PROTECTED]:

I think you can separate the values with commas like this:

t:context=p.productId, p.categoryId

Good luck!




On Mon, Apr 28, 2008 at 12:53 PM, Leon Derks  
[EMAIL PROTECTED] wrote:



How can I add multiple context values to an actionlink?

For example a productId and a categoryId?





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




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



Re: multiple context values

2008-04-28 Thread Manuel Corrales
I think you can separate the values with commas like this:

t:context=p.productId, p.categoryId

Good luck!

On Mon, Apr 28, 2008 at 12:53 PM, Leon Derks [EMAIL PROTECTED] wrote:

 How can I add multiple context values to an actionlink?

 For example a productId and a categoryId?





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




Re: multiple context values

2008-04-28 Thread Marcelo Lotif
I was just caught by this problem some time ago, and in the tapestry
site they recommend this:

public Object[] getAccountContext()
{
return new Object[] { account.companyId, account.id };
}

Object onActionFromDelete(long companyId, long accountId){
//...
}

p
 [t:actionlink t:id=delete context=accountContextdelete/t:actionlink
/p

see: 
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/ActionLink.html


2008/4/28 Manuel Corrales [EMAIL PROTECTED]:
 I think you can separate the values with commas like this:

 t:context=p.productId, p.categoryId

 Good luck!




 On Mon, Apr 28, 2008 at 12:53 PM, Leon Derks [EMAIL PROTECTED] wrote:

  How can I add multiple context values to an actionlink?
 
  For example a productId and a categoryId?
 
 
 
 
 
  -
  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]