You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Tim Blommerde <T....@sdb.nl> on 2005/02/01 13:58:47 UTC

How to handle domain objects with third party classes as fields.

Dear Tapestry users,

After I heard Mr. Howard M. Lewis ship talk about Tapestry on the recent JavaPolis 2004 event, I got quite interested in having a look into Tapestry. Now, nearly two months later, I finally got the time to dive into Tapestry and have by now followed some tutorials and am still very excited.

At this moment I just started developing a test Tapestry application for myself but already ran into my first problem. The problem I have is that I have some PoJo domain objects that have none JDK objects for fields. All examples I found had domain objects with Strings or numbers as their fields, but I couldn't find one that had third party classes as fields. Now my question is how to use such domain objects in forms and especially where and how to map inserted strings to the actual third party classes used in the PoJo's.

Thanks in advance for your answer,
Tim

____________________________________________________________

Alle email van SDB wordt gecontroleerd op virussen door McAfee anti-virus
software op de mailserver.
____________________________________________________________


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to handle domain objects with third party classes as fields.

Posted by Danny Mandel <dm...@tolweb.org>.
Oops.  That's true.  What I should have said is that using TextField for 
Strings and ValidFields for Numbers and other formatted input, you can 
accomplish these sorts of things.

Danny

Erik Hatcher wrote:

>
> On Feb 1, 2005, at 11:41 AM, Danny Mandel wrote:
>
>> assuming your class has a getBar method, you can create text fields 
>> like this:
>>
>> <input jwcid="@TextField" value="ognl:foo.bar.field1"/> etc.
>>
>> And this will work for your primitives.
>
>
> Actually, and unfortunately, TextField only works with String.
>
> I would like to say this will be fixed in 3.1, but I cannot promise I 
> will personally have the time to do it as completely and robustly as 
> it should be done.
>
>     Erik
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to handle domain objects with third party classes as fields.

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 1, 2005, at 11:41 AM, Danny Mandel wrote:
> assuming your class has a getBar method, you can create text fields 
> like this:
>
> <input jwcid="@TextField" value="ognl:foo.bar.field1"/> etc.
>
> And this will work for your primitives.

Actually, and unfortunately, TextField only works with String.

I would like to say this will be fixed in 3.1, but I cannot promise I 
will personally have the time to do it as completely and robustly as it 
should be done.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to handle domain objects with third party classes as fields.

Posted by Danny Mandel <dm...@tolweb.org>.
There is no simple answer to this question as it largely depends on what 
sorts of data your 3rd party objects contain.  For the most part, all of 
my custom classes are generally collections of primitive objects.  Using 
ognl, you can traverse an object graph of a contained object and access 
that contained object's fields.  i.e. class Foo has a reference to class 
Bar and class Bar has a number of fields that are Strings, Dates, Numbers

assuming your class has a getBar method, you can create text fields like 
this:

<input jwcid="@TextField" value="ognl:foo.bar.field1"/> etc.

And this will work for your primitives.  If you have the need to edit a 
relationship directly between two objects, you can use a 
PropertySelection and implement your own IPropertySelectionModel that 
can map between Strings and the actual objects they represent.

Of course, tapestry can do pretty much anything you tell it to, but I've 
found that most of what I've done can be broken down into simpler cases 
like these.

Hope that helps,
Danny

Tim Blommerde wrote:

>Dear Tapestry users,
>
>After I heard Mr. Howard M. Lewis ship talk about Tapestry on the recent JavaPolis 2004 event, I got quite interested in having a look into Tapestry. Now, nearly two months later, I finally got the time to dive into Tapestry and have by now followed some tutorials and am still very excited.
>
>At this moment I just started developing a test Tapestry application for myself but already ran into my first problem. The problem I have is that I have some PoJo domain objects that have none JDK objects for fields. All examples I found had domain objects with Strings or numbers as their fields, but I couldn't find one that had third party classes as fields. Now my question is how to use such domain objects in forms and especially where and how to map inserted strings to the actual third party classes used in the PoJo's.
>
>Thanks in advance for your answer,
>Tim
>
>____________________________________________________________
>
>Alle email van SDB wordt gecontroleerd op virussen door McAfee anti-virus
>software op de mailserver.
>____________________________________________________________
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: friendly url patch

Posted by Jamie Orchard-Hays <ja...@dang.com>.
google: tapestry friendlyurls


On Feb 1, 2005, at 8:27 AM, Alexey Romanchuk wrote:

> hello!
>
> i read about friendly url patch to tapestry. can you tell where it can
> be downloaded? and what limitation it have?
>
> thanx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


friendly url patch

Posted by Alexey Romanchuk <ui...@gorodok.net>.
hello!

i read about friendly url patch to tapestry. can you tell where it can
be downloaded? and what limitation it have?

thanx


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org