I need to create a <select> drop down menu that is populated by a database query. Interaction by the user may cause a new query to be generated, and I should remove all existing elements from the list and entirely repopulate the menu. What's the most graceful way of doing that? I'm not concerned about the database interaction, just on how to take a list of strings and use it to repopulate the menu.
Related
I have a page with multiple text fields and select lists with the list of values. What I want to do is defining a dynamic action on one of the select lists that display numbers and returns same numbers and according to the selected number, I want to create or duplicate another select list in an amount of selected number. Then, after the end-user finish his work, I want to be able to take the selected values of select lists that are created within the dynamic action within the on-submit process.
Example:
In short, I want to create a dynamic action that duplicates the instructor list as many as the selected number of the number of sections list. How can I accomplish this?
If I understood what you are saying, you'd rather switch to a tabular form (or interactive grid, depending on Apex version you use). Using it, you can "Add row" as many times as you want (which would be your "Number of sections") and use the same LoV (i.e. Select List) in every row.
As far as I know (which really isn't that much), Apex isn't capable of doing that "as is". Maybe you can accomplish it the way you want it using some other techniques (blindly guessing & mentioning: JavaScript, Ajax, jQuery or whatever you might need).
I have the following menu in my application:
As it currently is, a user can select one or more items and the filter is OR-ed. However, I also want the user to be able to AND items, if they so choose. Have any of you ever come across an example where a filter can be and-ed or or-ed based on the user's preference? If so, how would this be displayed?
I'm having this issue where I have a table that depending on what option I select for the first column, the next column which contains a drop down, will populate with the appropriate values that users can select.
Here's an example
When the user submits the form, they're brought to a results page and have the option of going back to the first screen (where they select the drop downs etc).
Currently, I'm using the window.history.go() function to go back to the previous pages. However, the dynamically created drop downs aren't retaining the value that the user selects (the option that is at the very top of the drop down is always selected).
I'm currently using PHP for the scripts to generate the tables. Is there a way to fix this? Just need someone to point me in the right direction.
Thank you!
u can use history.pushstate(url+'#idx=x') when dropdown changes. and load the param values into dropdown when page loaded
I'm building an mvc web app using C#. The place I am currently stuck is trying to add a cascading drop-down list. I have seen several articles on this, however my usage varies enough that I'm not sure how to implement it.
My information to populate the dropdown lists is coming from a series of sql tables. The first dropdown should show the information from one table (which lists available tables). When the user selects an option, a second dropdown list should be created and filled with the information from the chosen table.
How would I implement this cascading dropdown list which could read from any number of different tables?
I believe this will involve AJAX/javascript which I'm not very familiar with.
To better explain my data structure, this is an application for an administrator to keep track of useful information. There could be several tables such as Employees, CompaniesWorkedWith, ProjectsBeingDeveloped, BudgetItems, etc... Then a final lookup table that would contain these table names. The first dropdown would be populated with information from this lookup table. Then when the user selects an item (such as Employee) the second dropdown would grab the information from the appropriate table and display it in a dropdown. Then the user could select and item (such as an individual employee) which will then grab the details of that item and present it to the user. That last part should be easy. I'm just confused on how to get the dropdowns to cascade through multiple tables. It should be dynamic that someone can easily go in and add another table to the lookup table and have it function properly.
You need to implement callback's to update the data sources for the cascaded controls. Just use your update panels appropriately to prevent full page post-backs. If you're using a framework such as DevExpress, Telerik or ASP.NET then there's lots of options and sample source code for this exact thing.
http://www.codeproject.com/Articles/730953/Cascading-Dropdown-List-With-MVC-LINQ-to-SQL-and-A
EDIT: I realized you're second data-source depends on a second more dynamic data source. To do this I would create my own data-source implmenting IEnumerable. I have a sample of something that may help somewhere... I'll look for it.
EDIT 2:
Okay, I took a look at code similar to this (not quite the same) but here's how you can do it:
You'll need a generic container for your values for your second/third/etc. dropdown lists. This might be a List<string> or a List<MyGenericClass> with whatever properties you are filling out to represent your columns for each row in the dropdown.
Use SqlConnection, SqlCommand to iterate through the results and populate the List (or your own class that implements IEnumerable).
Assign the IEnumerable object to your dropdown list datasource.
Is there a way to force filteringselect to only allow the user to type items that appear in the drop list. I know that it will invalidate anything that is not in the list, but I would just rather it not allow invalid entries to show.
Really, what I would like to see is behaviour that matches the HTML SELECT control. Dojo doesnt seem to provide this with any of its controls.
Im not sure if I read you okay but this is how it things go:
If you type what is in the drop list of the FilteringSelect widget
then there will be no validation error.
If you want to match the HTML Select dropdown, then use
dijit.form.Select.
If you want to Filtering Select behaviour but want also be able to type in values that are not in the drop list, then use the
dijit.form.ComboBox widget.