PDA

View Full Version : How to set the value of a hidden variable present in contents(jsp) of ext js window?



50120C1288
2 May 2011, 1:41 AM
I have the following ext js window that i display:

Js file :

function showEFormDialog(htmlData) {
var eformDialog;
colCount = 0;
var mainString = htmlData.toString();
if(mainString.indexOf("serviceTypeWithEform")!= -1)
{

eformDialog = new Ext.Window({
title: "EForm",
width:1000,
autoHeight: true,
html: htmlData,
y: 150,
listeners: {
beforeclose: function () {
eformVisible = false;
}
},
buttons: [
{
id:'Prev', text:'Prev', handler: function() {
showNextPrevEFormPage('PREV');
}
},
{
text:'Next', handler: function() {
showNextPrevEFormPage('NEXT');
}
},
{
text:'Save', handler: function() {
saveEform();
pageNumber=0;
eformDialog.hide();
eformVisible = false;
}
}
]
});
}
else
{
eformDialog = new Ext.Window({
title: "EForm",
width:400,
autoHeight: true,
html: htmlData,
y: 150,
listeners: {
beforeclose: function () {
eformVisible = false;
}
}
});

}
alert("pageNumber is"+pageNumber);
eformDialog.show(this);
document.requestSubmissionEform.counter.value = pageNumber;
$('#Prev').attr('disabled', 'disabled');
}

I want to set the value of the counter variable which is a hidden variable in jsp.
The eformDialog window shows the following jsp:
jsp file:

<%@include file="/WEB-INF/jsp/include/pagedirectives.jsp"%>

<div style="background: #D6E8FF; padding: 10px;" class="advanced_search">
<%@include file="/WEB-INF/jsp/include/page.topmessagebox.jsp"%>
<script type="text/javascript">
var navigationId;
</script>
<table class="form" cellspacing="0" id="requestSubmissionEform" name="requestSubmissionEform">
<tbody>
<input type ="hidden" id="counter" name="counter" value=""></input>

<c:forEach items="${eformDetailsList}" var="eformDetails" varStatus="status">

<tr id="serviceTypeWithEform">
<td class="label"><label for="${eformDetails.id}_0"><c:out value="${eformDetails.label}" /></label>
<input type="hidden" id="label_${eformDetails.id}_0" value="${eformDetails.label}" name="label_0"></input>
<input type="hidden" id="index_${eformDetails.id}_0" value="${eformDetails.id}" name="index_0"></input>

</td>

<%for(int i=0;i<5;i++)
{%>
<c:if test="${eformDetails.controlType==1}">
<td id="Col<%=i%>" style="visibility: visible;">
<input id="eformDetail_${eformDetails.id}_<%=i%>" class="eformDetail" type="text" value="" name="form_<%=i%>"></input>

</td>

</c:if>
<%}%>
</tr>

</c:forEach>
<c:if test="${empty eformDetailsList}">
<tr id="serviceTypeWithNoEform">
<td><b>There is no eform associated with this Service Type</b></td>
</tr>
</c:if>

</tbody>
</table>

How can i set the value of the hidden counter variable before i show the window?

pmatsumura
2 May 2011, 1:49 AM
Please read the Forum Help Guidelines (http://www.sencha.com/learn/Ext_Forum_Help). Help us help you and format your code. Thank you.

friend
2 May 2011, 6:27 AM
Two Thumbs up on the code tag recommendation...



Ext.get('hiddenFieldsUniqueID').value = 'someValue'