NextGen Consulting

IT Consulting CRM BSS OSS

Implementing ‘Got_focus’ Event in Smart Client


Q: Clear Basic provide ‘got_focus’ event for controls but I can’t find the same event in smart client.
Is there any way to implement this feature in smart client?

   

A: You can add your native contol focus event listeners (lost/gained) as follows:
(assuming your control is a textBox named ‘txtCustomerName’)

// Add the following in the form_Load() event handler:  
// define focus event listeners (lost/gained)  
(    (javax.swing.JComponent)this.txtCustomerName.getNativeControl())
             .addFocusListener(new FocusListener()   
{    
// this is the equivalent to Clear Basic Lost_Focus() 
public void focusLost(FocusEvent focusEvent)
{       
// your logic here... 
System.out.println("focus lost");
}    
// this is the equivalent to Clear Basic Got_Focus() 
public void focusGained(FocusEvent focusEvent)
{
// your logic here... 
System.out.println("got focus");
}   
}   

);

01/10/2010 Posted by | Amdocs, CRM, CRM, Development, Front End, Smart Client, Technology | Leave a comment

%d bloggers like this: