You need to sign in to do that
Don't have an account?
BrokenBird
Radio Buttons
I am trying to use radio button in a list, but I can't figure out how to produce what I want. This is an HTML example of what I am looking for: Survey sample
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
I am trying to use radio button in a list, but I can't figure out how to produce what I want. This is an HTML example of what I am looking for: Survey sample
Well this didn't render too well, so I guess I need to explain.
I want this to work like a survey, each line is a question, and you can
select one answer per line. Depending on the selected radio button,
the rating column would be set to a specific number.
Can you try pasting the HTML in a code segment by clicking on the little clipboard icon above and pasting the HTML in that section?
I implemented something like this using a apex:dataTable,that iterates over a List of survey topics (ie line items for the survey). Additionally, I use the apex:actionSupport component to send the onclick event to the controller. This is just one way to accomplish it.
<apex:pageBlockSection title="Please rate the following topics:" > <apex:dataTable width="100%" value="{!surveyItems}" var="s"> <apex:column width="250"> <center> <apex:facet name="header">Topic to Rate</apex:facet> <apex:outputField value="{!s.Question__c}"/> </center> </apex:column> <!-- <apex:actionFunction action="{!updateRating}" name="updateRating" > <apex:param name="firstParam" assignTo="{!tempSurveyItemQuestion}" value=""/> <apex:param name="secondParam" assignTo="{!tempSurveyItemResponse}" value=""/> </apex:actionFunction> --> <apex:column width="150"> <center> <apex:facet name="header">Very Dissatisfied</apex:facet> <input type="radio" name="{!s.Question__c}" value="{!s.id}" > <apex:actionSupport event="onclick" action="{!updateResponse}" > <apex:param name="firstParam" assignTo="{!tempSurveyItemQuestion}" value="{!s.Question__c}"/> <apex:param name="secondParam" assignTo="{!tempSurveyItemResponse}" value="Very Dissatisfied"/> </apex:actionSupport> </input> </center> </apex:column> <apex:column width="150"> <center> <apex:facet name="header">Dissatisfied</apex:facet> <input type="radio" name="{!s.Question__c}" value="{!s.id}"> <apex:actionSupport event="onclick" action="{!updateResponse}" > <apex:param name="firstParam" assignTo="{!tempSurveyItemQuestion}" value="{!s.Question__c}"/> <apex:param name="secondParam" assignTo="{!tempSurveyItemResponse}" value="Dissatisfied"/> </apex:actionSupport> </input> </center> </apex:column> <apex:column width="150" > <center> <apex:facet name="header">Neither Satisfied or Dissatisfied</apex:facet> <input type="radio" name="{!s.Question__c}" value="{!s.id}" > <apex:actionSupport event="onclick" action="{!updateResponse}" > <apex:param name="firstParam" assignTo="{!tempSurveyItemQuestion}" value="{!s.Question__c}"/> <apex:param name="secondParam" assignTo="{!tempSurveyItemResponse}" value="Neither Satisfied or Dissatisfied"/> </apex:actionSupport> </input> </center> </apex:column> <apex:column width="150"> <center> <apex:facet name="header">Satisfied</apex:facet> <input type="radio" name="{!s.Question__c}" value="{!s.id}" > <apex:actionSupport event="onclick" action="{!updateResponse}" > <apex:param name="firstParam" assignTo="{!tempSurveyItemQuestion}" value="{!s.Question__c}"/> <apex:param name="secondParam" assignTo="{!tempSurveyItemResponse}" value="Satisfied"/> </apex:actionSupport> </input> </center> </apex:column> <apex:column width="150"> <center> <apex:facet name="header">Very Satisfied</apex:facet> <input type="radio" name="{!s.Question__c}" value="{!s.id}" > <apex:actionSupport event="onclick" action="{!updateResponse}" > <apex:param name="firstParam" assignTo="{!tempSurveyItemQuestion}" value="{!s.Question__c}"/> <apex:param name="secondParam" assignTo="{!tempSurveyItemResponse}" value="Very Satisfied"/> </apex:actionSupport> </input> </center> </apex:column> </apex:dataTable> </apex:pageBlockSection>
Hi,
Can you please post your complete working code? I am trying to developed
opportunity merge component using your solution but not yet succeed.
Thanks
Thanks for the code aalbert.