tag:blogger.com,1999:blog-4110180.post168803060443702197..comments2023-06-20T05:31:24.545-07:00Comments on Tapestry Central: T5 Screencast #4: BeanEditFormAnonymoushttp://www.blogger.com/profile/04486596490758986709noreply@blogger.comBlogger28125tag:blogger.com,1999:blog-4110180.post-3062649540352279212009-01-23T13:12:00.000-08:002009-01-23T13:12:00.000-08:00From a user perspective, something like this would...From a user perspective, something like this would be good:<BR/><BR/>Ct:FormLoop <BR/>source="itemsListFromDB" result="submittedItemsList"><BR/>C/t:FormLoopD<BR/><BR/>A "FormItem" could look like that:<BR/><BR/>public FormItemType getType();<BR/>public Value getValue();<BR/>public List(Value) getValues();<BR/>public boolean isArray();<BR/>public Validator getValidator();<BR/>public ItemDisplayOption getDisplayOption();<BR/><BR/>// DropDown | Textinput | Checkbox | RadioButton |<BR/><BR/>So you would just read your configuration from the database and the you could create a list of form items:<BR/><BR/>FormItem item = new FormItem();<BR/>item.setType(FormItemType.TextArea);<BR/>item.setValidator();<BR/>item.setLabel("Description");<BR/><BR/>FormItem item = new FormItem();<BR/>item.setType(FormItemType.Select);<BR/>item.setLabel("Car");<BR/>item.setModel(carsModel);<BR/>....Tobyhttps://www.blogger.com/profile/05220060081172588431noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-73344657105891182752009-01-23T08:02:00.000-08:002009-01-23T08:02:00.000-08:00Dynamic data web sites are quite possible; I'd say...Dynamic data web sites are quite possible; I'd say even easy, once you get it set up. However, the details tend to be very application specific.<BR/><BR/>Perhaps at some point I could create a library that can be used to generate these dynamic forms, and you would be responsible for translating your internal representation into Tapestry's representation.Anonymoushttps://www.blogger.com/profile/04486596490758986709noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-45168657601090471962009-01-23T01:10:00.000-08:002009-01-23T01:10:00.000-08:00It is a nice solution for creating forms for exist...It is a nice solution for creating forms for existing classes/beans. I only wish there was an easy way to generate forms dynamically if the configuration is stored in a database (e.g. website builder applications with a generic data model), e.g: http://wiki.apache.org/tapestry/WishList. If there should be a way to do this though, could you maybe cover this in the next screencast?Tobyhttps://www.blogger.com/profile/05220060081172588431noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-2542991335000407492008-07-10T00:39:00.000-07:002008-07-10T00:39:00.000-07:00Just a big thank you for all your work on BeanEdit...Just a big thank you for all your work on BeanEditForm.<BR/><BR/>I have stolen (with due credit, of course :) your great idea of 'using Javassist to read debug line information and order the UI fields according to source code order' for the latest release of <A HREF="http://www.metawidget.org" REL="nofollow">Metawidget</A>.<BR/><BR/>Thanks again and keep up the good work!Richardhttps://www.blogger.com/profile/11191015489042575122noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-82924091350267079892007-03-30T05:52:00.000-07:002007-03-30T05:52:00.000-07:00On the Java / Code Style preferences pane, you can...On the Java / Code Style preferences pane, you can list prefixes and/or suffixes for different types of fields. I list "_" as a prefix on ordinary (instance) Fields.Anonymoushttps://www.blogger.com/profile/04486596490758986709noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-62957144919785687582007-03-30T00:37:00.000-07:002007-03-30T00:37:00.000-07:00Off topic question. :-) I was wondering how you ge...Off topic question. :-) I was wondering how you get Eclipse to generate getters and setters properly when you use the underscore prefix naming convention? I use the same convention but I could never figure out how to get it to generate them correctly.<BR/><BR/>Thanks!Stevehttps://www.blogger.com/profile/06834366173173091438noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-6771594228944296182007-02-24T12:20:00.000-08:002007-02-24T12:20:00.000-08:00I just found my own answer again. There are valida...I just found my own answer again. There are validation, success/failure and submit events. I really should try harder before coming here.<BR/><BR/>I'll subscribe to the mailing list and check out the archives first. Thank you for your effort!Jaxhttps://www.blogger.com/profile/13783234024620705437noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-43597150350056728402007-02-24T12:15:00.000-08:002007-02-24T12:15:00.000-08:00Please check the Form documentation for the events...Please check the Form documentation for the events it emits. Also, it's much easier for me to answer questions on the mailing list; you'll find quite a few T5 questions and anwers there.Anonymoushttps://www.blogger.com/profile/04486596490758986709noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-42978549558563242492007-02-24T12:01:00.000-08:002007-02-24T12:01:00.000-08:00The submit event is also triggered when the form d...The submit event is also triggered when the form does not validate. How can one verify if it passed the validation by annotation?<BR/><BR/>And before I start posting every single question here is there a forum where such questions can be asked? Or are there only the mailing lists? Maybe I'll just have to wait that documentation matures somewhat...Jaxhttps://www.blogger.com/profile/13783234024620705437noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-26864508141634295482007-02-24T08:27:00.000-08:002007-02-24T08:27:00.000-08:00Yep, I'm lagging on the documentation . Often the...Yep, I'm lagging on the documentation . Often the test suite is a good way to see proper examples.<BR/><BR/>In this case, the Form component embedded inside the BeanEditForm will trigger a "success" event, which will propogate up to your page (or whatever the container of the BeanEditForm is).<BR/><BR/>Which raises an interesting question: when an event "bubbles up", what should be considered the originator of the event? As I'm writing this, I'm thinking that a bubbled event should appear to have originated BeanEditForm, not the (hidden) Form within. Otherwise it's very hard for the container that recieves the bubbled up event to know from where it orignates (this could be a problem if you mix a BeanEditForm with an ordinary Form within the same container).Anonymoushttps://www.blogger.com/profile/04486596490758986709noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-91118864338301446682007-02-24T08:25:00.000-08:002007-02-24T08:25:00.000-08:00@OnEvent("submit") is the answer. There is an exam...@OnEvent("submit") is the answer. There is an example here: http://tapestry.apache.org/tapestry5/tapestry-core/Jaxhttps://www.blogger.com/profile/13783234024620705437noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-19277949239925907392007-02-24T08:19:00.000-08:002007-02-24T08:19:00.000-08:00How does one actually use the submitted values? I ...How does one actually use the submitted values? I was thinking that it might be like an ActionLink, just add an id and you can catch the form with @OnEvent but that's not it.<BR/><BR/>I really would appreciate an answer to that or a hint so that I can figure it out for myself.Jaxhttps://www.blogger.com/profile/13783234024620705437noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-9357876816560332162007-02-19T07:11:00.000-08:002007-02-19T07:11:00.000-08:00I think there are limits to how much of the valida...I think there are limits to how much of the validation, especially cross-form validation, can be accomplished declaratively, especially once you start introducing JavaScript on the client side (especialy Ajax). My goal is to bring the declarative to where its perfectly good for most cases, and then make it easy to do the rest in clean, simple code (via event handler methods).Anonymoushttps://www.blogger.com/profile/04486596490758986709noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-9742945516938958142007-02-18T23:21:00.000-08:002007-02-18T23:21:00.000-08:00very nice, especially the validation stuff. what I...very nice, especially the validation stuff. what I would like to see is some framework support for layered validation like annotating properties at the lowest level as seen in this screencast. some mechanism for validating the whole bean as the next layer and some kind of methods for validating all form beans at the highest level. though it might get kind of tricky if you have some dependencies between some of the beans. however, i want more screencasts ;-) keep coding!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4110180.post-26933030221770593752007-02-18T18:22:00.000-08:002007-02-18T18:22:00.000-08:00Actually, I woke up realizing my question was real...Actually, I woke up realizing my question was really stupid... :p<BR/><BR/>T5 still looks awesome though... :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4110180.post-36468886557678381382007-02-18T11:13:00.000-08:002007-02-18T11:13:00.000-08:00Very nice! Started with the tutorial on apache and...Very nice! Started with the tutorial on apache and now I'm here.<BR/><BR/>I've tried the example in your screencast but I get an exception. I'm guessing that this feature isn't available yet.<BR/><BR/>Then completely off topic. If it would become available how do I update my libs with maven? I am quite new to this.Jaxhttps://www.blogger.com/profile/13783234024620705437noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-70636780854423654842007-02-18T08:17:00.000-08:002007-02-18T08:17:00.000-08:00Shaolang -- is that a joke?I think, and most would...Shaolang -- is that a joke?<BR/><BR/>I think, and most would agree, changing the labels using the message catalog is the best approach, especially in light of eventually localizing the application (providing translations for different locales).<BR/><BR/>You still have the option of overriding the default behavior (in this case, the default labels obtained from the message catalog) by directly editting the BeanModel. I.e.:<BR/><BR/>model.get("userId").label("Account Id");<BR/><BR/>... but I'd much rather put:<BR/><BR/>userId-label=Account Id<BR/><BR/>in a .properties file and not have to override & second guess the BeanModelSource service (which generates the BeanModel in the first place).Anonymoushttps://www.blogger.com/profile/04486596490758986709noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-39203978117880066592007-02-18T02:48:00.000-08:002007-02-18T02:48:00.000-08:00While this screencast is awesome, but I find dista...While this screencast is awesome, but I find distaste in using the .properties file to change the texfield labels. Is there any reason for not using annotations?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4110180.post-83583632376056822082007-02-17T08:37:00.000-08:002007-02-17T08:37:00.000-08:00You can still toss into the template excess HTML f...You can still toss into the template excess HTML for preview purposes (inside a t:block element to keep it out of the way). I'll probably be adding something like T4's $content$ and $remove$ in the future.<BR/><BR/>But choosing between iffy previewability and raw bang-for-your-buck, you can guess which side I'll choose.<BR/><BR/>I've said it before: we need to "hook" users within the first few minutes. I won't do anything flashy for the sake of being flashy, but I will bring in lots of ease-of-use and show that first, before the nuts-and-bolts details.Anonymoushttps://www.blogger.com/profile/04486596490758986709noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-58698261557408116302007-02-16T23:20:00.000-08:002007-02-16T23:20:00.000-08:00Fine sc. What caught my eye is the fact, that Tape...Fine sc. <BR/><BR/>What caught my eye is the fact, that Tapestry seems to move away from the idea of providing a HTML which can be used as static prototype. Is my asumption right, or was it only in this screencast?<BR/><BR/>Another side question: Are you still using Jetty 5 with the respective JettyRunner plugin? Me for myself was not able to find something working with j6/eclipse 3.2...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4110180.post-78226518843302384652007-02-16T16:25:00.000-08:002007-02-16T16:25:00.000-08:00BeanModel is a collection of PropertyModel. Prope...BeanModel is a collection of PropertyModel. PropertyModel includes an order property, the presentation order of the property within the bean. The default for order comes from getter position, unless overriden by the @Order annotation. Further, if you explicitly create the BeanModel, you can adjust the properties as you see fit before passing it to the BeanEditForm. <BR/><BR/>But, yes, a simple parameter to for setting the order explicitly would be nice as well. Low priority at this point.Anonymoushttps://www.blogger.com/profile/04486596490758986709noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-48779901467092789132007-02-16T14:57:00.000-08:002007-02-16T14:57:00.000-08:00Yah, awesome component, but I do echo the concern ...Yah, awesome component, but I do echo the concern about using ordering of the getter methods to specify the ordering of the fields in the component.<BR/><BR/>How about letting the getter ordering be the default but also having an optional parameter to beanform be a list of Strings of bean object property names to specify ordering?Bill Hollowayhttps://www.blogger.com/profile/01824149803522705231noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-1879320439943062742007-02-16T11:13:00.000-08:002007-02-16T11:13:00.000-08:00Looks very nice so far. Will there be some way of...Looks very nice so far. Will there be some way of adding other scopes to @ApplicationState other than the HTTP session? I'm thinking specifically of Seam's conversation scope, which I'm getting quite a bit of mileage out of in my current app.Chuck Adamshttps://www.blogger.com/profile/12403744972060658849noreply@blogger.comtag:blogger.com,1999:blog-4110180.post-26330787046173201082007-02-16T05:17:00.000-08:002007-02-16T05:17:00.000-08:00Excellent!It would also be nice to optionally spec...Excellent!<BR/>It would also be nice to optionally specify which fields need to be edited and the order.<BR/>Relying on the getter methods order would most likely cause some headache in the long run. One has to remember that the order might impact the form.<BR/><BR/><BR/>Other suggestion about the parameter: How about t:param?<BR/><BR/><BR/>my $0.02<BR/><BR/><BR/>/SergeAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4110180.post-35448879071005631102007-02-15T16:08:00.000-08:002007-02-15T16:08:00.000-08:00JSF facets can be strongly typed, but aren't by AP...JSF facets can be strongly typed, but aren't by API Map<String,UIComponent>. Strongly typed components usually come into play from the parent/children relationship such as a HtmlTable to UIColumn children, the UIComlumn can have anything for its 'header' and 'footer' facet. I think ADF is the only library I know of where it asserts facets of a specific type, but then again, you are free to do whatever you want with a clean API ;-)Jacob Hookomhttps://www.blogger.com/profile/15287497779663965560noreply@blogger.com