Using multiple UIWebView objects with a Tab Bar Controller.

So, I'm pretty new to this cocoa touch language and seem to be hitting a road block.
I have an application that will use a Tab Bar Controller as a navigation. Each tab will display a different UIWebView object that's been linked to their own URL's. I can't for the life of me figure out how to get past the first UIWebView. If they're all the same object, with the same name, how can I set a different url for each??
I've been going nuts over this for the past few hours and can't find any documentation online so any help would be AMAZING. Thank you very much.
Message was edited by: thenameisjesse

If they're all the same object, with the same name, how can I set a different url for each??
They're not the same object. You alloc and setup each UIWebView independently.
UIWebView is just a view so set it up the same way you would if you had a tabbar with multiple views.
The default template has 2 views as I recall. Change the UIViews to UIWebView. As you switch them in set the URL and have it load.

Similar Messages

  • More tabs than 5 with a tab bar controller

    When you create a tabbar based app using the template from the sdk you can see all your tabs (14 in my case) along the bottom in IB. See image:
    However when you compile and run the app you get only 4 and a more button. I would like to display all 14 at once as I don't think the more construction is very user friendly (at least not on an iPad in landscape mode ).
    Any suggestions

    Is there such an obvious answer to this that no one deigns to answer? Or is it really not possible? Do I have create my own version in IB? One window along the bottom containing a number of buttons and when one of the buttons is selected the corresponding xib is loaded in the large window above it. So basically what tabbar template does but without the bells and whistles and all hand coded.

  • RE: multiple named objects with the same name andinterface

    David,
    First I will start by saying that this can be done by using named anchored
    objects and registering them yourself in the name service. There is
    documentation on how to do this. And by default you will get most of the
    behavior you desire. When you do a lookup in the name service (BindObject
    method) it will first look in the local partition and see if there is a
    local copy and give you that copy. By anchoring the object and manually
    registering it in the name service you are programmatically creating your
    own SO without defining it as such in the development environment. BTW in
    response to your item number 1. This should be the case there as well. If
    your "mobile" object is in the same partition where the service object he is
    calling resides, you should get a handle to the local instance of the
    service object.
    Here is the catch, if you make a bind object call and there is no local copy
    you will get a handle to a remote copy but you can not be sure which one!
    It end ups as more or less a random selection. Off the top of my head and
    without going to the doc, I am pretty sure that when you register an
    anchored object you can not limit it's visibility to "User".
    Sean
    -----Original Message-----
    From: [email protected]
    [<a href="mailto:[email protected]">mailto:[email protected]]On</a> Behalf Of David Foote
    Sent: Monday, June 22, 1998 4:51 PM
    To: [email protected]
    Subject: multiple named objects with the same name and interface
    All,
    More than once, I have wished that Forte allowed you to place named
    objects with the same name in more than one partition. There are two
    situations in which this seems desirable:
    1) Objects that are not distributed, but are mobile (passed by value to
    remote objects), cannot safely reference a Service Object unless it has
    environment visibility, but this forces the overhead of a remote method
    call when it might not otherwise be necessary. If it were possible to
    place a copy of the same Service Object (with user visibility) in each
    partition, the overhead of a remote method call could be avoided. This
    would only be useful for a service object whose state could be safely
    replicated.
    2) My second scenario also involves mobile objects referencing a Service
    Object, but this time I would like the behavior of the called Service
    Object to differ with the partition from which it is called.
    This could be accomplished by placing Service Objects with the same name
    and the same interface in each partition, but varying the implementation
    with the partition.
    Does anyone have any thoughts about why this would be a good thing or a
    bad thing?
    David N. Foote
    Consultant
    Get Your Private, Free Email at <a href=
    "http://www.hotmail.com">http://www.hotmail.com</a>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>

    David,
    First I will start by saying that this can be done by using named anchored
    objects and registering them yourself in the name service. There is
    documentation on how to do this. And by default you will get most of the
    behavior you desire. When you do a lookup in the name service (BindObject
    method) it will first look in the local partition and see if there is a
    local copy and give you that copy. By anchoring the object and manually
    registering it in the name service you are programmatically creating your
    own SO without defining it as such in the development environment. BTW in
    response to your item number 1. This should be the case there as well. If
    your "mobile" object is in the same partition where the service object he is
    calling resides, you should get a handle to the local instance of the
    service object.
    Here is the catch, if you make a bind object call and there is no local copy
    you will get a handle to a remote copy but you can not be sure which one!
    It end ups as more or less a random selection. Off the top of my head and
    without going to the doc, I am pretty sure that when you register an
    anchored object you can not limit it's visibility to "User".
    Sean
    -----Original Message-----
    From: [email protected]
    [<a href="mailto:[email protected]">mailto:[email protected]]On</a> Behalf Of David Foote
    Sent: Monday, June 22, 1998 4:51 PM
    To: [email protected]
    Subject: multiple named objects with the same name and interface
    All,
    More than once, I have wished that Forte allowed you to place named
    objects with the same name in more than one partition. There are two
    situations in which this seems desirable:
    1) Objects that are not distributed, but are mobile (passed by value to
    remote objects), cannot safely reference a Service Object unless it has
    environment visibility, but this forces the overhead of a remote method
    call when it might not otherwise be necessary. If it were possible to
    place a copy of the same Service Object (with user visibility) in each
    partition, the overhead of a remote method call could be avoided. This
    would only be useful for a service object whose state could be safely
    replicated.
    2) My second scenario also involves mobile objects referencing a Service
    Object, but this time I would like the behavior of the called Service
    Object to differ with the partition from which it is called.
    This could be accomplished by placing Service Objects with the same name
    and the same interface in each partition, but varying the implementation
    with the partition.
    Does anyone have any thoughts about why this would be a good thing or a
    bad thing?
    David N. Foote
    Consultant
    Get Your Private, Free Email at <a href=
    "http://www.hotmail.com">http://www.hotmail.com</a>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>

  • Problem with tab bar controller!

    I'm fairly new to xcode (and programming for that matter) so please bear with me!
    I'm creating a utilities app and would like to put tabs on the flipside view controller. a normal push segue to a tab bar controller from the flipside doesn't seem to do the job when I run it.
    I'm not sure if I need to put a tab bar on the flipside view controller itself and connect it using coding? If so, how? Or is there another solution?
    Thanks in advance!

    I have an application based on the Tab Bar template as well, yet mine works. I also have views created via IB for each tab, but there are a series of connections which need to be made for the viewDidLoad method to be called. I made some notes along the way, perhaps they are helpful.
    In these notes, what I did was create the Tab Bar project, but I didn't like the way the views were set up, so I created a series of new views, added them the way I preferred (all from files, all the same view, including the first view), and then deleted the two default views.
    - Create a Tab Bar project.
    - With XCode, create a new UIViewController for the new first view, save it, add it to the project.
    - In IB, create a new view, save it, and add it to the project.
    - In the new view's File's Owner, set the class to the new view controller.
    - Connect the view outlet to the new view created.
    - Go to the tab bar control in the MainWindow.xib and create a new view controller.
    - Select the new tab button, and type in tab name and xib filename (without the extension).
    - Compile and run. With a label in the new view, it is easy to see if it works.
    Let me know if you find the problem.

  • All of a sudden I can no longer open a new tab using either the icon on the tab bar, the keyboard short cut or the File menu option. I can open a new tab ONLY by clicking on a bookmark or link.

    All of a sudden I can no longer open a new tab using either the icon on the tab bar, the keyboard short cut or the File menu option. I can open a new tab ONLY by clicking on a bookmark or link

    This issue can be caused by the Ask<i></i>.com toolbar (Tools > Add-ons > Extensions)
    Your system details show that toolbar in the user agent as AskTbAD2/3.12.2.16749
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • More than 5 tabs in tab bar controller

    Hi,
    I'm totally at a lost trying to get 6 tabs connected to my tab bar controller, which was created using the tab bar controller template.  Everything thing works fine with 5 view controllers.  When I add a 6th view controller I get the "More" tab in the 5th position, which when touched opens up a table view showing 2 more tabs for the user to choose from.  Touching either row in this table view causes the app to crash.  The error reads:
    2011-06-26 20:37:25.276 TMO[2761:207] will dissapear
    2011-06-26 20:37:27.157 TMO[2761:207] -[UIMoreListController __touchesEnded:withEvent:]: unrecognized selector sent to instance 0x4c3c010
    2011-06-26 20:37:27.159 TMO[2761:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIMoreListController __touchesEnded:withEvent:]: unrecognized selector sent to instance 0x4c3c010'
    *** Call stack at first throw:
        0   CoreFoundation                      0x014285a9 __exceptionPreprocess + 185
        1   libobjc.A.dylib                     0x0157c313 objc_exception_throw + 44
        2   CoreFoundation                      0x0142a0bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
        3   CoreFoundation                      0x01399966 ___forwarding___ + 966
        4   CoreFoundation                      0x01399522 _CF_forwarding_prep_0 + 50
        5   UIKit                               0x003aa0f4 forwardMethod2 + 92
        6   UIKit                               0x003aa0f4 forwardMethod2 + 92
        7   UIKit                               0x003aa0f4 forwardMethod2 + 92
        8   TMO                                 0x00006df6 -[UIView(__TapHook) __touchesEnded:withEvent:] + 51
        9   UIKit                               0x0056f4de _UIGestureRecognizerSortAndSendDelayedTouches + 3609
        10  UIKit                               0x0056fc53 _UIGestureRecognizerUpdateObserver + 927
        11  CoreFoundation                      0x0140989b __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
        12  CoreFoundation                      0x0139e6e7 __CFRunLoopDoObservers + 295
        13  CoreFoundation                      0x013671d7 __CFRunLoopRun + 1575
        14  CoreFoundation                      0x01366840 CFRunLoopRunSpecific + 208
        15  CoreFoundation                      0x01366761 CFRunLoopRunInMode + 97
        16  GraphicsServices                    0x019971c4 GSEventRunModal + 217
        17  GraphicsServices                    0x01997289 GSEventRun + 115
        18  UIKit                               0x002eac93 UIApplicationMain + 1160
        19  TMO                                 0x000024fc main + 102
        20  TMO                                 0x0000248d start + 53
    terminate called after throwing an instance of 'NSException'
    Any help or direction will not go unappreciated I've scoured the web and this forum for an answer I can understand.  I did get bits of code and explanations regarding using:
        UIViewController *moreViewController = tabBarController.moreNavigationController.topViewController;
        UITableView *moreTableView = (UITableView*)moreViewController.view;
    But, it's wasn't enough me to understand how to piece it all together.
    Thanks,
    Amy

    Open Xcode, then click on 'Window', click on 'Organizer'.
    Then click on the Documentation icon.
    Seach for 'viewcontroller'.
    Read and study the documentation for the various flavors of viewcontrollers.
    Then try applying some of your newfound knowledge your code and see what happens.
    I've found that trying a few ideas based on what I've read about is the best way to learn.  Be prepared to make lots and lots of mistakes;  You'll learn something from each one.
    Above all, be patient.  This technology can't be learned in a day or a week or even a month.  It may take months before you have that 'aha!' moment.  Once you do, it will start making sense.

  • Xcode4 Where is the Tab Bar Controller

    Hello,
    I am learning Xcode4 now and I am trying to build a Tab bar & Nav bar combined app. There is a great video tutorial about how to do it in Xcode 3.~, but when I try to do the same in Xcode4, I get stuck because I do not find the "Tab Bar Controller" allowing me to change the type of view controllers. Opening the same project in Xcode3 is working like a charm.
    Does anyone has the same problem? Sorry, this might be a pretty dumb question, as I'm a newbe!!
    The Xcode 3.xx tutorial
    http://www.youtube.com/watch?v=LBnPfAtswgw
    The Tab Bar Controller in Xcode3
    http://eremiya.net/share/xcode4-tabbarcontroller.png

    I think I have found a solution.
    Instead of going about as you would in Xcode 3 and in the video, you follow these steps:
    Select the view controller that you wish to change to a navigation controller - This can be done by either selecting the view controller under the 'objects' section of the expanded dock on the left hand side, or selecting the tab bar button that relates to the view controller
    In the Identity Inspector, change the 'Class' drop down menu (under the 'Custom Class' header) to 'UINavigationController'
    That should work
    null

  • Loading a Tab Bar Controller

    Hi,
    I am trying to make an iPhone application where there will be a settings view that is made of a tab bar controller. I have declared the tabBarController, and linked it to the app delegate in the main window.xib file. However, when I try to switch to it by pressing my button that should start the IBAction to switch to it, the app terminates due to an uncaught exception. Here is my code:
    -(void)switchToSettings {
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1.5];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
    [[gameViewController view] removeFromSuperview];
    [self.window addSubview:[settingsTabBarController view]];
    [UIView commitAnimations];
    gameViewController = nil;
    Someone please help! Thanks in advance.

    Hi David -
    Daviiidddd wrote:
    if there is a way to trigger a custom action when you click an item in a tab bar controller instead of loading a view.
    I think the implementation would depend on whether you wanted the custom action item to remain "selected", and if so, for how long? In other words, is the action item momentary or selectable? In either case, can we assume that tapping the action item leaves the current view visible? If not, what will the user see? Will the action item be visible from all the other views?
    As you know, normally, when you click an item in a tab bar it is going to load a view right? \[emphasis added by friendly neighborhood helper\]
    If you see most of us nodding, "yes", in agreement, it might be time to review [Tab Bars|http://developer.apple.com/iphone/library/documentation/UserExperience/Con ceptual/MobileHIG/SpecialViews/SpecialViews.html#//apple_ref/doc/uid/TP40006556- CH10-SW13] in the +iPhone Human Interface Guidelines+. Make sure your idea doesn't do something tab bars aren't expected to do. If you're not sure, look at some of the other UI options, e.g. [Toolbars|http://developer.apple.com/iphone/library/documentation/UserExperienc e/Conceptual/MobileHIG/SpecialViews/SpecialViews.html#//apple_ref/doc/uid/TP4000 6556-CH10-SW10], to see if there's a better fit for what you're doing.
    \- Ray

  • Triggering a custom action in a tab bar controller

    Hey guy,
    As you know, normally, when you click an item in a tab bar it is going to load a view right?
    But I was wondering if there is a way to trigger a custom action when you click an item in a tab bar controller instead of loading a view.
    If there is a way to do it, then how to do it?

    Hi David -
    Daviiidddd wrote:
    if there is a way to trigger a custom action when you click an item in a tab bar controller instead of loading a view.
    I think the implementation would depend on whether you wanted the custom action item to remain "selected", and if so, for how long? In other words, is the action item momentary or selectable? In either case, can we assume that tapping the action item leaves the current view visible? If not, what will the user see? Will the action item be visible from all the other views?
    As you know, normally, when you click an item in a tab bar it is going to load a view right? \[emphasis added by friendly neighborhood helper\]
    If you see most of us nodding, "yes", in agreement, it might be time to review [Tab Bars|http://developer.apple.com/iphone/library/documentation/UserExperience/Con ceptual/MobileHIG/SpecialViews/SpecialViews.html#//apple_ref/doc/uid/TP40006556- CH10-SW13] in the +iPhone Human Interface Guidelines+. Make sure your idea doesn't do something tab bars aren't expected to do. If you're not sure, look at some of the other UI options, e.g. [Toolbars|http://developer.apple.com/iphone/library/documentation/UserExperienc e/Conceptual/MobileHIG/SpecialViews/SpecialViews.html#//apple_ref/doc/uid/TP4000 6556-CH10-SW10], to see if there's a better fit for what you're doing.
    \- Ray

  • Problem with using multiple Entity Objects in a view Object.

    Hi
    Thank you for reading my post
    I have create 3 Business components for 3 of my database tables and now
    I must add 3 tables in a View object so i used Jdeveloper Wizard to create the View Object.
    -I Add Entity Objects which are business components to this view (In Step 2 of the Create Vview Object wizard).
    -In step 3 that I add Attributes all my attributes are marked as Transient
    Can some one explain why it happens?
    I need one of those tables to be updateable and two other tables are not updateable.
    What should should i do to achieve this?
    I should say that tables does not have any database relation (Foreign Key I Mean).
    Thanks.

    Hi user505214
    When you created your VO, on selecting the second EO, you'll note at the bottom of the same page on the wizard/editor, checkboxes for updatable or by reference. By default reference is checked and this will make your second EO's attributes transient.
    In the JDeveloper Developer's Guide for 4GL/Forms programmers, the following sections outline the difference between updatable or by reference:
    7.5 Including Reference Entities in Join View Objects
    27.9 Creating a View Object with Multiple Updatable Entities
    Make sure to read 27.9 if updatable is what you want as it indicates you may need to add some additional code.
    Hope this helps.
    CM.

  • IPhone Dev: Tab Bar Controller with nested Navigation Controller

    I want to have a tab bar with 2 views. The first view is a navigational one. I know the view can be loaded in from an external nib and I can set the first view to a navigation controller.
    My question is: can this navigation controller in the external nib instead? Ideally I want to separate it out so the tab bar loads in the external nib (that has the navigation controller). Is this possible? or the only approach is to simply have to set the view controller to a navigation controller?

    Hey, this writing an app that uses the Tab View Controller in conjunction with Navigation View Controllers is driving me bats. I took a sample program which worked well, added a nib file for a basic view that only had a label on it then:
    * I created a view controller class to work with it.
    * I added code to add create a navigation controller.
    * Added my new view controller to the navigation controller
    * added this nav controller to the array with the other stuff for the tab view controller.
    * RUN
    Everything seems to work as far as all the existing stuff. And the title for my new "tab" shows up on the More tab.
    But when I click on it (in the simulator) the program crashes. It could be how I set up the nib file I made is wrong.
    I posted the code on my web site. Here is the URL:
    http://chomer.com/iphonesample_code/05a_-_Brightness_ToolbarSwatches.zip
    Please have a look. Its probably something small and stupid that I missed.
    Regards,
    Orville

  • Using Multiple AD domains with ACS

    Hi,
    Is it possible to use multiple domains for authentication with ACS? I need to use AAA to authenticate remote users into a centralised location but the users will be from different domains and I was hoping to use a single applicance to cater for all domains. Can this be achieved using LDAP? I understand that ACS can only be part of one AD domain.....
    In essence I am hoping that I will be able to authenticate the user based on their domain\credentials.
    Thanks in advance
    Jason

    Hi Javier,
    I understand that ACS can only join a single AD domain - but can it use LDAP to authenticate users from different AD domains - I don't want to have to established trusts between different domains.
    Kind regards
    Jason

  • Is it possible to use multiple hard drives with iphoto?

    I am pretty new to Mac's so bear with me, I used to use multiple hard drives on my pc with my photos seperated by catagory in different hard drives. Is it possible to run iphoto with multiple hard drives without the photos loading onto my Imac? If so, How do I set it up. I have tried importing to a external drive, but when I check the file path of the photos it shows my Imac hd in the address. I seriously dont know why I cant just add the external hard drive as a library and have Iphoto work, Help

    There are instructions - and not the caveats - on how to do what you want below.
    However, you'e not quite grasping iPhoto:
    I used to use multiple hard drives on my pc with my photos seperated by catagory in different hard drives.
    When you do this, you're using the Finder (or file manager) to categorise the photos. All well and good, but why? That's exactly iPhoto's job. iPhoto is a database designed to help you manage your pics - including categorising them.
    Anyway:
    *How to do it:*
    Simply go to iPhoto Menu -> Preferences -> Advanced and uncheck 'Copy Files to the iPhoto Library on Import'.
    *What Happens:*
    Now iPhoto will not copy the files, but rather simply reference them on your HD. To do this it will create an alias in the Originals Folder that points to your file. It will still create a thumbnail and, if you modify the pics, a Modified version within the iPhoto Library Folder.
    *Some things to consider:*
    1. Importing and deleting pics are more complex procedures. You have to to put the files where they will be stored before importing them. When you delete them you'll need to remove the files from the HD yourself.
    2. You cannot move or rename the files on your system or iPhoto will lose track of them on systems prior to 10.5 and iPhoto 08. Even with the later versions issues can still arise if you move the referenced files to new volumes or between volumes.
    3. Most importantly, migrating to a new disk or computer can be much more complex.
    4. *Because iPhoto has no tools for managing Referenced Files, if, for some reason, the path to the photos changes then you could find yourself resolving aliases for +each photo in the Library+ one by one.*
    My own opinion:
    I've yet to see a good reason to run iPhoto in referenced mode unless you're using two photo organisers
    If disk space is an issue, you can run an entire iPhoto Library from an external disk:
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    If you're concerned about accessing the files, There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 and later*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    *For users of 10.4 and later* ...
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. However, if you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    For users of 10.6 and later:
    You can download a free Services component from MacOSXAutomation which will give you access to the iPhoto Library from your Services Menu. Using the Services Preference Pane you can even create a keyboard shortcut for it.
    For Users of 10.4 and later:
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    If you really want to spread your photos across volumes like this, Aperture would be a better fit.
    Regards
    TD

  • Using JQuery deferred objects with JSOM

    Hi,
    I have written following query to execute a JSOM call using Jquery Deferred objects.
    But It is not working. I am getting following error:
    Uncaught TypeError: Cannot read property 'get_current' of undefined .  Can anyone help what is wrong here?
    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(getrelatedProjects, "sp.js");
    function getrelatedProjects() {
        var dfd = $.Deferred(function () {
           var clientcontext = new SP.ClientContext.get_current();
            var list = clientContext.get_web().get_lists().getByTitle("Roadmap");
            var camlQuery = new SP.CamlQuery();
            this.collListItem = list.getItems(camlQuery);
            clientContext.load(collListItem);
            context.executeQueryAsync(
               function () {
                   var listItemCollection = list.getItems(camlQuery);
                   dfd.resolve(listItemCollection);
               function () {
                   dfd.reject(args.get_message());
        return dfd.promise();
    getrelatedProjects().done(function (listColl) {
        var listItemEnumerator = listColl.getEnumerator();
        // do something with the list
        while (listItemEnumerator.moveNext()) {
            var oListItem = listItemEnumerator.get_current();
            listItemInfo += '\nID: ' + oListItem.get_id() +
                '\nTitle: ' + oListItem.get_item('Title');
        alert(listItemInfo.toString());
    </script>
           

    I have been trying for help since one week on this issue. Here is my requirement. Can someone just help me modify this code. All I am looking for is to execute getStatus(project) synchronously.
    // JavaScript source code
    var roadmapList;
    var collListItem;
    var dashboardList;
    var statusItem;
    ExecuteOrDelayUntilScriptLoaded(loadRoadMap, "sp.js");
    function loadRoadMap() {
        var currentCtx = SP.ClientContext.get_current();
        var currentWeb = currentCtx.get_web();
        this.roadmapList = currentWeb.get_lists().getByTitle('Roadmap');
        var camlQuery = new SP.CamlQuery();
        this.collListItem = roadmapList.getItems(camlQuery);
        currentCtx.load(collListItem);
        currentCtx.executeQueryAsync(
            Function.createDelegate(this, this.onQuerySucceeded),
            Function.createDelegate(this, this.onQueryFailed)
    function onQuerySucceeded(sender, args) {
        var listItemInfo = '';
        var listItemEnumerator = collListItem.getEnumerator();
        while (listItemEnumerator.moveNext()) {
            //alert("Success");
            var oListItem = listItemEnumerator.get_current();
            var projectUrl = oListItem.get_item('ProjectURL').get_url();
            listItemInfo += '<tr><td>' + oListItem.get_item('Roadmap_x0020_Project')
    + '</td><td>' + getStatus(projectUrl) + '</td></tr>';
            $('#statusTable').append($(listItemInfo));
    function onQueryFailed(sender, args) {
        alert('Request failed. ' + args.get_message() +
            '\n' + args.get_stackTrace());
    function getStatus(project) {
        var crossSiteContext = new SP.ClientContext("http://myanothersite.com/it/");
        var crossSiteWeb = crossSiteContext.get_web();
        this.dashboardList = crossSiteWeb.get_lists().getByTitle('Dashboard');
        var projectQuery = new SP.CamlQuery();
        projectQuery.set_viewXml("<View><Query><Where><Eq><FieldRef
    Name=\'Project\'/>" +
            "<Value Type=\'URL\'>" + project + "</Value></Eq></Where></Query>"
    +
            "<RowLimit>1000</RowLimit></View>");
        this.statusItem = dashboardList.getItems(projectQuery);
        crossSiteContext.load(statusItem);
        crossSiteContext.executeQueryAsync(
            Function.createDelegate(this, this.onStatusQuerySucceeded),
            Function.createDelegate(this, this.onStatusQueryFailed)
    function onStatusQuerySucceeded(sender, args) {
        var projectItemInfo = '';
        var projectItemEnumerator = statusItem.getEnumerator();
        while (projectItemEnumerator.moveNext()) {
            var curstatusItem = projectItemEnumerator.get_current();
            projectItemInfo += '\nID: ' + curstatusItem.get_id() +
                '\nStatus: ' + curstatusItem.get_item('Project_x0020_Status').Label;
    function onStatusQueryFailed(sender, args) {
        alert('Request failed. ' + args.get_message() +
           '\n' + args.get_stackTrace());

  • Using multiple img src / with htmlText --display problem

    I need help.
    I am using multiple <img src /> tag with htmlText and
    pictures displays in layers(overlay)?
    html_txt.html = true;
    html_txt.htmlText = "text<br><img src = '
    http://picture1.jpg 'width='500'
    height='491' hspace='0' /><br>more text<br><img
    src = '
    http://picture2.jpg' width='299'
    height='612' hspace='101' ><br>end with text";
    Is there any way to refresh text field when pictures are
    fully loaded so it will display like regular html page?
    this is flash version, evrything is shown but it is not
    right.
    http://www.sosui.jp/flash/test/v001/pages/home/homeBlogV002.swf
    I want to show them like this page.
    http://sosui.jp/flash/test/v001/pages/home/blog.html
    I tried onEnterFrame but pictures will not show. I think it
    is because it is trying to load pictures everytime. So I cannot use
    onEnterFrame, i need other way to refresh text field.
    Please help me. you might of guessed I am not an English
    speaker, so my English might be little off.
    Thank you.

    does anybody know anything? how long do i need to wait to see
    if someone replies? I just need to know if it is possible or not.

Maybe you are looking for