[jboss-dev-forums] [Design of JBoss Portal] - Default window state

thomas.heute@jboss.com do-not-reply at jboss.com
Thu Oct 18 08:28:22 EDT 2007


A popular feature request concerns having a default window state (maximized, minimized or a custom one)

Here are few proposals, all of them have advantages and drawbacks:

Proposal 1

  | <page>
  |     <page-name>test</page-name>
  |     <window>
  |         <window-name>TestPortletWindow</window-name>
  |         <instance-ref>TestPortletInstance</instance-ref>
  |         <region>center</region>
  |         <height>0</height>
  |         <properties>
  |             <property>
  |                 <name>navigation.initialState</name>
  |                 <value>maximized</value> (or minimized, or a custom one)
  |             </property>
  |         </properties>
  |     </window>
  | </page>
  | 

Proposal 2

  | <page>
  |     <page-name>test</page-name>
  |     <window>
  |         <window-name>TestPortletWindow</window-name>
  |         <instance-ref>TestPortletInstance</instance-ref>
  |         <region>center</region>
  |         <height>0</height>
  |         <initial-state>maximized</initial-state>
  | 
  |     </window>
  | </page>
  | 

Those 2 solutions are error-prone since you can define 2 windows as maximized (while a unique one can be). Bringing a random behavior.

Proposal 3

  | <page>
  |     <page-name>test</page-name>
  |     <maximized-window>TestPortletWindow</maximized-window>
  |     <window>
  |         <window-name>TestPortletWindow</window-name>
  |         <instance-ref>TestPortletInstance</instance-ref>
  |         <region>center</region>
  |         <height>0</height>
  |     </window>
  |     <window>
  |         <window-name>TestPortletWindow2</window-name>
  |         <instance-ref>TestPortletInstance2</instance-ref>
  |         <region>center</region>
  |         <height>0</height>
  |         // Any of proposal 1 or 2 to define other modes like minimized or a custom one
  |     </window>
  | </page>
  | 

The advantage is that you can only define 1 window as maximized per page.
It is mostly a hack just for maximized, it wouldn't help for a custom mode that has the unique constraint. 

Proposal 4

  | <page>
  |     <page-name>test</page-name>
  |     <initial-navigational-state>
  |         <state name="maximized">
  |             <window-ref>TestPortletWindow</window-ref>
  |         </state>
  |         <state name="minimized">
  |             <window-ref>TestPortletWindow2</window-ref>
  |             <window-ref>TestPortletWindow3</window-ref>
  |         </state>
  |         <state name="myCustomState">
  |             <window-ref>TestPortletWindow4</window-ref>
  |         </state>
  |     </initial-navigational-state>
  |     <window>
  |         <window-name>TestPortletWindow</window-name>
  |         <instance-ref>TestPortletInstance</instance-ref>
  |         <region>center</region>
  |         <height>0</height>
  |     </window>
  |     ...
  | </page>
  | 

Here the advantage is to see the navigational state of a page in a concise way, it's easy to figure out if you have 2 windows in the same state, but error-prone to typos, and in that case you can define a window with 2 initial states (illegal).

I'm satisfied with none of those proposal, if you have better ideas or comments, please share :)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4096510#4096510

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4096510



More information about the jboss-dev-forums mailing list