<page:list id="pl:org.josean.rooworld.domain.Country" items="${countrys}" z="fmh1dw5QkHal9+wnb0JDqVvC1f8=">
<tblchooser:tblchooser data="${countrys}" maxPages="${upperTblMaxPages}" page="${upage}" size="${usize}" pageid="upage" sizeid="usize" anchorURL="${upperTblAnchorURL}" id="l:org.josean.rooworld.domain.Country" path="/citys" typeIdFieldName="${upperTypeIdFieldName}" z="1FSBfbX2cD9Hf48J/CgEpgGqM5I=">
<table:column id="c:org.josean.rooworld.domain.Country.name" >Detail Grid Client View</h2>
<h2>Detail Grid Client Code</h2> <!-- wp:code {"language": "xml"} --><pre class="wp-block-code"><code></code></pre><!-- /wp:code --> <page:list id="pl:org.josean.rooworld.domain.City" items="${citys}" z="?"> <table:table data="${citys}" id="l:org.josean.rooworld.domain.City" maxPages="${lowerTblMaxPages}" page="${lpage}" size="${lsize}" pageid="lpage" sizeid="lsize" typeIdFieldName="${lowerTypeIdFieldName}" anchorURL="${lowerTblAnchorURL}" path="/citys" select="false" z="fsLaGs5Dtou//oijKgETnKUig+Q="> <table:column id="c:org.josean.rooworld.domain.City.name" >Server Side code</h2> <!-- wp:code {"language": "java"} --><pre class="wp-block-code"><code></code></pre><!-- /wp:code --> @RequestMapping(params = { "find=ByIncountry", "form" }, method = RequestMethod.GET) public String CityController.findCitysByIncountryForm( @RequestParam(value = "upage", required = false) Integer upage, @RequestParam(value = "usize", required = false) Integer usize, @RequestParam(value = "lpage", required = false) Integer lpage, @RequestParam(value = "lsize", required = false) Integer lsize, @RequestParam(value = "ctryselected", required = false) String ctryselected, ModelMap modelMap) { modelMap.addAttribute("update", false); modelMap.addAttribute("delete", false); modelMap.addAttribute("create", false); if (upage != null || usize != null) { int sizeNo = usize == null ? 10 : usize.intValue(); modelMap.addAttribute( "countrys", Country.findCountryEntriesAllObj( upage == null ? 0 : (upage.intValue() - 1) * sizeNo, sizeNo)); float nrOfPages = (float) Country.countCountrys() / sizeNo; modelMap.addAttribute( "upperTblMaxPages", (int) ((nrOfPages > (int) nrOfPages || nrOfPages == 0.0) ? nrOfPages + 1 : nrOfPages)); modelMap.addAttribute("upperTblAnchorURL", "/citys?find=ByIncountry&form"); modelMap.addAttribute("upperTypeIdFieldName", "code"); modelMap.addAttribute("upage", upage); modelMap.addAttribute("usize", usize); } else { modelMap.addAttribute("countrys", Country.findAllCountrysAllObj()); } if (ctryselected != null) { int sizeNo = 10; lpage = lpage == null ? 0 : lpage.intValue(); int numOfCities = City.countCitiesByCountry(ctryselected); int nrOfPages = (int)Math.ceil(((double)numOfCities) / sizeNo); int from = ( lpage ==0? 0 : (lpage.intValue()-1) * sizeNo ); if (nrOfPages >= 1){ modelMap.addAttribute("citys",City.findCitysByIncountry(ctryselected,from, 10)); } else { modelMap.addAttribute("citys",City.findCitysByIncountry(ctryselected,0,numOfCities)); } modelMap.addAttribute("lowerTblMaxPages", nrOfPages); modelMap.addAttribute("lowerTblAnchorURL","/citys?find=ByIncountry&form&ctryselected=" + ctryselected+ "&upage=" + upage + "&usize=" + usize); modelMap.addAttribute("lowerTypeIdFieldName", "id"); modelMap.addAttribute("lpage", lpage); modelMap.addAttribute("lsize", lsize); } else { if (ctryselected == null) modelMap.addAttribute("citys", null); } return "citys/findCitysByIncountry"; }
Code language: HTML, XML (xml)
This method code handles the master/detail, countries/cities form of WorldAlmanac web app. As you can see it follows closely the client side. The upper section handles the countries grid population and its navigation. The ctryselected is a pivot the actives the lower section on country selection on the web form. There is not much else to explain here. Basically, it is a light customization of the source code generate by Roo. That is it! Java URL Encoder/Decoder Example - In this tutorial we will see how to URL encode/decode…
Show Multiple Examples in OpenAPI - OpenAPI (aka Swagger) Specifications has become a defecto standard…
Local WordPress using Docker - Running a local WordPress development environment is crucial for testing…
1. JWT Token Overview JSON Web Token (JWT) is an open standard defines a compact…
GraphQL Subscription provides a great way of building real-time API. In this tutorial we will…
1. Overview Spring Boot Webflux DynamoDB Integration tests - In this tutorial we will see…
View Comments
Hi,
Do you have any idea about how to make these columns sortable
Thanks & Regards,
Rohit
@Rohit,
Yes, I do...
Thanks
Hi,
In one of your replies you said that you can make these columns sortable,
Request to please share an example on how to do it.
Thanks & Regards,
Hi Viral,
This is nice, I want to create a grid in spring roo and set action ADD/UPDATE/DELETE in this grid so please help me
@Brijesh,
Thank you - thank you for your comment...
I offer consulting services for this kind of help. Please visit my blog page for details at http://pragmatikroo.blogspot.com.
BTW, I am the author of this tutorial. Viral is just the publisher.
B. Roogards
jD
Hi Mr. JD
I just wonder how far did you get on the springroo book you have mentioned sometime ago that you would be working latetlly. Shall we expect something to be released soon?
Hola leandro,
Thank you very much for asking it...
Bad news first:
No luck so far... I thought the best way to get the attention of a book house was by getting the endorsement of VIP on the Spring Roo. I contacted them and initially it seemed that they might support me with it. But never happened. On the other hand it seems the book houses go first with theirs "traditional" authors first or I haven't introduce myself like a viable author for them.
Good news:
I am accumulating more solutions for recurrent questions shown in the Spring Roo forum and others. So now I have material for several books. Like SR and mobile web apps, SR and jQuery and others.
Finally, I believe that eventually one of these book houses would realize that my approach of publishing books dedicated only on answering questions posted in the forums is a very-very good seller. Why because they are unique in some cases or very hard to find.
I am open to suggestion too!
B. Roogards
jD
The referred letter was sent to VIP in the SR "Team." I missed the word team previously.
I have to ask my friend Viral Patel how to edit a posted blog for the next time.
Thank you
jD
this is non sense. i don get wat is required.
Thanks for posting these useful articles on Spring Roo. As I do not have access to Maven Central Repository I am unable to fully utilize the downloadable zip file you have provided us. Wondering if you might be able to have a full web project available for download?
Please keep on sharing your valuable knowledge and experience. Thanking you again.
First of all, Thanks for this Article., it's gives us how far can we go with Spring Roo Technology.
Now i am Beginner in Spring Roo and i want to implement your suggest solution in three level of relationships.
therefor, I try many times to implement your solution only between to tables , but didn't work. The reasons are :
To customize the generated Controller.
To customize the JSPX Views, i had some difficultes , because of the Tags Elements and the complexity of generated code for the Web Interface.
one another thing is about the "tablechooser " Tag. it's not working form me, it's give me some errors in the level of "findCitysByIncountry.jspx", because some of "jsp:directive.attribute" aren't found.
I spend a lot of time, without any result, I ask you now for your Help, if you might.
Best Regards,
Yassin
Hello jD, Your articles are excellent. I have many years Java back ground, I'm interested in learning by doing some roo and rad stuff. Can you email me and I want to discuss a possible arrangement with you. I'm also on gtalk. - icancertify@gmail.com .
Thanks and keep doing the great work,
Ron