Two Tables, Master and Validation

 

 

         For our client "goodclient" we are doing a portlet project called "xmlpfexampleL" where we want to create a users table maintenance, where there are two fields one is the "userName" and the other is the "userTypeId", and we want to validate "usersType" with a record of another table called userTypes, where we have two fields "userTypeId" and "userTypeDescription".

 

        In this case, we have to define two <application> in our xml and conect "userTypeId" with the table UserTypes using <validation> tag. In this generation you will observe that the ".war" file contains two portlets, one for each <aplication> defined.

 

         This is how the portlets will look in the page with Liferays Classic theme. We put both of them in the same page, so you can understand functionality more easilly, but is not necesary to do so.

        This is how the portlet will look in user edit mode. Observe that records in User Types portlet are automaticly shown in the selection combo.

          Here you have the full XMLPortletFactory xml file.

XMLPFExample12.xml

          And here you have the portlet war generated. (for liferay 6.0.6)

xmlpfexampleL-portlet-6.0.6.1.war

          If you want to use this example you can follow instructions here DOCUMENTATION