Can an expression box work like a combo box?

G

G. Tarazi

Hi



Attached example, a form template and an xml file from the template, save both in C:\ drive, now; the form has a lookup table with code and description, and the combo box that is getting its data from the lookup table.



I would like an expression box that can emulate the combo box, in other word, to go to the lookup table codes, and pick the description, I have a sample attached, built using the InfoPath dialog boxes and filters, but giving the wrong results, this is because the combo box is in a repeatable section.



Any ideas



Thanks
 
G

G. Tarazi

Thanks for the response, what you are saying is correct, and it is in the
attached sample, the only problems is when the combo box is in a repeatable
group, I just can't find an XPATH expression to get it to render properly,
it always renders the first element of the repeatable section for all.



"Greg Collins [InfoPath MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in
message This was something I was asking for too, and then I finally realized that
you can use filters on the expression box to emulate the drop-down list box.
If, for example, you have a data source with a <Field name="" value=""/>
schema, and you set your drop-down list box to populate from those Field
nodes, you can have your expression box look up the Field whose value
matches the selected value, and then display the name instead.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com


"G. Tarazi" <Tarazi (at) LiveTechnologies.ca> wrote in message
Hi

Attached example, a form template and an xml file from the template, save
both in C:\ drive, now; the form has a lookup table with code and
description, and the combo box that is getting its data from the lookup
table.

I would like an expression box that can emulate the combo box, in other
word, to go to the lookup table codes, and pick the description, I have a
sample attached, built using the InfoPath dialog boxes and filters, but
giving the wrong results, this is because the combo box is in a repeatable
section.

Any ideas
Thanks
 
A

Andrew Watt [MVP - InfoPath]

Hi



Attached example, a form template and an xml file from the template, save both in C:\ drive, now; the form has a lookup table with code and description, and the combo box that is getting its data from the lookup table.



I would like an expression box that can emulate the combo box, in other word, to go to the lookup table codes, and pick the description, I have a sample attached, built using the InfoPath dialog boxes and filters, but giving the wrong results, this is because the combo box is in a repeatable section.



Any ideas



Thanks

Hi,

I downloaded your attachments. They don't function as described for
me. I tried republishing with no change in behaviour. The lookup
doesn't work for me.

If the form worked and I could see more clearly what you were trying
to do I would be happy to attempt an XPath solution for you.

Andrew Watt
MVP - InfoPath
 
G

G. Tarazi

Thanks for the help, I had a look at the sample, and I think I fixed it,
here is the code:

.../../my:group1/my:group2/my:field2[../my:field1 = current()/my:field3]



"Greg Collins [InfoPath MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in
message Yes. This is a common problem. You need to be using the current() function
to make this work right. Please see how this works in the InfoPath Dev
Example titled, "Repeating Cascading Lists of Cascading Lists, v1.0".

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



"G. Tarazi" <Tarazi (at) LiveTechnologies.ca> wrote in message
Thanks for the response, what you are saying is correct, and it is in the
attached sample, the only problems is when the combo box is in a repeatable
group, I just can't find an XPATH expression to get it to render properly,
it always renders the first element of the repeatable section for all.



"Greg Collins [InfoPath MVP]" <Greg.Collins_AT_InfoPathDev.com> wrote in
message This was something I was asking for too, and then I finally realized that
you can use filters on the expression box to emulate the drop-down list box.
If, for example, you have a data source with a <Field name="" value=""/>
schema, and you set your drop-down list box to populate from those Field
nodes, you can have your expression box look up the Field whose value
matches the selected value, and then display the name instead.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com


"G. Tarazi" <Tarazi (at) LiveTechnologies.ca> wrote in message
Hi

Attached example, a form template and an xml file from the template, save
both in C:\ drive, now; the form has a lookup table with code and
description, and the combo box that is getting its data from the lookup
table.

I would like an expression box that can emulate the combo box, in other
word, to go to the lookup table codes, and pick the description, I have a
sample attached, built using the InfoPath dialog boxes and filters, but
giving the wrong results, this is because the combo box is in a repeatable
section.

Any ideas
Thanks
 

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