UIScrollView - Call Touch Event Methods

Hello Anybody,
Design Pattern : I have a view with three buttons at the top of the view and one button at the bottom of the view. I have added an UIScrollView in the full centre part of the view. I have sub-classed an image view to this scrollview. This image view can now be pinch zoomed and can be viewed fully using the scroll view. I have done with these things. (Using Interface Builder)
This is my requirement: Now i need the touch event to be enabled on this UIImageView. It's because I have to touch anywhere in the imageview and have to add an image button at the corresponding positions on the UIImage View.
Question : But UIScrollview doesn't detect touchBegin , touchmove methods. What is reason for UIScrollview not detecting touch events and how can i activate touch event on UIScrollView?
Please anybody help me , Its very urgent .......
Nalan.

There is no difference to use CSS or JS to assign some style.
We havn't DOM-object for this menu
Therefor we should use some trick like touch event emulation.
May be i am wrong...

Similar Messages

  • How to call a bean method from javascript event

    Hi,
    I could not find material on how to call a bean method from javascript, any help would be appreciated.
    Ralph

    Hi,
    Basically, I would like to call a method that I have written in the page java bean, or in the session bean, or application bean, or an external bean, from the javascript events (mouseover, on click, etc...) of a ui jsf component. I.e., I would like to take an action when a user clicks in a column in a datatable.
    Cheers,
    Ralph

  • How to call a static method from an event handler

    Hi,
       I'm trying to call a static method of class I designed.  But I don't know how to do it.  This method will be called from an event handler of a web dynpro for Abap application.
    Can somebody help me?
    Thx in advance.
    Hamza.

    To clearly specify the problem.
    I have a big part code that I use many times in my applications. So I decided to put it in a static method to reuse the code.  but my method calls functions module of HR module.  but just after the declaration ( at the first line of the call function) it thows an exception.  So I can't call my method.

  • How to call server event in DO INIT method of view

    Folks,
    I have declared a server event in the view and when I am trying to call that event in DO INIT method of view , it is not firing the event .
    <i><b>
      public void wdDoInit()
        //@@begin wdDoInit()
        // set icon file names
        wdContext.currentContextElement().setIconLeftArrow("topLvlScrollerLeft.gif");
         wdContext.currentContextElement().setIconRightArrow("topLvlScrollerRight.gif");
        // hide display when errors during startup
         if(wdContext.currentContextElement().getErrorDuringInit())
              wdThis.wdFirePlugOutEmpty();
         wdThis.wdGetDaylyChangeModeAction();</b></i>

    I have created a action event
    <i><b>  public void onActionDaylyChangeMode(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionDaylyChangeMode(ServerEvent)
         wdThis.wdGetVcCatRecordEntryInterfaceController().blcEvent(VcCatRecordEntry.ACTION_CHANGE_MODE);
         wdContext.currentContextElement().setSelectedTab("TabCatRecordEntryDay");
         wdContext.currentContextElement().setTemp("Changed Tab");
        //@@end
      }</b></i>

  • Explicitly call the Event Handler method

    Hello Friends,
    Is it possible to explicitly call the eventhandler method `? or dynamically fire/invoke the event so that particular eventhandler method should be called ?
    Regards,

    You should call eventhandler as follows
    DATA lr_event TYPE REF TO cl_wd_custom_event.
    **Create event object
      CREATE OBJECT lr_event
        EXPORTING
          name = 'ON_SELECT'. " give your event name which appears in wdevent in your handler method
    * Call eventhandler
      wd_this->onactionsel_rdb(
      wdevent = lr_event                          " ref to cl_wd_custom_event

  • Why are my touch events got cancelled?

    Hi, I have a UIScrollView, an UIView inside it as subview and a few UIImageView inside the UIView as subview. All UIView and UIImageView's userInteractionEnabled are set to NO.
    I override touchesBegan, touchesMoved, touchesEnded, touchesCalcelled events of UIScrollView, just print out a message and call the correspondent method in super class. I found that most of my touches move and all my touches end events were called. Why?
    Thank you very much. Please help me.
    ff

    Fixed my own problem.  Ultamately a user error but tied to the many threads about the month view defaulting events to "all day" vs. hourly increment.  I knew that was the case, so when editing events from month view I made sure to add/change the time, but negected to look at "To" date.  If my event was for an hour, simply adding the hour pushed the day to span across dates so the event was really 25 hours.  Looked OK in the month view (just showed as a dot) but the day and week were all filled and casued the event to appear twice on the second day in list view (iPhone).  In the case of repeat events, sometimes "To" date ended up as the end date for the repeat cycle... which really messed every thing up... I believe causing what looked like duplicates, etc.

  • [iPhone] - No Touch Events After Selecting Photo in UIImagePicker

    In my OpenGL ES app, after calling the UIImagePicker and selecting a photo (or hitting cancel,) my app no longer registers any touch events.
    Touch events work fine before UIImagePicker is called. I am guess that somehow UIImagePicker (even though I release it) or something else is intercepting the touch events and not passing them along.
    Does anyone have any idea how to solve this problem?
    Photo Controller code:
    - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
    [self UseImage:image];
    // Remove the picker interface and release the picker object.
    [[picker parentViewController] dismissModalViewControllerAnimated:YES];
    [picker release];
    - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
    [[picker parentViewController] dismissModalViewControllerAnimated:YES];
    [picker release];
    - (void)SelectPhoto
    if( [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary ] )
    UIImagePickerController *pImagePicker;
    pImagePicker = [[UIImagePickerController alloc] init];
    pImagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    pImagePicker.delegate = self;
    pImagePicker.allowsImageEditing = NO;
    // Picker is displayed asynchronously.
    [self presentModalViewController:pImagePicker animated:YES];
    - (void)TakePhoto
    if( [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera ] )
    UIImagePickerController *pImagePicker;
    pImagePicker = [[UIImagePickerController alloc] init];
    pImagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    pImagePicker.delegate = self;
    pImagePicker.allowsImageEditing = NO;
    // Picker is displayed asynchronously.
    [self presentModalViewController:pImagePicker animated:YES];
    // Implement this method in your code to do something with the image.
    - (void)UseImage:(UIImage*)theImage
    The code calling the photo controller:
    [g_window addSubview:m_pPhotoController.view];
    [m_pPhotoController SelectPhoto];
    Thanks.

    Some more information:
    If I add a TouchesBegan function to my PhotoController it registers the touches. The stack-trace is:
    #0 0x000315be in -[GEPhotoController touchesBegan:withEvent:] at gephotocontroller.mm:155
    #1 0x30adb941 in forwardMethod2
    #2 0x30a6786b in -[UIWindow sendEvent:]
    #3 0x30a56fff in -[UIApplication sendEvent:]
    #4 0x30a561e0 in _UIApplicationHandleEvent
    #5 0x31565dea in SendEvent
    #6 0x3156840c in PurpleEventTimerCallBack
    #7 0x971545f5 in CFRunLoopRunSpecific
    #8 0x97154cd8 in CFRunLoopRunInMode
    #9 0x31566600 in GSEventRunModal
    #10 0x315666c5 in GSEventRun
    #11 0x30a4eca0 in -[UIApplication _run]
    #12 0x30a5a09c in UIApplicationMain
    #13 0x00002be0 in main at main.m:14
    I tried removing the photo controller's view by calling
    [m_pPhotoController.view removeFromSuperview];
    But to no avail. My photo controller object still captures all the touch events.

  • [IPhone SDK] NSTimer conflicts with touch events

    Hi all,
    i've an NSTimer that refresh the UIView at 30 fps. Below there is the scheduled timer:
    animationTimer = [NSTimer scheduledTimerWithTimeInterval:animationInterval target:self selector:@selector(refreshAll) userInfo:nil repeats:YES];
    The problem is that the app doesn't wrap the touch events (touchbegan, touchesMoved and touchEnded) because the timer interval is too low and conflicts with this events.
    I tried to set the animation interval to 2 seconds and the touch events works but the rendering obviously is slow.
    However the problem is only on the device because when i launch the app on the simulator i have no problem with the timer.
    Can anyone tell me how I can solve this problem?
    Thanks

    The game I'm developing for the iPhone has 2 play modes (the second mode has more on screen objects). In the first game mode, I get a solid 29-30 frames per second (acceptable), however the second mode with more objects gives me 25 fps (slightly jerky). BTW, on a PC with modern hardware I get >1300 fps @1680x1050.
    At first I thought that the NSTimer resolution might be causing problems. The Apple demos all use a resolution of 1/60. Setting a value of 0.0 actually bumps the frame rate up by few frames, but I lose the ability to process touch input (crap). Adding usleep(a_delta) hoping to invode a context switch does nothing for the touch input.
    The next thing I tried was creating a dedicated rendering thread which basically does a while (1) render(); The thread will loop as fast as it can, and I regain touch input. On the plus side, I gained 3-4 fps for both game modes, so now I can hit 30 fps for the second mode (sweet).
    To make this work, I obviously needed to add locking primitives between the render thread and the iphone input (touch, sleep, phone call etc). The render loop is now basically:
    while (alive)
    aLock->Lock();
    render();
    aLock->Unlock();
    Anyway, I thought people would appretiate my experience when looking to squeeze a few more frames out of the iPhone. You just need to understand multiprocessing to work out the synchronisation issues.
    PS. There is some interesting advice in the following thread:
    http://discussions.apple.com/thread.jspa?messageID=7898898&#7898898
    Basically, they set invoke the runloop from the animation method. This might be simpler than spawning threads and handling locking, but I haven't tried it.

  • [iPhone] Touch event and countdown timer

    Hi all,
    in my app I want to have a uilabel in my mainview which displays a countdown from a chosen number of seconds. This shouldnt be too hard. But now comes the clue. I only want the timer to start the countown when there are no touch events at all. So every time the user clicks a button, changes to a different view or does anything else the timer should start counting down from the begining again.
    How would you do this?
    How do I termine if there is a touch event anywhere in the app?
    Do I use NSTimer?
    Thanks for taking your time and making thoughts!

    From what you've said, you are going to decrement a variable every second unless the user does something on the screen, right? If so...
    Create your variable and set it to the starting value, say, 10 seconds.
    Set up your timer to call a given method (@selector:myCountdownMethod) every second.
    The method should decrement the counter every time it is accessed (i.e. every second), then update your UILabel. It should also handle what happens when the counter hits zero.
    Next, your touchesBegan method should simply set the counter value back to its original starting value, i.e. 10. The timer will still trigger every second and decrement the counter, it'll just never hit zero unless the user doesn't do anything for 10 seconds.
    Hope this helps.

  • How to call a private method in a JFrame

    I have a Frame which has some properties like its size, bgcolor plus other parameters, as instance variables. There is a button on the Frame with the caption : "set properties". When one clicks on that button, a new frame should appear via which a user can change the values of the parameters of the main Frame (i.e size, bgcolor,..etc). The user would input the new values in the textfields or radio buttons that are on the new frame, and then click a submit button, which has to exist on the same NFrame. How can I do that so that when the submit button is pressed, the parameters values are updated and so is the display view ?
    I made it this way : I created 2 classes, the main frame and the new Frame. I made the new Frame an instance variable of the main Frame. When the user clicks the " set properties" button on the main Frame, the new Frame is shown. The user enters new values for some of the parameters and clicks submit. The parameters in the new Frame are updated. UP TO HERE EVERYTHING WENT JUST FINE. Now, there is a private method in the main frame that changes the color, size, ...etc of the main frame according to the values stored in the instance variables color, size,...etc. THE QUESTION IS: How can the new Frame display the changes after the values have been updated ? That is, how can it call the "private" method in the main class?? Should the new class be a child class of the main class to be able to access it's private methods ??

    import java.awt.*;
    import java.awt.event.*;
    import java.util.Random;
    import javax.swing.*;
    public class CallingHome
        SkinMod skinMod;
        JPanel panel;
        public CallingHome()
            // send reference so SkinMod can call methods in this class
            skinMod = new SkinMod(this);
            JButton change = new JButton("change properties");
            change.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    skinMod.showDialog();
            JPanel north = new JPanel();
            north.add(change);
            panel = new JPanel();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(north, "North");
            f.getContentPane().add(panel);
            f.setSize(300,100);
            f.setLocation(200,200);
            f.setVisible(true);
        public void setBackground(Color color)
            panel.setBackground(color);
            panel.repaint();
        public static void main(String[] args)
            new CallingHome();
    class SkinMod
        CallingHome callHome;
        Random seed;
        JDialog dialog;
        public SkinMod(CallingHome ch)
            callHome = ch;
            seed = new Random();
            createDialog();
        public void showDialog()
            if(!dialog.isShowing())
                dialog.setVisible(true);
        private void createDialog()
            JButton change = new JButton("change background");
            change.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    callHome.setBackground(getColor());
                    dialog.dispose();
            JPanel p = new JPanel();
            p.add(change);
            dialog = new JDialog();
            dialog.getContentPane().add(p);
            dialog.setSize(200,100);
            dialog.setLocation(525,200);
        private Color getColor()
            return new Color(seed.nextInt(0xffffff));
    }

  • How to call a custom method in a parent container.

    I have an MXML component that defines the method:
    public function showAllGlyphs(spots:Array):void { ... }
    There is a child component of this MXML componet called
    DataClip, which has
    a method that needs to call the parent method:
    parent.showAllGlyphs(pushPins);
    I get a 1061 error when compiling. I understand the problem.
    The compiler
    thinks the paret is a static class, and does not know about
    the extention.
    My question is how to I cast or otherwise reference this
    method in the
    PARENT?
    Severity Description Resource In Folder Location Creation
    Time Id
    2 1061: Call to a possibly undefined method showAllGlyphs
    through a
    reference with static type
    flash.display:DisplayObjectContainer.
    DataClip.mxml Transitions line 32 August 21, 2006 3:07:28 PM
    169

    I understand why what you say is the correct design pattern
    (much more
    modularity and the potential for re-use).
    In my case, it still might make sense to use .parentDocument
    (my problem was
    not understanding the difference between .parent and
    .parentDocument)
    Although I still don't understand why .parentDocument does
    work.
    I have a bunch of purely GUI oriented subComponents of a
    .parentApplication.
    The parentApplication has a custom AS-only module that does
    the "business
    logic, network connections, etc).
    Basically, I want a module (Singleton Class) that is
    accessible from all GUI
    subcomponents that provides general utility functions. It
    can't be
    instatiatiated multiple times. So there needs to be one
    global place for it.
    It does not really make things clear if everything is done
    via an event
    paradigm. (Well, maybe to me, but I have a Ph.D. in CS so I
    am tainted) I
    want this clear to the average programmer.
    ===============================
    Dr. Yechezkal Gutfreund
    Team ACE for Mobile Devices
    ===============================
    "peterent" <[email protected]> wrote in
    message
    news:[email protected]...
    > As a rule of thumb, a child should never call functions
    in its parent. It
    > is
    > possible, it just not a very good programming practice.
    > If a child needs the parent to do something, the child
    should dispatch an
    > event. In your child, declare an event using Metadata:
    >
    > <mx:Metadata>
    > [Event("showGlyphs")]
    > </mx:Metadata>
    >
    > The child should have a public property that the parent
    can access to
    > handle
    > the event:
    >
    > public var pushPins:Array;
    >
    > When the child needs the parent to do this, have the
    child set the
    > pushPins
    > array, then dispatchEvent( new Event("showGlyphs") );
    >
    > In the parent, on the child's tag, have it listen for
    the event and
    > execute it:
    >
    > <MyChild
    showGlyphs="showAllGlyphs(event.target.pushPins)" />
    >
    > I know this seems like a lot more work, but it is a much
    better strategy
    > than
    > having children reach up and into the parent's code.
    >

  • Calling a bean method on select of Combo box item

    Hi
    On select of Combo box item in a form, text fields in the same form should be populated
    dynamically.Is it possible to call a bean method which does this,by calling onSelect() method
    of combo box ?
    Thanks in advance,
    Sridevi

    Uff, sorry!
    I ment that you write some code for the "onSelect" event which sends a request to the server with the selected value: onSelect="self.location.href='<%= request.getRequestURI()%>?selectedVal= ' + this.selectedIndex;"

  • Calling Portal event from ABAP class

    Hi Experts,
    I need a following clarificatrion, Please help,
    1. Is it possible to call a webdynpro method from a normal ABAP class?
    2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
    Is there any alternative method which can be used in ABAP having the same functionality.
    3. Is there any ways with which we can call portal event from ABAP class?
    Thanks,
    Shabir

    >1. Is it possible to call a webdynpro method from a normal ABAP class?
    I wouldn't necessarily recommend this approach. You shouldn't try to trigger events or any of the standard WDDO* methods from outside the WD Component itself.  That said, you can pass the object reference (like the WD_COMP_CONTROLLER object reference or the View Object Reference) into methods of normal classes.  Be careful if you are finding yourself calling a lot of your added methods from outside WD.  This is probably a sign that these methods should be in the Assistance Class or some other Class functioning as a Model Object.
    >2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
    Is there any alternative method which can be used in ABAP having the same functionality.
    What exactly do you want to do here?  Do you just want to get the relaxation script?  For what purpose?  You should never need to inject the relaxation script into WDA. 
    >3. Is there any ways with which we can call portal event from ABAP class?
    To what purpose.  Do you just want to delegate the triggering of the event that is inside WD Component to be called from a class?  If so you can pass the portal API object reference into a class from the WD Component.  However this only works while running within WD.
    How is this class used?  Are you running in WD?  Are you trying to generate some HTML code that runs in the portal independent of WD?

  • How to call view-controller method out of componentcontroller

    Hello all,
    my component implements a component-interface with method BACK.
    Thus my componentcontroller has the interface Method BACK.
    When triggering BACK from an foreign component, the implementation within the componentcontroller is called. So far so good.
    Now I want to POPUP_AND_CONFIRM when BACK is hit. But this POPUP_TO_CONFIRM requires me to create an action. But I can't create an action within the componentcontroller.
    I could realize the POPUP_AND_CONFIRM within the components view. But how can I call a view-method out of the componentcontroller?
    Or does anybody have a better solution? (Maybe I could implement BACK within the view, but how to connect the componentcontroller-back-method with the views back-method?)
    Thank you very much in advance...
    Regards
    I. Durmaz

    You should never attempt to call view methods from outside the view.  It is possible to register popop event handlers to methods of the component or custom controllers.  From the online help:
    For a few special cases it is useful to register event handlers for component controllers or custom controllers on the button events of a dialog box. For these cases, a special POPUP_TO_CONFIRM attribute of type IF_WD_POPUP_TO_CONFIRM_N has been implemented in the IF_WD_WINDOW interface. This interface provides precisely the methods with which event handlers for component and custom controllers can be registered on events of the dialog box.
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/47/b9487e01602fe2e10000000a42189d/frameset.htm

  • Can we call super class method from Overwrite method using SUPER keyword

    Hi All,
    For one of our requirement , I need to overwrite "Process Event" method of a feeder class  ,where process event is present is protected method. so when we are making a call , then its saying
    "Method  "process event"  is unknown or Protected  or PRIVATE ".
        But we are just copied the source code in the "Process Event" method to the Overwrite method.
    Can anyone provide me the clarification , why system behaving like this.
    Thanks
    Channa

    Hi,
    I think you can not.
    Because, only public attributes can be inherited and they will remain public in the subclass.
    for further detail check,
    http://help.sap.com/saphelp_nw70/helpdata/en/1d/df5f57127111d3b9390000e8353423/content.htm
    regards,
    Anirban

Maybe you are looking for