cancel
Showing results for 
Search instead for 
Did you mean: 

How to bind simple type to a table column

Former Member
0 Kudos

Hi All,

I have created a simple type in Dictionary. With some Key and value pair. I want to bind this simple type to a table column.

Does any body have suggestion how can I do that?

Regards,

Maya.

Accepted Solutions (0)

Answers (5)

Answers (5)

monalisa_biswal
Contributor
0 Kudos

As Armin suggested u have to add elements to ur context node to display values in ur table.

Former Member
0 Kudos

Hi Monalisa,

I try to take Input Field as table cell editor,

It works fine, but I would like that the values of the simple type will be shown in the Input Field on the same table, not in different one.

Thanks,

Maya.

monalisa_biswal
Contributor
0 Kudos

Take Input Field as your table cell editor.

Former Member
0 Kudos

Hi Maya,

There is another solution for ur Prblm.

Plz let me know if ur table is having any key,Value(desc) for that perticular dropdown.If it is ther means u can populate the dropdown By using this code.

1.ISimpleTypeModifiable objXX = null;

2.IModifiableSimpleValueSet objYYY = null;

objXX = wdThis.wdGetAPI().getContext().getModifiableTypeOf("ctx_ConveyanceType");

objYYY = objSimpleTypeConveyanceTypeData.getSVServices().getModifiableSimpleValueSet();

3.Get the size of that Table and get the Key and Value Descriptions.

4.Finally set it to DropDown

ex:objYYY .put(key,ValueDesc);

One more thing u need to create one string attribute for that Dropdown lik:ctx_strXX,type is string.

Populate this dropdown using above Code.

This method is applicable only for table coontains Key,Value for that Dropdown.

Let me know if u hav any doubts,

Regards,

Lavanya.G

Former Member
0 Kudos

Hi,

Create a context attribute of type simple type that you have created. Then add a TableCellEditor to your table column and bind the value or text property of that editor to the context attribute.

Regards,

Satyajit.

Former Member
0 Kudos

Hi Satyajit,

Thank for your quick replay.

I have did that already, and it didn't work.

Maybe the problem connection to the cardinality property, Which cardinality did U set?

Regards,

Maya.

Former Member
0 Kudos

Maya,

Can you share the context structure that you are using?

Regards,

Satyajit.

Former Member
0 Kudos

Hi,

if your diplaying only one record with the input field you can use the Cardinality 1..1

Or more than one record means you can utilize the 0..n

thanks,

Lohi.

Former Member
0 Kudos

Hi Satyajit,

Here is my context structure:

tableNode -> hourAttribute

I bind the tableNode to the table dataSource,

The type of hourAttribute is simple type which I have created. I bind it to TableCellEditor of my table column.

But on runtime nothing display on this column.

Regards,

Maya.

Former Member
0 Kudos

Hi,

try with the cardinality 1..1 then it might be displayed at run time.

Thanks,

Lohi.

Former Member
0 Kudos

hi,

try this.

In your view simple insert apply template and select your node that automatically take as Dropdownbykey of your simple type attribute and your context node cardinality change as a 1..1 and run your out put should come.

I think it should work i tried now.

Thanks,

Lohi.

Former Member
0 Kudos

Hi,

Maybe I should ask for first time:

Simple Type used only on DropDownByKey? since my column table is TextView and not a DropDown!

Thanks,

Maya.

Former Member
0 Kudos

Hi,

Yeah, that's the idea. Either it's a dropdown or a form of value help. A textview is a static display only UI element.

Regards,

Satyajit.

Former Member
0 Kudos

Give "tableNode" cardinality 0:N.

To display table rows, you have to create and add elements to the data source node. For example with code like

for (int i = 0; i < numRows; ++i)
{
  ITableNodeElement e = wdContext.nodeTableNode().createTableNodeElement();
  wdContext.nodeTableNode().addElement(e);
  e.setHourAttribute(<some-value>);
}

Armin