删除查询第一次未触发,第二次或第三次触发 [英] Delete query didn't fired on 1st time,it fired after 2nd or 3rd time

查看:111
本文介绍了删除查询第一次未触发,第二次或第三次触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我拥有的屏幕截图,我实现了工作单拒绝功能,现在当我单击十字按钮时,它会打开一个iframe,要求我输入一些备注,然后只需单击红色按钮,工作就会被拒绝,并且其状态也会相应更改. 一切工作正常,但是问题是,当我第一次执行此操作时,在检查日志后我发现查询没有被执行时,该更改未反映出来.

So here is the screen shot i have, i implemented workorder reject functionality, now when i click on cross button it open an iframe ask me to input some remark, and simply clicking on red button work orded rejected and its status changed accordingly. Everything is working fine, but the problem is when first time i performd this operation changes not reflected, after checking log i realized that query isn't fire.

第二次我再次执行相同操作时,它将删除工作单,再次检查日志时,将打印我的查询

when 2nd time i again performed the same, it deletes the workorder, when again checking log, so my query is printed

有时需要3次尝试才能删除记录. 我不知道这是JS问题吗?因为关闭iFrame并重定向到一个小时前实现的列表." 这是下面的源代码

sometimes it will take 3 attempt to delete the record. I can't figured out is this JS problem? because "closing an iFrame and redirect to the list I implemented an hour ago." here is the source code below

            <f:form action="${baseUrl}save_reject_status/${woSpIdEnc}" method="post" command="WorkOrderSp" id="workOrder" class="form-wizard validate" onsubmit="manageService()">



           <input type="hidden" name="woSpIdEnc"/>
            <div class="form-group"> 
                <label class="col-sm-2 control-label" for="field-5" style=" margin-top: 23px;">Remark<span style="color:#D50000">*</span></label> 
                <div class="col-sm-12"> 
                    <f:textarea path="rejectRemark" class="form-control autogrow" cols="5" id="field-5" required="required" placeholder="Let us know the reason behind rejection" style="margin-bottom:12px; height: 200px" />
                </div> 
                <div class="panel-footer" style="height:320px;">
                    <input type="submit" class="btn btn-danger pull-left no-margin" id="saveBtn" value="Reject Work Order" onclick="return confirm('Are you sure to Verify the Contractor.');">
                </div>

            </div>
        </f:form>

    <script>function manageService() {
            window.top.location.href = '../detail';
            parent.$.colorbox.close();
            return true;

        }
</script>

现在,它执行所有必需的操作,它会关闭iframe并同时将其降落在同一页面中..但不会在第一次删除工作单. 我再次表演相同,它的工作! 有时需要3个步骤才能达到相同目的. 我希望它能一次完成.

Now it perform all the required operation it closes the iframe as well as it also landing in the same page..but but workorder isn't deleted in first time. i am again performing the same and it worked!! sometimes it takes 3 steps to achieve the same. I want it to perform in the single shot.

推荐答案

有必要先发布表单请求.您可以尝试使用jquery

It is necessary first post the form request. You can try do this with jquery

<f:form action="${baseUrl}save_reject_status/${woSpIdEnc}" method="post" command="WorkOrderSp" id="workOrder" class="form-wizard validate" onsubmit="manageService(this);return false;">
    <!-- the form body -->
</f:form>

<script>
function manageService(form) {
  $(form).submit().success(function(){
    parent.$.colorbox.onClose = function(){window.top.location.href = '../detail';};
    parent.$.colorbox.close();
  });
}
</script>

这篇关于删除查询第一次未触发,第二次或第三次触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆