Selected value of dropdown in next form state

  • 22 January 2013
  • 8 replies
  • 2 views

Badge +2

Hello,


I have a drop down which i've binded with a smartobject created out of SP custom list, it basically displays company's Regions.


When i select a value and submit my requester form, on my next form state which is a manager approval activity, drop down does not show the selected value from previous state, it simply display the drop down with all the values available.


Any suggestions how to tackle this?


Thanks


8 replies

Badge +2

Hi,


Try to use Parameters to save data from one to another state.


For example:


1. create Form parameter RegionValue (and Save the Form)


2. on Click action then you navigate to another state choose "Configure" menu and in Mapping Destination section link your Region value from drop-down control to RegionValue parameter


3. on Initialized Form  Action (with the next state) use "Transfer data" action to set value from RegionValue to your company's Region drop-down control.

Badge +9

Lets take the following example:

Regions List in SharePoint turned into a SmartObject with the following fields:


    -  Title


    -  Description


Request SmartObject


    - ID


    - Employee


    - Region


    - Request


On the Create Request view i drag all my Request SmartObject fields over to create my view, including the Region property, change the region property to a dropdown control (it should remain bounded to the Request.Region property). A dropdown control has a Data Source section under properties, change the Type to make use of the SharePoint Region SmartObject, by default the Value will be set to Title, change this to ID and configure the Display the way you would like the control to display your SharePoint Data


For the View Request view configure the Region field exactly the same as explained above, if you now execute the load method to load the Request Item based on Request.ID the region control will display the corresponding region.


Let me know if you have further question or


 

Badge +2

Hi Renier,


I tried above but still my Region drop down is not populating with corresponding region on Manager Approval view.


As you suggested I bind my Region ddl to my Regions SO, used the #ID for Value and RegionName for Display. On Request submit I store all the values from controls to my process fields. At this point should I be saving the ID or RegionName to my process field Region???


On manager approval view, on form load i passes all the process fields values back to controls hence Region Drop Down List --> Region (Process field). Am I missing something simple here?


Thanks

Badge +9

Saving the ID should do it for you. I typically save that as part of the Request SmartObject, main reason being that you can then simply change the control type to dropdown and specify the lookup SmartObject. Now once the form loads the control will execute the getlist for the lookup smartobject and once you execute the load method with the relevant Request ID the control should display the correct region.


does that make sense?

Badge +1

Sorry to revive an old thread, but I'm having the same issue.  I understand all the above, and this is what we are doing.  But the workflow returns an Item Reference object, which passes directly to the SmartObject.


If I look into the Smart Object, it definitely has the data, but for some reason the drop down list does not select it.


I've even called the Associated SMO's load method, and I can put either the ID or Title in a normal textbox, but if I send either to the Drop-down, it simply ignores me..

Badge +1

Just a quick update - I got it working by moving the "open a worklist item" rule to the bottom of the list, so that the view's would execute their initialize methods first.  If the workitem list loaded after the views are initialised, it populates the drop downs properly...


Multiselect checkboxes still do not work, but if I pass the ID stored in my SMO to the multiselect control using a transfer data after the above mentioned rule, then it shows...

Badge +1

My have problem follow:


i have 3 item(static).


+1


+2


+3


when view init, i want choose +2(default value is +2), so how do i do?


 


thanks a lot

Badge +1

You can create a rule, when the drop down is initialised, to set the value to +2.

Reply