On a Jsp page i am retriving list based on previous list selection for that used struts 2 url and struts dojo tag div
<s:url id="d_url" action="employDivisionAction"/>
<sx:div showLoadingText="false" id="details1" href="%{d_url}" theme="ajax" listenTopics="show_division" onchange="show_Department()" formId="frm_demo"/>
in the js file this function is called
function show_Department()
{
dojo.event.topic.publish("show_department");
}
everything works fine i am able to retrieve list but the problem arises when i try to use
<s:file/>
tag in the jsp. the ajax functionalty stops working when i include the above tag. Any idea why it is not working any guidance would be helpful.
The complete jsp code
<s:form name="employee" action="AddEmployee" method="POST" theme="css_xhtml" enctype="multipart/form-data" id="frm_demo" >
<table align="center" cellspacing="10px">
<tr>
<td align="left"> <s:text name="global.empno"/> </td>
<td align="left"> <s:textfield name="employeeNo" value="%{employee.employeeNo}" onkeypress="return inputLimiter(event,'NameCharactersAndNumbers')"/> </td>
<td align="left"> <s:text name="global.fnm"/> </td>
<td align="left"> <s:textfield name="firstName" value="%{employee.firstName}" onkeypress="return inputLimiter(event,'NameCharacters')"/> </td>
</tr>
<tr>
<td><s:file name="Image"/></td>
</tr>
<tr>
<td align="left"> <s:text name="Company"/> </td>
<td align="left"><s:select name="currentCompany" id="companyList" headerKey="" headerValue="Select" list="companyList" onchange="show_branch()"/></td>
<td align="left"> <s:text name="Branch"/> </td>
<td align="left">
<div ><s:fielderror fieldName="branchName" /></div>
<s:url id="d_url" action="employBranchAction"/>
<sx:div showLoadingText="false" name="branchDiv" id="details" href="%{d_url}" theme="ajax" listenTopics="show_branch" onchange="show_division()" formId="frm_demo"/>
</td>
</tr>
<tr>
<td align="left"> <s:text name="Division"/> </td>
<td align="left">
<div ><s:fielderror fieldName="divisionName" /></div>
<s:url id="d_url" action="employDivisionAction"/>
<sx:div showLoadingText="false" id="details1" href="%{d_url}" theme="ajax" listenTopics="show_division" onchange="show_Department()" formId="frm_demo"/>
</td>
<td align="left"> <s:text name="Department"/> </td>
<td align="left">
<div><s:fielderror fieldName="departmentName" /></div>
<s:url id="d_url" action="employDepartmentAction"/>
<sx:div showLoadingText="false" id="details2" href="%{d_url}" theme="ajax" listenTopics="show_department" onchange="show_Section()" formId="frm_demo"/>
</td>
</tr>
<tr>
<td align="left"> <s:text name="Section"/> </td>
<td align="left">
<div><s:fielderror fieldName="sectionName" /></div>
<s:url id="d_url" action="employSectionAction"/>
<sx:div showLoadingText="false" id="details3" href="%{d_url}" theme="ajax" listenTopics="show_section" onchange="show_Unit()" formId="frm_demo"/>
</td>
<td align="left"> <s:text name="Unit"/> </td>
<td align="left">
<div ><s:fielderror fieldName="unitName" /></div>
<s:url id="d_url" action="employUnitAction"/>
<sx:div showLoadingText="false" id="details4" href="%{d_url}" theme="ajax" listenTopics="show_unit" onchange="show_Position()" formId="frm_demo"/>
</td>
</tr>
<tr>
<td align="left"> <s:label value="Position"/> </td>
<td align="left">
<div><s:fielderror fieldName="positionName" /></div>
<s:url id="d_url" action="employPositionAction"/>
<sx:div showLoadingText="false" id="details5" href="%{d_url}" theme="ajax" listenTopics="show_position" formId="frm_demo"/>
</td>
</tr>
</table>
<s:set name="webFramework" value="%{employee.employeeID}"/>
<table align="center" cellspacing="20px">
<tr>
<s:if test="#webFramework==0">
<td align="left"> <s:submit value="Add" cssClass="buttonSmall" onclick="return validateEmployee();"/> </td>
</s:if>
<s:if test="#webFramework>0">
<td align="left"> <s:submit name="update" cssClass="buttonSmall" value="Update"/> </td>
</s:if>
</tr>
</table>
</s:form>