cancel
Showing results for 
Search instead for 
Did you mean: 

how to display images in a table

Former Member
0 Kudos

Hi all,

I have to display five different images in five rows of a table.For this purpose i am trying to create a node element with value attribute.How can i set an image to the

node.If it is possible to set an image to the node then i can bind it dynamically to the table.Is it correct way?

Otherwise give me guidance to solve this problem.

Thanks&Regards

Satyam

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Designtime:

Context:

Value node "Rows" (cardinality 0:N)

Attribute "ImageURL": string

UI elements:

Table.dataSource = "Rows".

TableColumn, table cell editor = Image

Image.source = "Rows.ImageURL"

Runtime:


for (int i = 0; i < 5; ++i)
{
  IRowsElement row = wdContext.nodeRows().createRowsElement();
  wdContext.nodeRows().addElement(row);
  row.setImageURL(<URL of image at index i>);
}

If you put the image files inside folder src/mimes/components/<name-of-component>, you can use the filename as URL.

Armin

Former Member
0 Kudos

Hi Armin,

Could you please help how to code to pass URL. I want to set the image to setImageURL attribute.

sqlr3element.setImageURL(imglocaltion);

C:\workspace\WD_Tableimg\src\mimes\Components

Regards

Thank you

Maruti

Former Member
0 Kudos

Hai Maruti,

You are trying to place as Images.

Simply create attribute in table node, bind that attribute to ImageSrc .

Copy all the images mime--components.image1,images,image3....

for(int i=0;i<size;i++){

IPrivateXXView.ITableElement ele=wdContext.createElement();

ele.setImageSource("image"+i);

wdContext.nodeTable().addElement(ele);

}

Regards,

Naga

devendervb
Contributor
0 Kudos

Armin,

Thanks a lot , it helped me a lot