cancel
Showing results for 
Search instead for 
Did you mean: 

Table with only three columns ( only headers) no rows

Former Member
0 Kudos

Hi Colleagues,

Code is :

IWDTransparentContainer TableHeaderContainer = (IWDTransparentContainer)view.createElement(IWDTransparentContainer.class);
		  IWDGridLayout TableHeaderLayout =(IWDGridLayout) TableHeaderContainer.createLayout(IWDGridLayout.class);
		  
		  IWDTable tableheader = (IWDTable) view.createElement(IWDTable.class, null); 
		  IWDNodeInfo nodeInfo = wdContext.getNodeInfo().getChild("IterateValues");
		  tableheader.bindDataSource(nodeInfo);
		  
		  
		  tableheader.setDisplayEmptyRows(false);
		  tableheader.setDesign(WDTableDesign.TRANSPARENT);
		  tableheader.setFixedTableLayout(true);
		  tableheader.setDisplayEmptyRows(true);
		  tableheader.setVisibleRowCount(0);
		  tableheader.setRowSelectable(false);
		  WDTableGridMode mode1 = WDTableGridMode.NONE;
		  tableheader.setGridMode(mode1);
		  WDTableSelectionMode sm1 = WDTableSelectionMode.NONE;
		  tableheader.setSelectionMode(sm1);
		  
		  IWDTableColumn columnhead = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
		  tableheader.addColumn(columnhead);
		 
		  IWDCaption Col1header = (IWDCaption) view.createElement(IWDCaption.class, null);	
		  Col1header.setText("Title");
		  columnhead.setHeader(Col1header);
		  columnhead.setWidth("80%");
		  
		  IWDTableColumn columnhead2 = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
		  tableheader.addColumn(columnhead2);
		 
		  IWDCaption Col2header = (IWDCaption) view.createElement(IWDCaption.class, null);	
		  Col2header.setText("Size");
		  columnhead2.setHeader(Col2header);
		  columnhead2.setWidth("20%");
		  
		  IWDTableColumn columnhead3 = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
		  tableheader.addColumn(columnhead3);
		 
		  IWDCaption Col3header = (IWDCaption) view.createElement(IWDCaption.class, null);	
		  Col3header.setText("Download");
		 
		  columnhead3.setHeader(Col3header);
		  columnhead3.setWidth("25%");
		  WDTableColumnHAlign align = WDTableColumnHAlign.CENTER;
		  
		  
		  
		  IWDGridData tableheaddata = tableheader.createLayoutData(IWDGridData.class);
		  tableheaddata.setPaddingLeft("10px");
		  tableheaddata.setPaddingTop("7px");
		  
		  
		  TableHeaderContainer.addChild(tableheader);

Thanks & Regards

Swetha

Edited by: Swetha Nellore on Jun 16, 2009 12:32 PM

Edited by: Swetha Nellore on Jun 16, 2009 12:35 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Swetha,

Set the visibleRowCount to 0.

After the data binding the table will respond to the data in the node.

If the table is displaying a row, it must an element must from the node bound to the table.

Please check the cardinality of the node ensure that it is 0...1 or 0...n. Do not add any element to the node.

Regards,

Kartikaye

Former Member
0 Kudos

Hi Kartikaye,

Thankyou fro the reply.I got my problem solved.....

Best Regards

Swetha

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi colleagues,

By using the above code i am able to design a table with only three column headers ......without any rows..

But it is giving me Scroll bar at the right of the table...Could any one please let me know how to remove the scroll bar at the right?

Thanks & Regards

Swetha

Former Member
0 Kudos

Hi,

Try to set the table header property ScrollableColCount to -1 and visibleRowCount as 5

tableheader.setScrollableColCount(-1);
tableheader.setVisibleRowCount(5);

Hope this helps you

Regards,

Saleem

Former Member
0 Kudos

Hi Saleem,

Thankyou for the reply,

When i included the two lines.....the scrollbar is gone...but i am able to see one row

Here i dont ned any rows to be diaplayed......i ust need only header( Three Columns)

PLease let me know how to proceed

Thanks & Regards

Swetha

Former Member
0 Kudos

Hi,

Set the visible row count as 0 instead of 5

tableheader.setVisibleRowCount(0);

Regards,

Saleem

Former Member
0 Kudos

Hi,

Try setting VisibleRowCount to 0

could you please let me know wat exactly are you trying to do this way?

gill367
Active Contributor
0 Kudos

make visible row count to 0

tableheader.setVisibleRowCount(0);

thanks

Sarbjeet Singh

Former Member
0 Kudos

Hi Santosh,

i have tried setting visiblerow count to 0...now i am getting the scrollbar on the right

Actually what i am trying to do is:

Depending upon the node size we are generating tables....i.e if node size is 3 then 3 tables needs to be displayed...and each table should have a table header....and one row....should not have any column headers......it is achieved by me....

Now we have three Tables (looks like this....with out column headers)

Table1 Header

Googe                                         10KB                                     Button

Table2 Header

Gmail                                          10KB                                     Button

Table3 Header

Yahoo                                         10KB                                     Button

Now we need to display as ( need a cobined Column headers for all the tables) like....

Title                                          Size                                    Download

Table1 Header

Googe                                         10KB                                     Button

Table2 Header

Gmail                                          10KB                                     Button

Table3 Header

Yahoo                                         10KB                                     Button

To achieve this...i am creating an anither table above the previous table with only headers....

Thanks & Regards

Swetha

Former Member
0 Kudos

while creating a table with only Headers.....

i am facing the above problem....

i.e

If i use

tableheader.setScrollableColCount(-1);
tableheader.setVisibleRowCount(0);

i am getting a table with only header values but giving a scroll bar at the right

if i use

tableheader.setScrollableColCount(-1);
 tableheader.setVisibleRowCount(5);

i am getting a table with a single row ...without any scrollbar...

Is this possible to get a Header row ...with out any rows...

Thanks & Regards

Swetha

Edited by: Swetha Nellore on Jun 16, 2009 1:34 PM

Edited by: Swetha Nellore on Jun 16, 2009 2:01 PM

Former Member
0 Kudos

Hi,

Can you try increasing the Table Size if you have some empty screen space.

Use table.setWidth("<>") and provide max width for the same and check.

Write the below code u used earlier with the setWidth

tableheader.setScrollableColCount(-1);
tableheader.setVisibleRowCount(0);

.

Former Member
0 Kudos

One more option would be using cell varaints provided if you have EP7.0 as this exists only in this version. Check this link

http://help.sap.com/saphelp_nw70/helpdata/en/c1/fa7842fdb70f53e10000000a155106/frameset.htm

Now you can create only one table with the headers.But while filling the data you have to fill Table1Header etc., and the links data in the alternate rows

Former Member
0 Kudos

Hi,

I tried with your code i made small modifications and it is working fine for me

IWDTransparentContainer TableHeaderContainer = (IWDTransparentContainer)view.createElement(IWDTransparentContainer.class,null);
	IWDGridLayout TableHeaderLayout =(IWDGridLayout) TableHeaderContainer.createLayout(IWDGridLayout.class);
	IWDTable tableheader = (IWDTable) view.createElement(IWDTable.class, null); 
	IWDNodeInfo nodeInfo = wdContext.getNodeInfo().getChild("IterateValues");
	tableheader.bindDataSource(nodeInfo);
	tableheader.setDesign(WDTableDesign.TRANSPARENT);
	tableheader.setFixedTableLayout(true);
	tableheader.setScrollableColCount(-1);
	tableheader.setVisibleRowCount(0);
	tableheader.setWidth("400");
	tableheader.setFooterVisible(false);	
	tableheader.setRowSelectable(false);
	WDTableGridMode mode1 = WDTableGridMode.NONE;
	tableheader.setGridMode(mode1);
	WDTableSelectionMode sm1 = WDTableSelectionMode.NONE;
	tableheader.setSelectionMode(sm1);
	IWDTableColumn columnhead = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
	tableheader.addColumn(columnhead);
	IWDCaption Col1header = (IWDCaption) view.createElement(IWDCaption.class, null);	
	Col1header.setText("Title");
	columnhead.setHeader(Col1header);
	columnhead.setWidth("40%");
	IWDTableColumn columnhead2 = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
	tableheader.addColumn(columnhead2);
	IWDCaption Col2header = (IWDCaption) view.createElement(IWDCaption.class, null);	
	Col2header.setText("Size");
	columnhead2.setHeader(Col2header);
	columnhead2.setWidth("20%");
	IWDTableColumn columnhead3 = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
	tableheader.addColumn(columnhead3);
	IWDCaption Col3header = (IWDCaption) view.createElement(IWDCaption.class, null);	
	Col3header.setText("Download");
	columnhead3.setHeader(Col3header);
	columnhead3.setWidth("20%");
	WDTableColumnHAlign align = WDTableColumnHAlign.CENTER;
	TableHeaderContainer.addChild(tableheader);

Try to set some width for the table and make FooterVisible as false


tableheader.setScrollableColCount(-1);
tableheader.setVisibleRowCount(0);
tableheader.setWidth("400");
tableheader.setFooterVisible(false);

This should avoid the scroll bar...

Regards,

Saleem