in my application i'm calling a method using actionListener="#{jobsController.addSequence}"
method and it is not working for some reason. And i can't see anything wrong with my code or with EL
because it works in other places that i have used.
This is the code that's not working.
<p:dialog header="Remove Job" modal="true" widgetVar="remJob" minHeight="40" width="45%">
<h:panelGroup styleClass="ContainerIndent" layout="block">
<h:form id="removeJobForm">
<h:panelGroup layout="block">
<p:pickList id="jobPickList" value="#{jobsController.removeJobs}" var="jobs" itemLabel="#{jobs}" itemValue="#{jobs}"/>
</h:panelGroup>
<h:panelGroup styleClass="Seperator" layout="block"/>
<h:panelGroup styleClass="Fright">
<table border="0">
<tr>
<td width="110px" align="right">
<p:commandButton value="Reset" update="removeJobForm" process="@this" style="width:100px">
<p:resetInput target="removeJobForm" />
</p:commandButton>
</td>
<td width="110px" align="right">
<p:commandButton value="Submit" style="width:100px" onclick="PF('remJob').hide()" actionListener="#{jobsController.removeJobs}"/>
</td>
</tr>
</table>
</h:panelGroup>
</h:form>
</h:panelGroup>
</p:dialog>
This a working code that i have used the above method
In this i have used this actionListener="#{jobsController.addSequence}
as i have used it in the above code. And this is working without a problem.
<p:dialog header="Create Sequence" modal="true" widgetVar="addSeq" minHeight="40" width="50%">
<h:panelGroup styleClass="ContainerIndent" layout="block">
<h:form id="createSeqForm">
<table border="0" width="100%">
<tr height="40px">
<td>
<h:panelGroup layout="block" styleClass="Fleft">
<h:outputText value="Source Rollback After"/>
</h:panelGroup>
<h:panelGroup layout="block" styleClass="Fright">
<h:outputText value=":"/>
</h:panelGroup>
</td>
<td>
<h:panelGroup layout="block" styleClass="Fright">
<p:inputText style="width:197px" value="#{jobsController.jobBean.seqBean.src_rollback_after}" onkeypress="return isNumberKey(event)"/>
</h:panelGroup>
</td>
</tr>
</table>
<h:panelGroup styleClass="Seperator" layout="block"/>
<h:panelGroup styleClass="Fright">
<table border="0">
<tr>
<td width="110px" align="right">
<!-- <p:growl id="growl" showDetail="true" sticky="true" autoUpdate="true" /> -->
<p:commandButton value="Reset" update="createSeqForm" process="@this" style="width:100px">
<p:resetInput target="createSeqForm" />
</p:commandButton>
</td>
<td width="110px" align="right">
<p:commandButton value="Submit" style="width:100px" update=":createJobForm:sequenceTable" onclick="PF('addSeq').hide()" actionListener="#{jobsController.addSequence}">
<p:resetInput target="createSeqForm" />
<!-- <p:ajax update=":createJobForm:sequenceTable" resetValues="true" /> -->
<!-- <p:poll id="poll" interval="5" update="growl" /> -->
</p:commandButton>
</td>
</tr>
</table>
</h:panelGroup>
</h:form>
</h:panelGroup>
</p:dialog>
Java method i'm trying to call
public DualListModel<String> getRemoveJobs(){
List<String> source = new ArrayList<String>();
List<String> target = new ArrayList<String>();
try {
rs = db.select("SELECT JOB_ID FROM IM_JOBS");
int count=0;
while (rs.next()) {
source.add(rs.getString("JOB_ID"));
System.out.println(count);
count++;
}
System.out.println("Removable Jobs Retrieved and added to the Source");
jobs = new DualListModel<String>(source, target);
} catch (SQLException e) {
e.printStackTrace();
}
return jobs;
}
PS : I couldn't find any errors. No Exceptions, no validation errors or anything out of ordinary.