Re: T5 - using t:select nested inside beaneditform
On 08/07/2011 06:31 AM, Eric Torti wrote: t:beaneditform submitlabel=message:submit-label object=atestado t:select t:id=contratantes value=selectedContratanteId model=contratanteSelectModel / /t:beaneditform ... You have to use the add parameter in beaneditform for each manytoone property, and then use p: /p: to wrap the select (or any other custom html to be shown for this property. Just copy the structure from my example and change selectobject with simple select. smime.p7s Description: S/MIME Cryptographic Signature
opinion on modal dialog
In the past I have used the modal window from ChenilleKit, and recently I read the post from Taha on Java Magic blog, but I wanted to create something simpler, preferably without additional custom JavaScript code - just CSS and Tapestry zones. This is what I did, and I want to hear about any opinion if I will have problems with it. The use-case is: a page shows a grid based on a complex database view, and I want to edit underlying data that will change the grid contents, but the data itself is not directly part of the objects in the grid, so direct inPlace editing is not a suitable usecase. t:zone t:id=editingZone t:if test=objectToEditInModal div class=backgroundoverlay div class=modalwindow form t:id=editingForm zone=gridZonethis form is used to edit the relevant data t:submit /form /div /div /t:if /t:zone t:zone t:id=gridZone t:grid . add=editing p:editingCellt:actionlink id=editDataLink context=rowObject zone=editingZone / /t:grid /t:zone And in Java: @Property @Persist(FLASH) private SomeClass objectToEditInModal; public Object onActionFromEditDataLink(SomeClass rowObject) { objectToEditInModal = rowObject; return editingZone.getBody(); } public Object onSelectedFromCancelButton() { objectToEditInModal = null; return editingZone.getBody(); } @CommitAfter public Object onSuccessFromEditingForm() { doSomeThingWithData(objectToEditInModal); objectToEditInModal = null; return new MultiZoneUpdate(editingZone,editingZone),add(gridZone, gridZone); } So on clicking the EditDataLink in the grid, the editingzone will be updated, and because the value of the objectToEditInModal is no longer null, the inside DIVs and FORM will be displayed. If I click OK in the editingform then in Success it will change the data and set the objectToEdit to null, so after refreshing the two zones, the modal DIVs and the editingForm will be stripped from the HTML and finally everything will be commited. If I click Cancel then just objectToEdit is nulled and just the editing zone will be refreshed leaving the grid intact, but because the null value, the modal DIVs and the editingForm will be stripped from the HTML. Finally, how it will look like depends on CSS so here it is: .backgroundoverlay { visibility: visible; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 0; background-image: url(/upisi/images/background-plasma-transparent.png); } .modalwindow { width: 300px; margin: 200px auto; background-color: #fff; border: 1px solid #000; padding: 15px; -moz-border-radius: 15px; border-radius: 15px; -moz-box-shadow: 2px 2px 8px #000; -webkit-box-shadow: 2px 2px 8px #000; box-shadow: 2px 2px 12px #000; border:2px solid #DDF; -webkit-box-shadow: 3px 3px 6px rgba(0, 0, 0, .2), 0px 0px 3px rgba(0, 0, 0, .1), inset 0px 25px 25px #DDF; } I tried it with several browsers and it looked ok. It is very important for the z-index to be 0, in order for tapestry validation boxes to be shown in front. Do you see any problem with this? This approach works for me. With many test cases that I did for a single admin user it was OK. One problem that I see is if many users edit the same data and same page at the same time, I will need to constantly refresh the grid to show the latest data, and I might need some locking. But in my case this will not happen, there will be just few admins dealing with separate subsets of the data with proper filtering. Maybe there are some other problems, especially with how tapestry works, so that's why I need an opinion. smime.p7s Description: S/MIME Cryptographic Signature
Re: Remove @PageAttached @PageDetached
On 07/24/2011 07:48 PM, Thiago H. de Paula Figueiredo wrote: They were never equivalent. @PageAttached and @PageDetached are page instance lifecycle events. Without the pool, they don't make sense anymore, as each page is instantiated just once. I'm commenting a bit late on this one. I don't use them, but since you mention they are called just once, are there other methods for use in such cases? What should I use, if I need some (de)initialization code that happens just once on first instantiation? Constructor method for the page class? What about after live reload after the class is changed or after the tml is changed? I don't really know how it all works in the inside. Will the class be fully reinstantiated and put in the pool and constructor be called after such change? smime.p7s Description: S/MIME Cryptographic Signature
How do I add a dynamic number of forms to a page?
Hi there. I have a page on which I want to have a number of forms, one for each person. The forms will have forename, surname, etc... the usual fields. However, I wont know how many person forms I want on the page until runtime. At the moment it seems that I need to have a @Component on my page class for each form like this... @Component private Form personForm; And also a property for each form field... @Property @Validate(required) private String surname; If I add two person forms to my page, it looks like I will need to add extra components to my page class code. But this won't work if I want to make the number of forms on the page flexible as it will be hard coded wont it? Is there no way that I can have many forms on the same TML template, with the same name... and which ever one gets submitted, is the one that gets processed by the page class? If I could do this, all I need to do is add a hidded ID field to each form to determine which user to update in the database. But this doesnt seem possible. If I try to add 2 forms with the same t:id values in the TML file, I get this error... Exception assembling embedded component 'personForm' (of type org.apache.tapestry5.corelib.components.Form, within MyPage): Component MyPage already contains a child component with id 'personForm' Here is my page class code... public class MyPage { @Component private Form personForm; @Property @Validate(required) private String forename; @Property @Validate(required) private String surname; @Property private String personId; //Hidden form field to determine which person to update Here is the TML that I am using... form name=personForm id=personForm t:id=personForm p input type=hidden name=personid id=personid t:id=personid t:type=personid t:value=//value set as person id / /p p label for=forename class=labelForename:/label input type=text name=forename id=forename t:id=forename t:type=TextField t:value=forename / /p p label for=surname class=labelSurname:/label input type=text name=surname id=surname t:id=surname t:type=TextField t:value=surname / /p /form Any help or alternative suggestions would be much appreciated. Cheers!!! -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-do-I-add-a-dynamic-number-of-forms-to-a-page-tp4674893p4674893.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
Select component... Can i just pass it a list of values?
Hi. Is there any way I can create a select field and get is just to use the options listed in the html? The values I have are never going to change and Im happy with the list in the TML. Eg... I have... form t:id=search_form name=search_form p label for=employeeType class=labelEmployee Type:/label select style=width:178px; t:type=select t:model=??? t:value=employee_type option value=anyAny/option option value=permPermanent/option option value=tempTemp/option /select /p Obviously this complains that I dont have a t:model specified. But I dont want to really have to create a Select Model and Enum in Java to back this, when I really jsut want the values 'perm' and 'temp' already in my template above. Do I really need to create 2 or more Java classes with and an enum just to show this list of options that Ive already defined in the TML? Any help appreciated. Thanks!!! Dave. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Select-component-Can-i-just-pass-it-a-list-of-values-tp4674906p4674906.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: How do I add a dynamic number of forms to a page?
You can put a Form inside a Loop (over a Person list I presume in your case), and Tapestry will take care of rendering multiple forms. You will have a single t:id for the form, and Tapestry will take care of generating unique id's based on that. Look in to the context parameter of the form as an alternative to your hidden field idea. On Sun, Aug 7, 2011 at 8:39 AM, dkeenan david_siedle...@yahoo.co.uk wrote: Hi there. I have a page on which I want to have a number of forms, one for each person. The forms will have forename, surname, etc... the usual fields. However, I wont know how many person forms I want on the page until runtime. At the moment it seems that I need to have a @Component on my page class for each form like this... @Component private Form personForm; And also a property for each form field... @Property @Validate(required) private String surname; If I add two person forms to my page, it looks like I will need to add extra components to my page class code. But this won't work if I want to make the number of forms on the page flexible as it will be hard coded wont it? Is there no way that I can have many forms on the same TML template, with the same name... and which ever one gets submitted, is the one that gets processed by the page class? If I could do this, all I need to do is add a hidded ID field to each form to determine which user to update in the database. But this doesnt seem possible. If I try to add 2 forms with the same t:id values in the TML file, I get this error... Exception assembling embedded component 'personForm' (of type org.apache.tapestry5.corelib.components.Form, within MyPage): Component MyPage already contains a child component with id 'personForm' Here is my page class code... public class MyPage { @Component private Form personForm; @Property @Validate(required) private String forename; @Property @Validate(required) private String surname; @Property private String personId; //Hidden form field to determine which person to update Here is the TML that I am using... form name=personForm id=personForm t:id=personForm p input type=hidden name=personid id=personid t:id=personid t:type=personid t:value=//value set as person id / /p p label for=forename class=labelForename:/label input type=text name=forename id=forename t:id=forename t:type=TextField t:value=forename / /p p label for=surname class=labelSurname:/label input type=text name=surname id=surname t:id=surname t:type=TextField t:value=surname / /p /form Any help or alternative suggestions would be much appreciated. Cheers!!! -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-do-I-add-a-dynamic-number-of-forms-to-a-page-tp4674893p4674893.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 -- Jonathan Barker ITStrategic
Re: How do I add a dynamic number of forms to a page?
Yesss!. Tapestry seems to take care of it if I just create a loop. So I can loop through each person, create a form for each, and have one Form component with one set of field props in the page class that each generated HTML for can submit too. Brilliant. -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-do-I-add-a-dynamic-number-of-forms-to-a-page-tp4674893p4675090.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: How do I add a dynamic number of forms to a page?
The down side of this approach (depending on your target user) is that many users will expect all changes to all Persons to be submitted in a single submit. You could render a list of Person views, with each view in a Zone, and then have an Edit Person link that would update the Zone content with an edit Form. If you go with this approach, a place to be careful is the assignment of id's for the zones (not the t:id's), and making sure they agree with the zone parameter on the action links. On Sun, Aug 7, 2011 at 10:27 AM, dkeenan david_siedle...@yahoo.co.ukwrote: Yesss!. Tapestry seems to take care of it if I just create a loop. So I can loop through each person, create a form for each, and have one Form component with one set of field props in the page class that each generated HTML for can submit too. Brilliant. -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-do-I-add-a-dynamic-number-of-forms-to-a-page-tp4674893p4675090.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 -- Jonathan Barker ITStrategic
Re: Select component... Can i just pass it a list of values?
There is an example in the documentation: http://tapestry.apache.org/current/tapestry-core/ref/org/apache/tapestry5/corelib/components/Select.html in the Simple Example section. I think you would want t:model=literal:any=Any,perm=Permanent,temp=Temporary On Sun, Aug 7, 2011 at 8:45 AM, dkeenan david_siedle...@yahoo.co.uk wrote: Hi. Is there any way I can create a select field and get is just to use the options listed in the html? The values I have are never going to change and Im happy with the list in the TML. Eg... I have... form t:id=search_form name=search_form p label for=employeeType class=labelEmployee Type:/label select style=width:178px; t:type=select t:model=??? t:value=employee_type option value=anyAny/option option value=permPermanent/option option value=tempTemp/option /select /p Obviously this complains that I dont have a t:model specified. But I dont want to really have to create a Select Model and Enum in Java to back this, when I really jsut want the values 'perm' and 'temp' already in my template above. Do I really need to create 2 or more Java classes with and an enum just to show this list of options that Ive already defined in the TML? Any help appreciated. Thanks!!! Dave. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Select-component-Can-i-just-pass-it-a-list-of-values-tp4674906p4674906.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 -- Jonathan Barker ITStrategic
Re: Select component... Can i just pass it a list of values?
Brilliant! Thanks -- View this message in context: http://tapestry.1045711.n5.nabble.com/Select-component-Can-i-just-pass-it-a-list-of-values-tp4674906p4675175.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: T5 - using t:select nested inside beaneditform
Ok, Vangel, thanks. Problem solved! I`m going to move on to your proposition of using t:selectObject. In the event of me getting stuck :] I`ll post the problems on a new thread. Thank you for the help. I greatly appreciated it. Eric Torti On Sun, Aug 7, 2011 at 8:38 AM, Vangel V. Ajanovski a...@ii.edu.mk wrote: On 08/07/2011 06:31 AM, Eric Torti wrote: t:beaneditform submitlabel=message:submit-**label object=atestado t:select t:id=contratantes value=selectedContratanteId model=contratanteSelectModel / /t:beaneditform ... You have to use the add parameter in beaneditform for each manytoone property, and then use p: /p: to wrap the select (or any other custom html to be shown for this property. Just copy the structure from my example and change selectobject with simple select.
SVN trunk, gradle build hangs @ Building :tapestry-beanvalidator:test
Hi, I am attempting to build the SVN trunk. When gradle build gets to the point where it is indicating status Building :tapestry-beanvalidator:test Mozilla opens a new tab, with no content, and the build hangs. A wild guess, I need to do something to setup selenium locally? What else could be going wrong? thanks
Re: SVN trunk, gradle build hangs @ Building :tapestry-beanvalidator:test
Hi, Which version of firefox do you have? the current selenium version in t5 is compatible with 3.6 but not with firefox 4 and firefox 5. Cheers, Dragan Sahpaski On Sun, Aug 7, 2011 at 10:39 PM, Jon Williams williams.jonat...@gmail.comwrote: Hi, I am attempting to build the SVN trunk. When gradle build gets to the point where it is indicating status Building :tapestry-beanvalidator:test Mozilla opens a new tab, with no content, and the build hangs. A wild guess, I need to do something to setup selenium locally? What else could be going wrong? thanks
Re: SVN trunk, gradle build hangs @ Building :tapestry-beanvalidator:test
I'm on Firefox version 5.01. I know it's possible to install multiple versions of Firefox on OSX. The trick will be getting the 3.6 version to be default. thanks On Sun, Aug 7, 2011 at 1:44 PM, dragan.sahpas...@gmail.com dragan.sahpas...@gmail.com wrote: Hi, Which version of firefox do you have? the current selenium version in t5 is compatible with 3.6 but not with firefox 4 and firefox 5. Cheers, Dragan Sahpaski On Sun, Aug 7, 2011 at 10:39 PM, Jon Williams williams.jonat...@gmail.comwrote: Hi, I am attempting to build the SVN trunk. When gradle build gets to the point where it is indicating status Building :tapestry-beanvalidator:test Mozilla opens a new tab, with no content, and the build hangs. A wild guess, I need to do something to setup selenium locally? What else could be going wrong? thanks
Re: SVN trunk, gradle build hangs @ Building :tapestry-beanvalidator:test
In ubuntu I just update the symlinks. IDK if you can instruct selenium to use a custom command instead of just firefox. Cheers, Dragan Sahpaski On Sun, Aug 7, 2011 at 11:07 PM, Jon Williams williams.jonat...@gmail.comwrote: I'm on Firefox version 5.01. I know it's possible to install multiple versions of Firefox on OSX. The trick will be getting the 3.6 version to be default. thanks On Sun, Aug 7, 2011 at 1:44 PM, dragan.sahpas...@gmail.com dragan.sahpas...@gmail.com wrote: Hi, Which version of firefox do you have? the current selenium version in t5 is compatible with 3.6 but not with firefox 4 and firefox 5. Cheers, Dragan Sahpaski On Sun, Aug 7, 2011 at 10:39 PM, Jon Williams williams.jonat...@gmail.comwrote: Hi, I am attempting to build the SVN trunk. When gradle build gets to the point where it is indicating status Building :tapestry-beanvalidator:test Mozilla opens a new tab, with no content, and the build hangs. A wild guess, I need to do something to setup selenium locally? What else could be going wrong? thanks
Re: SVN trunk, gradle build hangs @ Building :tapestry-beanvalidator:test
Is there a way to just disable the selenium tests? I, personally would just rather do that than to mess with my environment. For the subset of the trunk that I am compiling there aren't even any selenium tests to run... - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: SVN trunk, gradle build hangs @ Building :tapestry-beanvalidator:test
If you use eclipse just run eclipse:eclipse (generates classpath entries for eclipse) and import the project as an existing project in eclipse and it will build it for you. Otherwise, just run gradle tasks and you will see all available tasks. Here are some of the tasks. assemble - Assembles all Jar, War, Zip, and Tar archives. build - Assembles and tests this project. buildDependents - Assembles and tests this project and all projects that depend on it. buildNeeded - Assembles and tests this project and all projects it depends on. classes - Assembles the main classes. clean - Deletes the build directory. jar - Assembles a jar archive containing the main classes. testClasses - Assembles the test classes. Cheers, Dragan Sahpaski On Sun, Aug 7, 2011 at 11:25 PM, lpri...@hope.nyc.ny.us wrote: Is there a way to just disable the selenium tests? I, personally would just rather do that than to mess with my environment. For the subset of the trunk that I am compiling there aren't even any selenium tests to run... - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: SVN trunk, gradle build hangs @ Building :tapestry-beanvalidator:test
Oh, and if you explicitly want to disable tests just change the enabled attribute from true to false for individual tests in src-test-conf-testng.xml Cheers, Dragan Sahpaski On Sun, Aug 7, 2011 at 11:25 PM, lpri...@hope.nyc.ny.us wrote: Is there a way to just disable the selenium tests? I, personally would just rather do that than to mess with my environment. For the subset of the trunk that I am compiling there aren't even any selenium tests to run... - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: SVN trunk, gradle build hangs @ Building :tapestry-beanvalidator:test
Thanks, that's what I was looking for.I guess I will look further into this whether I can disable selenium tests only,not all unit tests.dragan.sahpas...@gmail.com wrote:gt; Oh, and if you explicitly want to disable tests just change the enabledgt; attribute from true to false for individual tests ingt; src-gt;test-gt;conf-gt;testng.xmlgt; gt; Cheers,gt; Dragan Sahpaskigt; gt; gt; - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: SVN trunk, gradle build hangs @ Building :tapestry-beanvalidator:test
Well, selenium tests are mainly in the integration apps app1 to app6. IDK if other tests besides these are selenium tests. Cheers, Dragan Sahpaski On Sun, Aug 7, 2011 at 11:46 PM, lpri...@hope.nyc.ny.us wrote: Thanks, that's what I was looking for. I guess I will look further into this whether I can disable selenium tests only, not all unit tests. dragan.sahpas...@gmail.com ** wrote:** Oh, and if you explicitly want to disable tests just change the enabled attribute from true to false for individual tests in src-test-conf-testng.xml Cheers, Dragan Sahpaski - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Exception starting filter test
Hi Raj, Is your problem solved. I'm also facing similar issues while deployment in jboss5.1.0. Please help me in this regard, -- View this message in context: http://tapestry.1045711.n5.nabble.com/Exception-starting-filter-test-tp3407524p4673436.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
where will I find : tapestry-tutorials.tar.gz ?
Hi , I am new to tapestry framework. I tried to go through the quick start tutorial. but the link to download the tar filetapestry-tutorials.tar.gz on this page : http://tapestry.apache.org/tapestry4/QuickStart/index.html is NOT WORKING. can somebody help me ? Thanks, Bhavin -- View this message in context: http://tapestry.1045711.n5.nabble.com/where-will-I-find-tapestry-tutorials-tar-gz-tp4674321p4674321.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: where will I find : tapestry-tutorials.tar.gz ?
that link goes to tapestry 4. to get started, you can try tutorial in this link: http://tapestry.apache.org/getting-started.html -- View this message in context: http://tapestry.1045711.n5.nabble.com/where-will-I-find-tapestry-tutorials-tar-gz-tp4674321p4674548.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