Page History
[ |../../index.htm#lansa/wamengb8_0035.htm]
You are here:
...
Referencing column values in a grid is a little different than you may have seen before. When using a standard list you can reference the value of a column using an XSLT variable of the same name ($COLUMNNAME). This is not possible with the grid so it is necessary to access a column with the following XPath expression:
Wiki Markup
../lxml:column\[@name='COLUMNAME'\]
This is not necessary for referencing the current column (i.e. the column containing the weblet). In this case you can use a single period (.). If you know the position of the column you want to reference, you can use an Xpath expression like this:
../lxml:column\[2\]
This is handy for large lists as it is much faster but it may cause problems if you change the order of the columns in your list.
| Info |
|---|
| Note: |
...
| All |
...
| field |
...
| and |
...
| column |
...
| name |
...
| references |
...
| in |
...
| XPath |
...
| expressions |
...
| must |
...
| be |
...
| uppercase. |
...
| All |
...
| references |
...
| to |
...
| repository |
...
| fields |
...
| must |
...
| use |
...
| the |
...
| object |
...
| name |
...
| for |
...
| the |
...
| field. |
...
Also
...
see
| Info | ||
|---|---|---|
| ||
The XPath expression tells the XSLT processor where to find the column in the XML data output by the Webroutine. Like DOS or Linux file paths, the expression indicates a path to the target data from the current position and, like file paths, a period (.) refers to the current position and two periods (..) refer to the parent.
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
When |
...
processing |
...
a |
...
weblet |
...
in |
...
a |
...
grid |
...
column, |
...
the |
...
current |
...
position |
...
in |
...
the |
...
XML |
...
is |
...
the |
...
<lxml:column> |
...
tag |
...
for |
...
that |
...
row |
...
and |
...
column. |
...
An |
...
XPath |
...
expression |
...
like |
...
this: |
...
|
...
says |
...
to |
...
go |
...
up |
...
to |
...
the |
...
parent |
...
<lxml:entry> |
...
tag, |
...
look |
...
for |
...
a |
...
child |
...
<lxml:column> |
...
tag |
...
with |
...
a |
...
name |
...
attribute |
...
of |
...
'EMPNO' |
...
and |
...
return |
...
it |
...
. |
...