on 06-26-2007 10:54 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.