Select to view content in your preferred language

Problem using multiple expressions in eSearch 3.1

2327
16
Jump to solution
01-28-2013 06:09 AM
JustinFultz
Regular Contributor
I am trying to upgrade my flex application to 3.1 and am having problems with the eSearch widget. I have a multiple expression search that worked fine at 2.5. When I upgraded to 3.1 and the newest eSearch widget the multiple expression automatically runs when I fill in the first value and I never have the oppurtunity to select the second value. I have tried all different combinations of isvaluerequired, all with the same result. Below is the config for this particular expression. Any help would be appreciated.

<expression alias="Tie Lines" textsearchlabel="Select TO's to display tie lines..." isvaluerequired="true">      <values>       <value prompt="Select Area..." isvaluerequired="true" userlist="AECI,AEPW,AMMO,CLEC,EES,EMDE,GMO,GRDA,INDN,KACY,KCPL,LAFA,LAGN,LEPA,LES,MEC,MIDW,NPPD,OKGE,OMPA,OPPD,SPRM,SPS,SUNC,SWPA,WAPA,WERE,WFEC"> UPPER(SDE.SPP_TIE_LINES.TIE_NAM) LIKE UPPER('%[value]%')</value>       <value prompt="Select Area..." isvaluerequired="true" userlist="AECI,AEPW,AMMO,CLEC,EES,EMDE,GMO,GRDA,INDN,KACY,KCPL,LAFA,LAGN,LEPA,LES,MEC,MIDW,NPPD,OKGE,OMPA,OPPD,SPRM,SPS,SUNC,SWPA,WAPA,WERE,WFEC" operator="AND"> UPPER(SDE.SPP_TIE_LINES.TIE_NAM) LIKE UPPER('%[value]%')</value>      </values>      </expression>
Tags (2)
0 Kudos
16 Replies
AnthonyGiles
Honored Contributor
Robert,

The fix you supplied works if you have more than one field set as required, but the problem still exists if the fields are not set to be required. In my case all fields are optional as I want the user to be able to search on what fields they would like to search on (this may be a single field or a combination). But the query still fires on change of a field if they are all set to not required.

What I have done is disabled the automatic query on change of drop down value, but in cases where there is only one field the automatic search would be good. So what I think the solution needs to be is either check if more than one drop down is set up for the search and then disable the automatic search or have a setting to each layer in the config that allows you to specify automatic search true or false.

Regards

Anthony
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Anthony,

   I hear what you are saying and did consider that route, but decided that if a textbox or dropdown is Not required and all required fields have a value then the search will be executed when the user selects a value in the dropdown. It is hard to make this work for everyone's desires and situation as you want it one way and someone else is asking for something else. I do like the idea of a flag for autoexecuteonselection for all dropdowns. I will consider that approach in the next version if you think that will work.
0 Kudos
AnthonyGiles
Honored Contributor
Robert,

Not sure if you would need a flag for autoexecuteonselection on each drop down or just one set for the whole expression. Either way would work but the later maybe easier to implement.

Look forward to your solution if it makes the enhancement cut.

Many thanks again for all your effort,

Regards

Anthony
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Anthony and Others,

   There is code in the widget that follows this workflow:

  1. Every expression value in the eSarchWidget.xml gets either a textbox or a dropdownlist created in the widgets GUI

  2. If it is a textbox an event is added to it looking for the enter key to be pressed and then fires the AutoSubmitSearch

  3. The AutoSubmitSearch fires off and a check is done to see if there is only one entry item (i.e. one textbox or one dropdownlist) and if true then the search is automatically submitted.

  4. If there is more than one field in the GUI then it checks if the search button is enabled and if it is then the search is automatically submitted.

  5. Now the search button is disabled if all required fields do not have a valid value.

  6. If the expression requires a dropdownbox then it is give a change event listener and it fires the AutoSubmitSearch

  7. Step 3 thru 5 are repeated.

So if you follow the workflow above it currently does not matter if it is a textbox and you click enter or a dropdown and you choose a value if the search button is enabled because all the required fields have valid values the search will be executed.

   So I guess I explain all of this looking for input... If I add an autoexecute flag with true or false on the whole expression then that would control all the textboxes and the dropdowns in that expression and AutoSubmitSearch would or would not get fired based on that flag. Or I could put an optional autoexecute flag on each expression value so that you would have tighter control over each expression value and whether it individually fires the AutoSubmitSearch.

And do you think the autoexecute should default to true or false is not provided in the xml?
0 Kudos
AnthonyGiles
Honored Contributor
Robert,

My personal preference would be the second option if it gives you tighter control. I always think it is better to have the most control you can.

Regards

Anthony
0 Kudos
RhettZufelt
MVP Notable Contributor
I would second the second option.

preference would be default to true.  would make it an obvious feature, but one could disable if not desired.

R_
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Guys,

  Version 3.1.8 - 2/5/2013
* Fixed Localization issue with export2csvoptionlabel and export2txtoptionlabel
* Added autosubmit to expression values to allow control over whether a dropdown list
  automatically fires the search upon selection and textbox when the enter key is pressed.
  The default is true if this attribute is not used.
0 Kudos