Check if List Box is populated

M

Martyn Lawson

Hi,

I have a drop-down list box that is linked to a secondary datasource.
However, the secondary datasource is not connected until a button is pressed.

I would like to be able to perform some conditional formatting on a second
button depending on whether the drop-down list contains any options (not
whether it has a selected value).

Is this possible? Alternatively, is it possible to see whether a datasource
is connected?

Any suggestions would be greatly appreciated,

Cheers,
Martyn...
 
S

S.Y.M. Wong-A-Ton

Hi Martyn,

Have you already tried counting the nodes in the secondary data source using
the XPath count() function?

Regards,
S.Y.M. Wong-A-Ton
 
M

Martyn Lawson

Hi,

Thanks for your response. How is this possible using conditional formatting?
There isn't an option to count a datasource node.

Cheers,
Martyn...
 
S

S.Y.M. Wong-A-Ton

Hi Martyn,

You can set conditional formatting on the button and use "The Expression" in
the Conditional Format dialog box to use the XPath count() function. You will
have to modify the expression yourself, though.

Try this:
- Open the Conditional Format dialog box
- Click on [Add...]
- In the Conditional Formatting dialog box: Leave the field in the first
dropdown selected
- Leave "is equal to" in the second dropdown selected
- Select "Select a field or group" from the third dropdown
- Select a field (e.g. an ID field) from the secondary datasource you are
using to fill the dropdown on your IP form and click on [OK]
- Back in the Conditional Format dialog box: Select "The expression" from
the first dropdown
- Modify the expression in textbox to perform formatting if the datasource
contains nodes as follows:
Old expression: my:field1 = xdXDocument:GetDOM("...")/....
New expression: count(xdXDocument:GetDOM("...")/....) > 0
- Apply the desired formatting for the button
- Click on [OK] to close all dialog boxes

Hope this helps.

Regards,
S.Y.M. Wong-A-Ton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top