cancel
Showing results for 
Search instead for 
Did you mean: 

Can we have Input Field in one cell and Text View in another cell of table

Former Member
0 Kudos

Hi All,

Please let me know is it possible to have Input Field in one cell and Text View in another cell of table column.

Thanks and Regards,

Gangadharayya.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Gangadharayya,

You may use different cell editors in same column only in NW04s (7.0) -- see API docs/tutorials about CellVariant feature. In NW04 (6.40) all rows may have only one type of editor for given column.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hi Valery,

Thanks a lot for your reply. If that is the case, please clarify whether it will ask for cell editor for cell of a table or we need to write a code or we need to add dynamically at runtime. And if possible please give us a small example code.

Regards,

Gangadharayya

Former Member
0 Kudos

Gangadharayya,

Fortunately, you do not need any programming, everything is done via designer, so I will not post any code

1. Create one type of cell editor on column, say InputField, and bind it to context attribute. This is regular procedure.

2. Right-click on column, add cell variant from menu (use standard cell variant). Set its name and remeber it (say, MyTextView).

3. In cell variant create TextView as cell editor and bind it to context attribute

4. Now in context node create attribute of type String, name it for example SelectedCellVariant

5. Bind property cellVariant of column to SelectedCellVariant attribute.

Now you need a bit of coding Either in supply function for node used as table data source or iteratevly via node elements set SelectedCellVariant either to null or to "MyTextView" string. Afterwards you will see at run-time InputField for rows where SelectedCellVariant is null and TextView where its value is MyTextView.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Hi,

Thanks for your reply.It has almost solved my problem. But can you please elaborate statement "<b>Either in supply function for node used as table data source or iteratevly via node elements set SelectedCellVariant either to null or to "MyTextView" string"</b>

Please explain me how we can do it in

1) supply function

2) iteratevly via node elements --in ViewController in which method (i.e. doInit or doModifyView ) we need to do this.

And for this, we need to have access to table in View Controller methods. But I dont know how to access table in View controller methods.

Thanks in advace,

Gangadharayya.

Former Member
0 Kudos

Gangadharayya,

First and foremost, you don't have to access Table (UI control) in view controller methods, you should just create/modify context node elements and WD binding (UI-control-properties -> context-node-attributes) do the rest.

Now the specific depends on how you populate your context node elements.

Say, you have defined supplyFunction for context node (laizy or on-demand controlled loading of elements). In this supply function you are adding elements to node. Just set an attribute value here.

Otherwise, you might adding elements "manually" in repsonse to user operations via wdContext.node<YourNode>.addElement() or you are using RFC model with supplying relation roles. In this case, you have just to iterate over all elements in node with java "for" loop and set attributes here.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Answers (0)