aspose file tools
The moose likes Struts and the fly likes how to pass the IndexId in apply button Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "how to pass the IndexId in apply button" Watch "how to pass the IndexId in apply button" New topic
Author

how to pass the IndexId in apply button

subhani sayyad
Greenhorn

Joined: Jun 01, 2012
Posts: 2
Hi,
By clicking on "search" button i am displaying the records in table. now i added one "checkbox" for each row in a table. now i want to pass the each row values when i select corresponding "checkbox" in a table.
after clicking the "apply" button values values should pass next page.

Problem : I am not able to pass the IndexId in my apply button.
could you please suggest me how to pass..

here is my jsp and js code :

var dialogArguments = new Array();
var dialogUrl ="";
function showContent(encounterId,patientId,locationCode,patientClass,room,bed,locationType,dateOfBirth,gender){

var facility=document.getElementById("vo.addedFacilityId").value
dialogArguments[0]="<%=request.getContextPath()%>/PlaceDietOrderAction.do?method=1&encounterId="+encounterId+"&patientId="+patientId+"&locationCode="+locationCode+"&patientClass="+patientClass+"&vo.locationType="+locationType

dialogUrl = contextPath + "/eDS/PlaceDietOrder/jsp/PlaceDietOrderDSMain.jsp?&patientId="+patientId+"&encounterId="+encounterId+"&bed="+bed+"&room="+room+"&locationCode="+locationCode+"&dateOfBirth="+dateOfBirth+"&gender="+gender;
var pArgumentArrayMap = "facility="+facility+",nursing_unit="+locationCode;
var firstTime = true;
pArgumentArrayMap += ",searchText=**";
DWREngine.setAsync(false);
DynaLookup.doLookup("ehis.ds.lookupDsWardsForKitchen", pArgumentArrayMap, "true", lookupca);
DWREngine.setAsync(true);
}

function lookupca(obj)
{
var flag = false;
for (key in obj) {
flag = true;
}
if(flag)
{
var dialogFeatures = "dialogHeight:" + 80 + "; dialogWidth:" + 80 + "; scroll:no; status:no;";
var returnVal = window.showModalDialog(dialogUrl, dialogArguments,dialogFeatures);

//var returnVal = window.open(dialogUrl);


}
else
{
alert("Kichen is not assigned for this Nursing Unit")
}
}

function apply(encounterId,patientId,locationCode,patientClass,room,bed,locationType,dateOfBirth,gender)
{
alert("apply started");
var facility=document.getElementById("vo.addedFacilityId").value
dialogArguments[0]="<%=request.getContextPath()%>/PlaceDietOrderAction.do?method=1&encounterId="+encounterId+"&patientId="+patientId+"&locationCode="+locationCode+"&patientClass="+patientClass+"&vo.locationType="+locationType

dialogUrl = contextPath + "/eDS/PlaceDietOrder/jsp/PlaceDietOrderDSMain.jsp?&patientId="+patientId+"&encounterId="+encounterId+"&bed="+bed+"&room="+room+"&locationCode="+locationCode+"&dateOfBirth="+dateOfBirth+"&gender="+gender;
var pArgumentArrayMap = "facility="+facility+",nursing_unit="+locationCode;
var firstTime = true;
pArgumentArrayMap += ",searchText=**";
DWREngine.setAsync(false);
DynaLookup.doLookup("ehis.ds.lookupDsWardsForKitchen", pArgumentArrayMap, "true", lookupca);
DWREngine.setAsync(true);
}


--></script>
</head>
<body OnMouseDown="CodeArrest()" onKeyDown="lockKey()">
<ibaHTMLEl:form action="/WorkListPageAction.do">
<table border="1" cellpadding="1" cellspacing="0" width="100%" align="center">
<tr>
<td colspan="9" align="right" class="white">
<ibaLogic:equal name="PageForm" property="vo.page.nextPage" value="true">
<a href="javascript:doNext()">
<ibaBean:message key="com.iba.ehis.ds.next" bundle="dsLabels" />
</a>
</ibaLogic:equal>
<ibaLogic:equal name="PageForm" property="vo.page.previousPage" value="true">
<a href="javascript:doPrev()">
<ibaBean:message key="com.iba.ehis.ds.previous" bundle="dsLabels" />
</a>
</ibaLogic:equal>
</td>

</tr>
<ibaLogic:equal name="PageForm" value="0" property="vo.dataObjectsSize">
<script type="text/javascript">
alert("<ibaBean:message key='com.iba.ehis.ds.noRecord' bundle='commonMesages' />");
//parent.content.location.href=contextPath+"/WorkListPageAction.do?method="+queryMethod+"&vo.functionId="+'<%=request.getParameter("vo.functionId")%>'
</script>
</ibaLogic:equal>
<tr>
<th>
<ibaBean:message key="com.iba.ehis.ds.placeDietOrder.admDate" bundle="dsLabels" />
</th>
<TH>
<ibaBean:message key="com.iba.ehis.ds.placeDietOrder.encounter" bundle="dsLabels" />
</TH>
<TH>
<ibaBean:message key="com.iba.ehis.ds.placeDietOrderItem.patientID" bundle="dsLabels" />
</TH>
<TH>
<ibaBean:message key="com.iba.ehis.ds.mealPreparedServedComplaints.PatientName" bundle="dsLabels" />
</TH>
<TH>
<ibaBean:message key="com.iba.ehis.ds.placeDietOrderItem.gender" bundle="dsLabels" />
</TH>
<TH>
<ibaBean:message key="com.iba.ehis.ds.placeDietOrder.location" bundle="dsLabels" />
</TH>
<TH>
<ibaBean:message key="com.iba.ehis.ds.placeDietOrder.bed" bundle="dsLabels" />
</TH>
<TH>
<ibaBean:message key="com.iba.ehis.ds.placeDietOrder.room" bundle="dsLabels" />
</TH>
<TH>
<ibaBean:message key="com.iba.ehis.ds.placeDietOrder.multiP" bundle="dsLabels" />
</TH>
</tr>
<ibaLogic:iterate id="result" name="PageForm" property="vo.dataObjects" indexId="rowId">
<%
style = (rowId.intValue() % 2 == 0) ? "QRYEVEN" : "QRYODD";
int date_Id=rowId.intValue()+5000;

// out.println("date_Id="+date_Id);
%>
<tr>
<td class="<%=style %>">
<input type="hidden" name='admDate_<%=rowId%>' value='<ibaBean:write name="result" property="admDate" bundle="dsLabels"/>' />
<!-- <ibaBean:write name="result" property="admDate" bundle="dsLabels" /> -->
<input type="text" name='admDate_<%=date_Id%>' value=" " style="background:transparent;border=0;" readonly/>
</td>

<script>
var date=document.getElementById("admDate_<%=rowId%>").value

// alert("<%=locale%>")
//alert("beforecon="+date)

IBADateValidator.convertDateJS(date,"en","<%=locale%>","dd/MM/yyyy HH:mm",callBackDate);
function callBackDate(conDate){
//alert("afterconvertedDate="+conDate)
document.getElementById("admDate_<%=date_Id%>").value=conDate;
}
</script>

<td class="<%=style %>">
<ibaBean:write name="result" property="encounterId" bundle="dsLabels" />
<input type="hidden" name="encounterId" value='<ibaBean:write name="result" property="encounterId" bundle="dsLabels"/>' />
</td>
<td class="<%=style %>">
<a
href="javascript:showContent('<ibaBean:write name="result" property="encounterId" bundle="dsLabels" />','<ibaBean:write name="result" property="patientId" />','<ibaBean:write name="result" property="locationCode"/>','<ibaBean:write name="result" property="amPatientClass"/>','<ibaBean:write name="result" property="room"/>','<ibaBean:write name="result" property="bed"/>','<ibaBean:write name="result" property="locationType" />','<ibaBean:write name="result" property="dateOfBirth" bundle="dsLabels" />','<ibaBean:write name="result" property="gender" />')">

<ibaBean:write name="result" property="patientId" /> </a>
<input type="hidden" name="patientId" value='<ibaBean:write name="result" property="patientId" />' />

</td>
<td class="<%=style %>">
<!-- <ibaBean:write name="result" property="dateOfBirth" bundle="dsLabels" /> -->
<ibaBean:write name="result" property="patientName" />
</td>
<td class="<%=style %>">
<ibaBean:write name="result" property="gender" />
</td>
<td class="<%=style %>">
<ibaBean:write name="result" property="locationDecr" />
<input type="hidden" name="locationCode" value='<ibaBean:write name="result" property="locationCode" />' />
</td>
<td class="<%=style %>">
<ibaBean:write name="result" property="bed" />
<input type="hidden" name="bed" value='<ibaBean:write name="result" property="bed" />' />
</td>
<td class="<%=style %>">
<ibaBean:write name="result" property="room" />
<input type="hidden" name="room" value='<ibaBean:write name="result" property="room" />' />
<input type="hidden" name="dateOfBirth<%=rowId%>" value='<ibaBean:write name="result" property="dateOfBirth" bundle="dsLabels" />' />

</td>

<td class="<%=style %>">

<input type="checkbox" name="check" value='<%=rowId%>'/>
</td>

</tr>
</ibaLogic:iterate>

<td align="right" colspan="9">
<input type="button" name="button" value="<ibaBean:message key="com.iba.ehis.ds.apply" bundle="dsLabels" />" class="button" onclick="apply('<ibaBean:write name="result" property="encounterId" bundle="dsLabels" />','<ibaBean:write name="result" property="patientId" />','<ibaBean:write name="result" property="locationCode"/>','<ibaBean:write name="result" property="amPatientClass"/>','<ibaBean:write name="result" property="room"/>','<ibaBean:write name="result" property="bed"/>','<ibaBean:write name="result" property="locationType" />','<ibaBean:write name="result" property="dateOfBirth" bundle="dsLabels" />','<ibaBean:write name="result" property="gender" />')"/>
</td>

</table>




<ibaHTML:hidden property="vo.page.pageNo" />
<ibaHTML:hidden property="method" value="4" />

<ibaLogicEl:iterate id="result" name="PageForm" property="vo.criteriaVo.criteriaItems" indexId="ind">
<%
String itemValProp = "vo.criteriaVo.criteriaItems[" + ind + "].itemValue";
String prop = "vo.criteriaVo.criteriaItems[" + ind + "].property";
%>
<ibaHTMLEl:hidden property="<%=itemValProp%>" />
<ibaHTMLEl:hidden property="<%=prop%>" />
</ibaLogicEl:iterate>
<ibaHTML:hidden property="vo.criteriaVo.orderBySelected.itemValue" />
<ibaHTML:hidden property="vo.functionId" />
<ibaHTML:hidden property="vo.moduleId" />
<ibaHTML:hidden property="vo.criteriaVo.queryResultPage" />
<ibaHTML:hidden property="vo.addedFacilityId" />
<input type="hidden" name="locale1" value="<%=locale%>" />
</ibaHTMLEl:form>
</body>
subhani sayyad
Greenhorn

Joined: Jun 01, 2012
Posts: 2
this is issue is not solved yet...please suggest me on this
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to pass the IndexId in apply button
 
Similar Threads
how to do validation in struts1
Is it possible to call a servlet function using JavaScript?
using ajax and struts iterate tags
How to display error message
Struts2 variable inside javascript