Tôi có 2 menu thả xuống: Loại & Mã. Tôi muốn thả xuống Mã để thay đổi giá trị tùy thuộc vào menu thả xuống Loại nếu giá trị = A hoặc B hoặc C. Làm cách nào tôi có thể chuyển giá trị của A hoặc B hoặc C vào trình nghe để có thể hiểu và xử lý Danh sách của tôi?Cách chuyển giá trị vào Trình nghe trong selectOneMenu
<h:outputLabel value="Type" for="idType" />
<h:selectOneMenu id="idType" value="#{myController.type}">
<f:selectItem itemLabel="AAA" itemValue="AAA" />
<f:selectItem itemLabel="BBB" itemValue="BBB" />
<f:selectItem itemLabel="CCC" itemValue="CCC" />
<f:ajax event="valueChange" listener="#{myController.changeCodeList}" render="idCode" execute="@this" />
</h:selectOneMenu>
<h:outputLabel value="Code" for="idCode" />
<h:selectOneMenu id="idCode" value="#{myController.code}" >
<f:selectItem itemLabel="Select ..." noSelectionOption="true" />
<f:selectItems value="#{myController.codeList}" />
</h:selectOneMenu>
Ajax4jsf là một sublibrary của RichFaces với thẻ của 'thư viện '. Bạn dường như không sử dụng nó ở bất cứ đâu. Vui lòng không sử dụng thẻ '[ajax4jsf]' trên câu hỏi của bạn sau đó. –
BalusC