• Post Reply Bookmark Topic Watch Topic
  • New Topic

record lock when any of the form elements clicked to edit using jquery ajax call

 
rakhi grc
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm trying to lock the record when somebody starts editing the any element on a page. for this I'm using jquery ajax to call a lock method(methodname is lockSc) in some implementation class which locks particular record for 5 mins.

Previously record is used to lock whenevr page is loaded. Now it should lock the record only if the user starts editing the fields on the page.please give a jquery to call ajax when editing of the elements starts.

Below are some fields in the jsp

<tr>
<!-- sc status goes here -->
<td nowrap="nowrap" align="right" width="180">
<label for="scInfoForm.scStatus">SC Status:</label>
</td>
<td>
<s:textfield maxlength="10" size="10" name="scInfoForm.scStatusText" readonly="true" cssClass="readOnlyTextbox" cssStyle="width=100%" tabindex="-1" />
</td>
<td nowrap="nowrap" align="right" width="300">
<label for="scInfoForm.empId">Employee ID:</label>
</td>

<td>
<s:if test="%{eteamUser && !lockedByAnotherUser }">
<s:textfield maxlength="20" size="15" name="scInfoForm.empId" id="empId" onchange="checkDirty(true)" />
</s:if>
<s:else>
<s:textfield maxlength="20" size="15" name="scInfoForm.empId" id="empId" readonly="true" cssClass="readOnlyTextbox" tabindex="-1" />
</s:else>
</td>

</tr>
<tr>
<!-- sc status effective date goes here -->
<td nowrap="nowrap" align="right" width="180">
<label for="scInfoForm.effectiveDate" class="<s:property value='fmtDate'/>">SC Status Effective Date:</label>
</td>
<td >
<s:if test="%{eteamUser && !lockedByAnotherUser}">
<s:textfield name="scInfoForm.effectiveDate" id="effDate" cssStyle="width=96px" onchange="checkDirty(true)" />
</s:if>
<s:else>
<s:textfield maxlength="10" size="10" name="scInfoForm.effectiveDate" readonly="true" cssClass="readOnlyTextbox" tabindex="-1"/>
</s:else>
</td>

<td nowrap="nowrap" align="right" width="300">
<label for="scInfoForm.empIdAuNum">Accounting Unit:</label>
</td>

<td nowrap>
<s:if test="%{eteamUser && !lockedByAnotherUser }">
<s:textfield maxlength="7" size="3" name="scInfoForm.empIdAuNum" id="empIdAuNum" onchange="checkDirty(true)" />
</s:if>
<s:else>
<s:textfield maxlength="7" size="3" name="scInfoForm.empIdAuNum" id="empIdAuNum" readonly="true" cssClass="readOnlyTextbox" tabindex="-1" />
</s:else>
</td>
</tr>
<tr>
<!-- sc managed vendor goes here-->
<td nowrap="nowrap" align="right" width="180">
<label for="scInfoForm.managedVendor">SC Managed Vendor:</label>
</td>
<td >
<s:if test="%{eteamUser && !lockedByAnotherUser}">
<s:select name="scInfoForm.managedVendor" headerKey="1" headerValue="--SELECT--" list="scInfoForm.managedVendorList" listKey="id" listValue="description" cssStyle="width=96px" onchange="checkDirty(true)"/>
</s:if>
<s:else>
<s:textfield maxlength="10" size="10" name="scInfoForm.managedVendorText" readonly="true" cssClass="readOnlyTextbox" tabindex="-1" />
</s:else>
</td>


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!