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

multiselect picklist values to textbox
Hey i have one small problem...
i have a picklist. I want to get the selected values in a textbox delimited by a ' , '
Please suggest some code...
tried using all javascript.. not working... Stuck in middle...
Pls save...
I just prepared one example try this
Controller
VFP
I hope this will help you.
All Answers
I just prepared one example try this
Controller
VFP
I hope this will help you.
Thanks for the code... hope this will help me... But couldn't understand
if(value != null && value.size() > 0)
where is this 'value' coming from????
Can you please elaborate
Thanks for the code... hope this will help me... But couldn't understand
if(value != null && value.size() > 0)
where is this 'value' coming from????
Can you please elaborate. I am new to apex
If you see this
selectedOptionsList property is binded with apex:selectList control , in getter when the page is submitted to server, all properties are binded with page control like apex:selectlist in this case. In setter method you can retrieve that value
as I have use directly using value,
if(value != null && value.size() > 0)
in this case as we are using multiselect picklist so this value is list of string.
One more thing I have added javascript also in my earlier post as you wanted to show it in text box so please try that and let me know , i am waiting for you response.
Sir,
i searched for that code in your posts but could find it.. Can You pls make a small time and give me link..
Purpose fully i want this operation to happen on javascript only.
Please
this was the part I was referening in my post this will add seleted value in text box
to see this example running go to
http://metacubepoc-developer-edition.ap1.force.com/multiSlectDemo
This demo is perfect. I have Two queries
The options are hard coded. I mean if i want any valu in pick list is to be added or removed i have to do it in coding level.
Can You make it dynamic?
And this script coding i need to call it in some action. Can u suggest that change also?
Please.
Your Questions :
Ans 1 :
I used hard coded options just for demo purpose , you can add options dynamically as well just need to add values in
multiSelectOptionList
Change code to this
VFP
Added a button to add options dynamically.
See this again :
https://c.ap1.visual.force.com/apex/multiSlectDemo
Ans 2 : You can use '{!selectedOptions}' at any place in any action this will always give yoy , separated selected values.
excellent sir... we are adding the option are later stage. But i want the options to fill in which is already existing.
I have a multipicklist field. I am selecting some values in that. Later when i click button i want the selected options in the
textbox.
requirement is bit diff
SIr, i am in almost at bank of river. Pull me over to land..
Please
Can you explain this : we are adding the option are later stage. But i want the options to fill in which is already existing
Do you want to add option at top of the list means at 0th index of the list. Or you want this option to replace first option.
I have a multipicklist field. I am selecting some values in that. Later when i click button i want the selected options in the
textbox. : I think this we hae alrady achieved , seleted value is coming in the text box
Don't worry your we both can try to solve this , you will soon see land.
sir, i have multi picklist field called Cities.
Now i will get this field on visualforce page
so it appears in two blocks
Available and chosen.
values are selected from available and put into chosen.
Now i have a button which should do the operation of fetching chosen values and copy into text box delimeted by ' , '
When multi picklist filed value is used, u will have that Available and chosen box.
I think you have got correct picture.
Let me know sir if i am wrong.
See this demo now, Is this what you want. Took some time to achieve this.
http://metacubepoc-developer-edition.ap1.force.com/multiSelectComponentPage
Excellent coding sir, Thank you so much.
I think there is a sort of mis understanding. Unfortunately i am not able to post the image here. So i am sending the
link
http://www.gamefront.com/files/20566707/Multi.JPG
In the image if you can see, there is exactly the same kind of what you have coded.
But it is a Picklist (Multi-Select) field i am refering. When this field is taken in edit page, it appears as shown in image.
I want the chosen fields there to appear in the textbox when set is clicked.
Please let me know if i can provide you any more details. I am sorry for late reply.
Hi Sir,
I have great news for you. I implemented my requirement. this happened because of your code only. I used peices
of your code in my implementation and its working great.
Thank you so much. Thanks alot for spending your precious time in implementing this.
phanirajnadiger@gmail.comis my mail id. If possible please add my contact to yours.
Will be waiting to hear from you.
Hello Sir,
i have just check your code, excellent work done by you. but problem am facing in button check selection. i have also check your demo link in that its working fine. but when am trying it with your given code its not doing anything.
Will you please tell me where is the problem.
Thanks
Neeru Nagpal
Hi,
I want to replicate similar fucntionality. When i click on link i can see the demo but not the code. Please advice.
Thanks
You mean that the selected picklist values should come to a text box???
The best choosen answer is working fine..but i want to display custom multipicklist field instead of those hardcore picklist values.Can anyone help me on, how to use custom field here?
Thanks,