You need to sign in to do that
Don't have an account?
sfdc@isha.ax1814
urgent please help- passing parameters from vfpage to controller
Hi Everyone,
i am using juery datepicker and onclick ofthe daterange below method iam using and in alert iam getting the value on click of the daterange picker. but i see weired funcionality that sometimes value is paaing to controller but not sometimes.
please help me how to send the values from page to controller. onclick savesettings iam saving the daterangevalue to one of the field on the
contact setting__C object.
Issue: Sometimes value is passing and not sometimes not sure why. Please help me and let me know if you need any inormation
<apex:commandLink status="renderLightningSpinner" action="{!saveSettings}" value="Save" reRender="pgMsgPnl" title="Save Setting" style="width:25px;height:25px;"/>
<apex:actionFunction action="{!paramsave}" name="daterangemethod" rerender="">
<apex:param value="" name="param1" assignTo="{!daterangevalue}"/>
</apex:actionFunction>
<input name="dateRangeSelect" id="dateRangeSelect"/>
Daterange:<output id="outputid" type="text" value="">{!daterangevalue} </output>
<script>
$("#dateRangeSelect").daterangepicker({
open: function(event, data) {},
change: function(event, data) {
$("li.ui-menu-item").click(function(){
console.log($(this).text());
//$("#outputid").val("Date range : "+$(this).text());
$("#outputid").val($(this).text());
var dtr= ($(this).text());
alert(dtr);
daterangemethod(dtr);
});
public string daterangevalue {get;set;}
public void paramsave(){
string value = apexpages.currentPage().getParameters().get('param1');
}
public void saveSettings(){
paramsave();
if(views.selectedView == null || views.selectedView.isEmpty()){
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Business unit is Required');
ApexPages.addMessage(myMsg);
return;
for(string s : views.selectedView){
if(defaultViewCS.value__c != ''){
defaultViewCS.value__c = defaultViewCS.value__c + ';';
}
if(s == views.myBusinessUnit){
defaultViewCS.value__c = defaultViewCS.value__c + AccountRelatedActivitiesHelper.MY_BUSINESS_UNIT;
} else{
if(s == views.myDivison){
defaultViewCS.value__c = defaultViewCS.value__c + AccountRelatedActivitiesHelper.MY_DIVISON;
} else{
defaultViewCS.value__c = defaultViewCS.value__c + s;
}
}
}
contactSettingToUpsert.add(defaultViewCS);
system.debug('@@'+defaultViewCS);
}
i am using juery datepicker and onclick ofthe daterange below method iam using and in alert iam getting the value on click of the daterange picker. but i see weired funcionality that sometimes value is paaing to controller but not sometimes.
please help me how to send the values from page to controller. onclick savesettings iam saving the daterangevalue to one of the field on the
contact setting__C object.
Issue: Sometimes value is passing and not sometimes not sure why. Please help me and let me know if you need any inormation
<apex:commandLink status="renderLightningSpinner" action="{!saveSettings}" value="Save" reRender="pgMsgPnl" title="Save Setting" style="width:25px;height:25px;"/>
<apex:actionFunction action="{!paramsave}" name="daterangemethod" rerender="">
<apex:param value="" name="param1" assignTo="{!daterangevalue}"/>
</apex:actionFunction>
<input name="dateRangeSelect" id="dateRangeSelect"/>
Daterange:<output id="outputid" type="text" value="">{!daterangevalue} </output>
<script>
$("#dateRangeSelect").daterangepicker({
open: function(event, data) {},
change: function(event, data) {
$("li.ui-menu-item").click(function(){
console.log($(this).text());
//$("#outputid").val("Date range : "+$(this).text());
$("#outputid").val($(this).text());
var dtr= ($(this).text());
alert(dtr);
daterangemethod(dtr);
});
public string daterangevalue {get;set;}
public void paramsave(){
string value = apexpages.currentPage().getParameters().get('param1');
}
public void saveSettings(){
paramsave();
if(views.selectedView == null || views.selectedView.isEmpty()){
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Business unit is Required');
ApexPages.addMessage(myMsg);
return;
for(string s : views.selectedView){
if(defaultViewCS.value__c != ''){
defaultViewCS.value__c = defaultViewCS.value__c + ';';
}
if(s == views.myBusinessUnit){
defaultViewCS.value__c = defaultViewCS.value__c + AccountRelatedActivitiesHelper.MY_BUSINESS_UNIT;
} else{
if(s == views.myDivison){
defaultViewCS.value__c = defaultViewCS.value__c + AccountRelatedActivitiesHelper.MY_DIVISON;
} else{
defaultViewCS.value__c = defaultViewCS.value__c + s;
}
}
}
contactSettingToUpsert.add(defaultViewCS);
system.debug('@@'+defaultViewCS);
}