Enhanced Search Widget 1.1 - Basic Questions

2941
5
Jump to solution
08-11-2015 11:12 AM
LakshmananVenkatesan
Occasional Contributor II

@Robert I don't know whether below requirements already built in  or we need to write a new code for this. Please provide me detailed answer. a) First and foremost thing, when user enter input search value, I need validate using regex like this Ex: txtOperator.replace(/^\s+|\s+$/g, ''). b) I need to add a expression value which should search for 2 (or more) columns. But on display, only single input is provided         Example : Search Expression: Name will be searched in OPER_NM or OPER_NAME         whereClause + "and (upper(OPER_NM) like '%" + txtOperator + "%' or upper(OPER_NAME) like '%" + txtOperator + "%')"; c) Need to have input - which takes a list separated by commas, internally this will be split using commas and add in list and create a where clause?. I think this is new requirement d) In attribute result, I need make some column values are hyperlinks - if data start http:// or www.. I need to display as hyperlink e) I need a set a search expression with radio buttons a) or b) or c) ... how to make this?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

S R,

   This is why I dislike multi question threads because you have to take time and answer each question and then likely spend more time clarifying or answering sub questions to the multiple questions...

  1. I would look at adding the regEx to the SingleParameter.js. Now where in that file is on you as the developer depending on if it is a string value a number value or a date value.
  2. The widget is not developed for this so it would be up to you to recode the widget and UI to suit your needs. I don't have any recommendations for how to accomplish this.
  3. You need to look at the Widgets configuration UI and the widgets online Help. There is a "Add Link" right under "Available Fields" that allows for adding hyperlinks to the widgets results.
  4. As I said earlier if you need this just for presentation purposes then you will have to implement this in the UI yourself.

View solution in original post

5 Replies
RobertScheitlin__GISP
MVP Emeritus

S R,

First and foremost thing, when user enter input search value, I need validate using regex like this Ex: txtOperator.replace(/^\s+|\s+$/g, '').

This is not something supported by the widget and you would have to add it to the code.

I need to add a expression value which should search for 2 (or more) columns. But on display, only single input is provided

You just click the "Add Expression Value" again in the configuration UI and you specify the OPERATOR to be AND or OR.

Need to have input - which takes a list separated by commas, internally this will be split using commas and add in list and create a where clause?. I think this is new requirement

This is what the "IN" operation in the expression value dialog does in allows you to use a SQL statement like  FieldName IN ('value1','value2','value3'). There is no need to split the values by the comma as the SQL IN operator allows for a comma separated list to be used.

In attribute result, I need make some column values are hyperlinks - if data start http:// or www.. I need to display as hyperlink

There is nothing in the widget code that interrogates the results to look for a http or www. You add a link in the widgets configuration UI to specify what links you want in your results.

I need a set a search expression with radio buttons a) or b) or c) ... how to make this?

I have never considered adding this ability so I have no advice for you there. Why would you need radio buttons and not just select a value from the dropdown using the "Predefined" user list ability available in the widget?

0 Kudos
LakshmananVenkatesan
Occasional Contributor II

Thanks for Robert for detailed answer.

a) Which file needs to be edited for adding regex in input validation. Sorry I didnt go through entire JS files. I am fairly new to JS world and WAB.

b) I understand OR operator needs to be used. But in final widget screen I need to see single input text box, but when I un-check "Ask for values", screen looks like this. I want one input text box which should search multiple columns using OR condition.

input.png

c) I will try with IN condition

d) My question - when I include all fields, some of the columns contains value which is URL. This needs to be displayed as hyperlink in result window. I dont see any option to set a specific column as hyperlink.

e) My current application has options listed as a radio button , where user can see the choice and select and map /results changes accordingly.

0 Kudos
LakshmananVenkatesan
Occasional Contributor II

Robert, Can you please answer above questions. Thanks in advance.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

S R,

   This is why I dislike multi question threads because you have to take time and answer each question and then likely spend more time clarifying or answering sub questions to the multiple questions...

  1. I would look at adding the regEx to the SingleParameter.js. Now where in that file is on you as the developer depending on if it is a string value a number value or a date value.
  2. The widget is not developed for this so it would be up to you to recode the widget and UI to suit your needs. I don't have any recommendations for how to accomplish this.
  3. You need to look at the Widgets configuration UI and the widgets online Help. There is a "Add Link" right under "Available Fields" that allows for adding hyperlinks to the widgets results.
  4. As I said earlier if you need this just for presentation purposes then you will have to implement this in the UI yourself.
LakshmananVenkatesan
Occasional Contributor II

Robert, Thanks for being supportive always.

0 Kudos