Loading a View Controller based on UITableViewController cell

Hi,
I've been trying to make my TableViewController cells load different UIViewControllers when they are clicked, but haven't been having any luck. All that happens is my program starts but then when I click on the cells, the view freezes. This is my code for just loading one view but this can easily be changed to load different views later:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UIViewController *targetViewController = [menuList objectAtIndex: indexPath.row];
if (targetViewController == nil) {
switch(indexPath.row){
case 0: {
targetViewController = [[PageTitleViewController alloc] initWithNibName:@"PageTitleViewController" bundle:nil];
break;
case 1: {
targetViewController = [[PageTitleViewController alloc] initWithNibName:@"PageTitleViewController" bundle:nil];
break;
case 2: {
targetViewController = [[PageTitleViewController alloc] initWithNibName:@"PageTitleViewController" bundle:nil];
break;
case 3: {
targetViewController = [[PageTitleViewController alloc] initWithNibName:@"PageTitleViewController" bundle:nil];
break;
targetViewController = [menuList objectAtIndex: indexPath.row];
[[self navigationController] pushViewController:targetViewController animated:YES];
is there a better way of doing this? I tried if(indexPath.row == 0) but that seemed to make it freeze as well!

// MyTableController.h
#import <UIKit/UIKit.h>
#define kMenuLabelTag 100
@interface MyTableController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
IBOutlet UITableView *myTableView;
NSArray *menuList;
NSMutableArray *controlList;
IBOutlet UINavigationController *navigationController;
@property (nonatomic, retain) IBOutlet UITableView *myTableView;
@property (nonatomic, copy) NSArray *menuList;
@property (nonatomic, retain) NSMutableArray *controlList;
@property (nonatomic, assign) IBOutlet UINavigationController *navigationController;
@end
// MyTableController.m
#import "MyTableController.h"
#import "PageTitleViewController.h"
@implementation MyTableController
@synthesize myTableView, menuList, controlList, navigationController;
#pragma mark Table View Controller Methods
// Implement viewDidLoad to do additional setup after loading the view.
- (void)viewDidLoad {
[super viewDidLoad];
self.menuList = [NSArray arrayWithObjects:
@"Start",
@"Settings",
@"Instructions",
@"About",
nil];
NSMutableArray *mutableArray = [[NSMutableArray alloc] initWithCapacity:10];
for (int i = 0; i < [menuList count]; i++)
[mutableArray addObject:[NSNull null]];
self.controlList = mutableArray;
[mutableArray release];
- (void)dealloc {
[myTableView release];
[menuList release];
[controlList release];
[super dealloc];
#pragma mark -
#pragma mark Table View Data Source Methods
- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section {
return [self.menuList count];
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
UITableViewCell *Start = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (Start == nil) {
Start = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
Start.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
UILabel *label = [[UILabel alloc] init];
label.font = [UIFont boldSystemFontOfSize:24.0f];
label.frame = CGRectMake(85.0f, 15.0f, 200.0f, 28.0f);
label.textColor = [UIColor blackColor];
label.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.6];
label.opaque = NO;
label.tag = kMenuLabelTag;
[Start.contentView addSubview:label];
[label release];
UILabel *menuLabel = (UILabel*)[Start.contentView viewWithTag:kMenuLabelTag];
menuLabel.text = [menuList objectAtIndex:indexPath.row];
return Start;
#pragma mark -
#pragma mark Table View Delgate Methods
- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath {
NSUInteger row = [indexPath row];
NSLog(@"entering didSelectRow: controlList=%@ row=%d", controlList, row);
if ([controlList count] <= row) {
NSLog(@"return - controlList too short");
return;
UIViewController *targetViewController = [controlList objectAtIndex:indexPath.row];
if ((NSNull *)targetViewController == [NSNull null]) {
NSLog(@"at switch: targetViewController=%@", targetViewController);
switch(row){
case 0: {
targetViewController = [[PageTitleViewController alloc] initWithNibName:@"PageTitleViewController" bundle:nil];
break;
case 1: {
targetViewController = [[PageTitleViewController alloc] initWithNibName:@"PageTitleViewController" bundle:nil];
break;
case 2: {
targetViewController = [[PageTitleViewController alloc] initWithNibName:@"PageTitleViewController" bundle:nil];
break;
case 3: {
targetViewController = [[PageTitleViewController alloc] initWithNibName:@"PageTitleViewController" bundle:nil];
break;
default: {
NSLog(@"return - invalid row no.: %d", row);
return;
if (![targetViewController respondsToSelector:@selector(view)]) {
NSLog(@"return after switch - targetViewController is not a controller");
return;
[controlList replaceObjectAtIndex:row withObject:targetViewController];
[targetViewController release];
NSLog(@"ready to push controller: controlList=%@ targetViewController=%@", controlList, targetViewController);
[[self navigationController] pushViewController:targetViewController animated:YES];
@end

Similar Messages

  • Associating a Navigation Item with a View Controller in a XIB

    According to Xcode:
    The 'navigationItem' outlet of a UIViewController has been deprecated. Navigation items are required prior to loading a view controller's view. Instead of an outlet, consider embedding the navigation item in the view controller.
    What does "embedding the navigation item in the view controller" mean? The obvious interpretation of putting a navigation item in the view controller's XIB as a peer to the view has no effect.

    Hi -
       Try using Command "SET_SELECTION_STATE" in dropdown Data Binding - Data Binding type.
    Anesh B

  • EVMNU to set current view based on a cell

    Hi,
    I am trying to set the current view based on an attribute of another dimension.
    If I use EVMNU("SETCV","Set Value","Profit_Center=1220") that works fine but if I point to a cell (this cell contains the attribute value) instead of hardcoding the profit center value, it does not work:
    EVMNU("SETCV","Set Value","Profit_Center=G24")
    Can't you set the current view based on a cell value?
    Thanks
    David

    Nilanjan, I think that's the right idea, but I'm also not sure it will work. It would be better to have your function look like
    =EVMNU("SETCV","Set Value",A1)
    And then in the A1 cell have
    ="Profit_Center="&G24
    Cheers,
    Ethan

  • Complete table view controller with XML

    Hello, I'm from Brazil and am new to ios.
    Today I am making an example where I use a table view controller and fill it witharray (NSMutableArray).
    However I would do the same using XML so that now, I'm having so many difficulties to the point of not knowing where to start.
    The code I use to populate this array was.
    It is possible to use something like XML?
    #pragma mark - View lifecycle
    - (void)viewDidLoad
        [super viewDidLoad];
        // Uncomment the following line to preserve selection between presentations.
        // self.clearsSelectionOnViewWillAppear = NO;
        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem;
        registros = [NSMutableArray arrayWithObjects:@"1", @"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"12",@"13",@"14", nil];
    - (void)viewDidUnload
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    - (void)viewWillAppear:(BOOL)animated
        [super viewWillAppear:animated];
    - (void)viewDidAppear:(BOOL)animated
        [super viewDidAppear:animated];
    - (void)viewWillDisappear:(BOOL)animated
        [super viewWillDisappear:animated];
    - (void)viewDidDisappear:(BOOL)animated
        [super viewDidDisappear:animated];
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    #pragma mark - Table view data source
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
        // Return the number of sections.
        return 1;
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
        // Return the number of rows in the section.
        return [registros count];
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
        static NSString *CellIdentifier = @"listax";//este é o identificador da celula
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        cell.textLabel.text = [registros objectAtIndex:indexPath.row];
        return cell;

    If you have a custom XML schema (not a plist), consider two approaches.
    1. Before showing your table view, use NSXMLParserto deserialize the XML document into an NSMutableArray that will be the table view data source.  Typically the array contains custom class instances; one or more class properties are used to set table cell properties in cellForRowAtIndexPath.  If you have never worked with NSXMLParser (or any other SAX parser) before, start by creating a sample app so you understand how that works.
    2. Use a 3rd-party DOM parser like GDataXML.  Load your XML document into a class property in your table view's viewDidLoad.  Then the XML document will be the table view data source since elements and attributes can be directly queried using XPath in cellForRowAtIndexPath.  If you have never worked with XML DOM and XPath before, start by creating a sample app so you understand how that works.
    If your have a lengthy complex XML document, option #1 might be more efficient because indexed array access is faster than XPath queries.  Theoretically that is why Apple's Cocoa provides DOM support on OS X but not iOS.  There are strategies to improve efficiency if necessary, including your own indexing scheme.  The best solution depends on many factors.  For example, if your XML document includes thousands of rows, but users rarely scroll past the first 10, option #1 would waste time parsing everything.
    Both of these approaches keep all data in memory, which is fast but not friendly.  Perfectly fine for reasonably sized data sets.

  • Real Model View Controller with JTextField

    Hi!
    I am new to Java (so please bear with me). I am building a swing application. I already have added a JTable with a corresponding table model that extends AbstractTableModel. Rather than store the data in the table model, I have modified setValueAt and getValueAt to write and read cell data to another location. So far, everything is fine. When doing setValueAt, I have a fireTableCellUpdated statement that I use to update the edited cell. So far, things are all still fine.
    I would like to do the same thing with a JTextField. I found an example in Core Java Volume 1 for create a class that extends PlainDocument. It uses insertString to update the document in a way that ensures that only numbers are entered. I implemented this. Everything is still fine. I changed insertString to update my remote repository (a field in another class). Everything is still fine. Next, I tried to change (override) both getText methods to read from the repository. This works, but is not reflected on the screen.
    I realize that I need the equivalent of a fireTableCellUpdated statement for the class that extends PlainDocument, but do not know how to do this.
    I have looked a lot over the internet for the model view controller implementation. I know that it can be done using event and event listeners, but this seems to defeat the purpose of the model view controller - it seems like you ought to be able to directly modify the model object to access external data.
    My code is below.
    Thanks/Phil Troy
    * PlainDocument class to make it possible to:
    * - Make sure input in unsigned integer
    * - Automatically save data to appropriate locate
    * This will hopefully eventually work by overriding the insertString and getText methods
    * and creating methods that can be overridden to get and save the numerical value
    class UnsignedIntegerDocument extends PlainDocument
         TutorSchedulerPlusSettings settings;
         JTextField textField;
         public UnsignedIntegerDocument(TutorSchedulerPlusSettings settings)
         {     super();
              this.settings = settings;
         public void setTextField(JTextField textField)
         {     this.textField = textField;
         // Overridden method
         public void insertString(int offs, String str, AttributeSet a) throws BadLocationException
         {     if (str == null) return;
              String oldString = getText(0, getLength());
              String newString = oldString.substring(0, offs) + str +oldString.substring(offs);
              try
              {     setValue(Integer.parseInt(newString));
                   super.insertString(offs, str, a);
                   fireInsertUpdate(new DefaultDocumentEvent(offs, 10, DocumentEvent.EventType.INSERT));
              catch(NumberFormatException e)
         public String getText()
         {     return String.valueOf(getValue());
         public String getText(int offset, int length) throws BadLocationException
         {     String s = String.valueOf(getValue());
              if (length > 0)
                   s = s.substring(offset, length);
              return s;
         public void getText(int offset, int length, Segment txt) throws BadLocationException
         {     //super.getText(offset, length, txt);
              char[] c = new char[10];
              String s = String.valueOf(getValue());
              s.getChars(offset, length, c, 0);
              txt = new Segment(c, 0, length);
         public String getValue()
         {     int i = settings.maxStudents;
              String s = String.valueOf(i);
              return s;          
         void setValue(int i)
         {     settings.maxStudents = i;
    }

    Hi!
    Thanks for your response. Unfortunately, based on your response, I guess that I must not have clearly communicated what I am trying to do.
    I am using both JTables and JTextFields, and would like to use them both in the same way.
    When using JTable, I extend an AbstractTableModel so that it refers to another data source (in a separate class), rather than one inside of the AbstractTableModel. Thus the getValueAt method, getColumnCount method, setValueAt method, . .. all call methods in another class. The details of that other class are irrelevant, but they could be accessing data from a database (via JDBC) or from other machines via some other communication mechanism.
    I would like to do exactly the same thing with a JTextField. I wish for the data to come from a class other than an object of type PlainDocument, or of any class that implements the Document interface. Instead, I would like to use a class that implements the Document interface to call my external class using methods similar to those found in AbstractTableModel.
    You may ask why I would like to to this. I have specific reasons here, but more generally this would be helpful when saving or retrieving parameters set and displayed in a JTextField to a database, or when sharing JTextField to multiple users located on different machines.
    As to whether this is real MVC or not, I think it is but it really doesn't matter.
    I know that I can accomplish what I want for the JTextField using listeners. However, I would like my code for the JTables to be similarly structured to that of the JTextField.
    Thanks/Phil Troy

  • Keyboard not resigning the second time i pop a view controller

    i am developing an app that involves 2 tableViewcontroller. when a cell is selected in a tableViewController the detail table view is shown. the detail table view has a cell with a textfield in it.The value entered in the textfield is send to a webservice and the response is alerted using alertView. When the ok button is pressed in the alert view the viewcontroller is poped from navigationcontroller. the keyboard is hidden using the code
    - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
    [self.currentResponder resignFirstResponder];
    this is working fine the first time i push the viewcontroller and pop it. The keyboard is hiding. but the second time i push the same view controller and then pop the viewcontroller the keyboard is not hiding... can anyone tell me where i have went wrong..?

    I checked the code, we do not have any other manipulation on the view object, the only thing different in our case that I can think of is that this code is being called the 1st time from one page in the afterPhase method of a class that implements PagePhaseListener (on page load). I'm passing the page name to the View Object, and this invokation executes okay an returns the matching one record.
    Then I navigate to another page (again in its page definition, its controller is using the same pagePhaseListener class), so when the code is executed the next time, I'm passing the new page name, but this invokation does not return any data, even though I'm sure the SQL and the page name parameter does return 1 row in SQLPlus.
    Any thing special with executing the view object parameter binding when I navigate out and back to the page?
    Appreciate the help
    Mohamed

  • Use case for showing records in report view BAM based on version number

    Hi,
    I have a use case to update records based on version no. Let say I have a table or data object in BAM called 'Notes'. The Notes dataobject has three fields Id, Version, Description. The Notes data is displayed in a BAM report. I need to just display the latest version of the Notes. Say two records with one with Id as '124' and Version '4' and another with Id as '124' and version as '5'. The record related to version 5 should be dispalyed to user. How will I introduce this check in BAM reports for the latest version?
    Thanks
    Edited by: user5108636 on 28/06/2010 16:47

    That you see you're prints only means that your method outta called. The code creates a new row, but never inserts the row into the rowset. Then you call execute query which loses any connection to the new route which is not part of the rowset.
    First action would never to call insertRow(r1) on the view object.
    If you change data this way, only the model layer knows about it, the ui can't know about this (one of the disadvantages of using plsql or this construct you try). You have to tell the view controller to update it's data to. For this you can execute the iterator in the binding layer and/or ppr the container showing your data.
    Then I don't see any complicated plsql called do I question if a programmatic co is necessary.
    Timo

  • Question about view/controller/nib class design

    Assume you need to make an application with, let's say, 15 different views in total. There are two extreme design choices you can use to implement the app:
    1) Every single view has its own view controller and a nib file. Thus you end up with 15 controller classes and 15 nib files (and possibly a bunch of view classes if any of your views needs to be somehow specialized).
    2) You have only one controller which manages all the views, and one nib file from which they are loaded.
    AFAIK Apple and many books recommend going purely with option #1. However, going with this often results in needless complexity, large amounts of classes (and nib files) to be managed and complicated class dependencies, especially if some of the views (and thus their controllers) interact with each other or share something (something which would be greatly simplified if all these related views were handled by one single controller class).
    Option #2 also usually ends up being very complex. The major problem is that the single controller will often end up being enormous, handling tons of different (and usually unrelated) things (which is just outright bad design). This is seldom a good design, unless your application consists of only a few views which are closely related to each other (and thus it makes sense for one single controller class to handle them).
    (Option #2 also breaks the strictest interpretation of the MVC pattern, but that's not really something I'm concerned about. I'm concerned about simple design, not about following a programming pattern to the letter.)
    A design somewhere in between the two extremes often seems to be the best approach. However, since I don't have decades of Cocoa programming experience, I would like to hear some opinions about this subject matter from people with more experience on that subject. (I do have object-oriented programming experience, but I have only relatively recently started programming for the iPhone and thus Cocoa and its design patterns are relatively new to me, so I'm still learning.)

    Somehow I get the feeling that my question was slightly misunderstood.
    I was not asking "which one of these two designs do you think is better, option #1 or option #2?" I already said in my original post that option #2 is bad design (unless your application consists of just one or two views). That's not the issue.
    The issue is that from my own experience trying to adhere very strictly to the "every single view must have its own view controller and nib file" often results in needless complexity. Of course this is not always the case, but sometimes you end up having controller classes which perform very similar, if not even the exact same actions, resulting in code repetition. (An OO'ish solution to this problem would be to have a common base class for these view controllers where the common functionality has been grouped, but this often just adds to the overall complexity of the class hierarchy rather than alleviating it.)
    As an example, let's assume that you have a set of help screens (for example one help screen for each major feature of the app) and a view where you can select which help view to show. Every one of these views has, for example, a button to immediately exit the help system. If you had one single controller class managing these views, this becomes simpler: The controller can switch between any of the views and the buttons of each view (most of them doing the same things) can call back actions on this controller (eg. to return to the help selection or to exit the help screen completely). These help screens don't necessarily have any functionality of their own, so it's questionable what do they would need view controllers of their own. These view controllers would basically be empty because there's nothing special for them to do.
    View controllers might make it easy to use the navigation controller class, but the navigation controller is suitable mainly for utility apps but often not for things like games. (And if you need animated transitions between views, that can be implemented using the UIView animation features.)
    I also have hard time seeing the advantages of adhering strictly to the MVC pattern. The MVC pattern is useful in things like web servers, where MVC adds flexibility. The controller acts as a mediator between the database and the user interface, and it does so in such an abstract way that either one can be easily changed (eg. the "view", which normally outputs HTML, could be easily changed to a different "view" which outputs a PDF or even plain text, all this without having to touch the controller or the model at all). However, I'm not seeing the advantages of the MVC pattern in an iPhone app. It provides a type of class design, but why is it better than some other class design? It's not like the input and output formats of the app need to be changed on the fly (which is one advantage of a well-designed program using the MVC pattern).

  • How to go from a View Controller to a View Controller

    Hey everyone, I have asked this question over on Stack Overflow, and really had no luck with it.
         I am wondering how to go from one (1) View Controller that has buttons and another View Controller that has a UIWebViewer in? I know how to do the simple part to get the two to link up. But, the buttons are going to have different URL's hooked up to them, and I want to be able to reuse the Web Viewer. I am using the Swift Programming language to be able to do this.
    below is my current code that is has my buttons sitting on top of my web viewer,
    import UIKit
    import WebKit
    class ViewController: UIViewController {   
        @IBOutlet var wbView: UIWebView!
        var strUrl = ""
            @IBAction func buttonAction(sender: UIButton) {
                switch (sender.tag){
                case 1:
                    strUrl = "https://www.google.co.in/"
                case 2:
                    strUrl = "https://in.yahoo.com/"
                case 3:
                    strUrl = "https://www.facebook.com/"
                case 4:
                    strUrl = "https://bing.com/"
                default:
                    break;
                reloadWebViewWithUrl(strUrl);
            func reloadWebViewWithUrl(strUrl: NSString){
                var url = NSURL(string: strUrl);
                var request = NSURLRequest(URL: url!);
                wbView.loadRequest(request);
            override func viewDidLoad() {
                super.viewDidLoad()
                // Do any additional setup after loading the view, typically from a nib.
            override func didReceiveMemoryWarning() {
                super.didReceiveMemoryWarning()
                // Dispose of any resources that can be recreated.
    How should I go about changing this two allow my buttons to be in their own ViewController and still be able to to the secondary View Controller with the WebViewer?
    Thank You all in advanced with the help on this!

    This is the FirstViewController Code
    import UIKit
    class FirstViewController: UIViewController {
        @IBAction func webAction(sender: UIButton) {
            let index = sender.tag
            chosenURLString = addresses[index]
            performSegueWithIdentifier("WebViewSegue", sender: self)
        override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
            if let controller = segue.destinationViewController as?
                SecondViewController {
                controller.urlString = chosenURLString
                chosenURLString = nil
        private let addresses = ["", "https://www.google.com", "https://www.facebook.com", "https://spca.org", "https://www.facebook.com/wagzpack?fref=photo"]
        private var chosenURLString: String?
    This is the SecondViewController Code
    import UIKit
    class SecondViewController: UIViewController {
        @IBOutlet var webSite: UIWebView!
        var urlString: String?
        override func viewDidLoad() {
            super.viewDidLoad()
            if let urlString = urlString {
                if let url = NSURL(string: urlString) {
                    let request = NSURLRequest(URL: url)
                    webSite.loadRequest(request)
                    println("loading \(urlString)")
                else {
                    println("badly formed URL string.")
            else {
                println("missing URL string.")

  • View image based on the query

    view image based on the query
    hi i what to download my image based on the following query,am in jdeveloper 11g am using this method for download,i show the whole link of procedure where the query is located and how was it used in forms,but nw i what to take the query and put it in my java code not the webutil just the query,i put the whole forms package so you can undestand the logic of the query how was it used
        public void ViewImage(FacesContext facesContext, OutputStream outputStream)
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("DocumentImage");
            if (attr == null)
                return;
            // the value is a BlobDomain data type
            BlobDomain blob = (BlobDomain) attr.getInputValue();
            try
            {   // copy the data from the BlobDomain to the output stream
                IOUtils.copy(blob.getInputStream(), outputStream);
                // cloase the blob to release the recources
                blob.closeInputStream();
                // flush the output stream
                outputStream.flush();
            catch (IOException e)
                // handle errors
                e.printStackTrace();
                FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
                FacesContext.getCurrentInstance().addMessage(null, msg);
        }when i use the above method in diffient screen without the upload i get this error
    Target Unreachable, identifier 'viewImage' resolved to null
    Error     
    The file was not downloaded or was not downloaded correctly.
    the below procedure is how i what to download the image but in java,but usin query in below procedure
    function right_file (idref integer, i_file varchar2) return boolean is
    begin
         -- check directory
         -- file size
           if webutil_file.file_exists(dir ||'\' ||i_file) then
           return true;
           end if;
    return false;
    end;
    procedure download(i_dref integer, i_file varchar2) is
    file varchar2(50);
    dlin_id integer;
    l_success boolean;
    begin
         if not right_file (i_dref ,i_file ) then
                select file_name,dlin.id
                into file, dlin_id
                from sms_document_links dlin
                    ,sms_document_references dref
                where dref.id = i_dref
                and dref.dlin_id = dlin.id
       l_success :=  webutil_file_transfer.DB_To_Client
                         ( dir ||'\'|| file,
                           'SMS_DOCUMENT_LINKS',
                           'DOCUMENT_IMAGE',
                           'id = '||dlin_id);
      end if;          
    end download;
    procedure open_image (i_dref integer,i_file varchar2) is
    begin          
         local_path;
      local_viewer;       
         if I_file is not null then
              file := i_file;
         else
              select file_name into file
              from sms_document_references
              where id = i_dref
         end if;
         download(i_dref, file);
         if not webutil_host.ID_NULL(active_process) then
        close_previous_image_process;
         end if;
         image_dir_file := dir ||'\'|| file;
         process :=  webutil_host.nonblocking (image_viewer || image_dir_file);
         if webutil_host.ID_NULL(active_process) then
              active_process := process;
         end if;
         if webutil_host.equals(process,active_process) then
              null;
         else     
        close_previous_image_process;
        active_process := process;
         end if; 
         viewer_active := true;
    end;--

    oh ho.
    Dear user,
    this is not code factory/design factory/bla bla bla.
    this area for guide peoples where you are? what is way right to reach your target/goal. whatever in you words...
    from your post and also procedures, you are from forms background. am also came from ORacle froms 10g background try to understand. and implement it adf.
    back to topic:
    Target Unreachable, identifier 'viewImage' resolved to null Error .i just am giving the steps to igonre your error
    simple go to your taskflow - go to overview section - go to managed beans. configured you which you created bean say as x.java
    if you create following code can be seen in source
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <task-flow-definition id="xx-V-TF">
        <default-activity id="__1">xxV</default-activity>
        <managed-bean id="__2">
          <managed-bean-name id="__4">SUP1040V</managed-bean-name>
          <managed-bean-class id="__5">com.x.x.view.xBeans.xxV</managed-bean-class>
          <managed-bean-scope id="__3">backingBean</managed-bean-scope>
        </managed-bean>
        <view id="xV">
          <page>/ReportsPageFragments/xxV.jsff</page>
        </view>
        <use-page-fragments/>
      </task-flow-definition>
    </adfc-config>

  • Update methode in model-view-controller-pattern doesn't work!

    I'm writing a program in Java which contains several classes. It must be possible to produce an array random which contains Human-objects and the Humans all have a date. In the program it must be possible to set the length of the array (the number of humans to be produced) and the age of the humans. In Dutch you can see this where is written: Aantal mensen (amount of humans) and 'Maximum leeftijd' (Maximum age). Here you can find an image of the graphical user interface: http://1.bp.blogspot.com/_-b63cYMGvdM/SUb2Y62xRWI/AAAAAAAAB1A/05RLjfzUMXI/s1600-h/straightselectiondemo.JPG
    The problem I get is that use the model-view-controller-pattern. So I have a model which contains several methodes and this is written in a class which inherits form Observable. One methode is observed and this method is called 'produceerRandomArray()' (This means: produce random array). This method contains the following code:
    public void produceerMensArray() throws NegativeValueException{
         this.modelmens = Mens.getRandomMensen(this.getAantalMensen(), this.getOuderdom());
    for (int i = 0; i < this.modelmens.length; i++) {
              System.out.println(this.modelmens.toString());
    this.setChanged();
    this.notifyObservers();
    Notice the methods setChanged() and notifyObservers. In the MVC-patterns, these methods are used because they keep an eye on what's happening in this class. If this method is called, the Observers will notice it.
    So I have a button with the text 'Genereer' as you can see on the image. If you click on the button it should generate at random an array. I wrote a controller with the following code:
    package kristofvanhooymissen.sorteren;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    /**Klasse GenereerListener.
    * @author Kristof Van Hooymissen
    public class GenereerController implements ActionListener {
         protected StraightSelectionModel model;
         /**Constructor.
         *@param model Een instantie van het model wordt aan de constructor meegegeven.
         public GenereerController(StraightSelectionModel model) {
              this.model = model;
         /**Methode uit de interface ActionListener.
         * Bevat code om de toepassing te sluiten.
         public void actionPerformed(ActionEvent arg0) {
         this.model=new StraightSelectionModel();
         try{
         this.model.produceerMensArray();
         } catch (NegativeValueException e){
              System.out.println("U gaf een negatieve waarde in!");
         this.model.setAantalMensen((Integer)NumberSpinnerPanel.mensen.getValue());
         this.model.setOuderdom((Integer)NumberSpinnerPanel.leeftijd.getValue());
    StraighSelectionModel is of course my model class. Nevermind the methods setAantalMensen and setOuderdom. They are used to set the length of the array of human-objects and their age.
    Okay. If I click the button my observers will notice it because of the setChanged and notifyObservers-methods. An update-methode in a class which implements Observer.
    This method contains the follow code:
    public void update(Observable arg0,Object arg1){
              System.out.println("Update-methode");
              Mens[] temp=this.model.getMensArray();
              for (int i = 0; i < temp.length; i++) {
                   OnbehandeldeLijst.setTextArea(temp[i].toString()+"\n");
    This method should get the method out of the model-class, because the produceerRandomArray()-methode which has been called by clicking on the button will save the produce array in the model-class. The method getMensArray will put it back here in the object named temp which is an array of Mens-objects (Human-objects). Then aftwards the array should be put in the textarea of the unsorted list as you could see left on the screen on the image.
    Notice that in the beginning of this method there is a System.out.println-command to print to the screen as a test that the update-method has been called.
    The problem is that this update method won't work. My Observable class should notice that something happened with the setChanged() and notifyObservers()-methods, and after this the update class in the classes which implement Observer should me executed. But nothing happenens. My controllers works, the method in the model (produceerRandomArray() -- produce random array) has been executed, but my update-method won't work.
    Does anyone has an explanation for this? I have to get this done for my exam an the 5th of january, so everything that could help me would be nice.
    Thanks a lot,
    Kristo

    This was driving me nuts, I put in a larger SSD today going from a 120GB to a 240GB and blew away my Windows Partition to make the process easier to expand OS X, etc.  After installing windows again the only thing in device manager that wouldn't load was the Bluetooh USB Host Controller.  Tried every package in Bootcamp for version 4.0.4033 and 5.0.5033 and no luck.
    Finally came across this site:
    http://ron.dotsch.org/2011/11/how-to-get-bluetooth-to-work-in-parallels-windows- 7-64-bit-and-os-x-10-7-lion/
    1) Basically Right click the Device in Device manager, Go to Properties, Select Details tab, Choose Hardware ids from Property Drop down.   Copy the shortest Value, his was USB\VID_05AC&PID_8218 
    2) Find your bootcamp drivers and under bootcamp/drivers/apple/x64 copy AppleBluetoothInstaller64 to a folder on your desktop and unzip it.  I use winrar to Extract to the same folder.
    3) Find the files that got extracted/unzipped and open the file with notepad called AppleBT64.inf
    4) Look for the following lines:
    ; for Windows 7 only
    [Apple.NTamd64.6.1]
    ; No action
    ; OS will load in-box driver.
    Get rid of the last two lines the following:
    ; No action
    ; OS will load in-box driver.
    And add this line, paste your numbers in you got earlier for USB\VID_05ac&PID_8218:
    Apple Built-in Bluetooth=AppleBt, USB\VID_05ac&PID_8218
    So in the end it should look like the following:
    ; for Windows 7 only
    [Apple.NTamd64.6.1]
    Apple Built-in Bluetooth=AppleBt, USB\VID_05ac&PID_8218
    5) Save the changes
    6) Select Update the driver for the Bluetooth device in device manager and point it to the folder with the extracted/unzipped files and it should install the Bluetooth drivers then.
    Updated:
    Just found this link as well that does the same thing:
    http://kb.parallels.com/en/113274

  • Storyboard doesn't contain a view controller with identifier 'myViewController'

    I have 3 view controllers on storyboard. One of them has Storyboard Id as 'myViewController'. its runs perfectly on simulator. But when I try to run it on my device it gives following error:
    'Storyboard (<UIStoryboard: 0x1cd626d0>) doesn't contain a view controller with identifier 'myViewController''
    Please help me out with this.

    I'm not sure how "new" you are to Xcode and IB, but just double checking -- did you create the XIB file from Xcode (so that it was added to your project?). Or, if not, did you save it to your project directory somewhere and were prompted to add it to your project? If you created it new from IB it may not be part of your project yet. That's when I have seen my classes missing from the drop down menu on the Identity Inspector.
    One final thing -- after setting File's Owner, I don't see from your code how you are actually loading the NIB file (xib file). You are calling plain "init" in your app delegate where you create these view Controllers. You need to call the "initWithNibName" method. It is the designated init method for view controllers that load their interface from a NIB file.
    Cheers,
    George
    Message was edited by: gkstuart

  • WDRuntimeException: Instance of view controller SystemView does not exist

    Hi there,
    I'm working with SAP NetWeaver v7.0, NWDS 7.0.19 and IE v8 on Windows Platform. And have started with my first steps in front of Web Dynpro.
    The scenario is: I have three Web Dynpro views with tables (not embedded). All tables are setted with the property "selectionMode = none". The first and second table has just one column with cells from type of "LinkToAction".
    The navigation between the first both are working fine, but after clicking at one of the columns links in the second table, the third view is showing just an half second and then an error comes up:
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Instance of view controller SystemView does not exist.
         at com.sap.tc.webdynpro.progmodel.controller.Component.getController(Component.java:369)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.handleUIElementEvent(HtmlClient.java:939)
         at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.updateEventQueue(HtmlClient.java:382)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.prepareTasks(AbstractClient.java:93)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:316)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    When I reset the property value from "none" to anything in "selectionMode", all views are working fine, including the last one.
    Thanks for help and take care,
    Cengiz

    Ok, problem has been fixed. The reason was: I had defined "onLeadSelect = ANYTHING_SELECTED" (Event property) for the table and the LinkToAction-Element. Reset the "onLeadSelect" on the table level and the error should be solved.
    Thanks,
    Cengiz

  • ADF View Controller - Page Transitions

    Hi All,
    Definitley releveant here - JSF 2.0 / Jdev 11.1.2
    This one may be considered a little left of filed, but has anyone out their played around or implemented view controller transitions? Depending upon the network speed, with a lot of my pages, I can see the components rendering and loading. This is especially true with tables set with auto-height-rows not equal to -1.
    Just to be clear, some other front-end only frameworks give you the ability to slide or fade into the new page, once this is entirely loaded into the DOM.
    My educated guess is that this would involve some sort of View Model Layer extension, however I am guessing that this may be one of the areas that not many developers have attempted to tackle. Nothing on google so far - that or my search terms are way off.
    Even if someone could provide some psuedo logic into how this theortetically would be achieved. From my experience in ADF, I have realised that the framework is very extensible, and being open source, could support this requirement.
    Cheers,
    Simo
    Edited by: Simo on Jun 19, 2012 11:51 PM
    Edited by: Simo on Jun 19, 2012 11:52 PM
    Edited by: Simo on Jun 19, 2012 11:55 PM

    Simo,
    you may want to try partial page navigation as documented here http://docs.oracle.com/cd/E23943_01/web.1111/b31973/ap_config.htm#sthref409to speed page transition.
    I don't think that open source is a guarantee for animated transition(and ADF is not open source) as otherwise we would see that e.g. in Trinidad MyFaces or other open source JSF frameworks. Instead what we do is to work on reducing the page content size and the supplement CSS and JS file downloads (You will see improvements when JDeveloper 12c goes out) . Other strategies for faster page load and response include the use of page templates and ADF regions. So unless you need transition for a visual effect I am not quite sure I want to follow that adding transition animation is a way to improve the use experience in regards to performance
    Frank

  • Explore view controller like App Store Explore tab

    How to make an Explore view controller like App Store -> Explore, with all it functionality and animations.
    Is it a navigation bar ?
    If its a custom control, so how they made it  ?
    Thanks Advance,

    Hello BretonTom,
    I'm sorry to hear you are having these issues with the iTunes iOS App Store. If you are unable to load a specific tab or page on the App Store, you may find the troubleshooting steps outlined in the following articles helpful (they are primarily aimed at issues accessing the iTunes Stores in general, but may also be applicable for specific page issues as well):
    Can't connect to the iTunes Store - Apple Support
    iTunes: Advanced iTunes Store troubleshooting - Apple Support
    Sincerely,
    - Brenden

Maybe you are looking for

  • Unwanted Arpeggio In Logic 8?

    I'm having a rather frustrating problem with Logic 8, I'm getting unwanted arpeggio via midi and cannot seem to find a way to stop it. It's only occurring when the track is playing and only appears to be in this specific arrangement all my other trac

  • Problem with business rule

    Hi all, I have a problem with a business rule (BR) deployed as a standalone Descision service. the BR consists on a simple decision table wich compare an input (bigInteger) with 50. It returns two facts (as output). the two conditions are confugured

  • Supplier and manufaturer Detail in result recording

    Dear gurus, In inspection lot and at the time of vendor approval (Qinfo record) I wants combination of supplier and manufacturer separately. In the inspection lot details we are having 2 field Manufacturer --> Non editable Supplier --> Value flow fro

  • Lost sound when upgraded to Windows

    I lost sound when I upgraded my Gateway Solo250 from Windows 98 to Windows XP Home. On Device manager, the systems reports that my sound controls are working but the Multimedia Audio Controller is not installed (Problem 28). I have downloaded drivers

  • DNG converter 4.5, command line broken

    Hi, The command line feature of the DNG converter appears to be broken on the latest version (4.5). Version 4.4.1 still functions OK... Anyone got a clue? Greetings, Auke