You need to sign in to do that
Don't have an account?
Johnny #5
How to get I the value from the visualforce inputField?
I have two things: a visualforce page and an extension class to go w/ it...
In the visualforce page, I have this line to allow user to select a parent case....
<apex:inputField id="ParentId_Prop" value="{!Case.ParentId}" />
The question is how do I access the value that user inputs here, so I can do some validation check.
Any help is appreciated... Happy New Year!
How are you defining "Case" in your extension?
-Andy
from the looks of the syntax i guess you are using standard controller. In order to get the input value you just need to access the standard controller instance in your extension constructor.
Andy:
Thanks for the quick respone.
Maybe if I share my what I try to accomplish it will help a little: I am trying to verify the parentId that the user specified doesn't any one of the record he/she selected.
So, at the page header, I have
<apex:page apiVersion="23" standardController="Case" id="MassiveCaseUpdatePage" recordSetvar="Cases" extensions="MassiveCaseUpdate" >
somewhere in the body of the visualforce page, I have
<apex:inputField id="ParentId_Prop" value="{!ParentId}"/>
In my extension class,
I now have...
private String parentCaseNumber;
public SObject getParentId(){
return Case.parentId;
// return parentCaseNumber;
}
public void setParentId(String CaseNumber){
parentCaseNumber = CaseNumber;
}
The problem is that I don't know what return type the getParentId method should be. Am I heading the right track? Sorry, I am c# developer try to be an apex developer. :)
Generally an inputField can only be used with SObject fields. Meaning it should refer to a concreate instance of an Object.
My apologies - it's a bit tough to understand exactly what you are trying to do. There are a number of different things that could be a silver bullet for you, but could you post your full code so we can understand the context of how you're trying to code this page?
-Andy