Enable / Disabling Buttons on a Form

Enable / Disabling Buttons on a Form

  

I have a window that has 4 widgets on it.

FileUpload, 

"Load Spreadsheet" button

"Import" button

Data Grid.


I want to manipulate the Enable property on the buttons so they are enabled only under certain conditions as follows:

FileUpload: - Always enabled

"Load Spreadsheet" button - Only enabled when there is a file that has been selected by the "FileUpload" widget. and NOT when the Import process is running. If the FileUpload file is cleared by another process, then this button should automatically become disabled. This button will use the file specified by FileUpload to populate a table, which shows up in the data grid.

"Import" button - Only enabled when there is data in the table mentioned above and the Import process is NOT running. This button will start the import process, which could takes a couple of minutes to run.

Data Grid - Always enabled


Please let me know how to accomplish this. It is easily done in other environments using the events on window or controls, so I can only assume it fairly easy to do in OutSystems.  I'm sure I'm just missing something as I don't see any events for these objects.

If I need to swap out any of these widgets for something else, please let me know.

Thanks,

Paul

Hi,

You can use that conditions that you want in the Enable properties (that condition is just an example):


When you have some actin that need to change the enable condition for your widgets, use a OnChange action:


In there, you select a new action and inside that action you refresh your widgets. Don't forget that you widgets need to have the "Name" Property filled for you can call it in the ajax refresh:


Hope this can help.

Best regards,

Ricardo

Your explanation is great if you happen to use the right widgets, but in my case, I'm using the "Upload" widget, which doesn't seem to support an "OnChange" event and I'm unsure how to use the Extended Properties.

Perhaps I should ask why the "Upload" widget doesn't support "OnChange" and since it doesn't, how do I get around that problem.

Thanks,

Paul

Hi Paul,

you can get around with JS like the solution on this post or by using FakeNotifyWidget (richwidgets) and on extended properties add onclick and this on value OsNotifyWidget('" + FakeNotifyRefresh.Id + "','')

Regards,

Marcelo