Skip to main content

Hi folks,

  Here is my VFP : 

 

<apex:outputPanel id="section">

<apex:actionRegion >

<apex:repeat var="question" value="{!questionsMap}">

<br/><apex:outputText escape="false" value="<b>{!question}</b>"/><br/>

<apex:repeat var="answer" value="{!questionsMap[question]}" >

<apex:outputText escape="false" value="<b>{!answer}</b>"/>

<apex:inputText value="{!inputScore}" id="Score" label="Score">

<apex:actionSupport event="onchange" action="{!populateAnswers}" reRender="dummy">

<apex:param assignTo="{!answeredQuestion}" value="{!question}" name="answeredQuestion"/>

<apex:param assignTo="{!answers}" value="{!answer}" name="answers"/>

</apex:actionSupport>

</apex:inputText>

</apex:repeat>

</apex:repeat>

</apex:actionRegion>

</apex:outputPanel>

In apex Controller inputText value(inputScore) is not populated : 

public void populateAnswers(){

System.debug('***'+questionAnswerMap);

System.debug('***'+answers);

System.debug('***'+inputScore);

System.debug('***'+score);

answeredQuestion = Null;

answers = Null;

}

Also i have tried to send the value with apex:param, but fails.

Any help appreciated. 

 
1 respuesta
  1. 7 jul 2020, 18:36
    Hi Abhimanyu,

    Greetings!

    Have you tried this using JAVASCRIPT if you do not have any restrictions to use it.Please refer the below document for the sample code:

    https://kloudrac.com/blog/passing-value-of-variables-from-visualforce-to-controller-via-javascript/

    Also,I can see that you have already tried by using apex:param tag but I would suggest you the code in the below document to try it again.

    https://webkul.com/blog/use-apexparam-tag-visualforce/

    Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.

    Warm Regards,

    Shirisha Pathuri
0/9000