You need to sign in to do that
Don't have an account?

Multiple Dependent SelectLists
Howdy all,
I've implemented dependent selectLists in the interface below. The issue I'm having is that the lists only work when only 1 set exists. IE: 1 row for time entry in this case. When I add a row to the interface, it creates a new timeEntry instance and the selectLists in the bottom-most row work properly, but any above that do not work.
Is there a way to dynamically rerender a row in a table or some VF component? Ideally, each row or each outputPanel would have a different ID but I can't seem to set the rerender="" attribute dynamically.

Here is the code for the VF section:
I've implemented dependent selectLists in the interface below. The issue I'm having is that the lists only work when only 1 set exists. IE: 1 row for time entry in this case. When I add a row to the interface, it creates a new timeEntry instance and the selectLists in the bottom-most row work properly, but any above that do not work.
Is there a way to dynamically rerender a row in a table or some VF component? Ideally, each row or each outputPanel would have a different ID but I can't seem to set the rerender="" attribute dynamically.
Code:
<apex:actionRegion > <apex:selectList value="{!selectedProject}" size="1"> <apex:selectOptions value="{!ProjectOptions}" /> <apex:actionSupport event="onchange" rerender="mondayTask" status="loading" /> </apex:selectList> </apex:actionRegion> <apex:outputPanel id="mondayTask"> <apex:selectList value="{!taskId}" size="1" multiselect="false"> <apex:selectOptions value="{!taskItems}"/> </apex:selectList> </apex:outputPanel>

Here is the code for the VF section:
Code:
<apex:outputPanel id="mondayTable"> <apex:form > <table cellpadding = "0" cellspacing = "0"> <tr class = "header"> <td>Projects</td> <td>Tasks</td> <td>Description</td> <td width = "50">Time</td> </tr> <apex:repeat value="{!mondayTime}" var="t"> <tr> <td> <apex:actionRegion > <apex:selectList value="{!selectedProject}" size="1"> <apex:selectOptions value="{!ProjectOptions}" /> <apex:actionSupport event="onchange" rerender="mondayTask" status="loading" /> </apex:selectList> </apex:actionRegion> </td> <td> <apex:outputPanel id="mondayTask"> <apex:selectList value="{!taskId}" size="1" multiselect="false"> <apex:selectOptions value="{!taskItems}"/> </apex:selectList> </apex:outputPanel> </td> <td><apex:inputText value="{!t.description}" /></td> <td><apex:inputText value="{!t.hours}" /></td> </tr> </apex:repeat> <tr> <td> </td> <td> </td> <td> </td> <td><apex:commandButton action="{!addEntry}" value="add row" rerender="mondayTable" status="loading"/></td> <td><apex:commandButton action="{!saveMondayTime}" value="save" /></td> </tr> </table> </apex:form> </apex:outputPanel>
I surely am not the expert on this, I didn't get an answer when I started to ask about it: http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=2632#M2632
Steve
Thanks for your input. I'll probably just remove the ability to do multiple entries on a single day for the time being and tackle the issue again once I get the app out to my users.
Thanks!
Colin
I'm sort of bring this thread back from the ashes but...
Colin,
Did you ever figure a way to rerender just the row in which some event occurs? I have a similar example where a change is made in one row and this is really the only this row needs to be rerendered but I am either rerendering entire columns or the entire table. Everything works fine but when the table size becomes larger the rerender becomes slower. It's by no means super slow and is definetly usable but if there is a way to optimize why not?