Hi everyone here,
I am confused with getControl() usage, in JavaDoc there are several overload getControl() methods to use.
Control | getControl(java.lang.String strName) Get an existing control. |
Control | getControl(java.lang.String strName, java.lang.Class cl) Get control, creating it is it does not exist. |
Control | getControl(java.lang.String strName, int nIndex) Get an existing indexed control. |
Control | getControl(java.lang.String strName, int nIndex, java.lang.Class cl) Get indexed control, creating it is it does not exist. |
I saw most webtop source code use getControl(String, Class) instead of getControl(String), why?
Using getControl(String , Class) might accidentally create a control which doesn't exist on JSP originally, right? and this might cause error.
using getControl is much safer.
(I just encountered this error, before I checked the javaDoc, I thought those methods just the same.)
Can someone explain? thanks.