You need to sign in to do that
Don't have an account?
Stuck on a simple clear button (bug?)
I have a pick list and I am trying to create a clear button that clears the value. This is pretty simple but I can't seem to figure it out.
Here is the simple code to reproduce:
Message Edited by TehNrd on 10-07-2008 08:52 AM
Here is the simple code to reproduce:
Code:
PAGE: <apex:page controller="clearCon" action="{!load}"> <apex:form> <apex:pageBlock > <apex:pageBlockButtons location="bottom"> <apex:commandButton value="Clear Criteria" action="{!clear}" rerender="industry"/> </apex:pageBlockButtons> <apex:pageBlockSection columns="2" id="industry"> <apex:inputField value="{!acct.Industry}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page> Controller: public class clearCon { public Account acct {get; set;} public PageReference load() { acct = new Account(); return null; } public PageReference clear(){ acct.Industry = null; return null; } }
Message Edited by TehNrd on 10-07-2008 08:52 AM
may be a new bug in Winter 09.
Message Edited by TehNrd on 10-07-2008 08:52 AM
dkraun123 wrote:
take off the immediate=true that you added and you should be fine.
Whoops, totally forgot that was still there.
Taking a normal inputField and creating a pageBlockSectionItem seems like a lot of extra work especially if there are many fields. I discovered that If i rerender the inputField itself this will work as well but I was hoping I could rerender a pageBlockSection and clear many fields at once.
Message Edited by TehNrd on 10-07-2008 02:13 PM