Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Current Record in a Recordset
Message
From
06/07/1999 20:46:47
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00237942
Message ID:
00238042
Views:
15
>I have an xml data island embedded in a html page that is bound to a table. The table displays fine, but I want to be able to do something based on the selection of the user.
> What I am trying to do is call another asp file and display the results in another frame.
>
> My problem... I can't figure out how to reference the current item in the table. I am using the onClick of the table and calling a script to display the value.
>

If you can use the value of the cell that the user clicked on as a primary key to do some work, then your job isn't too hard. The following script example will show you how to get the value of the cell that the uesr clicked on:

In a script function called clickit:

MyCellValue = window.event.srcElement.innerText ;

and then call this function from the table's click event.


If you need to use the value of another cell, then you can make your function a little smarted by referencing the nth cell in the current row:

<br>alert(window.event.srcElement.parentElement.cells(1).innerText) ;<br>

If you are content handling this with table values, then this is all you need to know. But if decide you need to handle this through XMLDOM (for example, the value you need is not in the HTML table, but in the underlying XML DI), you will need to use the XMLDOM's selectSingleNode method to get a reference to the node that is tied to the cell that the user clicked. You might do your pattern matchng with something like:
<br>Keyval = window.event.srcElement.innerText ;<br>ResultNode = XMLdi.selectSingleNode('/Car[@ModelYear = KeyVal]');<br><br>

Ths code above takes the value of the cell that the user clicked, uses XMLDOM to check the value of a node against an XSL pattern, and assigns the resuling child node to the variable ResultNode.


I am pumped up to see people implementing XML... these question are getting very intersting.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform