Question
Stella
US
Last activity: 24 Jan 2020 8:54 EST
AutoComplete not setting all properties
I have an autocomplete based on an associated property. In addition I also show and set another property. The values are sourced from a data page. When I type in the autocomplete and it displays choices and I select one of those choices only the associated property gets set, not any of the other additional properties. I have an onchange on the autocomplete to refresh the section. This only works if I select a choice in the autocomplete dropdown where the associated property is a different value than previously selected even if the other properties shown are different. How do I get the autocomplete to set the additional properties in this case?
***Moderator Edit-Vidyaranjan: Updated Platform Capability***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Mphasis
IN
Hi,
Ideally it should work. Try following
1) Actions - Post value
2) Refresh section - Activity obj-save / Commit or OOTB Save activity
Thanks
UC
Stella
US
The onchange appears to not be firing.
Pegasystems Inc.
IN
Hi
This only works if I select a choice in the autocomplete dropdown where the associated property is a different value than previously selected even if the other properties shown are different. How do I get the autocomplete to set the additional properties in this case?
Could you please explain this, didn't get your exact scenerio
Stella
US
I have attached a screenshot. providername is the associated property.. In addition I am displaying providerid and setting it when a selection in the autocomplete is made. So I am displaying providername and providerid but providername is the associated property. If I make a selection where providername is the same as previously selected but with a different provider id then it does not update the providerid when selected. Even the onchange action on the autocomplete does not seem to get fired. I'm assuming its because the associated property is not changing, only providerid is actually changing.
Pegasystems Inc.
IN
I have configured in the same way and its working for me. I have checked reload once per interaction for data page load management. If that is not possible , have a data transform on actions to load the data page again if the provider ID is different . Please refer the attached screenshots.
Stella
US
OK so when you get the auto complete and you have two selection in the auto complete with each one having the same CountryCode but with each one having a different CountryNo and you select one and then the second time you select the other one then the CountryNo is set and onchange is called for the second time around?
Stella
US
And where did CCode come from?
Pegasystems Inc.
IN
CCode is country code(Work class property displayed in UI) . Country code represents your primary name and Country No represents your primar ID.
Stella
US
Oh wait. You have an action of "change" AND "CLICK"?
Pegasystems Inc.
IN
Yeah, if your data page can't be configured with reload once per interaction , you can give it a try to have the actions with data transform
Stella
US
Yeah I tried your solution and the behavior is really goofy. As soon as you click in the edit box of the auto complete it triggers the action set. That's not behaving in the right way.
Pegasystems Inc.
IN
Hello,
Do you have 1:N relation between what you are showing and setting on selection? showing the same value multiple times in autocomplete and selecting it for the second time and expecting to set the other values based on new selection?
If so, since the DOM element value hasn't changed logically for the second time, I guess there is no OnChange event trigger and leaving with previous values.
Can you try with setting unique value on autocomplete onchange and categorize records based on the property that has the same value.
Stella
US
That's what I thought. The onchange won't fire because basically the value of the associated property hasn't changed even though the value of the second property has changed which is supposed to be being set by the autocomplete but isn't. if this is the way it was intended to always work by not being able to set the second property until submit then it would seem to me that I would need to reverse the properties because unlike the associated property the second property is unique. Its just that our customer would prefer to search using the auto complete by the first property instead.
The first property (Associated property) is "provider name" for example. The other second property is "provider id". Provider id is unique but provider name is not unique unfortunately. So when they select the provider name along with the provider id that I am displaying the provider name gets set but the provider id does not get set. I have read its because it hasn't been submitted yet and a refresh has not been done. It sounds like I can't catch on change of the provider name if the provider name was the same as previously selected which means I can't refresh either.
Stella
US
It would seem that I need a control that can consider all properties being displayed at once.
Pegasystems Inc.
IN
If you prefer to show all the properties, you can have a property set with required properties on Data page's postprocessing DT and show it by selecting "Show" option on "Search Results Configuration".
Pegasystems Inc.
IN
" Its just that our customer would prefer to search using the auto complete by the first property instead. "
You may need to check if you can categorize the results based on the property which has the same value in conjunction with configuring other property as "Use For Search" setting the unique property on change.
However, it depends on your business scenario.
Coforge
IN
Hi @TerranceK4053,
I have gone through the above conversations and can see that, the below is the requirement.
Requirement:
User should be able to select the value from autocomplete and other properties on the page must be refreshed.
And, user might choose the same value also from the search field where other properties related to that may be different and the section should refresh.
For Ex:
Consider “Karthik” is an employee of NIIT.
User tries to search from the autocomplete by keying in “Kart”.
Then, the search results will display multiple “Karthik”’s available in NIIT Company.
User must be able to choose any “Karthik” and corresponding properties must be refreshed automatically.
How can we achieve this?
- For your Data source ,there MUST be a unique key,and we can use the same key as input to a D Page for setting the properties based on user selection from the auto complete.
- For sample,I have used a new Page which is dedicated to the Data Type.
- Page property has been configured to use D page as source with the unique key id as param.\
- Refresh the section if the Unique Key on the page is changed.
Hi @TerranceK4053,
I have gone through the above conversations and can see that, the below is the requirement.
Requirement:
User should be able to select the value from autocomplete and other properties on the page must be refreshed.
And, user might choose the same value also from the search field where other properties related to that may be different and the section should refresh.
For Ex:
Consider “Karthik” is an employee of NIIT.
User tries to search from the autocomplete by keying in “Kart”.
Then, the search results will display multiple “Karthik”’s available in NIIT Company.
User must be able to choose any “Karthik” and corresponding properties must be refreshed automatically.
How can we achieve this?
- For your Data source ,there MUST be a unique key,and we can use the same key as input to a D Page for setting the properties based on user selection from the auto complete.
- For sample,I have used a new Page which is dedicated to the Data Type.
- Page property has been configured to use D page as source with the unique key id as param.\
- Refresh the section if the Unique Key on the page is changed.
Please find the attachment,which i have tried to cover the most needed configuration setup
Note:
- I have not used Data transform/ Onclick/Onchange post actions to achieve the functionality
Hope,this help you in resolving the issue,which you are facing.
Thanks.
Coforge
AU
Remove "Post value" action from the action set, and try again.
Stella
US
I believe I have a solution to my problem. I use a different associated property that is a merge of the old associated property and the second property. In the post processing step of the data page I merge the properties in the code-pega-list.