Check if a button is Clicked

june1994
Kilo Explorer

I have created a widget where i a giving one incident number and after clicking one button it will show the details of that incident.I am using html 'table' tag to show the incident records but the problem is it is showing the labels that i am using to show the incident records like 'called-id' even before i have clicked the button.How can i check if the button is clicked??

HTML:

find_real_file.png

Server Script:

find_real_file.png

Client Script:

find_real_file.png

Widget View:

find_real_file.png

My problem is the labels of incident details are showing even when i have not given any incident number.

2 REPLIES 2

larstange
Mega Sage

hi



Only show the entire section if there is something in the c.data object.



So modify the div above your table to this



<div ng-if="c.data">



The object should be empty until you press the button an call the server. If not you can check for a specific property in the object like



<div ng-if="c.data.caller">


Rafael Messias1
Kilo Contributor

You should take the result and add it into c.data object.



c.server.update().then( function(r) {


        c.data = r.data;


});