cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Table cell

Former Member
0 Kudos

Hi friends

I display the table in which having few rows and columns and each cell(which is intersection of the row and column) has got some image in it....

my requirement is when i click in that cell(containing that image should be displayed on the top........?

)

how to display that image on the top?

Advance thanks

Shravan KUMAR

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

hi friends

What code do u write in the action class or event when i click that button the value or image contained in that cell should be displayed on top???

how to do this..?

thanks

Sharavan G

Former Member
0 Kudos

Assuming you have used LinkToAction as cell editor.

Define a parameter mapping (if possible inside IDE), otherwise with code like

wdDoModifyView(...)
{
  if (firstTime)
  {
    IWDLinkToAction cellEditor = (IWDLinkToAction) view.getElement("cell_editor_ID");
    cellEditor.mappingOfOnAction.addSourceMapping("nodeElement", "nodeElement");
  }
}

Create an action "ImageClicked" with a parameter "nodeElement" of type IWDNodeElement.

In the action handler, cast the generic parameter to the concrete node element type, get the image source and set it for the image above the table.

Context structure:

- imgTopSrc (attribute)
- Rows (node)
-- imgSrc (attribute)

Assume table data source is node "Rows" and image above the table is bound to attribute "imgTopSrc".

void onImageClicked(IWDCustomEvent event, IWDNodeElement nodeElement)
{
  IRowsElement row = (IRowsElement) nodeElement;
  wdContext.currentContextElement().setImgTopSrc( row.getImgSrc() );
}

Armin

Former Member
0 Kudos

One possibility is to use the lead selection change of the table. If you bind an image outside the table to the same attribute as the image used as cell editor, it will always display the image corresponding to the selected row.

Better solution is to not rely on the table selection and

- use LinkToAction as cell editor

- update the source of the image above the table when the assigned action is executed

Armin

former_member751941
Active Contributor
0 Kudos

Hi Shravan,

Check this threads.

Regards,

Mithu

Former Member
0 Kudos

Hi Shravan,

You create an Image UI element say <b>Image1</b>

You should have bound the column with an context attribute of type <b>Image</b>.

Also bind the<b> selectedCellVariant Property</b> of the <b>Table</b> to a context attribute of type <b>string</b>. So whenever you click on a cell, the cell info is will be stored in <b>selectedCellVariant</b> and you can write the code in the <b>onAction</b> event of the column so that you bind the image of the selected Cell to the <b>Image1</b>.

Regards,

Mathan MP

former_member186016
Active Contributor
0 Kudos

Create Image UI element on the top.

Bind to similar context element as the cell element is binded to.

When the row of table is selected, populate the context element to which Image UI element is binded to.

Regards,

Ashwani Kr Sharma