on 11-27-2007 12:54 PM
Dear community,
I'm creating a dynamic table containing all the neccessary fields to display my context node in Java code but I have one requirement that I can not resolve by myself:
Depending on the value of a cell the TableCellEditor should be of type IWDTextView or LinkToURL. So if the context node value is e.g. the String "abc" I want to display a LinkToUrl containing a Target - such as http://www.abc.com - depending on the value, if the context node value is "def" I want to do nothing but display the value in a TextView.
As I am creating the dynamic table in advance and binding my Context node to it later, I don't know how to change the TableCellEditor at that point of time.
Right now I have the choice to either display all cells of the column as LinkToUrl TableCellEditor or display all cells as TextView - the dynamic table generation itself is no problem for me.
Does anyone have an idea on how to do that? Maybe it is not possible in WDJ right now?
regards,
Christian
Hi,
In the Table column , you can not add more than one table cell editor.
You can keep 2 columns, one with Textview and other with LinkToURL.
And you can hide and show the columns according to your requirement.
REgards,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I resolved this by using a LinktoUrl and attaching some new attributes to my content node rendered in the table. One attribute of type string for the URL itself and the other of type boolean to mark the LinkToUrl as active/inactive.
Upon creation of the context node content I added those extra attributes to tell the specific URL (or an empty String) plus the boolean field for setting the LinkToUrl active or inactive.
The use of Cell Variant did not get clear to me, I needed the quickest solution. Maybe SAP's gonna provide the community with a more complex Table example for NW2004s one day...
Thanks for the help!
regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is a new article on the advanced table features: See <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/80d81237-b780-2a10-d398-cc33af6bd75c">here</a> and <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30291df2-b980-2a10-0884-839c4f7f147e">there</a>.
Armin
Hello Armin,
I'm on SP13, guess that's 7.0. Have to find docs about TableCellVariants first, will check other posted solutions as well and reward points accordingly.
kind regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you on a NW release >= 7.0? If yes, this can be done using table cell variants.
In NW < 7.0, you could use LinkToURL as table cell editor and disable it for those rows where you want to use a TextView.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christian
Try this:
IWDTable theTable=(IWDTable)view.createElement(IWDTable.class,"table");
IWD TableColumn aColumn=(IWDTableColumn)view.createElement(IWDTableColumn.class,"col");
if(str.equal("abc"))
{
IWDTextView aField=(IWDTextView)view.createElement(IWDTextView.class,"TextView");
aField.bindText(str);
aColumn.setTableCellEditor(aField);
}
else if(str.equal("def"))
{
IWDLinkToURL aField=(IWDLinkToURL)view.createElement(IWDLinkToURL.class,"LinkToURL");
aField.bindtarget("http://www."str".com");
aColumn.setTableCellEditor(aField);
}
theTable.addColumn(aColumn);
Best regards,
Sangeeta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.