PrimefacesJSFのドロップダウンボックスに値を設定しようとしています。データベースからデータが取得されているデータテーブルが1つあり、1つの行を選択したら、1つの列の値を確認し、それに応じてドロップダウンで値を設定する必要があります。ドロップボックスには2つの値があります。また、データベースから取得します。データテーブルの列の値に応じて1つの値を設定する必要があります。
データテーブルのコード
<p:dataTable var="patient" value="#{patientNotes.patientNote}"
scrollable="true" scrollHeight="262" rowKey="#{patient.id}"
styleClass="mygrid" paginator="true" rows="10"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
currentPageReportTemplate="(Displaying {startRecord} - {endRecord} of {totalRecords}, Page: {currentPage}/{totalPages})"
paginatorPosition="bottom" rowsPerPageTemplate="5,10,15"
selection="#{patientNotes.selectedNotes}" selectionMode="single">
<p:ajax event="rowSelect" listener="#{patientNotes.onRowSelect}" />
<p:column style="text-align: center" width="180">
<f:facet name="header">
<h:outputText value="Type" />
</f:facet>
<h:graphicImage value="../../images/dialog-warning.png" rendered="#{patient.warning == 'Y'}"/>
<h:graphicImage value ="../../images/alert.jpg" rendered="#{patient.alert == 'Y'}" />
<h:graphicImage value = "../../images/transaction_flat_16.gif" rendered="#{patient.creditControl == 'Y'}" />
</p:column>
<p:column headerText="Note" width="180">
<h:outputText value="#{patient.note}" ></h:outputText>
</p:column>
<p:column headerText="Created By" width="180">
<h:outputText value="#{patient.createdBy}"></h:outputText>
</p:column>
<p:column headerText="Date" width="180">
<h:outputText value="#{patient.date}"></h:outputText>
</p:column>
</p:dataTable>
ここで行を選択する際に、「Y」の場合は1つの変数アラートをチェックする必要があります。ドロップダウンボックスに設定する必要があります。アラートelse Admin ..これらの2つの値ALERTとAdminは、データベースからのドロップダウンボックスにあります。設定する必要があります。 。
ドロップダウンのコード
<h:panelGroup layout="block" class="inputContainer3" id="paneltype">
<span>Type: </span>
<h:selectOneMenu value="#{addNotes.typeSelection}" id="menutype">
<f:selectItem itemLabel=""
itemValue="1" />
<f:selectItems value="#{addNotes.selectedType}" />
</h:selectOneMenu>
</h:panelGroup>
私を助けてください、あなたがもっと多くのコードplzを私にさせないなら
前もって感謝します