Hi everyone, I have a button needs to be disenabled after it is clicked on the client side. I make a Dynpage class to implement it. The code snippet is as follows
Button btn_scan = new Button("btnid","Start");
getForm().addComponent(btn_scan);
btn_scan.setJsObjectNeeded(true);
btn_scan.setOnClientClick("ResetButton()");
String btn_scan_js ="<script language="JavaScript">"
+"function ResetButton() {"
+"var funcName = htmlb_formid+"_getHtmlbElementId";"
+"func = window[funcName];"
+"var btn = eval(func("btnid"));"
// + "alert(btn);"
// + "alert(btn.id);"
+ "alert(btn.setDisabled());"
+"}";
btn_scan_js = btn_scan_js + "</script>";
getForm().addRawText(btn_scan_js);
When I check alert(btn it displays object Object, when alert(btn.id) I can see an ID, but when I add alert(btn.setDisabled()), it displays undefined.
As JavaScrip API for Button at http://help.sap.com/saphelp_nw04/helpdata/en/43/067941a51a1a09e10000000a155106/frameset.htm the two methods setEnabled() and setDisabled() for Button are not working in my case.
How to make the button disabled just after the it is clicked? Thansk for early reply.
Kind regards.
Wang