Hi,

 

I have a tacos PartialForm and a tacos PartialLink.  When a user clicks
on the link a javascript call first checks to see if anything in the
form has changed.  If so, the form is submitted.  The links onClick then
continues.

 

My problem is that I need the form to finish submitting before the links
listener is called.  Can anyone tell me how to fix this?  Is it as
simple as changing a default attribute?

 

A bit of html...

The form:

<form id="editItemDetailsForm"
jwcid="[EMAIL PROTECTED]:PartialForm"
listener="ognl:listeners.saveButtonListener">

 

The link:

<a jwcid="@tacos:PartialLink"
listener="ognl:listeners.itemDetailsListener"
onclickMethod="taskPaneShowDirtyItemAlert"
refreshParts="ognl:{'menuBar','toolBar'}">

            <span key="itemDetails.label">Item Details</span>

</a>

 

The javascript:

function taskPaneShowDirtyItemAlert(a, refreshParts) {

            showDirtyItemAlert(a);

            return new PartRequest(a.href, refreshParts);

}

 

 

function showDirtyItemAlert(tableRow) {

            var dirtyItemFlag =
document.getElementById("dirtyItemFlag").innerHTML;

            var dirty = (dirtyItemFlag == "true");

                        

            if (dirty) {

                        var confirmed = confirm("${dirtyMessage}");

                        if (confirmed == false) {

                                    cleanItem();

                                    dirtyItemListener("discard");

                        } else {

 
document.getElementById("editItemDetailsForm").onsubmit();

                        }

            }

            return dirty;

}

 

 

Thanks,

Rob.

Reply via email to