How to prevent listbox showing blank first entry?

W

Wozza

Hi,

I am using a listbox to display an index of "pages" within my XML document,
and filtering the display by the page number selected in the listbox.

However, the listbox insists on displaying a blank first entry. No matter
what filters, etc i have tried I can't remove that first entry.

Anyone know how to get rid of the first entrey??

The XML I am using for prototyping a solution is as follows:
<DATA>
<CURRENTPAGE>1</CURRENTPAGE>
<PAGES>
<PAGE no="1" display="Page 1" />
<PAGE no="2" display="Page 2" />
<PAGE no="3" display="Page 3" />
<PAGE no="4" display="Page 4" />
</PAGES>
</DATA>

I bind the control to CURRENTPAGE, and use the PAGE element to display the
entries in the list.

In my actual project (not the prototype) I have tried changing the XSD to
attempt to force InfoPath into not allowing a blank entry, but to no avail
....

Any suggestions?
 
K

kookie

Have you tried?

Under Conditional Formatting

This expression : position()+1

Kookie
 
W

Wozza

Not sure what you mean by that ...

I found that the view1.xsl file contained a line "<option />" which
corresponded to the empty entry at the top of the listbox. This is despite
specifying in my XSD that the element is mandatory, etc, etc.

So what i did was added a task to my msbuild script that deleted that
element from the file. That did the trick!!

If you edit the listbox again however InfoPath puts the line back again,
which is why i put it in my build script ,,, so that if it happens to
reappear, it will just get deleted again!
 

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