<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Disable/enable Submit button on calling web service</title><link>https://community.appian.com/discussions/f/user-interface/18365/disable-enable-submit-button-on-calling-web-service</link><description>Hi, 
 I have a scenario where on a screen I am hitting a button and once it is clicked I am making a web service call and the output is returned/displayed on the same screen. 
 The requirement is to disable the button once you click it and the system</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Disable/enable Submit button on calling web service</title><link>https://community.appian.com/thread/72319?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2020 12:50:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e0b58ec4-4f12-4f5e-ba2d-7ac0cd36a970</guid><dc:creator>Gajapathy Ganesan</dc:creator><description>&lt;p&gt;Hi Burchell,&lt;/p&gt;
&lt;p&gt;I tried with your steps, but the problem is that the local!&lt;span&gt;isButtonDisabled&lt;/span&gt;&amp;nbsp;value is changed to true&amp;nbsp;only after the web service response is received (or) the&amp;nbsp;&lt;span&gt;local!webServiceResponse has some value.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Usually the Integration call that I am doing takes 4 to 5 seconds to get back&amp;nbsp;the response and update the variable.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Till that time the button is still enabled. Only after the response is received the&amp;nbsp;value of&amp;nbsp;local!isButtonDisabled is changed&amp;nbsp;to true and the button is disabled.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Ideally I need this variable&amp;#39;s value to be changed as soon as the button is clicked so that there is no option for the user to click it again until the response is received (till that 4 to 5 secs time frame).&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disable/enable Submit button on calling web service</title><link>https://community.appian.com/thread/72312?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2020 11:33:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e68fc240-72f6-4f98-a588-db7d6ee4fa59</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;In the saveInto: of your button you can break up the processing into steps by using a list of a!save() functions. Your first can set the local!variable that controls the button&amp;#39;s enabled status (better to keep it visible but disabled rather than hide it imo), and then in the next a!save() make the call to the web service. You can then change the value of the local!variable as the result of the data being retrieved by declaring that local!variable as an a!refreshVariable(), and alter its value based upon the content of the variable that holds the web service response in. SO, the steps should be something like this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;button is clicked&lt;/li&gt;
&lt;li&gt;in the saveInto: the first a!save() saves true() to&amp;nbsp;a local!variable that is used to set the button&amp;#39;s disabled attribute (let&amp;#39;s call the variable local!isButtonDisabled)&lt;/li&gt;
&lt;li&gt;&lt;span&gt;in the saveInto: the second a!save() makes&amp;nbsp;the call to the web&amp;nbsp;service&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;the web service response places data into a local!variable (let&amp;#39;s call that local!webServiceResponse)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;local!isButtonDisabled is defined as an a!refreshVariable(), with its refresh triggered by a change to the value of local!webServiceResponse&lt;/span&gt;, setting the value to false&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disable/enable Submit button on calling web service</title><link>https://community.appian.com/thread/72311?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2020 10:56:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bf4eb478-7c87-44fd-b37c-3892898a6731</guid><dc:creator>Gajapathy Ganesan</dc:creator><description>&lt;p&gt;Thanks Dinesh!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I even tried that. The issue is that only after&amp;nbsp;the web service response is received(once the page loads and completes) the local variable is updated to false.&lt;/p&gt;
&lt;p&gt;I need to update that variable to false the second I click the button.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disable/enable Submit button on calling web service</title><link>https://community.appian.com/thread/72310?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2020 10:46:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:82feaacb-40d6-44df-b285-e37330a714e4</guid><dc:creator>dineshd0001</dc:creator><description>&lt;p&gt;Hi Gajapathy,&lt;/p&gt;
&lt;p&gt;Hope you are calling the web service after the click of the button. My suggestion will be add a variable let say local!buttonVisibility and make it as false() when you click it at first, then call the weservice. Once the weservice call is success then again enable the buttonVisibility.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>