You need to sign in to do that
Don't have an account?
vivek krish 4
JQuery alert (MaxLength) Issue on first time ?
Hi All,
Am creating alert message in controller and called in VF Page by using JQuery.
But,whenever In Controller & VF Page Code updated (Irrespective of alert related code) means Jquery Pop_Up alert message is not working at first time.If I reduce the length of Pop_Up message then it's getting alert when clicking the button after that if I revert back Pop_Up Error message to normal length also am able to getting alert.
Apex Code :
if(codingChart.MA_User__c == UserInfo.getUserId()){ // And this is the MA Coder
for(MC_Chart_DxCode__c dx : this.dxCodes){
if(String.isBlank(dx.Master_Audit_Primary_Comment__c)){
saveAndMoveToNextStageFixMA = true;
saveAndMoveToNextStageWarning = 'At least one DxCode is missing an MA primary comment. If you proceed all DxCodes with blank MA primary comments will be updated to [Correct].Are you sure you wish to proceed?';
break;
}
}
}
VF Code :
<apex:page standardController="mc_Chart__c" extensions="MC_ChartCodingExtensions" action="{!PageAction}">
<apex:outputPanel id="nxtStage">
<apex:includeScript value="{!$Resource.jquery}"/>
<script>
var j$ = jQuery.noConflict();
j$(document).ready(function(){
checkForSaveAndMoveToNextStageWarnings();
});
function checkForSaveAndMoveToNextStageWarnings() {
var saveAndMoveToNextStageWarningMsg = "{!saveAndMoveToNextStageWarning}";
if(saveAndMoveToNextStageWarningMsg != ''){ // There was a validation warning, make sure the user still wants to save
if(confirm(saveAndMoveToNextStageWarningMsg)){
saveAndMoveToNextStageAction();
}
else {
clearSaveAndMoveToNextStageWarningAction();
}
}
}
<apex:form >
<apex:pageMessages />
<apex:actionfunction name="saveAndMoveToNextStageAction" action="{!saveAndMoveToNextStage}" />
<apex:actionfunction name="clearSaveAndMoveToNextStageWarningAction" action="{!clearSaveAndMoveToNextStageWarning}" />
<apex:commandButton value="Save & Move to Next Stage" action="{!saveAndMoveToNextStagePreCheck}" reRender="nxtStage" styleClass="saveButton" />
</apex:outputPanel>
</apex:page>
Static Resource Lib : jquery-1.4.2.js
Can i have suggestion on this ASAP.
Thanks & Regards,
Vivek
Am creating alert message in controller and called in VF Page by using JQuery.
But,whenever In Controller & VF Page Code updated (Irrespective of alert related code) means Jquery Pop_Up alert message is not working at first time.If I reduce the length of Pop_Up message then it's getting alert when clicking the button after that if I revert back Pop_Up Error message to normal length also am able to getting alert.
Apex Code :
if(codingChart.MA_User__c == UserInfo.getUserId()){ // And this is the MA Coder
for(MC_Chart_DxCode__c dx : this.dxCodes){
if(String.isBlank(dx.Master_Audit_Primary_Comment__c)){
saveAndMoveToNextStageFixMA = true;
saveAndMoveToNextStageWarning = 'At least one DxCode is missing an MA primary comment. If you proceed all DxCodes with blank MA primary comments will be updated to [Correct].Are you sure you wish to proceed?';
break;
}
}
}
VF Code :
<apex:page standardController="mc_Chart__c" extensions="MC_ChartCodingExtensions" action="{!PageAction}">
<apex:outputPanel id="nxtStage">
<apex:includeScript value="{!$Resource.jquery}"/>
<script>
var j$ = jQuery.noConflict();
j$(document).ready(function(){
checkForSaveAndMoveToNextStageWarnings();
});
function checkForSaveAndMoveToNextStageWarnings() {
var saveAndMoveToNextStageWarningMsg = "{!saveAndMoveToNextStageWarning}";
if(saveAndMoveToNextStageWarningMsg != ''){ // There was a validation warning, make sure the user still wants to save
if(confirm(saveAndMoveToNextStageWarningMsg)){
saveAndMoveToNextStageAction();
}
else {
clearSaveAndMoveToNextStageWarningAction();
}
}
}
<apex:form >
<apex:pageMessages />
<apex:actionfunction name="saveAndMoveToNextStageAction" action="{!saveAndMoveToNextStage}" />
<apex:actionfunction name="clearSaveAndMoveToNextStageWarningAction" action="{!clearSaveAndMoveToNextStageWarning}" />
<apex:commandButton value="Save & Move to Next Stage" action="{!saveAndMoveToNextStagePreCheck}" reRender="nxtStage" styleClass="saveButton" />
</apex:outputPanel>
</apex:page>
Static Resource Lib : jquery-1.4.2.js
Can i have suggestion on this ASAP.
Thanks & Regards,
Vivek