8 Replies Latest reply on Dec 17, 2010 3:56 AM by vineyard

    Code optimization - too many rich:modalPanel in a single page

    vineyard

      Hi,

      We are developing application with richfaces 3.3.0

       

      Most of our application pages use modal panels (rich:modalPanel).

       

      For example (just an example purpose):

      Dashboard page (dashboard.jsp)

       

      we provide below buttons for the user.

      1. Create Employee - clicking on the button should open a modal panel in which user can enter student details and save employee details.

      2. Create Department - clicking on the button should open a modal panel in which user can enter department details and save department details.

      3. Create location - clicking on the button should open a modal panel in which user can enter location details and save location details.

      4. Create address - should open modal panel in which users can enter the company address and save

      5. Create manager  - should open modal pane in which user can enter manager details and save

      6. Edit employee

      7. Edit department

      8. Edit location

      9. Edit Address

      10. Edit Manager

       

       

      For this how we are doing is

       

      1. employeecreate.jsp - contains : rich:modalPanel

      2. departmentcreate.jsp - contains: rich:modalPanel

      3. locationcreate.jsp - contains rich:modalPanel

      4. addresscreate.jsp - contains rich:modalPanel

      5. managercreate.jsp - contains rich:modalPanel

      6. emploeeedit.jsp - contains rich:modalPanel

      7. departmentedit.jsp - contains rich:modalPanel

      8. locationedit.jsp - contains rich:modalPanel

      9. addressedit.jsp - contains rich:modalPanel

      10. manageredit.jsp - contains rich:modalPanel

       

      Now we are including all these jsps inside dashboard.jsp by using: <jsp:include>

       

      The issue with this approach is, the page is getting slow down as the jsf is spending more time on processing all the jsps present in the dashboard.jsp

       

       

      We havfe tried to use: <a4j:include viewId=""/>

      But rich:modalPanel should be rendered compulsarily in the view in order to be displayed when user clicks on a button.               

      Also, we tried to use rendered="" attribute but that also is not fetching any performance improvement.

       

      I would like to know some standard way to handle this type of functionality.

      Our requirement is: 1. we should display modal panel as soon as the user clicks on the button

      2. JSF should not spend time on processing the page unnecessarily

       

      Thank you in advance.