You need to sign in to do that
Don't have an account?
svd
problem in accessing data using repeat tag
Hi All,
My requirement is to access the variable of repeat tag. My controller returns List < List<Trans__c> >. My repeat tag builds a pageblock section for each sublist. Data is being displayed fine, but I'm unable to access the repeat variable in the title of Pageblocksection.
here is sample data for more clarity on what I need.
<apex:repeat value="{!Transcript}" var="subList" > // My Controller returns List <List<Trans__c> > where Trans__c is my object.
<apex:pageBlockSection title=" ??? " columns="1" id="pbsTrans">
<apex:pageBlockTable value="{!subList}" var="trans" >
<apex:column value="{!trans.Activity_Title__c}" />
<apex:column value="{!trans.Year__c}" /> // I want this year to be displayed in the page block section TITLE
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:repeat>
I tried returning Map<Integer, List<Trans__c > > from my controller where integer would be year. But in my repeat tag I did not know how to access the sublist and integer of the returned map obj for my page block table.
please let me know how I can get this achieved.
Thanks in Advance,
dvs
My requirement is to access the variable of repeat tag. My controller returns List < List<Trans__c> >. My repeat tag builds a pageblock section for each sublist. Data is being displayed fine, but I'm unable to access the repeat variable in the title of Pageblocksection.
here is sample data for more clarity on what I need.
<apex:repeat value="{!Transcript}" var="subList" > // My Controller returns List <List<Trans__c> > where Trans__c is my object.
<apex:pageBlockSection title=" ??? " columns="1" id="pbsTrans">
<apex:pageBlockTable value="{!subList}" var="trans" >
<apex:column value="{!trans.Activity_Title__c}" />
<apex:column value="{!trans.Year__c}" /> // I want this year to be displayed in the page block section TITLE
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:repeat>
I tried returning Map<Integer, List<Trans__c > > from my controller where integer would be year. But in my repeat tag I did not know how to access the sublist and integer of the returned map obj for my page block table.
please let me know how I can get this achieved.
Thanks in Advance,
dvs
All Answers
Thanks a lot. Wrapper class concept worked absolutely fine for my requirement.
note:
Place a empty pageblock section before your repeat tag to make other pageblock sections collapse/expand.
Thanks for your time,
dvs
I have a different problem handling repeats. I am not sure how the Ids are created for the elements inside the repeat. I have an inputtext field inside the repeat and I want to access its value so that I can pass it as a url parameter in the outputlink. What I am trying to do is to, on clicking of the outputlink, invoking a javascript function which will capture the quantity of the correct inputtext and pass the value back to the link. (Not sure if it is the best way to do it). So I want to get access of the right Id of the inputtext , but since its inside repeat not sure how can I do it.
Is it possible to throw in a getQueryLocator in here so that pagination can be used?
Thanks