Hi,
-----------
I have dropdown list which should be a dynamic list.
However, choosing which dynamic list will depend on user's input to anther field. For example: if user set value 1 to field 1, then field 2 is the dynamic list will use list a. if user set value 2 to field 2, then field 2 will use list b.
How can this be done?
--------------
This had been fixed. However, as my last post, the "Please select" does not show up in the custom build dynamic list. How can this be add? for case user don't want to select then this value will be null.
Thank.
How to add "Please select" to custom build list?
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 272
- Joined: Fri Dec 14, 2012 2:55 pm
- Location: Ottawa
How to add "Please select" to custom build list?
Last edited by xren on Mon Jul 15, 2013 2:00 pm, edited 1 time in total.
0 x
- jig
- Ebase User
- Posts: 30
- Joined: Sun Oct 09, 2011 10:16 am
- Location: UK
Hi,
There are a few options depending upon your exact requirements:
1) Create One dynamic list (backed by a database table) and use the &&QUERY in WHERE clause SQL to filter values in this list depending upon the value chosen in 'Field 1'
2) Use 'createCustomList()' in JavaScript. E.g. http://www.schnellsolutions.co.uk:3131/ ... List%28%29. Using 'createCustomList()' you can also use values from an Ebase table to build a list. If you want, we would be happy to share an example
Hope this helps!
Regards
Jignesh
There are a few options depending upon your exact requirements:
1) Create One dynamic list (backed by a database table) and use the &&QUERY in WHERE clause SQL to filter values in this list depending upon the value chosen in 'Field 1'
2) Use 'createCustomList()' in JavaScript. E.g. http://www.schnellsolutions.co.uk:3131/ ... List%28%29. Using 'createCustomList()' you can also use values from an Ebase table to build a list. If you want, we would be happy to share an example

Hope this helps!
Regards
Jignesh
0 x
Regards,
Jignesh
Jignesh Vaducha, MSc, MCA
Mobile: +44 (0) 77 325 47 112
Telephone: +44 (0) 1462 488 311
Email: jignesh@schnellsolutions.com
Jignesh
Jignesh Vaducha, MSc, MCA
Mobile: +44 (0) 77 325 47 112
Telephone: +44 (0) 1462 488 311
Email: jignesh@schnellsolutions.com
-
- Ebase User
- Posts: 272
- Joined: Fri Dec 14, 2012 2:55 pm
- Location: Ottawa
More specifically,
I have field 1 - a date, field 2 a drop down list - low, high, medium.
field 4 is a dynamic list. If date is Monday and field2 is low, then the dynamic list for field 4 will be list 1. If date is Tuesday and field 2 is low, the dynamic list for field 4 will be list 2, so on and so on.
It will be great if you can provide a sample.
BTW, the link in your post does not work.
Thank you!
I have field 1 - a date, field 2 a drop down list - low, high, medium.
field 4 is a dynamic list. If date is Monday and field2 is low, then the dynamic list for field 4 will be list 1. If date is Tuesday and field 2 is low, the dynamic list for field 4 will be list 2, so on and so on.
It will be great if you can provide a sample.
BTW, the link in your post does not work.
Thank you!
0 x
-
- Ebase User
- Posts: 272
- Joined: Fri Dec 14, 2012 2:55 pm
- Location: Ottawa
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
I think you can achieve what you want by having a function that queries the database for your list entries. Here's a template you can use, but you will certainly have to modify it for your requirements. It accepts a single variable and issues different SQL depending on this. At a minimum, you will have to set the database connection name, and the values and SQL statements inside the switch/case logic.
Then to call this and build the list you will need something like this:
Good luck
Jon
Code: Select all
function getListFromDatabase(var1)
{
var connectionName = "DATABASE_CONNECTION_NAME"; // This must be changed to a valid database connection name
var sql;
switch (var1)
{
case "value1":
sql = "select xxx from tabyyy";
break;
case "value2":
sql = "select xxx from tabyyy";
break;
}
var con = system.getDatabaseConnection(connectionName);
var stmt;
var rs;
try
{
stmt = con.prepareStatement(sql);
rs = stmt.executeQuery();
var result = [];
while (rs.next())
{
result.push(rs.getString(1));
}
return result ;
}
finally
{
// It is very important to close any open result sets, statements and connection in this manner
// otherwise there will be a resource leak.
if(rs) rs.close();
if(stmt) stmt.close();
if(con) con.close();
}
}
Code: Select all
var list = fields.LISTFIELD.createCustomList();
var entries = getListFromDatabase(fields.VARIABLEFIELD.value);
for each (var ent in entries)
{
list.add(ent);
}
Jon
0 x
- jig
- Ebase User
- Posts: 30
- Joined: Sun Oct 09, 2011 10:16 am
- Location: UK
Hi,
You can also solve this using &&QUERY in WHERE clause of your Dynamic list SQL. E.g.
where DATE_COLUMN='Monday' and COLUMN_5='low' is build using &&QUERY.
If you still want me to send you an Example, please send me an Email as I don't have your Email id
Not sure why the link does not work for you...but you can try this one:
You can also solve this using &&QUERY in WHERE clause of your Dynamic list SQL. E.g.
Code: Select all
Select COLUMN_1,COLUMN_2,COLUMN_3,COLUMN_4 from TABLE_1 where DAY_COLUMN='Monday' and COLUMN_5='low'
If you still want me to send you an Example, please send me an Email as I don't have your Email id

Not sure why the link does not work for you...but you can try this one:
Code: Select all
http://www.schnellsolutions.co.uk:3131/ufs_dev/doc/javadocAPI/com/ebasetech/xi/api/WebFormFieldOrColumn.html#createCustomList()
0 x
Regards,
Jignesh
Jignesh Vaducha, MSc, MCA
Mobile: +44 (0) 77 325 47 112
Telephone: +44 (0) 1462 488 311
Email: jignesh@schnellsolutions.com
Jignesh
Jignesh Vaducha, MSc, MCA
Mobile: +44 (0) 77 325 47 112
Telephone: +44 (0) 1462 488 311
Email: jignesh@schnellsolutions.com
-
- Ebase User
- Posts: 272
- Joined: Fri Dec 14, 2012 2:55 pm
- Location: Ottawa
Who is online
Users browsing this forum: No registered users and 14 guests