Re: Standard BeanModel for my own classes

2015-10-13 Thread Thiago H de Paula Figueiredo
On Mon, 12 Oct 2015 06:32:01 -0300, Poggenpohl, Daniel wrote: Hi, Hi! Can I register the bean model in Tapestry so I don't have to set the model myself? Short answer: no. Long answer: no, but Chris' suggestions of contributing your own edition blocks will help you apply the same comp

Re: Standard BeanModel for my own classes

2015-10-12 Thread Chris Poulsen
Take a look at data type analyzers and their corresponding property display/edit blocks to get this working. Jumpstart has an example: http://jumpstart.doublenegative.com.au/jumpstart/examples/lang/propertyeditors -- Chris On Mon, Oct 12, 2015 at 11:32 AM, Poggenpohl, Daniel < daniel.poggenp...

Standard BeanModel for my own classes

2015-10-12 Thread Poggenpohl, Daniel
Hi, I've created some classes that are used rather prominently in my Tapestry 5.3.8 application. The classes have some attributes that are themselves simple string wrappers. So, for example, I have: SomeClass.java -- UidString someUid; [...] And UidString is basically a String

Re: Grid data source, BeanModel and nested properties

2015-01-06 Thread Ilya Obshadko
sformers.aliasToBean is used. The count is achieved > >> by using the Projections.rowCount(). > >> > >> On Fri, Jan 2, 2015 at 3:45 AM, Ilya Obshadko > >> wrote: > >> > I'm trying to implement a Grid data source optimized for database > >>

Re: Grid data source, BeanModel and nested properties

2015-01-06 Thread Jonathan Barker
ote: >> > I'm trying to implement a Grid data source optimized for database >> > retrievals (with paging support). Basically it's derived from >> > HibernateGridDataSource from Tapestry distribution, and provides support >> > for complex Criteria queries: >

Re: Grid data source, BeanModel and nested properties

2015-01-05 Thread Ilya Obshadko
ved from >> HibernateGridDataSource from Tapestry distribution, and provides support >> for complex Criteria queries: >> https://gist.github.com/xfyre/ecb36a9173aed6a37f14 >> >> However, there is a problem with sorting. >> >> Provided BeanModel implementation doesn&#

Re: Grid data source, BeanModel and nested properties

2015-01-05 Thread Thiago H de Paula Figueiredo
ia queries: https://gist.github.com/xfyre/ecb36a9173aed6a37f14 However, there is a problem with sorting. Provided BeanModel implementation doesn't support nested properties; that is, I cannot use properties of child Hibernate entities: include="property1, child1.property1, child2.proper

Re: Grid data source, BeanModel and nested properties

2015-01-03 Thread Ilya Obshadko
pestry distribution, and provides support > > for complex Criteria queries: > > https://gist.github.com/xfyre/ecb36a9173aed6a37f14 > > > > However, there is a problem with sorting. > > > > Provided BeanModel implementation doesn't support nested properties

Re: Grid data source, BeanModel and nested properties

2015-01-02 Thread Jonathan Barker
with paging support). Basically it's derived from > HibernateGridDataSource from Tapestry distribution, and provides support > for complex Criteria queries: > https://gist.github.com/xfyre/ecb36a9173aed6a37f14 > > However, there is a problem with sorting. > > Provided Bea

Re: Grid data source, BeanModel and nested properties

2015-01-02 Thread Chris Poulsen
port). Basically it's derived from > HibernateGridDataSource from Tapestry distribution, and provides support > for complex Criteria queries: > https://gist.github.com/xfyre/ecb36a9173aed6a37f14 > > However, there is a problem with sorting. > > Provided BeanModel implementati

Grid data source, BeanModel and nested properties

2015-01-02 Thread Ilya Obshadko
ver, there is a problem with sorting. Provided BeanModel implementation doesn't support nested properties; that is, I cannot use properties of child Hibernate entities: results in error. Initially I had a workaround of having helper getter methods in parent entity class, so it looked like .

Re: beanmodel ques

2013-05-28 Thread Thiago H de Paula Figueiredo
On Tue, 28 May 2013 10:45:06 -0300, Ken in Nashua wrote: Hi Folks, Hi! I want to include both player info and player stats in the same bean model. Check the mailing list archives for that. You'll probably need to implement a PropertyConduit and use it in beanModel.add("stats, new Y

RE: beanmodel ques

2013-05-28 Thread Ken in Nashua
Sorry folks... if I got this @Entity @ClassDescriptor(hasCyclicRelationships = true) @BeanModels( { @BeanModel(pageType = PageType.LIST, include = "player, gp, g, a, pts", exclude="") }) public class PlayerStats implements Cloneable, Serializable { priv

RE: beanmodel ques

2013-05-28 Thread Ken in Nashua
Maybe I should be doing the bean model on PlayerStats public class PlayerStats implements Cloneable, Serializable { private static final Log log = LogFactory.getLog(PlayerStats.class); private Integer id = null; private Player player = null; ...can I refer to the player from there ?

RE: beanmodel ques

2013-05-28 Thread Ken in Nashua
Players and stats are keyed by Season.class so there could be at any given time one Player instance and one PlayerStats instance to deal with. Its not immediately apparent to me how to combine properties from both classes into the grid bveanmodel

beanmodel ques

2013-05-28 Thread Ken in Nashua
Hi Folks, I have a Player.class public class Player extends Person implements Cloneable, Serializable { private Set playerStats = new HashSet(); He has a collection of stats. goals, assists, points etc... I am rendering league leaders... so I have a bean model I am working on myMo

Re: BeanModel Exception

2012-12-20 Thread Thiago H de Paula Figueiredo
On Thu, 20 Dec 2012 10:26:14 -0200, mateen wrote: the message object is just an Injected Object. But i get a render queue exception. What am i doing wrong. When an exception occurs and you want help, please post the exception, otherwise we can only guess what's happening. -- Thiago H. de

BeanModel Exception

2012-12-20 Thread mateen
nder queue exception. What am i doing wrong. -- View this message in context: http://tapestry.1045711.n5.nabble.com/BeanModel-Exception-tp5718873.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsu

Re: BeanModel - how to add results from a method?

2012-11-01 Thread Thiago H de Paula Figueiredo
On Thu, 01 Nov 2012 11:13:19 -0200, membersound wrote: Why not? That would be perfectly good, even recommended, object-oriented Because it was just an example here, I want to apply some calculations for some rows, which should not clutter my entities. And of course itself rely again on ot

Re: BeanModel - how to add results from a method?

2012-11-01 Thread membersound
the calculation is more a process for a service than being directly placed in the entity object itself. -- View this message in context: http://tapestry.1045711.n5.nabble.com/BeanModel-how-to-add-results-from-a-method-tp5717499p5717520.html Sent from the Tapestry - User mailing list archive

Re: BeanModel - how to add results from a method?

2012-11-01 Thread Thiago H de Paula Figueiredo
On Thu, 01 Nov 2012 10:06:34 -0200, membersound wrote: Sorry, I think I didn't get it. Nope, you didn't. :P setupRender() { model.add("result", pcSource.create("Product.class", "price")); Does this even compile? I guess it should be model.add("result", pcSource.create(Product.clas

Re: BeanModel - how to add results from a method?

2012-11-01 Thread membersound
Sorry, I think I didn't get it. Lets make an example here: http://tapestry.1045711.n5.nabble.com/BeanModel-how-to-add-results-from-a-method-tp5717499p5717512.html Sent from the Tapestry - User mailing list archive at Nabbl

Re: BeanModel - how to add results from a method?

2012-11-01 Thread Thiago H de Paula Figueiredo
On Thu, 01 Nov 2012 09:03:06 -0200, membersound wrote: Hi, Hi! When I create a BeanModel, how can I add results eg from a method that is not contained in the Entity-Object with which the BeanModel has been created? You can't pass the result itself, but you can implement a PropertyCo

BeanModel - how to add results from a method?

2012-11-01 Thread membersound
Hi, when I create a BeanModel, how can I add results eg from a method that is not contained in the Entity-Object with which the BeanModel has been created? Like: Here I create a beanmodel for the class UserProfile. And I want to add a field that gets its content from a method that is placed NOT

Re: Retain BeanModel when sorting columns?

2012-10-29 Thread membersound
com/Retain-BeanModel-when-sorting-columns-tp5717374p5717382.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-mai

Re: Retain BeanModel when sorting columns?

2012-10-29 Thread Dragan Sahpaski
list and a BeanModel? Especially regarding to the following example case: So the List is the GridDataSource in your case. This is a fine example of tapestry "magic". Tapestry coerces the List to a GridDataSource. Read about Type Coercion here http://tapestry.apache.org/type-coercion.

Re: Retain BeanModel when sorting columns?

2012-10-29 Thread membersound
OK I see. I'm doing it with BeanModelSource based on this example: http://jumpstart.doublenegative.com.au/jumpstart/examples/tables/gridmodel1 Would you recommend me switching to a GridDataSource in my page class for providing the data instead of a list and a BeanModel? Especially regardi

Re: Retain BeanModel when sorting columns?

2012-10-29 Thread Thiago H de Paula Figueiredo
On Mon, 29 Oct 2012 08:35:51 -0200, membersound wrote: @Property @Persist private BeanModel model; void setupRender() { this.model = beanModelSource.createDisplayModel(User.class, messages); this.model.add("...).sortable(true); } Result: everytime I sort, the db-fet

Re: Retain BeanModel when sorting columns?

2012-10-29 Thread Dragan Sahpaski
Can we have the full code? You are probably talking about a grid. The grid data is in the GridDataSource not in the BeanModel. Anyway. If you have a Hibernate like GridDataSource I wouldn't recommend persisting it because the sort should be done using SQL "order by" so persist

Retain BeanModel when sorting columns?

2012-10-29 Thread membersound
@Property @Persist private BeanModel model; void setupRender() { this.model = beanModelSource.createDisplayModel(User.class, messages); this.model.add("...).sortable(true); } Result: everytime I sort, the db-fetch is triggered. How can I persist the beanmodel data and

Trouble related with beaneditform, beanmodel and propertyconduit

2012-05-10 Thread ramonchu
@Inject private BeanModelSource beanModelSource; @Inject private ComponentResources resources; public BeanModel getModel(){ BeanModel result = beanModelSource.createEditModel(EntityB.class, resources.getMessages()); result.ad

Re: setSortAscending on BeanModel in Grid

2010-10-21 Thread Darren Williams
s wrote: >> Hi, we have been trying to work out a way to set the default sort order on >> our BeanModel to descending by default, since this is what out SQL query >> does but it appears as though the grid does not expose this method as shown >> below. >> >> Is

Re: setSortAscending on BeanModel in Grid

2010-10-20 Thread Josh Canfield
ot;entered"); // now sorts descending ugly, but effective. On Wed, Oct 20, 2010 at 5:41 AM, Darren Williams wrote: > Hi, we have been trying to work out a way to set the default sort order on > our BeanModel to descending by default, since this is what out SQL query does > but it a

Re: setSortAscending on BeanModel in Grid

2010-10-20 Thread Rich M
e have been trying to work out a way to set the default sort order on our BeanModel to descending by default, since this is what out SQL query does but it appears as though the grid does not expose this method as shown below. Is there another way we can do this? All the examples I have seen befor

setSortAscending on BeanModel in Grid

2010-10-20 Thread Darren Williams
Hi, we have been trying to work out a way to set the default sort order on our BeanModel to descending by default, since this is what out SQL query does but it appears as though the grid does not expose this method as shown below. Is there another way we can do this? All the examples I have

Re: T5.1 Question regarding BeanModel and BeanModelSource

2009-06-10 Thread Robert Zeigler
t the logic for detecting this annotation and adding the corresponding property to the BeanModel. This would be done with something like model.add( "display" ); in my former example. The decorator would be configured like explained in the ioc cookbook [1]. Now my call to modelSour

Re: T5.1 Question regarding BeanModel and BeanModelSource

2009-06-09 Thread Michael Gerzabek
implement the logic for detecting this annotation and adding the corresponding property to the BeanModel. This would be done with something like model.add( "display" ); in my former example. The decorator would be configured like explained in the ioc cookbook [1]. Now

Re: T5.1 Question regarding BeanModel and BeanModelSource

2009-06-08 Thread Robert Zeigler
the rest of the bean in a verbose mode to the user. Straight forward, no problem. Anyway, I'm just curious: Since I can imagine many occasions where a bean not only would hold data but also some semantics on the data that would be useful to be displayed to a person editing this bean. Is

Re: T5.1 Question regarding BeanModel and BeanModelSource

2009-06-08 Thread Michael Gerzabek
many occasions where a bean not only would hold data but also some semantics on the data that would be useful to be displayed to a person editing this bean. Is there a standard way to get this job done by BeanEditor/ BeanModel? To pick up your snippet: On my concrete BeanModel for bean Custom

Re: T5.1 Question regarding BeanModel and BeanModelSource

2009-06-08 Thread Robert Zeigler
etter that aren't otherwise marked as @NonVisual, and using createEditModel will only add the properties will getters and setters. But once you have the model, you can manipulate it anyway you want. For example: BeanModel getModel() { BeanModel model = beanModelSource.createDi

Re: T5.1 Question regarding BeanModel and BeanModelSource

2009-06-08 Thread Andy Huhn
Two separate beans--you create one bean on your view page (to be passed into BeanDisplay), another bean on your edit page (to be passed into BeanEditForm). They can have completely distinct sets of properties. On Mon, Jun 8, 2009 at 11:38 AM, Michael Gerzabek wrote: > Hi, > > BeanModelSource no

T5.1 Question regarding BeanModel and BeanModelSource

2009-06-08 Thread Michael Gerzabek
Hi, BeanModelSource now has deprecated create(..) in favor of createDisplayModel(..) and createEditModel(..). This is a nice feature leaving me with one question: I want to edit a bean that has some properties that should not be displayed at all (@NonVisual), some properties that should be d

BeanModel

2009-01-23 Thread superoverdrive
A question about BeanModel again http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/PropertyConduit.html It looks like "PropertyConduit" is the only way to modify a BeanModel - but this relies on Annotation...so adding fields that "do no exist" as metadata

T5: Query about BeanModel

2008-10-22 Thread tapestryphoto
Am I correct in thinking that the default BeanModel only recognises the standard property types (String, double, etc, etc)? I have a bean with several properties, one of which is one of my own types. When I attempt to use this bean in Grid I am unable to specify the property in the

Re: T5: Working with BeanModel

2008-07-08 Thread Andy Huhn
For future reference, here is the fix. I found it by looking at the source for BeanModelSourceImpl.java: BeanModel toReturn = _beanModelSource.create( MyClass.class, false, _componentResources ); toReturn.exclude( (String[])toReturn.getPropertyNames() .toArray( new

T5: Working with BeanModel

2008-07-02 Thread Andy Huhn
Hello, I have a class defined (MyClass) that has a String property pstlCode, with a getter and a setter. If I use BeanModelSource to create a BeanModel for MyClass, the BeanModel has a property pstlCode that can be used to access the pstlCode. However, if I exclude the pstlCode property, and

T5: Clearing BeanModel properties and adding them back

2008-07-01 Thread Andy Huhn
Hello, It seems that if I create a BeanModel using BeanModel toReturn = _beanModelSrc.create( MyObject.class, false, _cmpntRsrcs ); Things work as they should - I can then use the properties in the BeanModel, as I expect to. But, if I first clear all properties from the BeanModel

Re: BeanModel and complex types?

2008-06-25 Thread Udo Abel
Hi Kris, thank you for the quick response! Thats what I was looking for. Udo. Original-Nachricht > Datum: Wed, 25 Jun 2008 10:18:33 +0200 > Von: Kristian Marinkovic <[EMAIL PROTECTED]> > An: "Tapestry users" > Betreff: Re: BeanModel and complex typ

Re: BeanModel and complex types?

2008-06-25 Thread Kristian Marinkovic
ESTRY-2460 it has two examples how to display a complex child property with another block (containing another BeanEditor) g, kris "Udo Abel" <[EMAIL PROTECTED]> 25.06.2008 10:05 Bitte antworten an "Tapestry users" An users@tapestry.apache.org Kopie Thema BeanMod

BeanModel and complex types?

2008-06-25 Thread Udo Abel
accessed by something like employee.getSubsidiary().getName(); Is there a way to extend the BeanModel to access those properties? Or do I have to duplicate all fields from complex types in simple fields at the top level object, like employee.getSubsidiaryName(); ? Thanks, Udo. -- Pt! Schon vom

T5: clearing BeanModel properties

2008-06-24 Thread Andy Huhn
Hello, It seems that if I create a BeanModel using BeanModel toReturn = _beanModelSrc.create( MyObject.class, false, _cmpntRsrcs ); Things work as they should - I can then use the properties in the BeanModel, as I expect to. But, if I first clear all properties from the BeanModel, and

Re: Contributing to the BeanModel

2008-05-28 Thread Daniel Jue
I am a sole developer on my project, and I am also using Fernando's approach. The "form beans" help solve order of data entry and other dependencies that I just wouldn't want to encode in the persistent model. In addition, I've found these "form beans" are a great way to insert hard coded data an

Re: Contributing to the BeanModel

2008-05-28 Thread Fernando Padilla
The design pattern that we are starting to play with is to create beans specifically for the forms. Then write code that ferries the data between the form-bean and the actual persistent objects. This gives you more grunt work, but it adds a point of abstraction and flexibility. For the most

Re: Contributing to the BeanModel

2008-05-28 Thread Filip S. Adamsen
Well, you're right. But to me, at least, it's not that big of a deal. The dependency will be to tapestry5-annotations, which is a very small dependency. Anyhow, developing Tapestry apps is just a hobby of mine - for now, anyhow - so I make the decisions myself. Sadly, I don't know of any oth

Re: Contributing to the BeanModel

2008-05-28 Thread José Paumard
Hello Filip, From what I understand, that would involve changing the object model (not so nice, I dont have the hand on that), and making a dependency from this model to T5. I can already hear ppl screaming at that ;) Am I right ? Thank you, José Filip S. Adamsen a écrit : Hi José, You

Re: Contributing to the BeanModel

2008-05-28 Thread Filip S. Adamsen
Hi José, You can put @Inject in the constructor you want Tapestry to use for auto-instantiation. Should solve your problem. -Filip On 2008-05-28 15:59, José Paumard wrote: Hello Marcus, Thank you for your answer, but the customization provided by the BeanModel are about properties, their

Re: Contributing to the BeanModel

2008-05-28 Thread José Paumard
Hello Marcus, Thank you for your answer, but the customization provided by the BeanModel are about properties, their orders etc... A bean is built by a call to newInstance, defined in the BeanModel interface. The way the bean is built comes from InternalUtils.findAutobuildConstructor. This

use final for BeanModel fields

2008-05-28 Thread nille hammer
Hi Guys, just a little side note on Filip´s suggesion. Instead of initializing the BeanModel in onActivate() you could do this: private final BeanModel model; { model = beanModelSource.create(User.class, false, componentResources); model.get("username").sortable(false); } Mind

Re: Contributing to the BeanModel

2008-05-27 Thread Marcus
Hi José, Maybe this help. http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app3/ http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integratio

Re: T5: Teaching the BeanModel to always add my class

2008-04-16 Thread Tobias Wehrum
d so it was changed. Tobias -Filip Tobias Wehrum schrieb: Hi there, yes, maybe I caused confusion. To further point out what I'm trying to do: I just want to output whatever value Status.toString() will return to me, for example in a grid. When I add the property to the BeanModel, tapest

Re: T5: Teaching the BeanModel to always add my class

2008-04-15 Thread Filip S. Adamsen
want to output whatever value Status.toString() will return to me, for example in a grid. When I add the property to the BeanModel, tapestry has no problems calling toString() automatically; but at the moment, like I said, I have to add it first to the BeanModel, and I want to automatize this. (When it com

Re: T5: Teaching the BeanModel to always add my class

2008-04-15 Thread Tobias Wehrum
r point out what I'm trying to do: I just want to output whatever value Status.toString() will return to me, for example in a grid. When I add the property to the BeanModel, tapestry has no problems calling toString() automatically; but at the moment, like I said, I have to add it first to t

Re: T5: Teaching the BeanModel to always add my class

2008-04-15 Thread Tobias Wehrum
Hi there, yes, maybe I caused confusion. To further point out what I'm trying to do: I just want to output whatever value Status.toString() will return to me, for example in a grid. When I add the property to the BeanModel, tapestry has no problems calling toString() automatically; but a

Re: T5: Teaching the BeanModel to always add my class

2008-04-15 Thread Filip S. Adamsen
atus property to the BeanModel with model.add("myStatus"). Obviously implementing toString() isn't enough to teach my the BeanModel a new trick. So I tried to contribute a TypeCoercer and a TranslatorSource, but neither of them see

Re: T5: Teaching the BeanModel to always add my class

2008-04-15 Thread Filip S. Adamsen
But still when I have class A, which has a property of type Status, I always have to add the Status property to the BeanModel with model.add("myStatus"). Obviously implementing toString() isn't enough to teach my the BeanModel a new trick. So I tried to contribute a TypeCoerce

T5: Teaching the BeanModel to always add my class

2008-04-15 Thread Tobias Wehrum
Hi there, I have a class named "Status" which implements toString(). But still when I have class A, which has a property of type Status, I always have to add the Status property to the BeanModel with model.add("myStatus"). Obviously implementing toString() isn'

[T5] BeanModel and null values

2007-11-02 Thread Kevin Menard
Hi all, I'm working with the Grid component and customizing the BeanModel for display. I'd like to show complex paths in the grid. So, I've added them to the model and everything works well, except when there's a null somewhere along the path. Then in get an NPE in the