I want a page in which list is need to be displayed and further I need to refine the result of list based on checked checkbox. i have set of checkboxes like filter by date , filter by status etc. In each set of checkbox, multiple options can be selected.
what i have tried till now is that i m retrieving separate list for each checkbox selected in the controller class. can u tell me how can i merge all the list in single based on selection (I also don't want duplicate entries) and pass it to my view.jsp or any other way to do this.
and one more thing when m using onClick for radio or checkox html input tag, action is triggered but tick is not getting retained in view page. Option is getting unchecked automatically on page refresh
Related
I have a list of items within a drop down on Gsheets.
I'd the default to be blank, and if another cell says 'Pending', I'd like the dropdown to automatically also say 'Pending'.
I'd also then like the user to be able to change the item with another option in the list.
I've tried choosing a data range with the function under data validation.
Basically I'd like the dropdown choices to be:
=IF(A2="Pending", "Pending", "")
In Progress
Done
Is this possible within Gsheets, or even using App Script?
I'd like the cell to default to blank, then change to pending based off another cell saying pending.
At the moment it doesn't seem to be dynamic in the sense that it updates when the chosen cell says Pending.
I'm currently developing a simple application which does crud operations on a few tables.
It looks like this:
I have a problem with the add item form, invoked by pressing the button saying "Nova jedinica mjere". It opens a popup containing an ADF form as follows:
As you can see it does a create insert operation on popup fetch event, creating an empty row. When I fill the form with data, and press OK(the ok button is handled in the bean, doing a commit operation), I get an empty error message as follows:
This only happens if the table is editable(consisting of input text elements). If it is set to click to edit, this problem does not occur. How can I make validation only occur on form fields?
If you need any more info, please let me know because I too am new to adf.
EDIT:
This is the page in question:(posted as a pastebin link to not take up much space).
http://pastebin.com/5TKyPxEs
The form in the popup is a static region from a task flow with a method call and a page:
http://pastebin.com/9h69fRW4
You mean to say that when you enter the value in the form and Click OK, it should be there in the Table,If so, the values are not getting displayed in Table. It means your Iterator is not fetching the values. You have to Refresh your Iterator, VO and Table Compoent through Bean. So that the values in the form once you click OK, it will be there in the Table.
I have a JSF table with check boxes and pagination. I have the following question: I want to select all rows into all table pages and delete them. The simple way is to create a Java hashmap and store the keys. Then Java method will delete them using the keys into the hashmap, but what will happen if the hashmap is more than 1 million? Maybe memory leak?
Maybe the solution is to use this simple JavaScript to select all checkboxes:
//Select all checkbox
function selectall(){
$('button').click(function() {
$("[type=checkbox]").prop("checked", true);
})
}
//Unselect all checkbox
function selectall(){
$('button').click(function() {
$("[type=checkbox]").prop("checked", false);
})
}
There are two problems that I face:
1. If I use the JavaScript to select all checkboxes maybe only the checkboxes on the first page will be selected, if I switch on the second page there will not be selected checkboxes. The JavaScript only works for one page.
2. If I select all checkboxes with the JavaScript when I click on the delete button how the Java method would know that every checkbox is selected into the table and delete the rows?
How I can solve these problems?
If I use the JavaScript to select all checkboxes maybe only the
checkboxes on the first page will be selected, if I switch on the
second page there will not be selected checkboxes.
That is true, because the datatable (or even the whole page) are re-rendered and will loose their checked status.
How I can solve these problems?
Focus on what you try to achieve. In fact you don't want to select all one million entries in your paginated datatable but want to delete the whole list or collection that is backing your datatable.
Why not adding a button "Delete all" that simply empties out the list? Then you don't need to care about select boxes at all.
I have a lot of DropDownChoice components with many items in a form, and on loading the form, I'd like to display only the saved selected options. When the user clicks on a DropDownChoice, I'd like to ajax-load the full item list on the fly.
Can this be done?
Add a OnChangeAjaxBehavior to your dropdown-component. Override the onUpdate-method and add another component to the target. The chosen value of the dropdown-component is inside its model.
Update: Okey, I think I know what you're trying to achieve. Add an AjaxFormComponentUpdatingBehavior to your dropdown component with "onclick" as constructor parameter.
Override the onUpdate-method and add your dropdown component to the target. Before you do that, update the dropdown model, so that it now contains all values.
If you have a lot of options to show then using <select> is not the best option.
Better check http://ivaynberg.github.com/select2/ or http://livedocs.dojotoolkit.org/dijit/form/FilteringSelect or any other JS based component which can load options on demand via Ajax.
Maybe you could go with the AjaxEditableLabels... Using the AjaxEditableChoiceLabel from Wicket Extensions, you'll get a compponent that displays the current value as a Label until clicked and the changes to a DropDownChoice via Ajax. That should be pretty much like the solution you're looking for.
How many JSPs to create to maintain one table for data entry. Add.jsp to enter a new record and Update.jsp to update an already entered record. Is this a good idea or create only one jsp and use that for add and update using some parameter as all the fields and functionality remains same. Only difference is at the time of update few fields will be disabled and you need to pre-populate the form. I can use struts or jsf to develop this.
Better use one page, and differentiate between new and existing based on some criteria - for example, if the id of the object is 0.
Even if you make two pages, you can include the common content so that you don't copy-paste.
I like the one page approach too.
You could have a dropdown box containing the ids' or some other value that provides an easy way for the user to find a specific record and whatever other html elements you need on the page for displaying a record.
They make a choice using the drop down box if they wish to edit a record and then that records data is displayed on the page for editing, the user enters the corrections and hits the submit button.
If they want to enter a new record, then they do not make a choice using the dropdown box and instead just fill in the fields on the page and hit submit.
When posting back to the page you can check and see if a selection was made using teh dropdown box and if not enter a new record and if a choice was made then you update the record that corresponds to the selection made from the dropdown box.