* even though the rich:dataTable had a hardcoded id:
<rich:dataTable id="providerListTA" ...
when the page gets rendered by richfaces, the id looks like this in the rendered html code:
id="j_id1045:providerListTA:tb"
* the table is rendered inside a rich:modalPanel and contains a list of providers to select. inside that table there's a row with a link in the first column that i want to click on
Provider X
the problem is that behind the modalpanel there's a list of price agreements which also contains "Provider X", so the following code doesn't work:
specifying the element number also doesn't work because it will change from user to user, depending on what's in the price agreement list:
so i read the sahi api documentation and found out how to use the DOM relation marker called "_in", together with a regexp that matched only the hardcoded id in the xhtml/jsf code, leaving out the richfaces-appended texts, i.e. "j_id1045:" and ":tb":
_click(_span($transporter_name, _in(_table(/.*providerListTA.*/))));
Provider X is passed into the sahi script method as $transporter_name and the regex part of the code is this:
/.*providerListTA.*/
which means to match an id containing providerListTA with any characters in front or behind it.
No comments:
Post a Comment