Hallo zusammen,
ich bin gerade dabei eine XPage für das Helpdesk-System zu entwickeln.
Hierbei habe ich vor eine Datenbank für 3 Abteilungen zu hinterlegen.
Je nachdem welche Abteilung gewählt wird, soll das nächste Feld aktualisiert werden.
Zudem muss die ReqNumber bei wechsel der Abteilung ebenfalls angepasst werden: <ABTEILUNG>-ReqNumber
Darüber filtere ich dann die entsprechenden Datensätze in der View.
Kann mir vllt. jemand behilflich sein.
Hier ist der Code der xpage:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xe="http://www.ibm.com/xsp/coreex">
<xp:this.data>
<xp:dominoDocument var="xpsDominoDocument" formName="fNewTicketWeb" action="editDocument">
</xp:dominoDocument>
</xp:this.data>
<xp:span style="font-size:14pt"></xp:span><xp:this.data>
<xp:dominoDocument var="xpsDominoDocument" formName="fNewTicketWeb" action="editDocument">
</xp:dominoDocument>
</xp:this.data><xp:span style="font-size:14pt"></xp:span>
<xp:panel>
<xp:this.rendered><![CDATA[#{javascript:if(xpsDominoDocument.isEditable())
{
return true;
}
else
{
return false;
}}]]></xp:this.rendered>
<xp:span style="font-size:14pt">Neues Ticket erstellen</xp:span>
</xp:panel>
<xp:panel>
<xp:this.rendered><![CDATA[#{javascript:if(xpsDominoDocument.isEditable())
{
return false;
}
else
{
return true;
}}]]></xp:this.rendered>
<xp:span style="font-size:14pt">Ticket lesen</xp:span></xp:panel>
<xp:br></xp:br>
<xp:panel>
Speichern 
<xp:inputText id="tx_Speichern" defaultValue="0"></xp:inputText>
| Support-ID: 
<xp:inputText id="tmp_ReqNumber"
value="#{xpsDominoDocument.tmp_ReqNumber}">
<xp:this.defaultValue><![CDATA[#{javascript:session.evaluate("@Unique");}]]></xp:this.defaultValue>
</xp:inputText>
</xp:panel>
<xp:br style="font-size:14pt"></xp:br> <xp:table style="width:598.0px">
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold">Name</xp:td>
<xp:td style="width:310.0px">
<xp:inputText id="strName"
value="#{xpsDominoDocument.tx_Ansprechpartner}">
<xp:this.defaultValue><![CDATA[#{javascript:@Name("[CN]", session.getEffectiveUserName())}]]></xp:this.defaultValue>
</xp:inputText>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold">Abteilung</xp:td>
<xp:td style="width:310.0px">
<xp:inputText id="strAbteilung"
value="#{xpsDominoDocument.tx_Abteilung}" disabled="true">
<xp:this.defaultValue><![CDATA[#{javascript:User = @Name("[CN]", session.getEffectiveUserName());
db = new Array('maria_notes','names.nsf');
var keys = @DbLookup(db,'(v_departments)', User, 2);
if (!keys)
{
return 'no result';
}
else
{
return keys;
}}]]></xp:this.defaultValue>
</xp:inputText>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold">Telefon</xp:td>
<xp:td style="width:310.0px">
<xp:inputText id="strTelefon"
value="#{xpsDominoDocument.tx_telefon}" disabled="true">
<xp:this.defaultValue><![CDATA[#{javascript:User = @Name("[CN]", session.getEffectiveUserName());
db = new Array('maria_notes','names.nsf');
var keys = @DbLookup(db,'(v_departments)', User, "OfficePhoneNumber");
if (!keys)
{
return 'no result';
}
else
{
return keys;
}}]]></xp:this.defaultValue></xp:inputText>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold"></xp:td>
<xp:td style="width:310.0px"></xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:200px;font-weight:bold">Ticket für</xp:td>
<xp:td style="width:310.0px">
<xp:comboBox id="cb_TicketFuer"
value="#{xpsDominoDocument.tx_TicketFuer}">
<xp:selectItem itemLabel="-Bitte wählen Sie-"
itemValue="0" id="selectItem1">
</xp:selectItem>
<xp:selectItem itemLabel="IT-Abteilung"
itemValue="IT" id="selectItem2">
</xp:selectItem>
<xp:selectItem itemLabel="Medizintechnik"
itemValue="MT" id="selectItem3">
</xp:selectItem>
<xp:selectItem itemLabel="Technische Abteilung"
itemValue="TA" id="selectItem4">
</xp:selectItem>
<xp:eventHandler event="onchange" submit="true"
refreshMode="complete" id="eventHandler1">
</xp:eventHandler>
</xp:comboBox>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold">Problemtyp</xp:td>
<xp:td style="width:310.0px">
<xp:comboBox id="cb_TicketTyp"
value="#{xpsDominoDocument.tx_TicketType}">
<xp:selectItems id="selectItems1">
<xp:this.value><![CDATA[#{javascript:var element = getComponent('cb_TicketFuer');
@DbLookup(@DbName(), "vParameter", "Anfrageart_"+element.value, 2); }]]></xp:this.value>
</xp:selectItems>
<xp:eventHandler event="onchange" submit="true"
refreshMode="partial" refreshId="cb_Application">
</xp:eventHandler></xp:comboBox>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold">
<xp:panel>
Was funktioniert nicht mehr
<xp:this.rendered><![CDATA[#{javascript:var element = getComponent('cb_TicketFuer');
if (element.value != "MT")
{
return true;
}
else
{
return false;
}}]]></xp:this.rendered>
</xp:panel>
</xp:td>
<xp:td style="width:310.0px">
<xp:panel>
<xp:this.rendered><![CDATA[#{javascript:var element = getComponent('cb_TicketFuer');
if (element.value != "MT")
{
return true;
}
else
{
return false;
}}]]></xp:this.rendered>
<xp:comboBox id="cb_Application"
value="#{xpsDominoDocument.tx_Application}">
<xp:selectItems id="selectItems2">
<xp:this.value><![CDATA[#{javascript:var element = getComponent('cb_TicketFuer');
@DbLookup(@DbName(), "vParameter", "System_"+element.value, 2); }]]></xp:this.value>
</xp:selectItems>
</xp:comboBox>
</xp:panel></xp:td>
</xp:tr>
<xp:tr>
<xp:td style="font-weight:bold">
<xp:panel>
MPG-Nummer
<xp:this.rendered><![CDATA[#{javascript:var element = getComponent('cb_TicketFuer');
if (element.value != "MT")
{
return false;
}
else
{
return true;
}}]]></xp:this.rendered><xp:br></xp:br>Type (MPG)</xp:panel></xp:td>
<xp:td>
<xp:panel>
<xp:inputText id="str_MPG"
value="#{xpsDominoDocument.tx_MPG}">
<xp:this.rendered><![CDATA[#{javascript:var element = getComponent('cb_TicketFuer');
if (element.value != "MT")
{
return false;
}
else
{
return true;
}}]]></xp:this.rendered>
<xp:this.validators>
<xp:validateLength
message="Die MPG Nummer ist einzugeben!" minimum="1"
maximum="5">
</xp:validateLength>
</xp:this.validators></xp:inputText>
<xp:this.rendered><![CDATA[#{javascript:var element = getComponent('cb_TicketFuer');
if (element.value != "MT")
{
return false;
}
else
{
return true;
}}]]></xp:this.rendered>
<xp:br></xp:br>
<xp:inputText id="str_TypeMPG"></xp:inputText>
</xp:panel>
</xp:td>
</xp:tr>
<xp:tr><xp:td style="width:167.0px;font-weight:bold"></xp:td>
<xp:td style="width:310.0px"></xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold">Ticket-ID:</xp:td>
<xp:td style="width:310.0px">
<xp:inputText id="tx_ReqNumber"
value="#{xpsDominoDocument.ReqNumber}">
<xp:this.defaultValue><![CDATA[#{javascript:var element = getComponent('cb_TicketFuer');
var element2 = getComponent('tmp_ReqNumber');
element.value+"-"+element2.value}]]></xp:this.defaultValue></xp:inputText>
<xp:button value="Beschriftung" id="button1">
</xp:button></xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold">Problemmeldung</xp:td>
<xp:td style="width:310.0px">
<xp:inputTextarea id="str_Problem" cols="50" rows="10"
value="#{xpsDominoDocument.Body}" style="font-family:Arial,sans-serif;font-size:9pt;color:rgb(0,0,0)">
</xp:inputTextarea>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold">
<xp:panel>
Dateianhang wählen
<xp:this.rendered><![CDATA[#{javascript:if(xpsDominoDocument.isEditable())
{
return true;
}
else
{
return false;
}}]]></xp:this.rendered>
</xp:panel>
</xp:td>
<xp:td style="width:310.0px">
<xp:fileUpload id="fu_File"
value="#{xpsDominoDocument.tx_datei}">
</xp:fileUpload>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold"></xp:td>
<xp:td style="width:310.0px"></xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold">
<xp:panel>Dateianhang ansehen</xp:panel>
</xp:td>
<xp:td style="width:310.0px">
<xp:fileDownload rows="30" id="fileDownload1" displayLastModified="false" displayCreated="false" style="width:100%" value="#{xpsDominoDocument.tx_datei}" hideWhen="true"></xp:fileDownload></xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold"></xp:td>
<xp:td style="width:310.0px"></xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold">
<xp:panel>
Wer bearbeitet das Ticket
<xp:this.rendered><![CDATA[#{javascript:var v:Array = database.queryAccessRoles(session.getEffectiveUserName());
@IsMember("[Zentral]", v)}]]></xp:this.rendered>
</xp:panel></xp:td>
<xp:td style="width:310.0px">
<xp:panel>
<xp:this.rendered><![CDATA[#{javascript:var element = getComponent('cb_Supporter');var v:Array = database.queryAccessRoles(session.getEffectiveUserName());
@IsMember("[Zentral]", v)}]]></xp:this.rendered>
<xp:comboBox id="cb_Supporter"
value="#{xpsDominoDocument.tx_Bearbeiter}">
<xp:selectItems id="selectItems3">
<xp:this.value><![CDATA[#{javascript:var element = getComponent('cb_TicketFuer');
@DbLookup(@DbName(), "vParameter", "Supporter_"+element.value, 2); }]]></xp:this.value>
</xp:selectItems>
</xp:comboBox>
</xp:panel></xp:td>
</xp:tr>
<xp:tr>
<xp:td style="width:167.0px;font-weight:bold">
<xp:panel>
Status des Tickets
<xp:this.rendered><![CDATA[#{javascript:var v:Array = database.queryAccessRoles(session.getEffectiveUserName());
@IsMember("[Zentral]", v)}]]></xp:this.rendered>
</xp:panel></xp:td>
<xp:td style="width:310.0px">
<xp:panel>
<xp:this.rendered><![CDATA[#{javascript:var v:Array = database.queryAccessRoles(session.getEffectiveUserName());
@IsMember("[Zentral]", v)}]]></xp:this.rendered>
<xp:checkBoxGroup id="cb_Status" layout="pageDirection"
readonly="true" value="#{xpsDominoDocument.tx_Status}">
<xp:selectItem itemLabel="Eingegangen" itemValue="0"
id="selectItem5">
</xp:selectItem>
<xp:selectItem
itemLabel="Angenommen druch Supporter" itemValue="1"
id="selectItem6">
</xp:selectItem>
<xp:selectItem
itemLabel="In Bearbeitung durch Supporter" itemValue="2"
id="selectItem7">
</xp:selectItem>
<xp:selectItem itemLabel="Rückfrage" itemValue="3"
id="selectItem8">
</xp:selectItem>
<xp:selectItem itemLabel="Abgeschlossen"
itemValue="99" id="selectItem9">
</xp:selectItem>
</xp:checkBoxGroup>
</xp:panel></xp:td>
</xp:tr>
<xp:tr>
<xp:td style="font-weight:bold"></xp:td>
<xp:td></xp:td>
</xp:tr>
<xp:tr>
<xp:td style="font-weight:bold"></xp:td>
<xp:td>
<xp:button value="Speichern" id="btnSave">
<xp:this.rendered><![CDATA[#{javascript:if(xpsDominoDocument.isEditable())
{
return true;
}
else
{
return false;
}}]]></xp:this.rendered><xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<xp:actionGroup>
<xp:modifyField name="tx_Speichern"
value="1">
</xp:modifyField>
<xp:saveDocument></xp:saveDocument>
<xp:openPage name="/xpThanks.xsp"></xp:openPage>
</xp:actionGroup>
</xp:this.action></xp:eventHandler></xp:button>
</xp:td>
</xp:tr>
</xp:table>
</xp:view>
Vielen Dank im Voraus!