11/16/2024 12:57:32 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss using & developing the legacy SalesLogix Web Client (For versions 7.0 and earlier). View the code of conduct for posting guidelines.
|
|
|
|
Converting a web picklist to a multi-select picklist?
Posted: 08 Mar 07 2:44 PM
|
fiogf49gjkf0d Customers set up activity meetings to cover several topics. They would like to select several reasons (regardings) for the meeting. I know I need to add the M option, but do I also need to modify the action and database table to support multiple choices? Does any one have experience setting up SLX web pages with multi-select picklists? Is this something that others have tried and recommend that we don't do? |
|
|
|
Re: Converting a web picklist to a multi-select picklist?
Posted: 09 Mar 07 12:42 AM
|
fiogf49gjkf0d Kerry,
It's been a long time since I've had to do a multi-select list on the web. I just tried adding the "M" option and selecting several options and it didn't work. It only stored the first value in the database. So it doesn't look as if that's changed. Basically, you have to modify the database field to be large enough to store all the selected values. Then when the user selects the items, and before the form is submitted, you have to get all the selected items and put them into a string in a hidden field. I can't remember how the LAN stores multiple selections in the database, but you'll have to use either javascript and a web action to get the selected values into the same format as the LAN would expect.
Then, on the view of the form, you'll have to retrieve the DB value into a hidden field and parse the string to get all the values and then select each of the items in the picklist.
If you're going to use the same picklist in the LAN and web, you need to make the storage of picklist values conform to how the LAN client works. If it's web only, you can store them in the DB any way you like - I have used pipe delimited strings. Makes it easy on retrieval to do a javascript split statement to get all the values. Once you've split them, you can use the result to select the items in the list.
So, to answer your question, unless something has changed, it's a bit of work to get a multi-select working in the web, but it can be done. If I've really made it muddy and you want to go ahead and get stuck, post again and I'll help if I can.
Jeff
|
|
|
|
Re: Converting a web picklist to a multi-select picklist?
Posted: 09 Mar 07 2:41 AM
|
fiogf49gjkf0d Kerry,
There are a couple of ways to do it. Firstly the multi select way is pretty naff - it will only show you whats selected if you scroll down the list (not very user friendly). A better way is to have a read only field with a pen icon next to it, as you will see on the account details tab for one of the fields. Clicking the pen will bring up a dialog window that you can make your selection in and these will show up as a comma delimited list in the read only box on the screen. Its very easy to imitate by taking the code from the account details tab - but if you have any problems post back here.
Thanks, Nick |
|
|
|
Re: Converting a web picklist to a multi-select picklist?
Posted: 09 Mar 07 9:46 AM
|
fiogf49gjkf0d Nick,
Did you mean contact details? I can't find anything on acc details, but the cuisine pref and interests on the contact details tab do have the pop-up you're referring to.
Kerry, those fields on the contact details (cuisine and interests) basically are an implementation of what I'd outlined. The function init on the coninterestspl template uses the string.split method and then goes through the resulting array to select each item in the list. I'd forgotten they added those a few versions ago but Nick is right - just follow the example and it'll get the job done.
Jeff
|
|
|
| |
|
Re: Converting a web picklist to a multi-select picklist?
Posted: 09 Mar 07 10:44 AM
|
fiogf49gjkf0d Thanks for the information.
1. We are web only 6.2.6, so I do not ahve the issue to make things work in LAN and web.
2. We have several customizations, including condet, but I can see the base and will trace how INTERESTS and CUISINEPREF work.
3. I also found some information in my Web Developers Reference manual, but only how to save the selections, not how to build the selected list back out. I'll look on the support site to see if the current manual has a different example.
Thanks for the tips Nick and Jeff. I'll post again if I have questions or if I can get it working. Always like to finish threads for the next time. |
|
|
|
Re: Converting a web picklist to a multi-select picklist?
Posted: 09 Mar 07 12:15 PM
|
fiogf49gjkf0d Kerry,
if you look at the template coninterestspl, you'll see a function "init" that basically receives the delimited string of items selected in the <#AF name=curval>. It then does a javascript split on the string, which creates an array with the values. It then uses an inner and outer for loop. The inner loop iterates through each of the items stored in the database (<#AF name=curval>, passed in from the main contact details tab and then the inner loop iterates through each value in the concinterests control (the picklist), if the value on the outer loop (the interest) matches the value on the inner loop (the picklist item), it selects the item. If the value isn't found, it adds it to the picklist.
The function init is what does that - there's nothing else happening in "init()", so you can copy, paste and change the names.
Jeff
|
|
|
|
Re: Converting a web picklist to a multi-select picklist?
Posted: 09 Mar 07 1:47 PM
|
fiogf49gjkf0d Working on it now. I showed the base condet to the customer and they agreed it would work for what we wanted.
Using the code from condet (edtCuisine function and the html around CUISINEPREF). Also copied coninterestspl and changed to be my picklist modal window.
Didn't work the first time - Error processing HTML template Server : SalesLogix actaddmeet Rendering Stage: Scan Pass Tag Handler: Access violation at address 0196991C in module 'slxweb.dll'. Read of address 0000000C
Must have a HTML or js error. |
|
|
|
Re: Converting a web picklist to a multi-select picklist?
Posted: 09 Mar 07 3:13 PM
|
fiogf49gjkf0d Kerry,
An error like that usually means there's a bad tag...in the edtCuisine function you copied, there's a #FIELD tag referring to conownerid. If your template isn't based on the contact table, it'll fail, because it can't resolve the reference to the contact table if you're on actaddmeet. If you don't need the ownerid, you can safely remove all references to "ownerid", the JS variable that the <#FIELD> populates.
Jeff
|
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|