IPhone Table View Initialization

Hi, I am trying to write an app with two views. One view there will be a simple game, and the other, settings for the game. I have successfully written the game, and the code that allows the app to switch to the opposite view and back again. However, on the second view, I want there to be a UITableView with the settings options on it. I have created an NSMutable Array in my SettingsViewController.m file in the viedDidLoad method. Then, I set the rows of my table view by using the numberOfRowsInSection method. Then, I populated the cells by using the cellForRowAtIndexPath method. Everything compiles fine, but because I am not using the Navigation based template, I cannot seem to get the table to link with the table that I inserted in interface builder. Can anyone help me? Thanks.

Hi, I am trying to write an app with two views. One view there will be a simple game, and the other, settings for the game. I have successfully written the game, and the code that allows the app to switch to the opposite view and back again. However, on the second view, I want there to be a UITableView with the settings options on it. I have created an NSMutable Array in my SettingsViewController.m file in the viedDidLoad method. Then, I set the rows of my table view by using the numberOfRowsInSection method. Then, I populated the cells by using the cellForRowAtIndexPath method. Everything compiles fine, but because I am not using the Navigation based template, I cannot seem to get the table to link with the table that I inserted in interface builder. Can anyone help me? Thanks.

Similar Messages

  • [iPhone] UI Design pattern for table views with properties and children?

    Hello,
    I'm getting started with iPhone development and I have a question about the proper way to display a list that has both properties of the list itself as well as the ability to drill down into the members of the list. For example, my data is a Group (of people say). The Group itself can have properties - the name of the group, group email address, web page, etc. - and it obviously has members which also have properties - name, address, etc.
    In my table view, I want to show the Group members and have accessory/disclosure buttons on each row to show the details of a person, but I also want to be able to edit the properties of the group - Group name, etc. What's the UI pattern for editing the properties of the table itself?
    I thought about having a tabbar that toggles between the list and the properties of the list.
    I also thought about having a parent table that lists the groups (so I could have more than one) and then have accessory buttons on each group row. The UI would then have to be that the user taps the row to drill down to the group members and taps the accessory button to edit the properties of the group. Is that "proper" - tap the bar or tap the accessory icon in a table row?
    Thanks

    I don't think I'd use a tab bar.
    You could break the table up into 2 sections, section 0 being the properties, section 1 the list.
    Make section 0 just say 'Properties', then when you tap that row you drill down to a properties table, slap an edit button in the navigation bar to go into edit mode.

  • [iPhone] large table view (500+ elements), each cell with a UIWebView

    Hello, all ...
    I'm developing an application that has to show a table view with 500 (or more) elements in it. Each element has a UIWebView that has to load an image (50x50 pixels in PNG format) from a web server. What i'm finding is that, when this table view is displayed, most of the images don't show up, though a few of them do. I've verified that all of the images are indeed on the web server, but I think that most of the requests fail (perhaps to too many of them going on at once?). Furthermore, the table sometimes scrolls very rough i.e. when an upcoming cell is loading its' image.
    Other iPhone apps seem to do the UIWebView-in-a-cell thing pretty well i.e. Facebook. In the Facebook iPhone app, the table scrolls smoothly, and the images display as they're loaded. How can I make my app behave similarly?
    Regards,
    John
    Falling You - exploring the beauty of voice and sound
    http://www.fallingyou.com

    Hmm ... something still isn't right. The scroll view still scrolls very jerkily, and the reason seems to be that I don't know which delegate method to override to detect when scrolling has finished. I tried overriding -scrollViewDidScroll, like so:
    - (void)scrollViewDidScroll:(UIScrollView *)scrollViewDidScroll
    AlbumViewCell *firstAlbumShown = (AlbumViewCell *)([[self.tableView visibleCells] objectAtIndex:0]);
    AlbumViewCell *lastAlbumShown = (AlbumViewCell *)([[self.tableView visibleCells] lastObject]);
    NSLog(@"scroll view finished scrolling ... first row is %s:%s and the last is %s:%s",
    [[[firstAlbumShown album] albumname] UTF8String],
    [[[firstAlbumShown album] artist] UTF8String],
    [[[lastAlbumShown album] albumname] UTF8String],
    [[[lastAlbumShown album] artist] UTF8String]);
    for (int count = 0; count < [[self.tableView visibleCells] count]; count ++)
    [[[self.tableView visibleCells] objectAtIndex:count] displayAlbumArt];
    ... but when I make one swipe with my finger to scroll the view, I see this in the console log:
    2008-10-21 15:43:52.051 Magnatune[3160:20b] scroll view finished scrolling ... first row is 14 Days:Plunkett and the last is A Celtic Celebration:Da Camera
    2008-10-21 15:43:52.637 Magnatune[3160:20b] scroll view finished scrolling ... first row is 5 and 6 part Fantasies of William Lawes:Oberlin Consort of Viols and the last is Acoustic Abstracts:Heavy Mellow
    2008-10-21 15:43:53.376 Magnatune[3160:20b] scroll view finished scrolling ... first row is Airs De Cour Francais Du XVIIe Siecle:Trio Dafne and the last is Alpha and Oranges:Atomic Opera
    2008-10-21 15:43:54.247 Magnatune[3160:20b] scroll view finished scrolling ... first row is Ambient Excursions:Stargarden and the last is Apa Ya:The Headroom Project
    2008-10-21 15:43:55.041 Magnatune[3160:20b] scroll view finished scrolling ... first row is Ashek:Tim Rayborn and the last is Back with Bach:Ralph Rousseau Meulenbroeks
    2008-10-21 15:43:56.002 Magnatune[3160:20b] scroll view finished scrolling ... first row is Azadi:Junoon and the last is Balance:Solace
    2008-10-21 15:43:56.581 Magnatune[3160:20b] scroll view finished scrolling ... first row is Azadi:Junoon and the last is Balance:Solace
    i.e. -scrollViewDidScroll was called multiple times, even though I only swiped once. I just want to know when the scrolling has truly and completely stopped, so I can tell the visible cells to draw their album art. Which delegate method do I override?
    Regards,
    John
    Falling You - exploring the beauty of voice and sound
    http://www.fallingyou.com

  • [iPhone] Grouped Table View using SQLITE?

    I am filling my table views from a SQLITE table. I am trying to get it to display in grouped mode, but I am unsure on how to handle this using SQLITE. I can get the grouped mode to work, but I can't get it to show any headers, it is just one large block with all the returned results.
    Anyone been able to get this to work or might have some advice?
    Thanks.

    Beers is correct. This is easy to accomplish though, if you have your recordset fed into an array on SELECT.
    I'll start you off because i'm such a stand-up guy
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tv {
    return 123456789;
    - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    // switch( section ), or if statements to send different titles
    return @"My Title Is The Greatest";
    - (NSInteger)tableView:(UITableView *)tv numberOfRowsInSection:(NSInteger)section {
    // Again, if more than one section do a switch( section ): or bunch of if statements
    return [myDataArray count];

  • How can I create a Table View in Cocoa Applescript?

    This is my last resort. I've searched for days and only found tutorials for iPhone and Cocoa, and I have no idea where to start. I'm looking for a way to create a Table View, and fill it with a few cells that call a handler when clicked. I've looked through the Xcode help, the Apple documentation, and countless tutorials, and I don't know what to do. I'm sure what I'm asking is possible, because usually what is possible in Cocoa is possible in Cocoa-Applescript.
    Perhaps something like:
    myTableView's addCell_OfType_WithHandler("This is a text cell", text, "myHandler:")
    I would appretiate any responses and brief descriptions on the matter.

    You did not answer my first question, which was not an idle question. I'll answer here, but if cross-chatter appears in a different thread I'll ignore it. You'll have to keep track of the mess yourself.
    Apple_For_The_Win wrote:
    At this point, I've dragged a Table View onto my window, in Xcode. I've connected it to the value "myTableView", and that's where I need help. I'm specifically trying to add cells into the table view.
    I'll assume that 'connected it to the value "myTableView"' means that you've control-dragged in XCode from the table view in Main Menu.xib to a property in your applescript app delegate called myTableView. If that's not the case, please correct me.
    I prefer to use an array controller for this, so please drag an array controller object into main menu.nib. once you've done that, do the following:
    open the applescript app delegate and add a new property called "tableController"
    select the table view in the object list (you may need to open some disclosure triangles to reach it). and add appropriate (an) column name(s). you can hide column titles later if you like, but having named columns makes life easier.
    select the array controller in the object list
    rename the array controller "table data"
    open the attributes inspector, and then add the column name(s) as key(s) in the object controller area
    open the bindings inspector, and where it says "controller content", open the disclosure arrow and bind the content to the App Delegate object on the model key path self.tableController
    select the table view in the object list again, then go down a level and select each column in turn
    for each column, open the bindings inspector, and where it says "value", open the disclosure arrow and bind the content to the Table Data object with the controller key arrangedObjects model key path being the name of the column (which is the name of the key in the controller as well)
    back in the applescript app delegate, add code like the following:
      -- create a list of records, where each record represents a row and the column name is the record key
      set myData to {{column_1_name:"hello"}}
      -- convert it to an NSArray and add it to the controller content. don't forget the *my* keyword, or it won't work
      set my tableController to NSArray's arrayWithArray:myData
      -- may or may not be needed
      myTableView's reloadData()
    That should populate the table with simple text. if you want something more complicated (like buttons or links) then create the more complicated elements separately and add them to the data.

  • Table View in View-based Application

    Hi.
    I want to use an UITableView in a View-based Application.
    All examples I found are for Navigation-based Applications.
    I Found only one example for View-based Applications, but it create all components himself without the Interface-Builder.
    I search an example with Interface-Builder.
    My main problem is, when i create a view with Interface-Builder, the controller class does not inherit from UITableViewController.

    GrinderFX wrote:
    I want to use an UITableView in a View-based Application.
    Hi, and welcome to the Dev Forum!
    Firstly, I would point out that you don't need to use UITableViewController to control a table view. The table view controller is just more convenient. So for example, you could simply drag a table view from the library in IB and drop it onto your view. Then you could hook up the table view's dataSource and delegate outlets to the File's Owner. Then you would add the data source and delegate protocols to the @interface of your UIViewController subclass and add the required data source and delegate methods to the @implementation.
    I mention the above because building your table view that way is very instructive. If you want to learn more about table views in general I would recommend Chapter 8 of +Beginning iPhone Development: Exploring the iPhone SDK by Mark and LaMarche+, which includes 3 table view projects that don't involve a navigation controller.
    My main problem is, when i create a view with Interface-Builder, the controller class does not inherit from UITableViewController.
    Returning to your specific question, IB allows you to change the class of an object. Here are the steps to use the View-Based Application template as you described (In the following I'm using Grinder as the name of the project; e.g. the app delegate class is named GrinderAppDelegate, and the view controller subclass is named GrinderViewController):
    1) _Change parent of view controller subclass in your code_
    In GrinderViewController.h, you only need to change the superclass from UIViewController to UITableViewController:
    @interface GrinderViewController : UITableViewController {
    However it will be easier later on if you make new files from the UITableViewController file template:
    a) Ctrl-click on GVC.h and GVC.m in the Groups & Files tree; select Delete->Also Move to Trash;
    b) Ctrl-click on Classes; select Add->New File->iPhone OS->Cocoa Touch Classes;
    c) Select UITableViewController subclass from the right center panel and click Next;
    d) File Name: GrinderViewController.m; check Also create GrinderViewController.h;
    e) Make sure the name for these new files is exactly the same as the ones you deleted; if you make a mistake here, delete the new files and start over, because that name must be the same in several other files;
    f) Click Finish; the replacement files should now appear under Classes.
    2) _Change the view controller class in IB_
    a) Double click on MainWindow.xib under Resources in the Groups & Files tree;
    b) Make sure the MainWindow.xib window is open by selecting Window->Document from the IB menu;
    c) Locate the View Mode switch, upper-left, in the xib window, and select the Center position;
    d) The xib window should now be displaying two columns with small icons on the left;
    e) Select the Grinder View Controller icon;
    f) Select Edit-Delete to delete that icon;
    g) Select Tools->Library from the menu, and expand Controllers in the Library Panel;
    h) Drag a Table View Controller to the xib window and drop it right under the app delegate icon;
    i) Select Tools->Identity Inspector from the menu to open the Grinder View Controller Identity Panel (the new Table View Controller should still be selected in the xib window);
    j) Under Class Identity, select Grinder View Controller from the list; tab out of the Class field to be sure the selection is recorded;
    k) Ctrl-Click on Grinder App Delegate and connect the view controller outlet (ctrl-drag) to Grinder View Controller;
    l) Expand GVC in the xib window and delete the Table View icon (since we want it in the other xib file);
    m) Reselect the GVC icon and open the Grinder View Controller Attributes panel;
    n) Under View Controller, select GrinderViewController from the NIB Name list;
    o) In the Table View Controller IB Editor window, select GrinderViewController.nib to open the other xib file;
    p) Make sure the GrinderViewController.xib window is open in small icon mode as in steps b-d above;
    q) The class of the File's Owner should be GrinderViewController;
    r) Delete the View icon;
    s) Drag a Table View from the Library to where the View icon was;
    t) Ctrl-click on File's Owner and connect (ctrl-drag) it's view outlet to the Table View;
    u) Ctrl-click on Table View: connect both the dataSource and delegate outlets to File's Owner;
    v) File->Save both xib files.
    3) _Make some rows in the table view and test_
    a) Open GrinderViewController.m in Xcode;
    b) Add the commented lines (be sure to use the correct line for your target OS);
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 20; // <-- change to more than zero
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    // Configure the cell
    // add this line for OS 2.x
    cell.text = [NSString stringWithFormat:@"Row %d", indexPath.row];
    // add this line for OS 3.0
    // cell.textLabel.text = [NSString stringWithFormat:@"Row %d", indexPath.row];
    return cell;
    c) Build and Go.
    I should add that the procedure might be a little easier if you start with the Window-Based Application Template. But the above is good practice in editing xib files.
    Hope that's helpful!
    - Ray

  • How to get the count of the entries in the table view

    Hello experts,
             I have got a requirement where i need to display the total number of entries present in the table view, since the result comprises of several pages. This requirement is even applicable for the filter options in the table view i.e., if i use a filter it should count the total number of entries that satisfy the filter criteria.
    Thanks in advance,
    Vijayalakshmi

    hi,
    its simple,just place an input field in the layout and display the cpunt in that field.
    for that do as below,
    first in the layout of the page where you are giving tableview tab,in the next line give
    <b><htmlb:inputField id="Count"
                      value="<%=ln%>"
                      disabled = 'X'/></b>
    to display the count in that input field which is disabled.
    and if i am mot wrong in the Initialization event, you are writing select query right to populate internal table.
    after that write,
    <b>describe table it_mara lines ln.</b>
    and define this ln in page attributes as type i.
    do award points f it helps u,
    regards,
    Message was edited by:
            sowjanya s

  • Deleting one row from a table view

    hi i have one tableview model. At the footer of this tableview there are 2 buttons add and delete. I want that when I press the delete button one row must be deleted. I have written one ondel event.I have to implement the logic inside that.Can anyone help me with the logic?

    Hey Sumana,
    Check the row of the table view u want to delete.Iterate through all the rows from the top of the Table View and copy it into another new array.While doing so, check whether the row is selected or not.If it is not selected,
    then copy the content into the new array and if it selected,skip that particular row and start copying from the next row.proceed till the end of the TableView.At the end initialize this new array to the model of the Table View.u have a Table View with the specified row deleted now.
    Anil

  • Button is not coming in the first row of a table view

    Hi,
    I am having an assignment block in which i have added a button in DO_PREPARE_OUTPUT method. It is displaying in the second line in the header of the table view and the first line shows the excel and personalization buttons. I want all these buttons to display on the same line in the assignment block.
    the .html code is below
       <%@page language="abap" %>
    <%@extension name="thtmlb" prefix="thtmlb" %>
    <%@extension name="chtmlb" prefix="chtmlb" %>
    <%@extension name="bsp" prefix="bsp" %>
    <%@extension name="tajax" prefix="tajax" %>
    <%
      data: lv_xml          type string value is initial.
      DATA: lv_displayMode  TYPE crmt_boolean.
      lv_xml    = controller->CONFIGURATION_DESCR->GET_CONFIG_DATA( ).
      lv_displayMode = controller->view_group_context->is_view_in_display_mode( controller ).
    %>
    <%
      IF lv_displayMode eq abap_true.
    %>
    <%--<chtmlb:tableExtension tableId = "ResultList"
                           layout  = "FIXED" >--%>
    <chtmlb:configTable id                    = "Table"
                        navigationMode        = "BYPAGE"
                        onRowSelection        = "select"
                        selectedRowIndex      = "<%= ADMINS->SELECTED_INDEX %>"
                        selectedRowIndexTable = "<%= ADMINS->SELECTION_TAB %>"
                        selectionMode         = "<%= ADMINS->SELECTION_MODE %>"
                        table                 = "//ADMINS/Table"
                        usage                 = "ASSIGNMENTBLOCK"
                        visibleRowCount       = "6"
    <%--                    actions          = "<%= controller->gt_button %>"--%>
    <%--                    actionsMaxInRow       = "6"--%>
                        width                 = "100%"
    <%--                    headerVisible         = "TRUE"--%>
                        hasLeadSelection      = "X"
                        personalizable        = "FALSE"
                        downloadToExcel       = "FALSE"
                        showNoMatchText       = "FALSE"
                         />
    <%--</chtmlb:tableExtension>                     --%>
    <%
      ELSE .
    %>
    <chtmlb:tableExtension tableId = "Table"
                           layout  = "FIXED" >
    <chtmlb:configTable id               = "Table"
                        displayMode      = "<%= lv_displayMode %>"
                        navigationMode   = "BYPAGE"
                        onRowSelection   = "select"
                        selectedRowIndex = "<%= ADMINS->selected_index %>"
                        table            = "//ADMINS/Table"
                        usage            = "ASSIGNMENTBLOCK"
                        visibleRowCount  = "6"
                        selectionMode    = "<%= ADMINS->SELECTION_MODE %>"
                        allRowsEditable  = "TRUE"
                        personalizable   = "FALSE"
                        downloadToExcel  = "FALSE"
                        headerVisible    = "TRUE"
                        hasLeadSelection = "X"
                        visibleFirstRow       = "<%= ADMINS->visible_first_row_index %>"
                        actions          = "<%= controller->gt_button %>"
    <%--                actionsMaxInRow       = "6"--%>
                        width            = "100%" />
    </chtmlb:tableExtension>
    <%
      ENDIF .
    %>
    Could you please let me know where i went wrong.

    In your code
    if(rs.next()){
      depflights = new ArrayList();
       while(rs.next()){ ...when you call rs.next() in the if statement, the resultset cursor has been placed on the first record and you are not reading it. So, you never get the first record.
    Change your code to remove that if condition and simply initialize the ArrayList.

  • Multi layer table view/navigation controller hierarchy best practice

    Hi,
    I am new to iPad/iPhone development and wondering what the best practice for multiple layers of table views is? I understand the principle of a navigation controller providing the framework for moving up and down a list but have not yet quite got my head around if you should have one navigation controller for the whole tree or several navigation controllers.
    In my app I need to have the following:
    Main view -> window view showing some interactive elements (picker, buttons etc.)
    Setup view -> Hierarchy managed by nav controller/table views
    The setup view needs to manage the following hierarchy...
    - Level A:
    - Global app variables (one table view)
    - Level B Items (table view showing list of items at belonging to Level B)
    - Level B Item 1 (table view showing list of items at level C belonging to level B item 1)
    - Level C Item 1 (table view showing list of items at level D belonging to level C item 1)
    - Level D Item 1 (table view showing list of items at level E belonging to level D item 1)
    - Level E item (table view for properties of item at Level E)
    - Level D Item n
    - Level C Item n
    - Level B Item n
    Each level in this has some properties and then a list of child items.
    What would be the best way of structuring this? I would assume that creating a class that extends a view controller for each level is a given but what about the control of the navigation? Should this be handled by one navigation controller or one per level? I think I know the right answer but have not seen a neat way of implementing
    I think I am also best off having each level in it's own xib but, once again, am not 100% sure that this is the best design pattern.
    Many thanks in advance for any help/pointers!
    Cheers
    jez

    Hi Julian,
    I have struggled with the same questions you are addressing. On a previous project we tried to model based on packages, but during the course of the project we encountered some problems that grew overtime. The main problems were:
    1. It is hard to enforce rules on package assignments
    2. With multiple developers on the project and limited time we didn't have time to review package assignment
    3. Devopelers would click away warnings that an object was already part of another project and just continue
    4. After go-live the maintenance partner didn't care.
    So, my experience is is that it is a nice feature, but only from a high level design point of view. In real life it will get messy and above all, it doesn't add much value to the development. On my neew assignment we are just working with packages based on functional area and that works just fine.
    Roy

  • SWI5 transaction - is there a table view ?

    Hi
    I am trying to pull a report of outstanding approval inbox items (TS1230097 - for leave requests) that I see when I go to tcode SWI5 for managers. If I run a report it does not give me the manager id in it which I need.
    Is there a table view for SWI5 information possibly or can anyone suggest another transaction that can be used to see the current manager associated with outstanding leave request items (when I use various SWI* or PTARQ reports they do not show me the current manager in situations in which leave request items have been forwarded to new managers and so are unreliable. I'm just wondering if there's any other report/transaction I can use therefore.
    Thanks for your help
    Nicola

    Hi,
    Nicola paste this code in se38 and execute it.
    TYPE-POOLS : slis.
    TABLES : swwuserwi,swwwihead,bseg,bkpf.
      TYPE DECLARATION   *************************************
    TYPES : BEGIN OF TY_SWWUSERWI,
            USER_ID      TYPE SWWUSERWI-USER_ID,
            WI_ID        TYPE SWWUSERWI-WI_ID,
            TASK_OBJ     TYPE SWWUSERWI-TASK_OBJ,
            END OF TY_SWWUSERWI.
    TYPES : BEGIN OF TY_SWWWIHEAD,
            WI_ID        TYPE SWWWIHEAD-WI_ID,
            WI_LANG      TYPE SWWWIHEAD-WI_LANG,
            WI_TEXT      TYPE SWWWIHEAD-WI_TEXT,
            WI_RHTEXT    TYPE SWWWIHEAD-WI_RHTEXT,
            WI_STAT      TYPE SWWWIHEAD-WI_STAT,
           WI_CD        TYPE SWWWIHEAD-WI_CD,
           WI_CT        TYPE SWWWIHEAD-WI_CT,
            END OF TY_SWWWIHEAD.
    TYPES : BEGIN OF TY_TEMP,
            BUKRS TYPE BUKRS,
            BELNR TYPE BELNR_D,
            GJAHR TYPE GJAHR,
            END OF TY_TEMP.
    TYPES : BEGIN OF TY_BSEG,
            BUKRS TYPE BSEG-BUKRS,
            BELNR TYPE BSEG-BELNR,
            GJAHR TYPE BSEG-GJAHR,
            WRBTR TYPE BSEG-WRBTR,
            LIFNR TYPE BSEG-LIFNR,
            ZUONR TYPE CHAR10,
            END OF TY_BSEG.
    TYPES : BEGIN OF TY_CEPC,
            PRCTR TYPE CEPC-PRCTR,
            ABTEI TYPE CEPC-ABTEI,
            END OF TY_CEPC.
    TYPES : BEGIN OF TY_BKPF,
            BUKRS TYPE BKPF-BUKRS,
            BELNR TYPE BKPF-BELNR,
            GJAHR TYPE BKPF-GJAHR,
            BLDAT TYPE BKPF-BLDAT,
            BUDAT TYPE BKPF-BUDAT,
            XBLNR TYPE BKPF-XBLNR,
            END OF TY_BKPF.
    TYPES : BEGIN OF TY_LFA1,
            LIFNR TYPE LFA1-LIFNR,
            NAME1 TYPE LFA1-NAME1,
            END OF TY_LFA1.
    TYPES : BEGIN OF TY_FINAL,
            USER_ID     TYPE SWWUSERWI-USER_ID,
            WI_ID        TYPE SWWUSERWI-WI_ID,
            BUKRS       TYPE BSEG-BUKRS,
           WI_TEXT     TYPE SWWWIHEAD-WI_TEXT,
            WRBTR       TYPE BSEG-WRBTR,
            BELNR       TYPE BELNR_D,
            LIFNR       TYPE LFA1-LIFNR,
            NAME1       TYPE LFA1-NAME1,
            BLDAT       TYPE BKPF-BLDAT,
            XBLNR       TYPE BKPF-XBLNR,
            GJAHR       TYPE GJAHR,
            ABTEI       TYPE CEPC-ABTEI,
            BUDAT       TYPE BKPF-BUDAT,
            END OF TY_FINAL.
      DATA TYPE DECLARATION   *************************************
    DATA : it_swwuserwi TYPE STANDARD TABLE OF ty_swwuserwi,
           it_swwwihead TYPE STANDARD TABLE OF ty_swwwihead,
           it_final TYPE STANDARD TABLE OF ty_final,
           it_temp TYPE STANDARD TABLE OF ty_temp,
           it_bseg TYPE STANDARD TABLE OF ty_bseg,
           it_cepc TYPE STANDARD TABLE OF ty_cepc,
           it_bkpf TYPE STANDARD TABLE OF ty_bkpf,
           it_lfa1 TYPE STANDARD TABLE OF ty_lfa1,
           wa_swwuserwi TYPE ty_swwuserwi,
           wa_swwwihead TYPE ty_swwwihead,
           wa_final TYPE ty_final,
           wa_bseg TYPE ty_bseg,
           wa_cepc TYPE ty_cepc,
           wa_bkpf TYPE ty_bkpf,
           wa_lfa1 TYPE ty_lfa1,
           wa_temp TYPE ty_temp.
    DATA: wa_sort TYPE LINE OF slis_t_sortinfo_alv,
          it_sort TYPE slis_t_sortinfo_alv.
    DATA: it_field_cat TYPE slis_t_fieldcat_alv,
          ws_sort TYPE slis_t_sortinfo_alv,
          g_variant TYPE disvariant,
          ws_layout TYPE slis_layout_alv."slis_t_fieldcat_alv.
    DATA: IT_EVT_TAB         TYPE SLIS_T_EVENT,
          IS_LS_EVENT        TYPE SLIS_ALV_EVENT.
    DATA: C_TOP            TYPE SLIS_FORMNAME          VALUE 'TOP_OF_PAGE',
          IS_EVT             TYPE SLIS_ALV_EVENT     .
    DATA: REC_LAYOUT         TYPE SLIS_LAYOUT_ALV.
    *rec_layout TYPE lvc_s_layo.
    DATA: IS_LS_LINE         TYPE SLIS_LISTHEADER,
          IT_TOP             TYPE SLIS_T_LISTHEADER.
    DATA: TEXT(60) TYPE C,
          text1 TYPE char10,
          text2 TYPE char20,
          text3 TYPE char20,
          ebeln TYPE char10,
          year  TYPE char4.
    DATA: user TYPE SY-uname.
    DATA: lang  TYPE sww_lang VALUE 'EN',
          c_x TYPE char1 VALUE 'X',
          C_FLAG TYPE CHAR1 VALUE IS INITIAL,
               status1 TYPE sww_wistat VALUE 'READY',
          status2 TYPE sww_wistat VALUE 'STARTED'.
      INPUT OPTIONS   ***********************************************
    INITIALIZATION.
    DATA: C_PF_STAT        TYPE SLIS_FORMNAME          VALUE 'PF_STAT',
          C_USERC          TYPE SLIS_FORMNAME          VALUE 'PURVESH',
          C_TOP_OF_PAGE    TYPE SLIS_FORMNAME          VALUE 'TOP_OF_PAGE'.
      SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .
      PARAMETERS     : USERID LIKE USREFUS-BNAME MODIF ID 001.
      SELECT-OPTIONS : COMP   FOR BSEG-BUKRS NO INTERVALS.
      SELECT-OPTIONS : YEAR1  FOR BSEG-GJAHR NO INTERVALS.
      SELECT-OPTIONS : DOC    FOR BSEG-BELNR.
      SELECT-OPTIONS : VEND   FOR BSEG-LIFNR NO INTERVALS.
      SELECT-OPTIONS : DAT    FOR BKPF-BUDAT.
      SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR userid.
      PERFORM f4_help_fname.
    *&      Form  F4_HELP_FNAME
          text
    -->  p1        text
    <--  p2        text
    FORM F4_HELP_FNAME .
    data: begin of itab occurs 0,
    BNAME like USREFUS-BNAME,
    USERALIAS like USREFUS-USERALIAS,
    end of itab .
    select BNAME
    USERALIAS
    from USREFUS into corresponding fields of table itab.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'BNAME'
    dynpprog = SY-repid
    dynpnr = SY-dynnr
    dynprofield = 'USERID'
    value_org = 'S'
    TABLES
    value_tab = ITAB.
    *IF sy-subrc 0.
    *ENDIF.
    ENDFORM.                    " F4_HELP_FNAME
    **********************************************START - OF - SELECTION*******************************************
    START-OF-SELECTION.
      PERFORM init.
      PERFORM buildfieldcat.
      PERFORM displayalv.
    END-OF-SELECTION.
    *&      Form  INIT
          text
    -->  p1        text
    <--  p2        text
    FORM INIT .
      IF USERID IS NOT INITIAL.
        SELECT USER_ID
                 WI_ID
                 TASK_OBJ
                 INTO TABLE IT_SWWUSERWI
                 FROM SWWUSERWI
                 WHERE USER_ID = USERID AND NO_SEL NE c_x.
    endif.
      IF IT_SWWUSERWI IS NOT INITIAL.
        SELECT WI_ID
               WI_LANG
               WI_TEXT
               WI_RHTEXT
               WI_STAT
              WI_CD
              WI_CT
               INTO TABLE IT_SWWWIHEAD
               FROM SWWWIHEAD
               FOR ALL ENTRIES IN IT_SWWUSERWI
               WHERE WI_ID = IT_SWWUSERWI-WI_ID AND WI_LANG = lang.
        IF IT_SWWWIHEAD IS NOT INITIAL.
          LOOP AT IT_SWWWIHEAD INTO WA_SWWWIHEAD.
            SPLIT WA_SWWWIHEAD-WI_TEXT AT SPACE INTO TEXT TEXT1 TEXT2.
            WA_TEMP-BUKRS = TEXT2+0(4).
            WA_TEMP-BELNR = TEXT2+4(10).
            WA_TEMP-GJAHR = TEXT2+14(4).
            APPEND WA_TEMP TO IT_TEMP.
            CLEAR : WA_TEMP.
          ENDLOOP.
            LOOP AT IT_SWWUSERWI INTO WA_SWWUSERWI.
              READ TABLE IT_SWWWIHEAD INTO WA_SWWWIHEAD WITH KEY  WI_ID = WA_SWWUSERWI-WI_ID WI_LANG = lang.
                  WA_FINAL-USER_ID      = WA_SWWUSERWI-USER_ID.
                  WA_FINAL-WI_ID        = WA_SWWUSERWI-WI_ID.
             WA_FINAL-WI_TEXT      = WA_SWWWIHEAD-WI_TEXT.
                  APPEND WA_FINAL TO IT_FINAL.
                  CLEAR : WA_FINAL,WA_SWWWIHEAD,WA_SWWUSERWI,WA_TEMP,WA_BSEG,WA_BKPF,WA_LFA1,WA_CEPC.
                ENDIF.
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDIF.
        DELETE ADJACENT DUPLICATES FROM it_final.
      ENDIF.
    ENDFORM.                    " INIT
    *&      Form  DISPLAYALV
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAYALV .
      REC_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
      REC_LAYOUT-ZEBRA             = 'X'.
      REC_LAYOUT-F2CODE            = SY-REPID.
      REC_LAYOUT-WINDOW_TITLEBAR   = 'Workitem summery'.        "#EC NOTEXT
      REC_LAYOUT-COLTAB_FIELDNAME  = 'COLOR'.
      REC_LAYOUT-DETAIL_TITLEBAR   = 'Workitem Summery'.        "#EC NOTEXT
    WS_LAYOUT-ColWIDTH_OPTimize = 'X'.
    WS_LAYOUT-ZEBRA             = 'X'.
      wa_sort-tabname = 'IT_FINAL'.
      wa_sort-fieldname = 'USER_ID'.
    wa_sort-spos = 9.
    wa_sort-subtot = 'X'.
      APPEND wa_sort to it_sort.
      CLEAR wa_sort.
       PERFORM GET_EVT_UP.
    PERFORM alv_text.
    PERFORM top_of_page.
    *rec_layout-grid_title   = 'Report for WI Analysis'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
         i_callback_pf_status_set = c_pf_stat
          I_CALLBACK_USER_COMMAND  = C_USERC
         I_CALLBACK_TOP_OF_PAGE   = C_TOP_OF_PAGE
          i_grid_title             = text-024
          is_layout                = rec_layout
          it_fieldcat              = it_field_cat
          it_sort                  = it_sort
          I_DEFAULT                = 'X'  "allow default variant
          i_save                   = 'A'
          is_variant               = g_variant
         IT_EVENTS                = IT_EVT_TAB
        TABLES
          t_outtab                 = it_final
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " DISPLAYALV
    *&      Form  build_catalog
          text
         -->P_TABNAME    text
         -->P_FIELDNAME  text
         -->P_DO_SUM     text
         -->P_SELTEXT    text
         -->P_X          text
         -->P_Y          text
    FORM build_catalog  USING  p_tabname   TYPE slis_fieldcat_alv-tabname
                               p_fieldname TYPE slis_fieldcat_alv-fieldname
                               p_do_sum     TYPE slis_fieldcat_alv-do_sum
                               p_seltext   TYPE slis_fieldcat_alv-seltext_l
                               p_x         TYPE c
                               p_y         TYPE c.
      DATA : wa_fieldcat TYPE slis_fieldcat_alv,
             pos TYPE i VALUE 0.
      pos = pos + 1.
      wa_fieldcat-col_pos     = pos.
      wa_fieldcat-tabname     = p_tabname.
      wa_fieldcat-fieldname   = p_fieldname.
      wa_fieldcat-do_sum      = p_do_sum .
      wa_fieldcat-seltext_l   = p_seltext.
      wa_fieldcat-HOTSPOT      = p_x.
      wa_fieldcat-fix_column  = p_y.
      APPEND wa_fieldcat TO it_field_cat .
      CLEAR wa_fieldcat.
    ENDFORM.                    "build_catalog
    *&      Form  PURVESH
          text
         -->L_UCOMM    text
         -->W_SELFIELD text
    FORM PURVESH USING L_UCOMM  TYPE SY-UCOMM   W_SELFIELD  TYPE SLIS_SELFIELD ."#EC CALLED
    BREAK AAB_PURVESH.
      CASE L_UCOMM.
        IF  USERID IS NOT INITIAL.
          user = userid.
        ELSE.
          user = sy-uname.
        ENDIF.
        WHEN '&IC1' or 'ZWORK_LOAD'.
          READ TABLE IT_FINAL INTO WA_FINAL INDEX W_SELFIELD-TABINDEX.
          IF SY-SUBRC = 0.
            IF user NE SY-UNAME.
              CALL FUNCTION 'SAP_WAPI_FORWARD_WORKITEM'
              EXPORTING
                WORKITEM_ID  = WA_FINAL-WI_ID
                USER_ID      = SY-UNAME
                LANGUAGE     = SY-LANGU
                DO_COMMIT    = 'X'
                CURRENT_USER = user.
              IMPORTING
                RETURN_CODE          =
                NEW_STATUS           =
              TABLES
                MESSAGE_LINES        =
                MESSAGE_STRUCT       =
                USER_IDS             =
            ENDIF.
            CALL FUNCTION 'SAP_WAPI_EXECUTE_WORKITEM'
              EXPORTING
                WORKITEM_ID          =  WA_FINAL-WI_ID
                LANGUAGE             = SY-LANGU
              IMPORTING
                NEW_STATUS           =
                RETURN_CODE          =
              TABLES
                MESSAGE_LINES        =
                MESSAGE_STRUCT       =
           DELETE IT_FINAL WHERE WI_ID = WA_FINAL-WI_ID.
           PERFORM displayalv.
          ENDIF.
      ENDCASE.
    ENDFORM.                    "PURVESH
    *&      Form  GET_EVT_UP
          text
    -->  p1        text
    <--  p2        text
    FORM GET_EVT_UP .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE     = 0
        IMPORTING
          ET_EVENTS       = IT_EVT_TAB
        EXCEPTIONS
          LIST_TYPE_WRONG = 1
          OTHERS          = 2.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        SORT IT_EVT_TAB   BY NAME.
        READ TABLE IT_EVT_TAB WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO IS_LS_EVENT BINARY SEARCH.
        IF SY-SUBRC = 0.
          MOVE C_TOP TO IS_LS_EVENT-FORM.
          MODIFY IT_EVT_TAB FROM IS_LS_EVENT INDEX SY-TABIX TRANSPORTING FORM.
        ENDIF.
        READ TABLE IT_EVT_TAB  INTO IS_EVT WITH KEY NAME = SLIS_EV_USER_COMMAND BINARY SEARCH.
        IF SY-SUBRC EQ 0.
          IS_EVT-FORM = 'PURVESH'.
          MODIFY IT_EVT_TAB  FROM IS_EVT TRANSPORTING FORM WHERE NAME = IS_EVT-NAME.
        ENDIF.
      ENDIF.
    ENDFORM.                    " GET_EVT_UP
    *&      Form  ALV_TEXT
          text
    -->  p1        text
    <--  p2        text
    FORM ALV_TEXT .
      CLEAR IS_LS_LINE.
      IS_LS_LINE-TYP = 'H'.
      IS_LS_LINE-INFO = 'Workload Analysis Report'.             "#EC NOTEXT
      APPEND IS_LS_LINE TO IT_TOP.
      WRITE: 'RunDate:' TO TEXT,
             SY-DATUM TO TEXT+10,
             ', Time :' TO TEXT+20,                             "#EC NOTEXT
             SY-UZEIT TO TEXT+27,
             ', User :' TO TEXT+38,                             "#EC NOTEXT
             SY-UNAME TO TEXT+46.
      IS_LS_LINE-TYP = 'S'.
      IS_LS_LINE-INFO = TEXT.
      APPEND IS_LS_LINE TO IT_TOP.
      CLEAR TEXT.
    ENDFORM.                    " ALV_TEXT
    *&      Form  TOP_OF_PAGE
          text
    -->  p1        text
    <--  p2        text
    FORM TOP_OF_PAGE .
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = IT_TOP.
    using this code specify only buildfieldcatalog and there is a custom inbox ready for you
    here you can specify userid and from alv report you can execute workitem of any user.
    Hope magic Works!
    Regards,
    Purvesh.

  • Horizontally scrolling page views and vertically scrolling table views

    This may be a feature request, and I'm trying to figure out if I'm trying to do too much in an iPhone app, but I want to have an outer view scroll horizontally with pages - easy to do with the UIPageControl and UIScrollView.
    Within each page, however, I have a view (or nested views). In one of those views, I want to be able to scroll vertically (it's a table view) - but I can't! The message never gets down to the tableview because it's eaten on top - or at least it seems like it. It looks like I can do it in the simulator, but not on the phone.
    Is this doable?

    "Iain71" <[email protected]> wrote in
    message
    news:g6kj3r$s5p$[email protected]..
    > This is the sort of thing I've seen on a few sites, and
    wondered about
    > before.
    > Sometimes they can look a bit overboard, but I've just
    seen one on this
    > site
    > that looks pretty well done, and doesn't take over the
    page :
    >
    >
    http://www.timesatlas.com/Pages/Default.aspx
    >
    > It's the bit below the main atlas pic, with the
    different versions of the
    > atlas.
    >
    > Does anyone know of any extensions, or tutorials for
    recreating something
    > along those lines? (Not sure if it's Flash or not?)
    I'm pretty sure Project Seven (www.projectseven.com) has an
    extension that
    does almost exactly that.
    Patty Ayers | www.WebDevBiz.com
    Free Articles on the Business of Web Development
    Web Design Contract, Estimate Request Form, Estimate
    Worksheet

  • Editing scroll view frame size in IB causes table view to change

    I suppose this is a continuation of the problems I was having with the table view resizing: http://discussions.apple.com/thread.jspa?threadID=2618816&tstart=0.
    I have a controller which needs to have a scroll view with numerous elements attached to it, including a table view.
    I have performed the following steps:
    - Set the simulated interface elements of the owning view to a nav bar.
    - Added a scroll view to the main view in the nib file.
    - Set the file owner view controller subclass' view to the scroll view.
    - Set the contentSize of the scroll view to the desired size in viewDidLoad.
    The problem is that the table view size/position are incorrect when I load the view in the iPhone simulator if I change the scroll view's frame size from 320x460. Basically, every time the scroll view frame size is changed, it causes the scroll view position and size to change.
    However, there are times I want to make the scroll view's frame size bigger in order to edit items that might be offscreen when the application is first loaded, which becomes awkward if the size of the view in IB or in code without causing the table view size/position to change. I keep having to change the size of the scroll view frame, edit the items, change it back to 320x460, and then fix the table view.
    Is there a way around this, such as a way to locking the size of a table?

    Hi Kaspars,
    I would say there is atm no possibility to change the table view size dynamicly, because you can't input a formula into the size field so the size is fixed as you enter it.
    Best Regards,
    Marcel

  • Initializing a table view

    Hi,
    I am having a table view with some data populated in it.
    I want to clear the data in the table view anad initialize it on click of a button. Can some one please help me in resolving this issue.
    Thanks,
    Ravi G

    Hi Ravi,
    In the controller, method DO_PREPARE_OUTPUT, just clear the collection and build the table:
    data:
    coll_wrapper        TYPE REF TO cl_bsp_wd_collection_wrapper.
    if lv_event eq 'RESET'.
         coll_wrapper = typed_context->TV->get_collection_wrapper( ).
         coll_wrapper->clear_collection( ).
         typed_context->TV->build_table( ).
    endif.
    where TV is your tableview context node and lv_event a new attribute to store server event value (adjust method DO_HANDLE_EVENT)
    Regards,
    Fabian

  • RSS Table View with Tab Bar Code Error

    I created an iphone app with a navigation controller that has a table view which displays an rss feed. My client wants it able to display multiple rss feeds through a tab bar. I have attempted several times and have messed up. If anyone could help me with this it would be greatly appreciated.

    Hi Guy, and welcome to the Dev Forum!
    I would recommend starting as follows:
    1) Start a new project with the Tab Bar Application template;
    2) Open MainWindow.xib and select Window->Document from the IB menu to make sure the xib window (the icon winow) is visible;
    3) Locate the "View Mode" switch in the upper-left corner of the xib window and make sure it's in the Center position to display a 2-column table showing the view hierarchy as a tree of small icons to the left;
    4) Expand the Tab Bar Controller branch, then delete (select and Edit->Delete) each of the two view controllers under the Tab Bar Controller. The only child of that controller should now be the Tab Bar;
    5) Open the Library window (Tools->Library), drag a Navigation Controller into the xib window and drop it when it's on top of the Tab Bar Controller icon;
    6) Repeat step 5 until you have as many nav controllers (one for each RSS feed) as you want (for this example, assume 4 RSS feeds);
    7) The Tab Bar Controller should now have 5 children: the Tab Bar plus the 4 nav controllers; if not, drag the nav controllers until each of their icons is shown indented under the Tab Bar Controller just as the Tab Bar is;
    8) Expand the first Navigation Controller branch, and expand it's Root View Controller; you should now see that root controller's Navigation Item;
    9) Select the nav item, open the Attributes Inspector (Cmd-1), and change the Title to "RSS 1 Root";
    10) Repeat 8-9 for the remaining 3 nav controller branches, so the root views will be labeled "RSS 2 Root", ... "RSS 4 Root" respectively;
    11) Save the xib, return to Xcode, and click "Build and Go". The project should build and run without any warnings or errors. If not, return to step 1 and try to see where things went wrong.
    Let us know if you need more help after you get the above skeleton app working. The next step will be to change the class of the "RSS 1 Root" controller to the class of the first table controller in your original project, and to add that controller's xib (you can delete FirstViewController.h/.m and SecondView.xib by selecting each in the Groups & Files tree of the Xcode project window and selecting Edit->Delete).
    Please avoid the temptation to merge the above steps into your original project. In my experience, moving each of your files into the new skeleton, and testing at each buildable stage will reduce the chances for error while making it easier to spot any incompatibilities in your old code. The process shouldn't involve touching any of your XML parse or table display code, but you may need to override some additional table view controller methods such as viewWillAppear:
    Btw, in case this hasn't been discussed yet, be aware you'll face a major decision soon: When tabbing to feed no. 2, what happens on the return to feed no. 1? If the user will return to the same detail view that was last displayed, you might need lots more memory and there will be lots more to go wrong. If the user will return to the home menu, the whole project will be much simpler. Estimate your effort accordingly.
    Also be prepared for your client to say something like this during beta: "Oh... one or two of the links in feed no. 3 might be a mp3 or mp4 next month. That won't be a problem, will it?".
    Hope that helps!
    \- Ray

Maybe you are looking for

  • Remote Desktop Connection dropping

    I have a RDC connection into a remote server that is on a VPN tunnel between 2 pixes. When I have this access-list in it does not drop. access-list 111 extended permit ip 10.10.128.0 255.255.255.0 192.9.20.0 255.255.255.0 but when I tried to tighten

  • Error making zabbix agent on OSX

    I am installing the 1.4.2 agent on a OSX 10.4.10 Server machine that has XCode installed. I have also encountered the same problem on 10.4.8 Server, 10.4.6 Server, and 10.3.8 Server. I ran the ./configure --enable-agent and it checked out fine, then

  • Sync Outlook '11 with iPhone Calendar

    I want to sync my iPhone events that on my iPhone 4 right now to the Calendar in Outlook 2011 on my Mac but I don't want to replace anything else... like remove any events off my iPhone. But can I also do this wirelessly through cloud or something so

  • Two ChartElement problem

    I have two different classes that extend ChartElement. Both are listening for a mouse down event and both work when applied to a chart. However, if I apply both to a chart then only one of them hears the mouse down event. Any ideas why this might be?

  • How can I delete duplicates automatically?

    I find that I have inadvertently duplicated numerous photos in iPhoto. I could try to delete them one by one but that is tedious. Is there a simple work around? I have an IMac with OSX Version 10.9.4 and iphoto version 9.5.1. Thank you.