0

I am having a pageblock table with three picklists. based on one picklist value and text the second picklist would generate the values and based on selected second picklist value and text the third one will be generated. However, I am unable to get the correct value from that particular column(cell). I am using jQuery and it is not working as expected. Please help.

below is my sample code:


<apex:page>
</apex:form>
<script>
$(document).ready(function{


});

function callfunction1(){
var value = $('.picklist1').val();
var text =$('select option:selected').text();
calldeliveryno(value, text);
}

function callfunc2();{
var value=$('.picklist2').val();
var text= $('select option:selected').text();
calllineitems(value,text);
}
function
</script>
<apex:Pageblock>
<apex:pageblocktable value="{!listrecord}" var="list">
<apex:column headervalue ="first picklist">
<apex:selectlist value="{!list.firstcolumn}" styleclass="picklist1 vareity " onchange="callfunction1();">
<apex:selectoptions value="{!forpicklist1}">
</apex:selectlist>
</apex:column>

<apex:column headervalue ="second picklist" id="column2">
<apex:selectlist value="{!list.secondcolumn}" styleclass="picklist2 vareity " onchange="callfunc2();">
<apex:selectoptions value="{!forpicklist2}">
</apex:selectlist>
</apex:column>

<apex:column headervalue ="Third picklist" id="column3">
<apex:selectlist value="{!list.thirdcolumn}">
<apex:selectoptions value="{!forpicklist3}">
</apex:selectlist>
</apex:column>



</apex:pageblocktable>


</apex:pageblock>
<apex:actionregion>
<apex:actionfunction name="calldeliveryno" action"{!passdelivery}" rerender="column2">
<apex:param name="delno" assignto="firstpicklistval" value="">
<apex:param name="delno1" assignto="firstpicklisttext" value="">
</apex:actionfunction>
</apex:actionregion>

<apex:actionregion>
<apex:actionfunction name="calllineitems" action"{!passlineitem}" rerender="column3">
<apex:param name="lineno" assignto="firstlineitemval" value="">
<apex:param name="lineno1" assignto="firstlineitemtext" value="">
</apex:actionfunction>
</apex:actionregion>

</apex:form>
<apex:page>
2
  • Where have you added the JQuery resource? You would need to load JQuery before using it. – Mr.Frodo May 21 '19 at 10:31
  • please see How to Ask for getting the most from the community – cropredy May 21 '19 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.