У меня есть форма для ввода информации, включая 3 поля
- имя пользователя текстового поля (Requiere = true)
- Название банка в выпадающем списке (реквиер = true)
- Отделения банка Combobox (Requiere = true)
Я хочу, чтобы, когда пользователь выбирал банк, отделение банка загружалось без заполнения формы (конкретному пользователю не нужно заполнять текстовое поле: «имя пользователя»)
Например: моя форма xhmtl
<h:form id="ftextform">
<s:validateAll id="ValidateAll">
<fieldset>
<div class="entry">
<h:outputLabel for="name" styleClass="label #{invalid?'errors':''}">name<em>*</em></h:outputLabel>
<h:inputText id="name" value="#{branch.name}" required="true" />
</div>
<div class="entry">
<h:selectOneMenu id="creditBank" value="#{branch.creditBank}" immediate="true">
<f:selectItems value="#{fExtBankList}"></f:selectItems>
<a:support id="onkeyup" event="onchange" actionListener="#{branch.creditBankchange}" reRender="searchResults"/>
</h:selectOneMenu>
</div>
<a:outputPanel id="searchResults">
<div class="entry">
<h:selectOneMenu id="creditBankBranch" value="#{branch.creditBankBranch}">
<f:selectItems value="#{branch.creditBankBranchList}"></f:selectItems>
</h:selectOneMenu>
</div>
</a:outputPanel>
</fieldset>
<fieldset>
<div class="buttonBox">
<h:commandButton id="check" value="Cancel" action="#{branch.cancel}" immediate="true"/>
 
<h:commandButton id="next" value="Next" action="#{branch.next}"/>
</div>
</fieldset>
</s:validateAll>
</h:form>
мой боб:
@Name("branch")
public class Branch implements IBranch
{
private static int count = 0;
private String creditBank;
private String creditBankBranch = "aaa";
private String name;
private List<SelectItem> creditBankBranchList = new ArrayList<SelectItem>();
// action
public void creditBankchange()
{
SelectItem e = new SelectItem(creditBank + count, creditBank);
creditBankBranchList.add(e);
}
....