project problem

X-Application Version: 3.1.3
Tamino Version : 3.1.1
Platform : Win2k
WebContainer : Tomcat 3.3
JDK Version : 1.3.1

hi
I have two doctype :users
userid,password,projectcode(repeat)
and doctype request :
requestid,projectcode,userid,…
we want to read project code from doctype users for specific userid and show in the combobox the project code that belong to specific userid.and when the project code choosed then project code is stored in a doctype request.
in other words,we want read from one doctype with condition and show in the combobox and choose it and store in another doctype
thanks

Hi,

the select tag provides the functionality you are looking for. With the select tag you are able to use almost abitrary queries (restricted by X-Query). Therefore you are able to read information from an independent source(here: of doctype ‘users’) not depending to a surrounding context (here: of doctype ‘request’).

The following lines of code refer to the ‘login example’ of a previous post:

<xapp:setvar [b][i]name="comboBoxQuery"[/i][/b]>/users/Xpath_to_ProjectCode[/users/userid="<xapp:display select="/users/userid"/>"]</xapp:setvar>


<xapp:form>
...
     <xapp:edit select="/request/Xpath_to_ProjectCode">[b]<xapp:select text="[i]${comboBoxQuery$}[/i]" />[/b]</xapp:edit>
...
</xapp:form>



Explanation:

  • 1. define a query depending on the user who is locked in an store it into a variable(here:comboBoxQuery
  • 2. use a select tag within an edit tag, pointing to you destination.
    a)edit tag: <xapp:edit select="/request/Xpath_to_ProjectCode">
    b)let the text attribute refer to the vaiable: <xapp:select text="{comboBoxQuery}" />


Hope that this will help you

Bye
Thorsten

Actually ,I could not emplemet your solution , I will be very pleased if U implement such case for me .
and I have the below code :
<xapp:setvar name=“filter” scope=“session” value="[users/userid=’${userid$}’]" />
<xapp:setvar name=“query” value="/users/project/code${filter$}" />
<xapp:select text="${query$}" >

</xapp:select>
(userid is the variable that contains my userid )
but I do not get a correct response
but if I give the exact query
<xapp:select text="/users/project/code[/users/userid=‘fsg’]>
I get the correct answer !
please help me !

hi,

fair question.
It seems ok to me, what you have implemented.
Unfortunately, you did not sent me, how the wrong response look like.

Is it possible to send me the page as an attachment? Though I can have a look on it.

Please include also both schemas, this will make it easier to test.

Bye
Thorsten