primefaces p:rowExpansion - datatable

I am using primefaces2.2.1 in my jsf2.0 application. I have problem with datatable rowExpansion which contains another datatable. So, I want to add/remove/edit row in inner datatable (datatable which is in expanded row) and update it after action has preformed. Also I want to keep current row expanded after update. One solution is: updating whole datatable and expanding selected row after update but it gives bad visual effect...

Related

How to handle filterd result during continously refreshing data?

I have no issue to use DataTable, to filter its data and put it into a DefaultView.
The thing is even I use original DataTable or creation of DefaultView to present the filtered data my time dependent operation is getting constantly input that is refreshed in DataTable that is bind to DataGridView and when the filter is active and values are updated row-wise it is refreshed. So it results in this specific visual thing that rows that are filtered out get inserted back but not completely just in 1 column and if I select this row in DataGridView it pushes out an error System.IndexOutoFRangeException.
If no filter is active all is fine.
I need an advise what I need to do to reach my goal:
Even if a filter is active the values should be updated in DataTable (works already) that refreshes DataGridView without a "glitch"glitched so I can select a row without getting the aboves exception.
Solved:
The trick looks simple that solves the glitch too.
myDT = new DataTable();
myDV = new DataView(myDT);
bind the View to DataGridView.

Orbeon Repeat Grid Issue Dropdown Issue

In my Repeat Grid I have
1. First Dropdown
2. Second Dropdown
3. Input Area
When I select value from First Dropdown, data of Second Dropdown will be loaded. (I'm using On Value Change Action)
When I click on Plus (+) the value of Second Dropdown of First Row changes!
Similarly if I change any row First Dropdown, the values getting bounded for all the Second Dropdowns. Whatever I selected initially will be reloaded again!
Is this the bug in Orbeon or is there a way to load them differently?
This was the behavior prior to Orbeon Forms 2016.1. You can read more details in issue #1770. You can consider upgrading to Orbeon Forms 2016.1, or using the Dynamic Data Dropdown control as a workaround.

Display multiple new rows in Kendo Grid

I am doing an inline add using Kendo Grid, but on the server side I am actually creating multiple records. The DataSourceRequest sends back all the newly created rows, but only one is added to the grid. The other added records may not show up in the grid at all until the grid is forced to query for the data again.
Is there a way for me to add multiple rows at once?
If not, is there a way to re-query the data and put all newly added models at the top?
In my controller function that creates the new records, I am returning the following. "models" contains all of the newly created records:
return this.Json(models.ToDataSourceResult(request, this.ModelState), JsonRequestBehavior.AllowGet);
I also have a similar issue when updating a row since the server may actually update multiple rows. Since "models" contains multiple models, the first one in the list may or may not be the actual model selected to be updated, so sometimes a different edited model will replace the model that was selected to be updated in the grid.
Thanks,
Rob
I ended up using the kendo grid datasource insert method to add any records returned by my controller that were not already in the grid. I did this in the RequestEnd event for the datasource.
In order for this to work for inline adds, I needed to make sure the first model in the list returned by the controller was always the model being added by the grid. For some reason the initial model being added does not have an ID until the dataBinding event is reached which occurs after the RequestEnd event. So on adds, I simply ignore the first model in the results because it is already in the grid.
Also, when editing rows that are manually inserted into the datasource and then cancelling the edit, the grid removes them from the datasource. I had to block this using the preventDefault() function in the DataBinding event when a "remove" action was encountered directly after editing a row that I manually inserted into the datasource.

Disable duplicate select on dataTable

When selecting the same row twice (on a Primefaces DataTable), the rowSelect ajax behavior gets fired both times. Is there any way to optimize this and don't update the second time when the same row is selected?
Note:
Primefaces 5.0

jqgrid add new row - pre-filled

I use two grids at one PHP page.
Is there any way to get data from the first grid (i.e. after click row) and pre-fill it into the add new row form in the second grid?
thank you for any suggestion Petr
I am not sure that I correct understand what you mean under the "pre-filling". But how I understand you question you can do following:
With respect of onSelectRow event which you define on the first grid you will receive the id of selected row as the parameter. Inside of the onSelectRow event handle you can call getRowData to get full information about the data of selected row. Then using addRowData for example you can add new row in the second grid.

Resources