knockout - update UI (filter data) based on select/dropdown choice? - select

How can I update this UI based on the selection made in the select/dropdowns?
For example, if I select a member name from the select/dropdown, I want the table to update/filter to only show those member rows (member names are in far right column) AND their corresponding date header (the gray background).
If I select a provider name from the select/dropdown), I want the table to update/filter to only show those provider rows (provider names in left column) AND their corresponding date header (the gray background).
I'm using the KO mapping plugin. The dummy data is hard coded and would eventually be returned via ajax.
Here's a fiddle of all the code (it's all just inlined in the HTML pane). You could copy/paste this and run it locally if you wanted, as well.
http://jsfiddle.net/qBGTh/
Any help/direction is greatly appreciated!

My suggestion is to use a computed value at eob level returning the filtered array. To add this computed value during the mapping process, you must customize the eob object creation using a create callback in the mapping options parameter (see mapping doc)
Here is the updated fiddle to see it in action.
Also don't forget to add 2 more observables to capture current values for the 2 select elements. The computed value will depend on those 2 observables.
Note: the provided fiddle will not run on IE as github where is located the
mapping javascript does not return the content-type header required by IE.

Related

Update chart after changing a field in an APEX form

How do I cause APEX to refresh a chart (graph) after I change the value in a text box/select list/etc that is used as a parameter in the chart's pl/sql statement?
I'd like it to look as professional as possible and minimize the portion of the page that must be refreshed (i.e., "ajax-like", which is the standard in 2018).
Create a dynamic action on the text box/select list/etc that is changed with event "change"
Create a true action and select pl/sql and write
Begin
null;
end;
In page items to submit select your items
Create a second true action after the first and select Refresh. Then select region as affected element and select your chart. Remember that the option 'Fire on initialization' must be set to NO
See Approach B, below, for the optimal solution.
Approach A
The simplest option (that is less professional) is to modify every text box/select list/etc of interest to submit the page when the value of the text box/select list/etc changes. As an example, for the select list, go to its settings->page action on selection and change the setting to submit page.
There are two main downsides to that approach:
Most of the page will refresh, which is jarring to your user, and
If you're using a plugin, or the type of item that you're using doesn't support that approach, then you're out of luck.
Approach B
A more complex solution that yields a more professional result follows. This solution involves dynamic actions, which I will probably not fully explain here. However, the information should be enough for the user to figure it out.
Let us suppose that you have two things: (1) a select list whose value is used as a parameter in a (2) chart's sql source statement.
To get the chart to update every time you make a new choice via the select list, you need to:
Create a dynamic action for the select list of interest. You do this by clicking on the select list, going to the dynamic action tab (the lightning bolt); right-click on the item; click select dynamic action; give it a name and set the event to change and make the selection type an item and set the item to the name of the select list you're watching.
Create a true action for that dynamic action that executes pl/sql code (you can do this by modifying the show action that was created by default in 1.). Set the pl/sql code to null;. Then under items to submit, specify the name of the select list of interest.
Create a second true action that refreshes the region that contains the chart.
You'll need to make sure that the sequence assigned to 2. is a smaller number than the sequence assigned to 3.. This should happen by default, but it's an area you can get tripped up.
Inapplicable Approach C
In Apex 5.something, they added a feature called Cascading List of Values. This feature allows you to specify that one item depends on another item for its values. For example, if you have a select list that allows the user to choose a department, and then you have a second select list that allows you to choose an employee from the chosen department (which presumably obtains its values from a query involving the value chosen in the first select list), you can tell APEX to refresh the second select list whenever you update the first.
You do this by editing the second select list. Under its settings goto list of values->cascading LOV parent item(s). Add the first select list as a "reverse" dependent (aka, "parent"). This will ensure that any time the first select list is updated, the second select list is also updated.
For better or for worse, charts do not have the cascading LOV parent item(s) setting. Thus, this solution does not apply to this question.

Is it possible to modify parts of the form based on one of the field of the form?

I am using the Formula package from the Iliad web framework in Pharo. I have a model object which have a first attribute and then one to three other attributes depending of the value of the first one.
I built a form with ILFormula but couldn't find methods in Formula to change the displayed input based on changed value on the first field.
So I believe I need to add an event on the first field and do it directly but I am not sure where to begin to that within the Iliad framework.

APEX 4.0 - How to load items when using select

I have a question about APEX, I have the problem that when I try to select a value from a selectbox, no value shows in the other items. What I have tried to do is loading data from the database to the items when I select a code from the selectbox with PL/SQL. How do I do this? Selecting a code from a selectbox and filling all the other items?
Vid
Ok if i understand you right you need a List of Values.
If you create this shared Object. Use a dynamic list.
There you have a dialog you can put a PL/SQL or SQL Code snippet into.
You must return a 2 column list. The first Column is the field name in you later select box and the second is you reference.

Customizing the Content Report Table Macro

I have been using the content report table macro, which has been working. Ideally, I only want to list content matching certain labels, and lock in an alphabetical sort order and not show the content author.
I have not been successful in figuring out a way to do this just yet.
Is there a way to just edit the source code for that macro and create a "new one"? I'm struggling to find any useful documentation out there.
Any suggestions are appreciated!
I was also interested on doing this some days ago. Unfortunately, the Content Report Table Macro only have very limited parameters which are very strict. However, the way I succeeded to display only certain properties from the pages and present them in a tabular way (in Confluence 5.8) was with the combination of the macros Page Properties and Page Properties Report, both of them linked by a unique label. I'll break it down below.
Outcome:
1. Set up of properties you want to track
Create a page.
Add the Page Properties macro (no need to specify an ID)
Within the macro just add a table with all the properties you need to keep track of, similar to this:
Important, this is what links the two macros together: Add a label to the recently created page.
2. Display properties in main page
Add Page Properties Report macro. Specify label used across all the already created pages. Also specify the space (I just love this part). In here you also add custom fields (some fields from Content Reports are here). In Options you can specify which properties to display (columns to show), also the sorting order (in my case I'm sorting by the property ID that I added to each page).
Note: if you just want to remove the content author this can even be done easier: no need to add any property, just specify the label of your pages and add the fields you need to show and sorting order.
Hope this helps.

Access comboxbox selection needs to change value in label control

On a form, I have a combobox, with the RowSource coming from a query (specifically, a calculated field in the query). When the user makes a selection, I want to update a label on the same form with a different column from that same query, but of course associated to the selection.
I'm fine with VBA and writing queries and whatnot, but I am not very familiar with Access forms.
By the way, I tried searching for an answer to this, but it was quite difficult because I don't know what this thing is really called that I am trying to do. A good link to a site explaining this would be perfectly fine (no need to write a bunch of stuff here if it already exists elsewhere).
In the After Update event of my combo box, cboUserID, I can set a label control, lblFoo, to the value of the second column in the selected row of the combo.
Me.lblFoo.Caption = Me.cboUserID.Column(1)
If your combo box is bound to a field in the form's record source, you may want to do that same operation from the form's On Current event also.
You can use the column property to refer to anything other than the bound column of a combo.
Rowsource: SELECT ID, SName, FName FROM Table
Me.MyCombo.Column(2)
This would return FName.
-- http://msdn.microsoft.com/en-us/library/aa224084(v=office.11).aspx
Me.MyLabel.Caption = Me.MyCombo.Column(2)