Accessing JADE attribute from JavaScript function

For questions and postings not covered by the other forums
Posts: 1
Joined: Fri Feb 12, 2016 1:49 am

Accessing JADE attribute from JavaScript function

Postby LAshikoto » Fri Feb 12, 2016 5:18 pm


I have a button (StaffCareWeb::WunitSchedules::btnSave) that once clicked it saves the rota. However, before the JADE save method (handleSave) is called, there is a JS function checkSaveVersion that is first called and is linked to btnSave, onClick function. In this JS function, it checks whether the version of the rota is 0. In the case that it is, it displays a warning message and the user can either click “OK” to proceed saving or “CANCEL” to abort the save process.

In the JADE class StaffCareWeb::WunitSchedules I have created a Boolean attribute allowSave. I would then like to set this attribute from the JS function, depending on the button that is clicked. If the “OK” button is clicked, it should set the value to true, if “CANCEL” is clicked, it should set it to false. Once this attribute has been set from the JS function, the method StaffCareWeb::WunitSchedules::btnSave_click() will then check whether it should call the StaffCareWeb::WunitSchedules:: handleSave() method or not.

I have attached the following methods:

-This method contains the JS with the function checkSaveVersion (line26 – 51)

-This method is the one called after the JS function has been executed. It is the one where the allowSave attribute is checked to see whether the save should be performed or not.

StaffCareWeb::WunitSchedules:: handleSave()
-This is the method that performs the saving process.

Could you please assist me in how to set the value of allowSave to either TRUE or FALSE from within the checkSaveVersion JS function?


(2.75 KiB) Downloaded 83 times
(2.94 KiB) Downloaded 80 times
(781 Bytes) Downloaded 83 times

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests