usage and manipulation of (multiple) doctypes by fillselect

hello,
I have made an interessting conclusion according to the usage of X-application-tags and multiple doctypes(different schemas) you might be interessted in.

I am working on the module named “bdprob” and on a current document/doctype.

It is possible to get the value from another doctype(in this case category) in a pull-down menue and insert it in the current one which is hold in the workspace.
The edit tag of the current document contains a fill-select Tag which queries the other doctype


<bdm:edit select="/docuinfo/category">
<bdm:fillselect module=“bdProp” schema=“category” value="/category/cat_path" text="/category/cat_path">



</bdm:fillselect>
</bdm:edit>

…or on the same doctype:

<bdm:edit select="/category/cat_path">
<bdm:fillselect module=“bdProp” schema=“category” value="/category/cat_path" text="/category/cat_path">



</bdm:fillselect>
</bdm:edit>

By pressing commit the value is inserted by X-application.



The Disadvantage, you cannot modify the value of ‘/docuinfo/category’ or ‘/category/cat_path’ for example by using javascript.

But I wanted to add the name of the category to the end of this string.
The solution for modifying the value by using the javascript onSubmit-Handler:

Split the X-application tags in two pieces as follows:

<bdm:edit select="/category/cat_path">

</bdm:edit>

and

<bdm:fillselect module=“bdProp” schema=“category” value="/category/cat_path" text="/category/cat_path">



</bdm:fillselect>

Now you can use the onSubmit-Handler to set the value of the hidden field by submitting the form:


function setCatPath()
{
//the value assignment only works with a hidden x-app field. We have to assign this hidden field the path of existing categories and the current name
tmp = document.forms[‘form1’].elements[‘select’].value + “/”+document.forms[‘form1’].elements[’/category/name’].value;
document.forms[‘form1’].elements[’/category/cat_path’].value = tmp;

}


If you try version 1. you will recognize that the value is set to NULL, only by using the solution I described above it is possible to insert the modified value by a hidden field and X-application into the Tamino-Database.

This solution is based on the X-application-release 3.1.2. In the new release you should try “select” instead of “fillselect”.

:slight_smile:

Michael

Software AG Germany, Darmstadt