Jump to content

_IE UDF for AJAX tables


AnselRoe
 Share

Recommended Posts

Hi guys,

I am an AutoIt noob - but have been able to use most of the _IE UDFs with few problems.

Please correct me if I am not in the right place or not sending the required info.

I am trying to figure a way (Other than MouseClick) to simulate a click on a line in an Ajax table.

I can limit the table to a single line... and only need to "click" anywhere on the first line.

The table is in an IEFrame .

HTML 'onclick=' code looks like this : (#=======... is my separator)

#================================================

</div>

<!-- Following Div grid_popup needed for AjaxGrid -->

<div class="grid_popup" id="grid_popup" style="visibility: hidden; display: none;">

<div class="popup_body">

<table>

<tr>

<td onmouseover='className="navon"' onmouseout='className="navoff"' onclick='alert("Do Action 1 \n row: " + o.ClickedRow + "\n ID: " + o.ClickedTD.id );'>

Option 1</td>

</tr>

<tr>

<td onmouseover='className="navon"' onmouseout='className="navoff"' onclick='alert("Do Action 2 \n row: " + o.ClickedRow + "\n ID: " + o.ClickedTD.id);'>

Option 2</td>

</tr>

<tr>

<td onmouseover='className="navon"' onmouseout='className="navoff"' onclick='alert("Do Action 3 \n row: " + o.ClickedRow + "\n ID: " + o.ClickedTD.id);'>

Option 3</td>

</tr>

</table>

</div>

#================================================

I know that the row will always be one, if that helps.

I have looked at the generated http line and might be able to simulate navigation matching a 'click'.

That is, I could simulate the navigation but a critical piece of information required to do that

'SetWorkOrderId' is hidden in a POST response that looks like this:

{"rows":[{"row":"1","column1":"\u003cspan\u003e\u003ctable border=\"0\" cellpadding=\"0\" cellspacing=\"0\"\u003e\u003ctr\u003e\u003ctd onclick=\u0027SetWorkOrderId(15189112400)\u0027 style=\"color: red\"\u003e11/26/2009\u003c/td\ ....

and I have been unsuccessful at figuring a way to get the POST Response or that piece of information using AutoIT as well.

Any help would be appreciated.

Thanks,

ARG

Link to comment
Share on other sites

Since you have the id of the DIV container and know that the table structure is stable, you can use _IETagnameGetCollection to drill in. E.g.

$oDiv = _IEGetObjById($oIE, "grid_popup")
$oTable = _IETagnameGetCollection($oDiv, "table", 0) ; get first table
$oTR = _IETagnameGetCollection($oTable, "tr", 0) ; get first TR
$oTD = _IETagnameGetCollection($oTR, "td", 0) ; get first TD
_IEAction($oTD, "click")

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...