[richfaces-issues] [JBoss JIRA] (RF-13126) ExtendedDataTable Header Column Widths does not conform to Row Data Column Widths specified in TableState

Brian Leathem (JIRA) jira-events at lists.jboss.org
Tue Sep 3 15:45:03 EDT 2013


    [ https://issues.jboss.org/browse/RF-13126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798974#comment-12798974 ] 

Brian Leathem edited comment on RF-13126 at 9/3/13 3:44 PM:
------------------------------------------------------------

As requested The following defines the table with tableState:

{code}
<rich:extendedDataTable
	id="contTable" 
	var="b" 
	value="#{appController.dataModel}"
	enableContextMenu="false"
	frame="frame"
    height="#{appController.dataModel.tableHeight}px"
    width="#{appController.dataModel.tableWidth}px"
	styleClass="table_standard" 
 	rowClasses="row_ext_even,row_ext_odd"
	sortMode="single"
	selectionMode="none"
	tableState="#{appController.dataModel.tableState}"
	groupingColumn="#{appController.dataModel.groupingColumn}"
	rows="#{appController.currPreparedDataSize}"
	noDataLabel="#{appController.currSelTitle} #{appController.currPreparedDataSize} #{messages['recordsFoundTitle']} [*** NO DATA ***]"
 	rendered="#{appController.currSelectionAvailable}">
{code}

-------------------------------------------

In the bean (note complete code prepares widths dynamically + programmatically)

-------------------------------------------

{code}
    /** State String */
    private String tableState;


	/**
	 * return associated state
	 * @return String
	 */
	public String getTableState() {
		if (this.tableState == null) {
				this.tableState = prepareTableState();
		}
		if (log.isDebugEnabled())
			log.debug(getClass().getSimpleName() + " getTableState() = " + (tableState != null ? tableState : "null"));
		return this.tableState;
	}
	
	/**
	 * set associated state
	 * @param state TableState String
	 */
	public void setTableState(String state) {
		if (log.isDebugEnabled())
			log.debug(getClass().getSimpleName() + " setTableState() = " + (state != null ? state : "null"));
		if (this.tableState == null) {
			this.tableState = prepareTableState();
			if (this.tableState == null)
				this.tableState = state;
		} else {
			this.tableState = state;
		}
	}
	
	/** Number of table state columns */
	private static final int NBR_TABLE_STATE_COLS = 10;
	/** Default table column width */
	private static final int DEFAULT_TABLE_STATE_COL_WIDTH = ControllerHelper.DEFAULT_COL_WIDTH;
	
	/**
	 * get associated table state
	 */
	private static final String TABLE_STATE_FORMAT = 

"{\"columnsVisibility\":{" +
	"\"col0\":\"1\"," +
	"\"col1\":\"1\"," +
	"\"col2\":\"1\"," +
	"\"col3\":\"1\"," +
	"\"col4\":\"1\"," +
	"\"col5\":\"1\"," +
	"\"col6\":\"1\"," +
	"\"col7\":\"1\"," +
	"\"col8\":\"1\"," +
	"\"col9\":\"1\"}" +
	",\"columnGroupingState\":{},\"columnsSizeState\":{" +
	"\"col0\":\"5\"," +
	"\"col1\":\"7\"," +
	"\"col2\":\"10\"," +
	"\"col3\":\"12\"," +
	"\"col4\":\"14\"," +
	"\"col5\":\"17\"," +
	"\"col6\":\"25\"," +
	"\"col7\":\"30\"," +
	"\"col8\":\"35\"," +
	"\"col9\":\"40\"}" +
	",\"columnsOrder\":[" +
	"\"col0\"," +
	"\"col1\"," +
	"\"col2\"," +
	"\"col3\"," +
	"\"col4\"," +
	"\"col5\"," +
	"\"col6\"," +
	"\"col7\"," +
	"\"col8\"," +
	"\"col9\"]}";
	
	/**
	 * prepare a table state format using specified column widths
	 */
	public String prepareTableState() {
          return TABLE_STATE_FORMAT;
        }
{code}
                
      was (Author: entracity):
    As requested The following defines the table with tableState:

<rich:extendedDataTable
	id="contTable" 
	var="b" 
	value="#{appController.dataModel}"
	enableContextMenu="false"
	frame="frame"
    height="#{appController.dataModel.tableHeight}px"
    width="#{appController.dataModel.tableWidth}px"
	styleClass="table_standard" 
 	rowClasses="row_ext_even,row_ext_odd"
	sortMode="single"
	selectionMode="none"
	tableState="#{appController.dataModel.tableState}"
	groupingColumn="#{appController.dataModel.groupingColumn}"
	rows="#{appController.currPreparedDataSize}"
	noDataLabel="#{appController.currSelTitle} #

{appController.currPreparedDataSize} #{messages['recordsFoundTitle']} [*** NO 

DATA ***]"
 	rendered="#{appController.currSelectionAvailable}">

-------------------------------------------

In the bean (note complete code prepares widths dynamically + 

programmatically)

-------------------------------------------

    /** State String */
    private String tableState;


	/**
	 * return associated state
	 * @return String
	 */
	public String getTableState() {
		if (this.tableState == null) {
				this.tableState = prepareTableState();
		}
		if (log.isDebugEnabled())
			log.debug(getClass().getSimpleName() + " 

getTableState() = " + (tableState != null ? tableState : "null"));
		return this.tableState;
	}
	
	/**
	 * set associated state
	 * @param state TableState String
	 */
	public void setTableState(String state) {
		if (log.isDebugEnabled())
			log.debug(getClass().getSimpleName() + " 

setTableState() = " + (state != null ? state : "null"));
		if (this.tableState == null) {
			this.tableState = prepareTableState();
			if (this.tableState == null)
				this.tableState = state;
		} else {
			this.tableState = state;
		}
	}
	
	/** Number of table state columns */
	private static final int NBR_TABLE_STATE_COLS = 10;
	/** Default table column width */
	private static final int DEFAULT_TABLE_STATE_COL_WIDTH = 

ControllerHelper.DEFAULT_COL_WIDTH;
	
	/**
	 * get associated table state
	 */
	private static final String TABLE_STATE_FORMAT = 

"{\"columnsVisibility\":{" +
	"\"col0\":\"1\"," +
	"\"col1\":\"1\"," +
	"\"col2\":\"1\"," +
	"\"col3\":\"1\"," +
	"\"col4\":\"1\"," +
	"\"col5\":\"1\"," +
	"\"col6\":\"1\"," +
	"\"col7\":\"1\"," +
	"\"col8\":\"1\"," +
	"\"col9\":\"1\"}" +
	",\"columnGroupingState\":{},\"columnsSizeState\":{" +
	"\"col0\":\"5\"," +
	"\"col1\":\"7\"," +
	"\"col2\":\"10\"," +
	"\"col3\":\"12\"," +
	"\"col4\":\"14\"," +
	"\"col5\":\"17\"," +
	"\"col6\":\"25\"," +
	"\"col7\":\"30\"," +
	"\"col8\":\"35\"," +
	"\"col9\":\"40\"}" +
	",\"columnsOrder\":[" +
	"\"col0\"," +
	"\"col1\"," +
	"\"col2\"," +
	"\"col3\"," +
	"\"col4\"," +
	"\"col5\"," +
	"\"col6\"," +
	"\"col7\"," +
	"\"col8\"," +
	"\"col9\"]}";
	
	/**
	 * prepare a table state format using specified column widths
	 */
	public String prepareTableState() {
          return TABLE_STATE_FORMAT;
        }

                  
> ExtendedDataTable Header Column Widths does not conform to Row Data Column Widths specified in TableState 
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: RF-13126
>                 URL: https://issues.jboss.org/browse/RF-13126
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-tables
>    Affects Versions: 5.0.0.Alpha1
>         Environment: Windows / Tomcat 7 / JDK 1.7 (Firefox & IE)
>            Reporter: Steven W.
>
> In prior 3.x release the ExtendedDataTable control supported TableState data for sizing of columns - this worked relatively well *however* there is/was a bug such that the columns headers above the table did *not* align properly with the data rows of the table below; this could be partially accommodated by specifying a size for the column (in the TableState data) that was wider than the longest string in the column data as he initial / minimum size.
> In subsequent release (in 4.x time frame I believe) the control was refactored and the TableState capability as a whole was lost - I saw this in another report on the forum or Jira though not the same but other related issues may be RF-4855 + RF-13094 and RF-13095 ; the report I remember reading, however, is that this TableState functionality was lost during the refactoring and was then said to be restored in a subsequent release.
> I am now using Version 5 of RichFaces to include the first milestone and latest (overnight) snapshot and am confirming this column header sizing AND/OR TableState table header sizing issue(s) still remain, regardless of prior attempts to include TableState data recognition and, if/as so, the widths of the column headers does not respect the TableState data nor do they conform to the column widths of the data in the rows below.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list