on 04-02-2007 4:54 PM
Could someone help me with the code to maintain the data when paging the table. I populated the table based on the role that the user selected in a drop down. Here is my existing code.
Protected Sub ddkRolesList_Select(ByVal sender As System.Object, ByVal e As SAP.Web.UI.Controls.AbstractDropDownByKey.SelectEventArgs) Handles ddkRolesList.Select
Dim um As New UserManagement
Dim role As String = ddkRolesList.SelectedKey.ToString()
Dim users As Array = um.GetUsersOfRole(role, True)
Dim user As String
For Each user In users
Dim tRow As New TableRow()
Dim tCell As New TableBodyCell()
Dim tCell2 As New TableBodyCell()
Dim tCell3 As New TableBodyCell()
tCell.TableCellContent = New TextView(GetName(user))
tRow.Cells.Add(tCell)
tCell2.TableCellContent = New TextView(GetEmail(user))
tRow.Cells.Add(tCell2)
tCell3.TableCellContent = New CheckBox()
tRow.Cells.Add(tCell3)
Table1.Items.Add(tRow)
Next
End Sub
Thanks,
Gabe Petro
Amit - I have changed my code a bit. Is it possible for you to help by being specific to my example? I am struggling to find info on using anything but a sqlAdapter call. I am not using sql but instead a query of the UM.
Private Sub BuildTable(ByVal roleID As String)
Dim um As New UserManagement()
Dim role As String = roleID
Dim users As Array = um.GetUsersOfRole(role, True)
Dim user As String
tblRoleA.Header.Text = "Users of " & ddkRoleA.SelectedItem.Text
Dim usersTable As New DataTable
Dim myDataRow As DataRow
Dim myDataView As DataView
usersTable.Columns.Add("Name", Type.GetType("System.String"))
usersTable.Columns.Add("Email", Type.GetType("System.String"))
' Iterate FileInfo objects to populate the DataTable.
For Each user In users
myDataRow = usersTable.NewRow()
myDataRow("Name") = GetUserName(user)
myDataRow("Email") = GetUserEmail(user)
usersTable.Rows.Add(myDataRow)
Next user
' Create a new DataView and sort it based on the sort field.
myDataView = usersTable.DefaultView
'myDataView.Sort = strSortField
tblRoleA.DataSource = myDataView
tblRoleA.DataBind()
End Sub
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gabe,
how are you doing ?
have you informed yourself of the links presented by Ofer in the following thread : ?
that is the methodology to be able to access the UM from within NPDK
comming to the code :
the logical steps in your case
1> read portal object
2> create local copy of data object
3> create local data table
4> create default view and bind grid
they are over engineered, but none the less should yeild the result you require
what result do you get with the code ?
um.GetUsersOfRole(role, True)
please check the methods
1> GetUserName
2> GetUserEmail
as they are outside the scope of the current function
with respect,
amit
-
Private Sub BuildTable(ByVal roleID As String)
Dim um As New UserManagement()
Dim role As String = roleID
Dim users As Array = um.GetUsersOfRole(role, True)
Dim user As String
tblRoleA.Header.Text = "Users of " & ddkRoleA.SelectedItem.Text
Dim usersTable As New DataTable
Dim myDataRow As DataRow
Dim myDataView As DataView
usersTable.Columns.Add("Name", Type.GetType("System.String"))
usersTable.Columns.Add("Email", Type.GetType("System.String"))
' Iterate FileInfo objects to populate the DataTable.
For Each user In users
myDataRow = usersTable.NewRow()
myDataRow("Name") = GetUserName(user)
myDataRow("Email") = GetUserEmail(user)
usersTable.Rows.Add(myDataRow)
Next user
' Create a new DataView and sort it based on the sort field.
myDataView = usersTable.DefaultView
'myDataView.Sort = strSortField
tblRoleA.DataSource = myDataView
tblRoleA.DataBind()
End Sub
Hi Gabe,
how are you doing ?
Basic steps to enable Paging in a SAP Netweaver Table Control,
you need to :-
1> create a server side event for paging on the table
2> call a binding procedure within the event handler
the example is kept simple to demonstrate paging, it is not optimized for performance ****
with respect,
amit
-
protected DataSet dsxBUList;
protected SAP.Web.UI.Controls.Table tblCustList;
-
private void tblCustList_Paging(object sender, SAP.Web.UI.Controls.PagingEventArgs e)
{
pageLoader();
}
private void pageLoader()
{
listBUs();
}
private void listBUs()
{
string strConnection;
// use service user temporarily :
// invoke the BU List web service
wsBusinessPartner wsBUList = new wsBusinessPartner();
dsxBUList = wsBUList.getBUList("",strConnection);
// display the results
if(dsxBUList != null)
{
tblCustList.Visible = true;
bindBUListGrid();
}
else
{
tblCustList.Visible= false;
}
}
private void bindBUListGrid()
{
tblCustList.DataSource = null;
if (dsxBUList!=null)
{
if (dsxBUList.Tables.Count>0)
{
tblCustList.DataSource = dsxBUList.Tables[0];
tblCustList.DataBind();
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.