• How to get the name/unid/key of the cliked row item in Mobile controls?

    By Thomas Adrian 1 decade ago

    I have a question about Mobile controls, in extelib 8.5.3

    I am trying to understand how to pass the clicked row unid to another appPage. I have my xe:djxmLineItem inside a repeat and the rows are displayed nicely. In another appPage I want to get hold of the item clicked, name or unid so I can open the document

    I have read the mobile tutorial, but could not find an example of this.
    In the sample it looks like there is a document data source, but I can't find the unid in order to open a document in an appPage, not sure I undertand that bit.

    my repeat is fetching data outside notes, so I cannot connect the clicked item to a document source. I only want the clicked name or id so I can make a lookup based on that

    thanks for your help.

    Thomas

    • Re: How to get the name/unid/key of the cliked row item in Mobile controls?

      By Lorcan McDonald 1 decade ago

      If the item is coming from a non-Domino source you will have to pass the identifier into the xe:djxmLineItem's moveTo parameter. The format is similar to a URL query string, in that it's an ampersand (&) delimited list of key value pairs separated by an equals sign. The only difference is that the first item is taken to be the appPage you're interested in.

      Therefore:

      http://example.com/ex.nsf/mobile.xsp#docView&documentId=1234

      Would show the appPage named docView and pass it 1234 as the documentId.

      • not really

        By Thomas Adrian 1 decade ago

        Thanks for you reply.

        I just tested this and this and we got a little bit closer to solution. :-)

        Using the full url in "moveTo" does not work, but I got the fragment part working;  #appPage2&id=1234

         

        however, as we are talking about the fragment part of the url, this is not available in SSJS, so I can't get hold of the paramters, e.g

        var id = context.getUrl(); or var id = context.getUrlParameter("id") does not work.

        so, I now know how to pass the value to another appPage, but can't get hold of the value.

        any ideas?

         

         

        Thanks

        Thomas

         

         

         

        • Similar issue

          By Richard Sharpe 1 decade ago

          I'm having the same problem.

          I have my xe:djxmLineItem moveTo use the UNID of the document from a repeat control:













          And in my Page2 I have a Panel with a Document Datasource defined with the





          javascript:context.getUrlParameter("id");}]]>







          Also on the Mobile Page the resetrContent is true to force a reload.



          I htoght this would work?? Any ideas?

        • Similar Issue

          By Richard Sharpe 1 decade ago

          On further testing I think this may be a caching issue....

          The code I submitted above works... but only after 15 mins???? If I test my code (Preview in Safari browser) the link will show me the second page but it displays an empty (or new) doc. So the labels are all correct but the data for each doc is missing (I know the UNID is correct as I can see this in the URL in the browser).

          If I wait 15 mins and use the app (without refreshing and certainly without editing the XPage) it works fine??? As soon as I add a control or edit the Xpage in designer and reload it's back to the empty data again????

          • Re: Similar Issue

            By Lorcan McDonald 1 decade ago

            Could you check to see if you're getting any errors in your Javascript console? Do you see the same issue in a desktop browser?

        • This works for me: ...

          By Frank Hein 1 decade ago

          Hi Thomas,

          var id = context.getUrl(); or var id = context.getUrlParameter("id") does not work for me either.

          Try var id = facesContext.getExternalContext().getRequest().getParameter("id"). Worked for me.

          Cheers, Frank

    • I have the exact same requirement

      By Claude Sammut 1 decade ago

      and still no luck in getting it done