Press event in sap.m.StandardListItem

Hi Experts,
I am creating a Kapsel based mobile application using SAP WebIDE. I have used OfflineStore to store the data and I am able to read data from OfflineStore and bind it to List. I want to move to the next view(detail view) while selecting one item from the Listview. But when I tap on the List Item, I am getting the following error.
Following is my code in js file:
read:function() {
                oList = this.byId("CustomerList");
                oList.removeAllItems();
                var uri = window.localStorage.getItem("ApplicationEndpointURL");
                var user = window.localStorage.getItem("User");
                var password = window.localStorage.getItem("Password");
                var headers = { "X-SMP-APPCID" : window.localStorage.getItem("ApplicationConnectionId") };
                // Create OData model from URL
                var oModel = new sap.ui.model.odata.ODataModel(uri, true, user, password, headers);
                var iOS = (navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false );
                if (iOS) {
                    oModel = new sap.ui.model.odata.ODataModel(uri, true, user, password, headers);
                var oTemplate = new sap.m.StandardListItem({
                   title: "{CustomerNumber}", description: "{CustomerName}", press:"handleProductListItemPress", type:"Navigation"    
                oList.setModel(oModel);
                oList.bindItems("/Customers", oTemplate, null, null);
   handleProductListItemPress: function(oEvent) {
        var app = sap.ui.getCore().byId("idApp");
        var context = oEvent.oSource.getBindingContext();  
        var screen  = app.getPage("idCustomerDetail");   
        screen.setBindingContext(context); 
        app.to(screen);   
And my xml code for the view is as follows:
<sap.ui.core.mvc:View xmlns="sap.m" xmlns:sap.ui.core="sap.ui.core" xmlns:sap.ui.core.mvc="sap.ui.core.mvc" controllerName="com.arteria.view.CustomerList">
    <Page title="Customers" showNavButton="true">
    <List id="CustomerList" growingScrollToLoad="false"/>
   </Page>
</sap.ui.core.mvc:View>
I want to pass the data from Listview to Detail view while moving.
Also I have noticed that, if I remove the property "press:"handleProductListItemPress" from the StandardListItem, I am not getting any error.
Kindly help.
Regards,
Dhani

Hi Sakthivel,
Directly implementing the function while creating the StandardListItem solved my issue.
Now my code looks like this:
var oTemplate = new sap.m.StandardListItem({
                    title: "{CustomerNumber}",
                    description: "{CustomerName}",
                    press:function(oEvent) {
                        var app = sap.ui.getCore().byId("idApp");
                        var context = oEvent.oSource.getBindingContext();
                        var screen  = app.getPage("idCustomerDetail");
                        screen.setBindingContext(context);
                        app.to(screen);
                    type:"Navigation"
Regards,
Dhani

Similar Messages

  • How to call a dynamic URL on 'button press' event, in MVC-based BSP

    Hi,
    My requirement is as below:
    On selecting a row in table view, and pressing a button, I need to open a browser.
    The Browser URL depends on the row selected.
    The key field from table view, is added at the end of the URL string.
    Shortly, I can say that, I am getting a value on row selection & want to pass it to button event.
    In Views Section, there are 2 tags- (1)table view & (2)button.
    Right now, I have put the code for getting the key field, in DO_HANDLE_DATA method.
    In Button's OnClientClick method, I have called the Javascript to open the browser.
    If I now write the code to concatenate the key field value to form the dynamic URL in 'OnClick' method,
    it will be called only after the browser is opened.
    (as OnClick event is executed only after OnClientClick event is executed)
    Could anyone please tell me what event (and in which tag) can be used to solve this.
    Is there any event which is triggered, as soon as the row is selected, &  before the button press event is triggered ?
    Would really appreciate responses made to this query.
    Thanks,
    Nisha Vengal.

    Hi Nisha,
    The crux of your issue here is that you want to call the event triggered with onClick before calling the event triggered on onClientClick. This can be achieved by the following code in the function called on the onClientClick.
    function fn_button()
               htmlbSL(this,2,'b_row_selection:onInputProcessing()');
               window.open("new_page",target="BLANK");
    Here, fn_button is the javascript function called on button click, and b_row_selection is the event triggered on the onClick event of row selection.
    Try this out and let us know if it works for you.
    Regards,
    Saurabh

  • Problem with swapDepth with press event

    Hi guys,
    Im getting confused with swapDepth for navigation buttons. I
    have a button mc's that use this for stacking but something weird
    happens on just the press event. I have tried to take away the
    press event but the problem makes it more difficult. This was the
    script i tried to tweak on the button in order to swapDepth with
    the mc next to it:
    on (press, release, releaseOutside) {
    _root.x +=2;
    _root.bar_mc.swapDepths(_root.x);
    _root.red_mc.swapDepths(_root.bar_mc);
    trace("bar: " + _root.bar_mc.getDepth());
    trace("red: " + _root.red_mc.getDepth());
    ..where the bar_mc is just an border mc so that the clicked
    button will appear on top of it as well as the rest of the button
    mc, my problem comes when you just perform press event w/o
    releasing it, all the buttons appear on top of the border mc, it
    only becomes normal after releasing the mouse. I mean users will
    notice this so I cant figure out how to tell all unclicked buttons
    not to appear on top of border mc on press event. Did this happened
    to anyone? I would gladly appreciate any suggestions that you can
    give. You can see the FLA version here ->
    http://www.janethsieh.net/flash/swapDepth.fla
    _scriptRookie

    hi kglad, thanks for looking into my problem, i just actually
    need solve the problem during press event. when i press any button
    w/o releasing it all the other buttons appear on top of bar_mc,
    what i want it every time i press a button only that button should
    appear on top. open this swf to see what I mean ->
    http://www.janethsieh.net/flash/swapDepth.swf

  • XI triggers an event in SAP

    Hi experts,
    Does anybody of you know the necessary steps to make the XI trigger an event in SAP R3??
    I have a file to file scenario and i would like XI to trigger a function in R3 once the file is delivered in any target folder. I think the best way is using events but not pretty sure.
    Aditionally, R3 runs over SunOS and so XI.
    Any clues?
    Best regards,
    David

    Hi David,
    Yes, no mapping is required.
    IR - you need to create a Message Interface (inbound) with the same Message Type that you are using in Message Interface (outbound). Afterwards, go to ID and change your Receiver Determination in order to use your SAP Business System (You should have this Technical and Business Sys in your SLD, import it to ID environment. If is not there apply this blog /people/michal.krawczyk2/blog/2005/03/10/registering-a-new-technical-system-in-sld--abap-based
    Then, go to your SAP sys t-code SPROXY > Goto > Connection Test, and perform the 4 tests. You need to check if your Business System SAP ERP is configured for ABAP proxy connection with XI. If not apply this blog: How do you activate ABAP Proxies? /people/vijaya.kumari2/blog/2006/01/26/how-do-you-activate-abap-proxies
    For your developments, check this as well:
    File to R/3 via ABAP Proxy
    /people/prateek.shah/blog/2005/06/14/file-to-r3-via-abap-proxy
    ABAP server Proxies
    /people/siva.maranani/blog/2005/04/03/abap-server-proxies
    If you have problems, let me know
    Cheers,
    Ricardo.

  • How to know login history/events of  Sap user from server

    how to know login history/events of  Sap user from server without operating users computer.
    Am using B1 2007A PL47 Forthshift(FSE version 8.5 SP03PL05)

    Hi,
    Check the thread
    Re: User login history SAP Business One
    *Close the thread if issue solved.
    Regards
    Jambulingam.P

  • Question about generate key press event to system. help plz.

    I am wondering if it is possible to write a java program to generate key press event(not receiving)to the local system so all the other program in the system receive those key press event also. Thanks.

    Hi,
    :. I don't know what exactly you intend to accomplish. But, I have used the following code in order to simulate keys pressing inside a Java application.
          /* - - - Simulates TAB (java.awt.Event)
          EventQueue evtq = Toolkit.getDefaultToolkit().getSystemEventQueue();
          evtq.postEvent( new KeyEvent(this, KeyEvent.KEY_PRESSED,
                          0, 0, KeyEvent.VK_TAB, KeyEvent.CHAR_UNDEFINED) );
          evtq.postEvent( new KeyEvent(this, KeyEvent.KEY_RELEASED,
                          0, 0, KeyEvent.VK_TAB, KeyEvent.CHAR_UNDEFINED) );
          /* - - - Simulates Shift+TAB (java.awt.Event)
          evtq.postEvent( new KeyEvent(this, KeyEvent.KEY_PRESSED, 0,
                          InputEvent.SHIFT_DOWN_MASK, KeyEvent.VK_TAB,
                          KeyEvent.CHAR_UNDEFINED) );
          evtq.postEvent( new KeyEvent(this, KeyEvent.KEY_RELEASED, 0,
                          InputEvent.SHIFT_DOWN_MASK, KeyEvent.VK_TAB,
                          KeyEvent.CHAR_UNDEFINED) );:. However, as far as I know to send keys to the whole OS you have to create a 'Hook' as described inside Win32API documentation. That's for Microsoft Windows naturaly.
    Cheers.
    Roque

  • Unable to receive Tab key press event

    Hello,
    I have written a component which extends JComponent.
    For that , when Tab key is pressed I need to process something.
    I have overridden the function processKeyBinding in my class.
    But I am not getting any event for tab key press. For all the other key press events, the function is being called.
    I also tried to create a action and add it to the action map. But that is also not working.
    Can anyone explain me why it is not working and give me the solution.
    Thanks in advance,
    Anu

    public static void removeTabFromFocusTraverval(Component c) {
         int id = KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS;
         Set strokes = c.getFocusTraversalKeys(id);
         Set newStrokes = new HashSet(strokes);
         newStrokes.remove(KeyStroke.getKeyStroke("TAB"));
         c.setFocusTraversalKeys(id, newStrokes);
    }

  • How to binding a key press event of "Esc" to "cancle" button

    I create a class extended JComponent. Than I add a button named "cancle " to it.
    Than I add the class's instance to a JDialog object.
    I try to get the key press event through add a keyListener to the class instance, but no works.
    I try to add a keymap and action map to the dialog 's getRootPane() also no works.
    Who can tell me how can I do?

    Thats the way I did it:
        // map escape key
        ActionListener escapeActionListener = new ActionListener()
          public void actionPerformed(ActionEvent e)
            cancelPressed();
        this.registerKeyboardAction( escapeActionListener,
                                     KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false),
                                     JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );

  • Raise Key pressed event

    Hello, any know how can I raise a key press event throw code. For example I want to simulate that the user has press the A Key. How can I do that throw code?
    Thanks a lot !!

    Hi there,
    Your question has been discussed previously in the forums. Sounds like you want to programmatically click a button in WPF.
    Please check out this post
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1329603&SiteID=1
    Thanks,
    Jennifer

  • How to register "Enter" event  in sap xrpm

    all expert:
    how to register "Enter" event  in sap xrpm

    all expert:
    how to register "Enter" event  in sap xrpm

  • How to detect space key pressed event

    I am working on a japplet where it is needed to pause the applet on the occurrence of a space bar key pressed event can anybody help
    thanks in advance

    Have a look at the tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/events/keylistener.html
    http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html
    -Puce

  • How to catch events from SAP

    Hi everybody:
    I'm trying to set an event in SAP and catch it from a .NET progam using the .NET Connector.
    I have sow the function BP_EVENT_RISE but it seems it doesn't help enough.
    We want to verify if the users have use an especific transaction inside SAP program. We have user exits created and we only need to indicate over the .NET program who is listening for some event.
    How can I solve this?
    We are not using Business Connector.
    I will appreciate any suggestion.

    The User Exit only reflects one step of exit performed by the user.
    The events that i need to perform have the objetive to inform that some task have been performed inside SAP, a complete task, not only knowing that the user have finished his day work.
    The idea it's to know that the user finished a new human resource registration, beyond it's well done, I need to know the number of the human resource.
    On this point, I need to continue the registration in an automatic way over the security system (active directory), send an event to the person who have to regiter him over the corporate system and configure his mail (if needed).
    I have look and evaluate the advise, but it dosen't solve my needs. I have to wait until my user finished his job (or ask him to exit) each time he register a new human resorce, that's not my idea.
    Any other sugestion?. Thanks.

  • How to handle form close event or escape key press event for user defined f

    Experts,
    Please let me know how to handle form close event or escape key press event for user defined form...
    Thanks & Regards,
    Pravin.

    Hi
    You can catch the form close event like this
    If ((pVal.FormType = 139 And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_CLOSE)) And (pVal.Before_Action = True)) Then
          Try
                   SBO_Application.SetStatusBarMessage(pVal.EventType.ToString())
          Catch ex As Exception
                    SBO_Application.SetStatusBarMessage(ex.Message)
            End Try
          End If
    Hope this helps
    Regards
    Arun

  • Can we fire key press event programmatically????

    hi there,
    is it possible in java to fire a key press event (of the associated component) programmatically??? like we can fire action event of a button by saying
    button.doClick();
    thanks in advance.
    anshu

    You can do so by using awt.Robot.keyPress(), just don't forget to do awt.Robot.keyRelease() afterwards!
    Note that it doesn't work for Applets unless you sign them, for security reasons (you don't want to go into a site and have the applet click ctrl+alt+del for you, right?)
    Cheers!
    Moti

  • Is it possible to execute a code in my program based on a click event in SAP B1?

    Hi!, everybody
    I may be doing some wishful dreaming, but I ask my question nevertheless. We never know...
    My pictures are self explanatory, but I explain my requirement below:
    I have a grid which is populated by a query. Briefly, it is a list of Invoices to be reconciled.
    The user selects the invoice to be reconciled by selecting the row. Then he presses the Reconcile? button.
    This is what the Reconcile? button does:
             It colors the background of the selected row Red - just to indicate all rows which have already been selected (because reconciliation has to be
             done one row at a time).
             Then it opens the Internal Reconciliation screen in SAP B1 to allow the user to reconcile his items.
    Ideally, I should color the  selected row Red only after the user has done his reconciliation.
             If he decides not to proceed, he can cancel, and the selected row will not be colored red.
             But I don't know how to do this. (Is it possible???). So I color the selected row assuming the user will proceed with the recon.
    Can anyone tell me if I can fire my program (color the background red) only if the user clicks the reconcile and OK buttons in SAP B1?
    Thanks
    Leon Lai

    Hi Pedro,
    Your VB.NET code finally runs without syntax error.
    However, I still have a problem. The program does not behave as intended.
    See the attached picture.
    And my code is below.
    I am sure you are very near the correct solution.
    So, please tell me what is not working in my code.
    I notice you have removed the lines concerning Handler. Is this the problem?
    My objective is to display the Reconciliation Completed MsgBox (or row coloring in the real project) if the Reconciliation is successful.
    Best Regards,
    Leon
    Option Strict Off
    Option Explicit On
    Module SubMain
        Friend WithEvents Action As ABC = New ABC()
        Public Sub Main()
         Action.Reconcile()
        End Sub
        Private Sub OnReconcileComplete(ByVal sender As Object, ByVal e As EventArgs) Handles Action.ReconcileComplete
            MsgBox("Reconciliation completed")
        End Sub
    End Module
    Dim BPForm2 As SAPbouiCOM.Form
    Public Event ReconcileComplete As EventHandler
        Private Sub RaiseReconcileComplete(ByVal e As EventArgs)
            RaiseEvent ReconcileComplete(Me, e)
            '//Dim Handler As EventHandler = Me.ReconcileComplete
            '// If Not Handler Is Nothing Then
            '//  Handler(Me, EventArgs.Empty)
            '// End If
        End Sub
        Public Sub Reconcile()
            SBO_Application.ActivateMenuItem("9459")
            '// 9459 = Modules -> Business Partners -> Internal Reconciliations
            BPForm2 = SBO_Application.Forms.ActiveForm
            Dim oCode As String
            oCode = "LV10010"
            Dim oBPCode As SAPbouiCOM.EditText = CType(BPForm2.Items.Item("120000008").Specific, SAPbouiCOM.EditText)  ' 120000008 = Business Partner Field
            oBPCode.Value = oCode
            BPForm2.Items.Item("120000001").Click()
            RaiseReconcileComplete(New EventArgs())
        End Sub

Maybe you are looking for

  • [WP8.1][Xaml]Help with datatemplate layout

    Hello all,  I am having this problem with a UI getting perfectly rendered.  Here is the xaml: <DataTemplate x:Key="myDataTemplate"> <Grid x:Name="GridItemPanel"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <Row

  • Error message when clicking "Update" in the server options on ServerManager

    Hello, I have a strange error message when I want to modify the server options through the Server manager component (BPC for MS 7.0 SP5). Here is the error message : "Cannot update server options. Err: Cannot connect to the web server registry. Make

  • Every time I use safari, software update etc... spinning beachballs

    When I try to use safari, software update, system prefs, calculator etc., basically all of the software included with Panther, I get a no response and that spinning beachball thing. Has anyone had this problem. I ran /sbin/fsck -fy and I also did a d

  • Transferring money(balance) from one account/computer to another

    I have purchased itunes cards and applied the money to my account, on different computers. Thus, I have a balance in one computer as well as another. Is there a means to lump all of this money/balance into one computer, so that I need not use the oth

  • User exit for setting tax indicator in Sale order

    Hi All, I want to know if there is a way (user exit) that could look at the Sales Order Type , particular Item Pricing Condition  and Ship-to party State and set the materialu2019s tax classification (VBAP/TAXM1) to u201C0u201D (Exempt) ? Thanks in A