Focal Point
Maintain : Row Clicked in HTML-Table

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1881088331

August 11, 2005, 11:42 AM
Pete
Maintain : Row Clicked in HTML-Table
Hi ,

Is there a way in maintain to get the number of the row that has been clicked in an HTML - table

there are no links is my table.


Any ideas?

Peter
August 12, 2005, 07:25 AM
Pete
If not does anyone know a good reference for building maintain apps.
Cause i'm new at building maintain apps
August 12, 2005, 11:59 AM
<DocServices>
Hi Pete,

Try the Developing WebFOCUS Maintain Applications manual. This manual is available for the following releases:

Version 7.1 (DN4500692.0505)
Version 5.3 (DN4500595.0904)
Version 5.2.3 (DN1800113.0903)

You can view and/or download the Developing WebFOCUS Maintain Applications manual from the Technical Documentation Library.

If you have an InfoResponse ID, login on the Tech Support web site and then access the Library. By logging in first, you can download the PDF file and/or view the HTMLHelp version.

You can access the Technical Documentation Library via the following Web sites:




Hope this helps.

Regards,
Jennifer
August 12, 2005, 02:00 PM
Maintain Wizard
Pete
The best thing to do with an HTMLTable is to set a link to the body of one of the columns. Then, when a user clicks on that row you can get the row number using:

Compute Row1/i3 = Form.HTMLTable.ClickRow;

Where Form is the name of the form and HTMLTable is the name of the HTMLTable. You can also use:

Compute Col1/i3 = Form.HTMLTable.ClickColumn;
for the Column Number and:

Compute Val1/a20 = Form.HTMLTable.Value;
to get the value of the cell.

Mark
August 12, 2005, 02:44 PM
Pete
Hi Mark

First of all, thanks for your input , and yes i have tried it and it works , but can i do away with the link in anyway cause its visible and users are likely to click on it , while it does nothing


is there any workaround???


Peter
August 12, 2005, 05:48 PM
Maintain Wizard
Pete
An HTMLTable is pretty much a single object. When you click on it, without first setting a link, you are clicking on the entire object, not a specific row.

If you do set a link, you COULD get tricky and change the background color of the HTMLTable to the color of the link so it blends. Also, you could have a JavaScript trigger so the screen wouldn't flash if the user clicks on it.

While it brings in more overhead, you COULD use a Grid object instead of an HTMLTable and just make the columns read only. When you click a row on a grid, the stk.focindex gets set.

Mark
August 12, 2005, 06:29 PM
Pete
Cool , mark !

i think i can work with that

can i exactly change the color of the link?

what do i put in that java scrip so that it doesnt flash?

It would really help me alot,

thanks

Peter
August 15, 2005, 12:48 PM
Maintain Wizard
First create a field and place it on the form. You can make this field VISIBLE NO when everything is working. I named mine currow. Make sure when you place it on the form, the field is named currow. Not Currow or Currow_Edit. It is easier if it is one word and all lower case.

Create a CLICKLINK trigger on the HTMLTable and click the J at the top to tell Maintain this is a JavaScript trigger. Use this code:

var row1 = document.Form1.HTMLTable1_ClickRow.value;
document.Form1.currow.value = row1;

Form1 is the name of my form and HTMLTable1 is the name of my table. Make sure yours are exact. Case matters. Now, when the user selects a row, currow gets populated with no screen flash. You can then use currow in your calculations.

I hope this helps.

Mark
August 15, 2005, 01:18 PM
Pete
Thanks Mark !

Can i change the link-color? i guessing not but ....i'm hoping