MS Office Forum / General MS InfoPath Questions / November 2004
Can an expression box work like a combo box?
|
|
Thread rating:  |
G. Tarazi - 09 Nov 2004 15:26 GMT 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
Greg Collins [InfoPath MVP] - 09 Nov 2004 21:25 GMT 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.
 Signature Greg Collins [InfoPath MVP] Please visit: http://www.InfoPathDev.com
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. Tarazi - 10 Nov 2004 14:16 GMT 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.
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.
 Signature Greg Collins [InfoPath MVP] Please visit: http://www.InfoPathDev.com
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
Greg Collins [InfoPath MVP] - 10 Nov 2004 19:46 GMT 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".
 Signature Greg Collins [InfoPath MVP] Please visit: http://www.InfoPathDev.com
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 news:uHssZKqxEHA.3908@TK2MSFTNGP12.phx.gbl... 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.
 Signature Greg Collins [InfoPath MVP] Please visit: http://www.InfoPathDev.com
"G. Tarazi" <Tarazi (at) LiveTechnologies.ca> wrote in message news:em0R9BnxEHA.3840@tk2msftngp13.phx.gbl... 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. Tarazi - 10 Nov 2004 20:40 GMT 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]
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".
 Signature Greg Collins [InfoPath MVP] Please visit: http://www.InfoPathDev.com
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 news:uHssZKqxEHA.3908@TK2MSFTNGP12.phx.gbl... 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.
 Signature Greg Collins [InfoPath MVP] Please visit: http://www.InfoPathDev.com
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
Andrew Watt [MVP - InfoPath] - 10 Nov 2004 14:37 GMT >Hi > [quoted text clipped - 5 lines] > >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
|
|
|