cancel
Showing results for 
Search instead for 
Did you mean: 

Single Column with link in one row and text in other row

Former Member
0 Kudos

Hi Colleagues,

We have a requirement where there will be a table with two columns

Here the coding for the second column i am using is pasted below

IWDTableColumn column1 = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
	  table.addColumn(column1);	
	  IWDCaption Col2header = (IWDCaption) view.createElement(IWDCaption.class, null);	
	  String DownloadLink = TextAccessor.getText("DownloadLink");
	  Col2header.setText(DownloadLink);
	  column1.setHeader(Col2header);
	  column1.setWidth("60%");
	  
	  IWDLinkToURL editor1 = (IWDLinkToURL) view.createElement(IWDLinkToURL.class, null);
	  IWDAttributeInfo attribInfo = nodeInfo.getAttribute("link");
	  
	  //IWDTextView editor1 = (IWDTextView) view.createElement(IWDTextView.class, null);
	  editor1.bindText(attribInfo);
	  
	  wdComponentAPI.getMessageManager().reportSuccess("link from editor"+editor1.getText());
	  //editor1.bindReference("prerequisites.link");
	 // editor1.setReference("prerequisites.link");
	  //editor1.bindTarget("prerequisites.link");  
	  editor1.bindReference(attribInfo);
	  editor1.setEnabled(true);

column1.setTableCellEditor(textedit);

Here from the above code what i am able to get is display the links in the Second column........

But we need to display Text also in the same column for some entries

Could any one please let me know how can this be achieved

Thanks & Regards

Swetha

Accepted Solutions (1)

Accepted Solutions (1)

pravesh_verma
Active Contributor
0 Kudos

Hi Swetha,

There is a nice way of achieving this requirement. There is something called Cell variant. You can use the Cell variants for the column and can solve this.

If you are still in SAP then I can send you one document through mail. OR just ping me your ID.

OR you can check this link as well:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/80d81237-b780-2a10-d398-cc33af6b...

I hope this helps. Please revert back in case you need any further information on this.

Thanks and Regards,

Pravesh

Answers (2)

Answers (2)

Former Member
0 Kudos

Either use TableCellVariants (if available in your version) or just disable the links in those rows where only a text should appear.

Armin

Former Member
0 Kudos

Hi Swetha,

Using CellVariant you can achieve this requirement.

Go through this wiki. step by step procedure to work with cell variant.

https://wiki.sdn.sap.com/wiki/display/WDJava/Using%20Table%20Cell%20Variants%20in%20NW%202004s

Regards,

Jaya.