You need to sign in to do that
Don't have an account?
Use of onchange componenet on apex:selectlist!!!Plz help
Hi All,
I have this piece of code here, given below:
<apex:pageBlock id="tEntryWeekSelectionPageBlock">
<apex:actionRegion >
<apex:pageBlockSection id="selectedWeek" title="Project List for {!$User.FirstName} {!$User.LastName}" columns="2" collapsible="true">
<apex:pageBlockSectionItem id="selectedWeek">
<apex:outputLabel for="selectedWeek">Week Beginning</apex:outputLabel>
<apex:panelGroup >
<apex:selectList value="{!selectedWeek}" multiselect="false" size="1">
<apex:selectOptions value="{!Weeks}"/>
</apex:selectList>
</apex:panelGroup>
</apex:pageBlockSectionItem>
<apex:commandButton value="Go" action="{!setWeek}" rerender="timeEntryBlock, messageBlock"/>
</apex:pageBlockSection>
</apex:actionRegion>
</apex:pageBlock>
Now the action="{!setWeek}" is working perfectly on click of the button. But now I want to perform the same action on change of value in my apex:selectList value="{!selectedWeek}", when I make the given change to my code , it throws an error.
<apex:selectList value="{!selectedWeek}" multiselect="false" size="1" onchange="!{setWeek}">
Can anyone please help me with this?
Hi
Try in this way
<apex:selectList value="{!selectedWeek}" multiselect="false" size="1">
<apex:actionSupport event="onchange" action="{!setWeek}" reRender="timeEntryBlock, messageBlock"/>
<apex:selectOptions value="{!Weeks}"/>
</apex:selectList>
If this post answers your questions please mark it as solved and give kudos for this post If It helps you
Thanks