ADF RichTable binding with view object - jdeveloper

I have created viewobject which generates columns based on a dynamic query. I want to bind the viewobjec to richtable instead of iterating through each row in viewobject and adding it to the richtable. Can anyone help me?

Did you consider using the dynamic table component?
Similar to this:
https://blogs.oracle.com/shay/entry/adf_faces_dynamic_tags_-_for_a

Related

How to combine two tables/view objects into one in JDeveloper?

I have the following tables/view objects:
StudentRequest
StudentApprovedRequests
I want to add a new StudentRequestHistory View object that simply combines both of these tables by displaying both of their content in one. This table is simply for visual/front end purposes, its does not exist in the database.
What I want is this:
StudentRequest View Object
StudentApprovedRequests View Object
StudentRequestHistory View Object
Really hope someone can help.
Thank you!
Define a VO based on a SQL query that uses the Union: https://docs.oracle.com/middleware/1213/adf/develop/adf-bc-vo-queries.htm

DataGridview with linq-to-sql

I have a datagridview which is used for listing all the students information .I am using linq to sql as a datasource.My problem arises when I edit a row or add a new row directly in a gridview.I mean there are no any forms for editing or adding student information.User should type on the particular columns to edit or to add a new row.
I found the soultions which uses SqlDataAdapter .
TableAdapter.Update(e.Row); which updates the database.
I wonder how can I achieve the same functionality using linq to sql.
Call the SubmitChanges() method of the DataContext, which you used to fill the DataGridView.
MSDN reference:
http://msdn.microsoft.com/en-us/library/bb292162.aspx

problem with 'datatable' jquery plugin and two table (ajax related)

i have two tabs that their content loads by ajax. both have a table in their content. i want to apply 'datatable' jquery plugin to both table. tables have the same id because they are create by a function.but their rows are different.
datatable plugin is applied to first tab table well but on the second one give this error:
"DataTables warning (table id = 'dttable'): Cannot reinitialise DataTable.
To retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrieve to true. Alternatively, to destory the old table and create a new one, set bDestroy to true (note that a lot of changes to the configuration can be made through the API which is usually much faster)."
i use "bDestroy":true in datatable plugin define.but in this way the plugin doesn't show in second table.
would you help me?
Your problem is that both tables have the same ID, which is invalid HTML. When you try to initialize the second Databable, your selector only finds the first table and tries to initialize Datatables on the first table again, which results in the error that you are getting.
You need to change your function to create each table with a unique ID and initialize each table by its respective ID.
Why not set the Datatables by a className rather than ID then it can apply to both of them?
When retrieving the data you can use something like $('.dataTableStyle').eq(1) to get information from the relevant one.
I'm using mvc3 and my problem was with initializing a dataTable in a view, then rendering a partial view with another dataTable. The issue was not in the id's of the 2 tables, but in the way the partial views get rendered in the framework. In my case, I had to move the script, or reference to the script, into the view that hosts the partial view. I had an issue similar to this using the Google Maps api.
try this code
$(document).ready(function() {
oTable = $('#DataTables_Table_0').dataTable({ //DataTables_Table_0 <-------table id
iVote: -1, //your field name
"bRetrieve":true
});
oTable.fnSort( [ [1,'desc'] ] );
});
use this in function event when you would change your table data
$('#tbl_resultates').dataTable().fnDestroy();
and add
"bRetrieve": true,
in
$('#tbl_resultates').dataTable({

XtraReport and xrTable shows only 1 record

I have a linq to sql generated object MyObject and this contains an EntitySet.
Now i use an XtraReport with a BindingSource.DataSource = MyObject. I have a xrTable in the Detail band (which is the only one i use btw) with four xrTableCells binded binded to properties from MyObject.MyotherObject.Property. It keeps showing me only the first record and not all of them.
Anyone with an idea?
I believe you'll need to implement the ITypedList with your custom object to use it as a datasource. Check out this online documentation article for more info:
http://www.devexpress.com/Help/?document=XtraReports/CustomDocument4046.htm
I have just solved a similar problem. Did you use typed datasets to help you layout the report at design time? If you did then clear the Data Source in design view. If you apply LINQ to SQL Data Source at runtime without clearing the typed dataset Data Source in the design view, you may get only one row showing in the detail band.
i have similar problem and tried above answers, but it was so simple
just set your report DataMember to the name of your sub collection MyObject.MyotherObject
and the table will load all items in your sub collection.
XtraReport report = new XtraReport(){DataSource = MyObject,DataMember="MyotherObject" };

How do I edit a Telerik RadGrid when using multiple tables as a data source

I have asked this question on Telerik forums with no reply so I'm turing to you.
I have seen this topic come up before but without an answer so I thought I'd define the problem as simply as possible.
I have a LINQ command creating a query:
var gridData = from au in dc.aspnet_Users
join aur in dc.aspnet_UsersInRoles
on au.UserId equals aur.UserId
join ar in dc.aspnet_Roles
on aur.RoleId equals ar.RoleId
join am in dc.aspnet_Memberships
on au.UserId equals am.UserId
select new
{
au.UserName,
ar.RoleName,
am.Email,
am.IsApproved,
am.IsLockedOut
};
THE IMPORTANT POINT IS THAT THIS USES MORE THAN 1 TABLE.
Note: This is accessing the Roles and Users tables using the standard ASP.NET Membership framework.
Then I have a simple RadGrid:
<MasterTableView EditMode="InPlace">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
</MasterTableView>
Finally I bind the data to the grid in Page_Load
rgUsers.AutoGenerateColumns = true;
rgUsers.DataSource = gridData.ToList();
rgUsers.DataBind();
rgUsers.EditIndexes.Add(1);
rgUsers.DataBind();
GridView1.AutoGenerateColumns = true;
GridView1.DataSource = gridData.ToList();
GridView1.DataBind();
GridView1.EditIndex=1;
GridView1.DataBind();
This will display the data from the 4 tables correctly.
I included a GridView to compare functionality.
I also put the grid into Edit mode programatically to make sure that this was not just a problem with the Edit button.
However, when in Edit mode the RadGrid fields are not editable.
I have tried the following:
1) 1) I can use a LinqDataSource that allows Edit/Update BUT only if there is only 1 table in the LINQ query.
2) 2) I can use a ObjectDataSource onto a dataset but once again this only works if the the dataset adaptor is accessing a single table.
I have looked at the variouse suggested demos and example code but they have all ignored the multiple table/Join problem:
www.telerik.com/community/code-library/aspnet-ajax/grid/automatic-operations-with-linqdatasource.aspx
demos.telerik.com/aspnet-ajax/grid/examples/dataediting/threelevel/defaultcs.aspx
www.telerik.com/community/code-library/aspnet-ajax/grid/automatic-operations-with-linqdatasource.aspx
I am not wedded to LINQ. I am quite happy to adapt in order to get a RadGrid that can support Update and Edit to multiple tables.
What should I do to achieve a RadGrid that displays records composed from multiple tables with Update and Edit available?
Thanks for any help
Richard
Have you considered using ADO.net's dataview class in conjunction with a dataset class? You should be able to pull you data using the system.data.sqlclient class with a stored proc if that is the type of database you're using. You can preserve your database's relationships in the dataset class and the dataview class will allow you to view the data as if it were a single table. Then you should be able to bind the dataview class to the Telerik control.
Why not using NeedDataSource binding as opposed to DataBind() calls? Thus the Telerik grid should manage its editing states without extra coding. If you use joins for different source tables and set you update or insert commands using appropriate T-SQL statements, everything should work fine. Check out this demo for a start:
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/extractvalues/defaultcs.aspx
Dick
Turns out that the LINQ query returns an anonymous type that is read only.
I replaced it with a SQLDataSource using stored procedures so it works now.
Thanks

Resources