alternate entries from secondary source

O

olivier

In a previous question (trancoding 1/28), I was looking for, from a secondary
source , filling a drop list with functions names and storing XML file with
corresponding function code (the function name is just for user interface).
As Michelle suggested me, I thought the problem was close with drop-list
properties/Data.Lookup values in a data connection... but unfortunately it is
not.

In my case, Value and Display names (which are supposed to be Xpath -see
icon bubble) do not allow to browse to select others sibling fields. It just
shows attributes of the field selected with "entries". In the following
example, value and display name fields begin with the name node and then
will only allow to select "lang" and not "code" or "desc"

<function>
<name lang="en">function</name>
<code>001</code>
<desc>description</desc>
</function>

So what' wrong ? Is it because the purpose of value and display name is not
to offer an alternative to entries in the drop-down list box properties ? Or
a problem with Infopath ? Why isn't it possible to fill the value and
display name with directly with Xpath (../@code) ?
 
O

olivier

Thanks. Yes this is an answer that I didn't think about. But I hope that it
will be corrected soon as it's seems to me to be a workaround and the value
and display fields should allow a better browsing of the tree, or a least
allow direct xpath scripting like in some other dialog boxes. !
 
M

Michelle Beall

if you point your datasource to the repeating node, then you can select
sibling nodes contained within the repeating node.

Look at the bottom of the data tab in the drop down list box properties
dialog window. There is a box where you identify the data connection.
Beneath that you specify which node entries are coming from. Bind this to
the repeating group node (in your case it would be function as function will
be repeating). Then for Value and for Display Name you can select child
nodes of the function repeating group. They can be sibling nodes such as
name and code. Those boxes will be filled with XPath generated by the GUI.

I know this works because I use it for material lists where I display the
part name but use the part number as the value.

I can send you a screen shot if that will help.

Michelle
 
O

olivier

Really wonderful. it works. The trick you found and was not so obvious was to
set the entries to the parent node and the display value and node to childs.
My idea was to set the entry directly to the child and this doesn't work,
even if the drop list is well filled. Thanks once again for you help.
 
O

olivier

One more question to be complete, sorry to be long. How would it be possible
to adapt this selection to a recursive construction ? That's to say, the
secondary datasource is recursive and contains
<Function>
--<Name level1>
----<Function>
-------<Name level2>
and so on

If I select Function in Entries, and Name in Display Name, the functions
list in the drop list box is always composed of the level 1 names, even if I
have inserted a function from the recursive repeating function of the form.
In other words, this means to set Functions name list relative and not
absolute.
Even if it's not so nice, I thank to create several drop-list levels in the
form, but as it is based on an Xml schema, Infopath doesn't allow that and
always create a recursive section when I drag a sub function from the data
source inside the function in the form. Is it necessary to extract form file
and to modify them ? There is such an exemple in the Infopath SDK/Best
practices/Create a recursive data structure but I wonder if it's a good idea,
when I notice that the example is not coherent with the actual generated code.

Thanks so much.
 
M

Michelle Beall

The GUI doesn't support recursive elements to fill a drop down list. That
would be interesting though ... have you tried building your own control to
do that? (traverse the node list to build your dependent list)

And if you drag a recursive element on to the form InfoPath will place a
recursive section there as that is what it interprets what you want.

If you want some kind of depency then you might want to look at building
dependent drop down lists where you will use 2 drop down lists and the second
list is populated based on the selection in the first. You can find an
example at www.infopathdev.com. I think I've seen other examples also but
don't recall where they are now. You would not want a recursive section in
your schema in this case.

Another idea (but I haven't tried this) would be to show a repeating table
of the level 1 functions and inside the repeating table have a drop down list
bound to the sub functions. (I'm also assuming there is only one sub level).
I'm not sure if this would work though.
 
O

olivier

I'll try your suggestions. One important thing is that your answer shows that
I didn't miss something about this GUI. Thanks again for all your kind help.
 

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