Here is the code in my View, I have a dropdown list and basically what i want is that when i click on any item on this list I get the value of the item and it complete the input in the name field.
I managed to do this on JS with a button that load the input but the pb is that it's in Ajax and to be honest I am knew to this and I don't really understand how to make it functional. Should I do it using basic JS ?
<h:outputText value="Name" styleClass="section-label"/>
<h:inputText id="name" value="#{contextSchemeDetailBean.contextScheme.schemeName}"
required="true" maxlength="255"
requiredMessage="Please fill out 'Name' field."
label="Name" styleClass="section-content input-section">
<f:validateLength maximum="255"/>
</h:inputText>
<h:outputText value="Code List" styleClass="section-label"/>
<p:autoComplete id="inputCodeList" required="true"
requiredMessage="Please fill out 'Code List' field."
styleClass="section-content input-section"
completeMethod="#{codeListBean.completeInput}"
dropdown="true" scrollHeight="220">
<p:ajax event="itemSelect" listener="#{codeListBaseBean.codeList.guid}"/>
</p:autoComplete>
I dont know if I am really clear, if not dont hesitate to ask. Thanks !!