In my form I have af:query based on a view.
also I have a checkbox that indicates to add or remove sql statements from the 'where clause' of the view.
for example:
my view query is
"select * from employees where employees.kod_emp>0"
I need that in case the checkbox is checked the view will look like this:
"select * from employees where employees.kod_emp>0 and employees.kod_dept = :dept_id"
and when the checkbox is unchecked the view will return to the original query.
how could I implement it using the same af:query component?
Make "autosubmit" property true for the check box and add a partial trigger.
Related
We are having a cascading LOV -> Deaprtment, class(inputComboBoxWithLOV). Class LOV is filtered with selected value of Department. When I follow the below steps:
select a department
click on the down arrow to show filtered results, I see filtered classes with the selected department. Select a class and tab out.
clear the class field, again click on the down arrow to show filtered results.(P.S : Department field is not touched) But the class field is not showing filtered results. But when I clicked on More... to display the Search and select popup, I could see the filtered results.
Only the the combobox dropdown values were unfiltered.
On Debugging, found that the viewCriteria which was applied to filter using Department is missing. The entire Where clause is missing.
This is occurring after our latest migration to 12.1.3, earlier we were using jdeveloper 11g and never faced this issue.
Any pointers about this issue will be highly appreciated.
The LOV UI hints "Filter Combo Box Using" option was unchecked, when I checked it and tried I was able to see filtered results in the dropdown.
However I did not understand why it was not picking values from existing view criteria from the view object definition related to the LOV's view accessor and why should I explicitly check this option.
This sounds like a 12.1.3 ADF BUG. You should fill in a Service Request with Oracle about it.
If you don't have a SR account, I will be happy to fill one in your behalf, if you can provide a sample workspace running on HR schema where we can reproduce the problem.
I am really struggling to select an option from my combo box based on the text rather than value. I have a combo box which has a datasource attached to it which are countries. These countries are stored in the database. I want the default country to be "United Kingdom".
At the moment I am doing the following:
combobox.select(combobox.text("United Kingdom"));
However, this only shows the text and doesn't actually select it because the select function does not trigger. Any help with this?? I want the value to be applied. I have an alert in the select function which is not appearing.
Use the select method of the widget and pass a predicate
combobox.select(function(dataItem) {
return dataItem.text === "Apples"; //note that 'text' === dataTextField
});
Here is a runnable demo demonstrating this approach.
Selecting kendo comboBox value explicitly from javascript don't trigger the "Select" event.
In order achieve that you have to trigger the "Select" event after setting the required value.
e.g.
var myComboBox = $('#comboBoxId').data('kendoComboBox');
myComboBox.text("United Kingdom");
myComboBox.trigger("select");
Hope this will solve your purpose. Also check here.
in oracle adf when we drop a table from Data Controls to a jsf page,and when we run project a row of table is pre_selected. what should I do that at first time load of the page no rows is selected?
I use jdeveloper 11g R2.
Try deleting selectedRowKeys attribute in the table properties:
<af:table value="#{bindings.View1.collectionModel}"
...
selectedRowKeys="#{bindings.View1.collectionModel.selectedRow}">
If you have a master/child relationship, set refresh condition of child to "ifNeeded".
Once user selects rows and triggers an event, in a backing bean get a handle to the table (various ways to do this), then you can get selected rows using:
Iterator tableIterator = tableHandle.getSeletedRowKeys().Iterator();
if (tableIterator.hasNext()) {
...do stuff
Once you've processed the selection(s), you can clear the selection and add partial target to show the table again without selection. First refresh the table iterator, then clear the selected keys:
if (tableHandle.getSelectedRowKeys() != null) {
tableHandle.getSelectedRowKeys().clear();
}
AdfFacesContext.getCurrentInstance().addPartialTarget(tableHandle);
Refer this, it might help you
to disable rowSelection permanently you can set table rowSelection to none and remove it's selection listener and selected rowkey
See this -http://amit-adf-work.blogspot.in/2012/09/how-to-disable-adf-default-row.html
Thanks
You can use property rowSelection="none" for af:table to disable row selection.
-Vinoth
Greeting,
I have problem about Dev Express in VB.NET 2005.
Im using Data Grid View.
How to use Data grid with checkbox in each row like this picture below ?
I can not find that properties.
This is regular List View in VB.NET
http://i293.photobucket.com/albums/mm54/davisvee/Snap1_zps07f5a11a.jpg
Thanks for reading and answer
I think here you can see an example how to do this implement multi row selection: or here
use unbound checkbox column
Hope it helps. Just skip the part with selection
You have to bind your field of the dev express grid with the column of the data table your gridview is bound to and make sure that the case of both datatable filed and gridcolumn. Fieldname is same. After doing this thing, you need to add the following code snippet to make
RepositoryItemCheckEdit repositoryCheckEdit1 = gridControl1.RepositoryItems.Add("CheckEdit") as RepositoryItemCheckEdit;
repositoryCheckEdit1.ValueChecked = "True";
repositoryCheckEdit1.ValueUnchecked = "False";
gridView1.Columns["Item"].ColumnEdit = repositoryCheckEdit1;
The above example is true for the fields which has true or false as saved values in database.
If you just want the selection mode as CheckBoxes, then try this in the Designer:
Then you can get the selected row's values as you wish.
Use RepositoryItemCheckEdit from repository section, set values check as 1 and uncheckvalues as 0
and set repository to column edit
I am trying to update existing form field based on another combo box selection.
I have a DB with such relations: http://img696.imageshack.us/img696/7396/relationse.jpg
I have a such form: http://img233.imageshack.us/img233/9758/getdata.jpg
Which Offers to select only existing IDs in database.
All i want to do is when user selects (change) existing combo box "Filmas_ID" value, in nearby input box with value "Unbound" shows up data related to this ID (You know - Just for informative reasons).
(SELECT Filmas.Nosaukums FROM Filmas WHERE Filmas_ID = combo box "Filmas_ID" value; )
It looks very simple, but i had no success yet to get it work.
Thanks for your help! =)
There are a few handy ways to do this, one involves including the data in the combo. Let us say the combo is set up like so:
RowSource : SELECT Filmas_ID, Nosaukums FROM Filmas
ColumnCount : 2
You now have a choice of setting the column widths so that filmas_id is selected, but Nosaukums is shown in the combo. Alternatively, you can set the textbox to reference the combo column, like so:
= mycombo.column(1)
Where columns count from zero.
Another method is to use DlookUp in the control source of the textbox:
= DLookUp("Nosaukums","Filmas", "Filmas_ID = " & mycombo)
Where Filmas_ID is numeric and the required value is in the bound column of the combo.