You need to sign in to do that
Don't have an account?
KeithJ
inputText required="true" not working
Hi there.My inputText field in my vf page is renderd like so:
but in my vf code I have
<apex:pageBlockSectionItem > <apex:outputLabel value="Title" for="titleField" /> <apex:inputText value="{!title}" required="true" id="titleField" style="width: 200px;" /> </apex:pageBlockSectionitem>
Where you can see that the inputText is required=true but it's not showing up on my vf page.
This field binds to a String property in my custom controller that's called title
Thanks for the help & regards
I believe it should look something like this. The"value" is bound to a string array which will contain the selected values.
VF page
Your controller:
All Answers
There are a couple of threads related to your issue:
link 1
Link 2
Thanks devNut!
One other thing instead of starting a new thread:
if you have a selectList with attribute multiselect="true"
do you know how you can capture multiple selected values?
In my controller, I tried binding my selectList to a List and a string, but these
can't seem to be able to handle multiple selected values.
Any ideas?
Thanks again
I believe it should look something like this. The"value" is bound to a string array which will contain the selected values.
VF page
Your controller:
I see. That's pretty strange because I would've imagined a List would do it.
Wouldn't work out for me. Thanks again for your help and your time!
That works great for capturing the selected values of a multiselectpicklist.
But how would one actually set them in the sobject field explicitly?
For example, if you imagine that there was an SObject field called Country which was a
multiselectpicklist, how can you set the values explicitly after you have captured the
values for the apex selectlist?
If you say Country__c = countries;
this isn't going to work.
Any ideas?
Thank you very much
Ultimately a multi-select picklist in salesforce saves the selected values in a semi-colon delimited string.
You can build a semi-colon delimited string of the values in the countries array.
Then you would save this semi-colon delimited string to the salesforce database, using Country__c = countriesSemiColonString;
Brilliant!
Thank you very much. :)
Where did you find this information btw?