UIGroupMembershipSelector uiSelector = event.getSource();
UIComponent uiPermission = uiSelector.<UIComponent> getParent().getParent();
uiPermission.setRenderSibling(uiPermission.getClass());
WebuiRequestContext pcontext = event.getRequestContext();
UIPopupWindow uiPopup = uiSelector.getParent();
//TODO: Tung.Pham modified
//-----------------------------------
//UIForm uiForm = event.getSource().getAncestorOfType(UIForm.class);//TODO: Remove duplicated call to event.getSource()
UIForm uiForm = uiSelector.getAncestorOfType(UIForm.class);
//-----------------------------------
//TODO: by Minh Hoang TO, retrieve the UIPermissionSelector and update this component
//UIPermissionSelector pSelector=uiPopup.getAncestorOfType(UIPermissionSelector.class);
//if(pSelector!=null){
// event.getRequestContext().addUIComponentToUpdateByAjax(pSelector);
//}
if (uiSelector.getCurrentGroup() == null)
{
UIApplication uiApp = pcontext.getUIApplication();
uiApp.addMessage(new ApplicationMessage("UIGroupMembershipSelector.msg.selectGroup", null));
// pcontext.addUIComponentToUpdateByAjax(uiApp.getUIPopupMessages());
uiPopup.setShow(true);
return;
}
event.getRequestContext().addUIComponentToUpdateByAjax(uiPermission);
uiPermission.broadcast(event, event.getExecutionPhase());
uiPopup.setShow(false);
// UIForm uiForm = event.getSource().getAncestorOfType(UIForm.class) ;
// if(uiForm != null) {
// event.getRequestContext().addUIComponentToUpdateByAjax(uiForm.getParent());
// }else{