File $projectDirectory/resources/xml/model/film/CustomerDIGENERATED.xml describes the layout of Customer entity. **Following XML elements:**
return null==value ? "" : #FV().address + " " + #FV().city.city + " - " + #FV().city.country.country; return null==value ? "" : String.valueOf(#FV().getStoreId());
\\ **renders the following layout:**\\ {{ customer_detail_generated.png | Customer detail (brute)}} \\ \\ \\ **Change XML elements** * Copy CustomerDIGENERATED.axml file to CustomerDI.axml which will become the reference for generated code. * Replace above XML lines with the following ones:
return null==value ? "" : #FV().address + " " + #FV().city.city + " - " + #FV().city.country.country; return null==value ? "" : String.valueOf(#FV().getStoreId());
Create editor file for Customer as shown:\\ org.adichatz.jpa.extra.JPAUtil.openForm(getFromRegister("rentalsTSI:table")); #CONTROLLER(dependenciesCompositeBag).showChildController(#CONTROLLER(), #CONTROLLER(rentalsDIPart:detailContainer));
org.adichatz.jpa.extra.JPAUtil.openForm(getFromRegister("paymentsTSI:table")); #CONTROLLER(dependenciesCompositeBag).showChildController(#CONTROLLER(), #CONTROLLER(paymentsDIPart:detailContainer));
displayGMap(); import org.adichatz.engine.widgets.gmaps.GMap; private boolean doit = true; private void displayGMap() { if (doit) { doit = false; GMap gmapControl = #CONTROL(map); Customer customer = #BEAN(); if (null != customer.getAddress()) { StringBuffer addresSB = new StringBuffer(); addresSB.append(customer.getAddress()).append(" "); addresSB.append(customer.getAddress().getCity().getCity()).append(" "); addresSB.append(customer.getAddress().getCity().getCountry().getCountry()); gmapControl.setValue(addresSB.toString().trim()); } else gmapControl.setValue(null); doit = true; } } #CONTROLLER(dependenciesCompositeBag).showChildController(getSelectedController());
** renders the new layout:**\\ {{ customer_editor.png | Editor and detail from Customer (improved)}}
Remark:\\ File CustomerDIGENERATED.axml is copied as file CustomerDI.axml and File CustomerEDITORGENERATED.axml is copied as file CustomerEDITOR.axml. So that, if a generation process occurs, changes will not be affected. \\ Change completely layouts is made easy.