var TaskActionId= CAF.model('#{activePageBean.clientIds['TaskActionDropdown']}'); var TaskActionValue = CAF.model(TaskActionId).getValue(); var TaskActionLength = TaskActionValue.length; var ClaimOwnershipId= CAF.model('#{activePageBean.clientIds['claimOwnershipCheckbox']}'); var ClaimOwnershipValue = CAF.model(ClaimOwnershipId).getValue(); var hdnPanelClaimOwnershipFlag= CAF.model('#{activePageBean.clientIds['hdnPanelClaimOwnership']}').isVisible(); var ClaimOwnershipCommentTextId= CAF.model('#{activePageBean.clientIds['ClaimOwnershipCommentText']}'); var ClaimOwnershipCommentTextValue = CAF.model(ClaimOwnershipCommentTextId).getValue(); var ClaimOwnershipCommentTextLength = ClaimOwnershipCommentTextValue.length; if((TaskActionValue == null) || (TaskActionLength==0)) { CAF.model('#{activePageBean.clientIds['failureReasonText']}').setValue("Error - You have not selected an Action"); CAF.model('#{activePageBean.clientIds['failureModalDialog']}').show(); } if ((hdnPanelClaimOwnershipFlag==true) && (ClaimOwnershipValue == "true") && (ClaimOwnershipCommentTextLength ==0)) { CAF.model('#{activePageBean.clientIds['failureReasonText']}').setValue("Error - You must enter a comment in support of Claim Ownership"); CAF.model('#{activePageBean.clientIds['failureModalDialog']}').show(); } else { if (TaskActionValue == "Query Broker") { if ((ClaimOwnershipCommentTextLength > 0) && (ClaimOwnershipValue != "true") ) { CAF.model(ClaimOwnershipCommentTextId).setValue(""); } queryBrokerAction(); } else if (TaskActionValue == "Reallocate") { if ((ClaimOwnershipCommentTextLength > 0) && (ClaimOwnershipValue != "true") ) { CAF.model(ClaimOwnershipCommentTextId).setValue(""); } reallocateAction(); } else if (TaskActionValue == "Refer to Ops") { if ((ClaimOwnershipCommentTextLength > 0) && (ClaimOwnershipValue != "true") ) { CAF.model(ClaimOwnershipCommentTextId).setValue(""); } referToOps(); } else if (TaskActionValue == "Create Diary") { if ((ClaimOwnershipCommentTextLength > 0) && (ClaimOwnershipValue != "true") ) { CAF.model(ClaimOwnershipCommentTextId).setValue(""); } pendItemAction(); } else if (TaskActionValue == "Escalate") { if ((ClaimOwnershipCommentTextLength > 0) && (ClaimOwnershipValue != "true") ) { CAF.model(ClaimOwnershipCommentTextId).setValue(""); } escalateAction(); } else if (TaskActionValue == "Conflict of Interest") { if ((ClaimOwnershipCommentTextLength > 0) && (ClaimOwnershipValue != "true") ) { CAF.model(ClaimOwnershipCommentTextId).setValue(""); } conflictOfInterestAction(); } else if (TaskActionValue == "Complete") { var hdnCTPCheckObj=CAF.model('#{activePageBean.clientIds['hdnCTPCheck']}'); var hdnCTPCheckMapObj=CAF.model('#{activePageBean.clientIds['hdnCTPCheckMap']}'); hdnCTPCheckMapObj.setValue(hdnCTPCheckObj.getValue()); if ((ClaimOwnershipCommentTextLength > 0) && (ClaimOwnershipValue != "true") ) { CAF.model(ClaimOwnershipCommentTextId).setValue(""); } completeAction(); } }