3 Replies Latest reply on Oct 6, 2008 8:46 PM by Eric Smith

    Configure dashboard invalid regions after layout change

    Eric Smith Newbie

      This is a Configure Dashboard problem that occurs when a layout is changed and the region names of the new layout are not the same as the previous layout: for instance going from generic (center, left) to modified3Column (left, middle, right).

      What happens: the Page Layout area does a (partial?) refresh and APPEARS correctly, but if you examine the HTML source it is using the old layout's region names. The impact is that -- for mislabelled regions -- if you ADD a portlet instance it will get added to the wrong region. For example after switching from generic to modified3Column, the second region listed is labelled "Middle" (correct) but the underyling Input button is named "layoutForm:a_left", so when you press ADD the portlet gets added to the Left region (wrong).

      To see this problem you need to either modify one of the pre-delivered layouts, for instance renaming the "center" region to "middle" in the 3columns layout, done by changing these 2 files and restarting:
      jboss-portal.sar/portal-core.war/layouts/3columns/index.jsp
      jboss-portal.sar/portal-core.war/WEB-INF/portal-layouts.xml
      or create a new layout, for instance one with "alpha", "beta", "gamma" regions.

      Workaround: IF the user changes the LAYOUT and then leaves the Configure Dashboard and then re-enters the Configure Dashboard, the screen is fully refreshed and the Page Layout area is correctly rendered.

      In this example I went from generic (center, left) to modified3Column (left, middle, right), notice the first region is labelled correct (left region) but the element names are incorrect (layoutForm:a_center):

      <table width="100%">
       <tbody>
       <tr>
       <td colspan="3" class="portlet-form-field-label">
       <hr />
       left Region
       </td>
      
       </tr>
       <tr>
       <td valign="top"><input id="layoutForm:a_center" name="layoutForm:a_center" type="submit" value="Add" onclick="document.getElementById('blah').value=document.getElementById('windowForm:windowName').value;if(typeof window.clearFormHiddenParams_layoutForm!='undefined'){clearFormHiddenParams_layoutForm('layoutForm');}" class="portlet-form-button layout-button" />
       </td>
       <td width="100%"><select name="layoutForm:_id37jbpnsabcsnpbj" multiple="multiple" size="7" class="windowList portlet-form-field"> <option value="JSPPortletWindow">JSPPortletWindow</option> <option value="IdentityUserPortletWindow">IdentityUserPortletWindow</option></select>
       </td>
       <td valign="top" width="250"><input id="layoutForm:u_center" name="layoutForm:u_center" type="submit" value="Up" onclick="if(typeof window.clearFormHiddenParams_layoutForm!='undefined'){clearFormHiddenParams_layoutForm('layoutForm');}" class="portlet-form-button layout-button" /><br /><input id="layoutForm:d_center" name="layoutForm:d_center" type="submit" value="Down" onclick="if(typeof window.clearFormHiddenParams_layoutForm!='undefined'){clearFormHiddenParams_layoutForm('layoutForm');}" class="portlet-form-button layout-button" />
      
       <hr /><input id="layoutForm:l_center" name="layoutForm:l_center" type="submit" value="Delete" onclick="if(typeof window.clearFormHiddenParams_layoutForm!='undefined'){clearFormHiddenParams_layoutForm('layoutForm');}" class="portlet-form-button layout-button" />
       </td>
       </tr>
       <tr>
       <td colspan="3" class="portlet-form-field-label">
       <hr />
       middle Region
       </td>
       </tr>
      
       <tr>
       <td valign="top"><input id="layoutForm:a_left" name="layoutForm:a_left" type="submit" value="Add" onclick="document.getElementById('blah').value=document.getElementById('windowForm:windowName').value;if(typeof window.clearFormHiddenParams_layoutForm!='undefined'){clearFormHiddenParams_layoutForm('layoutForm');}" class="portlet-form-button layout-button" />
       </td>
       <td width="100%"><select name="layoutForm:_id45jbpnsabcsnpbj" multiple="multiple" size="7" class="windowList portlet-form-field"></select>
       </td>
       <td valign="top" width="250"><input id="layoutForm:u_left" name="layoutForm:u_left" type="submit" value="Up" onclick="if(typeof window.clearFormHiddenParams_layoutForm!='undefined'){clearFormHiddenParams_layoutForm('layoutForm');}" class="portlet-form-button layout-button" /><br /><input id="layoutForm:d_left" name="layoutForm:d_left" type="submit" value="Down" onclick="if(typeof window.clearFormHiddenParams_layoutForm!='undefined'){clearFormHiddenParams_layoutForm('layoutForm');}" class="portlet-form-button layout-button" />
       <hr /><input id="layoutForm:l_left" name="layoutForm:l_left" type="submit" value="Delete" onclick="if(typeof window.clearFormHiddenParams_layoutForm!='undefined'){clearFormHiddenParams_layoutForm('layoutForm');}" class="portlet-form-button layout-button" />
       </td>
       </tr>
      
       <tr>
       <td colspan="3" class="portlet-form-field-label">
       <hr />
       right Region
       </td>
       </tr>
       <tr>
       <td valign="top"><input id="layoutForm:a_right" name="layoutForm:a_right" type="submit" value="Add" onclick="document.getElementById('blah').value=document.getElementById('windowForm:windowName').value;if(typeof window.clearFormHiddenParams_layoutForm!='undefined'){clearFormHiddenParams_layoutForm('layoutForm');}" class="portlet-form-button layout-button" />
       </td>
      
       <td width="100%"><select name="layoutForm:_id91jbpnsabcsnpbj" multiple="multiple" size="7" class="windowList portlet-form-field"></select>
       </td>
       <td valign="top" width="250"><input id="layoutForm:u_right" name="layoutForm:u_right" type="submit" value="Up" onclick="if(typeof window.clearFormHiddenParams_layoutForm!='undefined'){clearFormHiddenParams_layoutForm('layoutForm');}" class="portlet-form-button layout-button" /><br /><input id="layoutForm:d_right" name="layoutForm:d_right" type="submit" value="Down" onclick="if(typeof window.clearFormHiddenParams_layoutForm!='undefined'){clearFormHiddenParams_layoutForm('layoutForm');}" class="portlet-form-button layout-button" />
       <hr /><input id="layoutForm:l_right" name="layoutForm:l_right" type="submit" value="Delete" onclick="if(typeof window.clearFormHiddenParams_layoutForm!='undefined'){clearFormHiddenParams_layoutForm('layoutForm');}" class="portlet-form-button layout-button" />
       </td>
       </tr>
       </tbody>
       </table>
      


      I have more examples if needed.

      It seems like org.jboss.portal.core.admin.ui.dashboard.DashboardBean updateTheme() needs to force a full screen refresh somehow.