Getting current view via Javascript

In a 3D model with multiple named views, when the user selects a view from either the Views pulldown on the 3D toolbar or from the View pane under the Model Tree, the model is oriented to selected view. Is there a method in Javascript to find which named view is the currently selected view? I don't see anything in the 3D Javascript API other than getting the camera position and trying to infer which view it could be.
Thanks.

Selecting a view from the toolbar fires a cameraEvent in the 3D API, but there is no access to the view which triggers it. In fact there's no exposure of the 'view' object except by name, because view presets define a whole bunch of parameters beyond the scope of the JSAPI.
You're correct in saying the only way you could work out which view preset was chosen would be to compare the camera matrix immediately after the cameraEvent fires to a static array of exemplars in your code - you cannot dynamically read the presets from the toolbar.

Similar Messages

  • SaveAs and maintain "optimized for web view" via javascript???

    I am trying to do a SaveAs via javascript, but I need to maintain the linearized (optimized for web view) state of the PDF.
    I would get this via the SaveAs menu item, but I need to do it silently and rename the file (replace _H.pdf with .pdf).
    Is there anything that I can read that will help me do this? I have looked through the API reference, AcrobatUsers.com, web search, etc.
    Or, if it cannot be done, stop me now.
    Here is what I am doing currently wtih help from this forum.
    XXX_DoSaveLoRes = app.trustedFunction(function()
    app.beginPriv();
    this.saveAs(this.path.replace(/\_H.pdf$/i,"") + ".pdf");
    app.endPriv();
    Thanks,

    I don't think it can be done.

  • Get current View in ViewNavigatorApplication

    Hello,
    How can I get the name of the Class for the current view in a ViewNavigatorApplication, please?
    Thank you.

    OK, this is what I've done,I'm not sure if it's the best way.
    Also, I have not been able to find a way to compare navigator.activeView to navigator.firstView.
    private function currentViewIsFirstView():Boolean
            if(navigator.activeView.className.toLowerCase()=='name_of_first_view_class'){return true;}
            return false;
    I'm doing this so I can exit the NativeApplication when the Back Button (Android) is pressed on the first view.

  • How to get current viewed task

    For an external synchronization requirement I need to maintain or be able to retrieve the current viewed task by a user. I'm hopeful that this has been solved before. Does anyone have any insight there? I'm considering setting up a table to maintain the current viewed taskid for the user, but even that is proving challenging with my lack of ADF exposure. I see the 'TaskSelectedEvent' in the wizard generated task form I'm using but I'm not sure how I might leverage that.
    Any help is appreciated.

    Yes. there is no API to get the current task.
    Try this:
    WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("wi_id");
    But i still say a bit confused with your requirement.
    The task id gets created only upon creation of a task. And you want this current task id in the BPM Process context? How is it possible unless and until some action takes place and the data is passed from WDJ to BPM Context?
    Please clear my doubt.

  • How to get current view name on clicking device back button?

    Hi,
    iam wriing a function for handling device back button(in android) press in my app.controller.js .How to get current viewname when clicking device back button.
    code samples will be helpful.
    my app.controller.js looks like below
    sap.ui.controller("com.opensap.App", {
      onInit : function() {
      document.addEventListener("deviceready", onDeviceReady, false);
      onBeforeShow : function(evt) {
      navButtonTap : function(evt) { 
    function onBackKeyDown(){
      //alert("hai");
      //sap.ui.getCore().byId("SalesDetail").app.backToPage("ProductList");
      //sap.ui.getCore().byId("ProductList").app.backToPage("Dashboard");
      //sap.ui.getCore().byId("SupplierDetail").app.backToPage("Dashboard");
    function onDeviceReady(){
       document.addEventListener("backbutton", onBackKeyDown, false);

    I somehow managed to find the solution
    function onBackKeyDown(){
      var app = sap.ui.getCore().byId("LoginDetail").app;
      app.back();

  • Control the / interact with Report Viewer via Javascript

    Hi
    i have some questions about client control of the report viewer. I would want to use some custom buttons in order to use the report viewer functionalities, as an example to print, or to known when a customer leaf through the report pages saving something in a javascript variable.
    Is it possible to interact with the report viewer? There is a reference text?
    Thanks

    I've never done it with JavaScript, but you could use the built in events to keep track of some information about report navigation. Some of the available events are below.
    CrystalReportViewer Events
    Description
    CrystalReportViewerBase.AfterRender Event
    (Inherited from CrystalReportViewerBase Class.) Event fires when the report rendering process is finished.
    CrystalReportViewerBase.AfterRenderContent Event
    (Inherited from CrystalReportViewerBase Class.) Event fires when the report content rendering process is finished.
    CrystalReportViewerBase.AfterRenderObject Event
    (Inherited from CrystalReportViewerBase Class.) Event fires when the report object rendering process is finished.
    CrystalReportViewerBase.BeforeRender Event
    (Inherited from CrystalReportViewerBase Class.) Event fires when the report rendering process starts.
    CrystalReportViewerBase.BeforeRenderContent Event
    (Inherited from CrystalReportViewerBase Class.) Event fires when the report content rendering process starts.
    CrystalReportViewerBase.BeforeRenderObject Event
    (Inherited from CrystalReportViewerBase Class.) Event fires when the report object rendering process starts.
    CrystalReportViewer.Drill Event
    Event fires when a report is drilled down on.
    CrystalReportViewer.DrillDownSubreport Event
    Event fires when the user drills down on a subreport.
    CrystalReportViewerBase.Error Event
    (Inherited from CrystalReportViewerBase Class.) Event fires when the report object throws an exception.
    CrystalReportViewer.Navigate Event
    Event fires when the user navigates through a report.
    CrystalReportViewerBase.OnRenderScript Event
    (Inherited from CrystalReportViewerBase Class.) Event fires when the HTML script generation starts.
    CrystalReportViewerBase.OnRenderStyle Event
    (Inherited from CrystalReportViewerBase Class.) Event fires when the HTML style class generation starts.
    CrystalReportViewerBase.ReportPartBookmarkNavigation Event
    (Inherited from CrystalReportViewerBase Class.) Event fires after navigation to a report part in the same report or another report is finished.
    CrystalReportViewer.ReportRefresh Event
    Event fires when the data in the report is refreshed.
    CrystalReportViewer.Search Event
    Event fires when text is searched for in the report.
    CrystalReportViewer.ViewZoom Event
    Event fires when zoom level of the viewer changes.
    CrystalReportViewerBase Events
    Description
    CrystalReportViewerBase.AfterRender Event
    Event fires when the report rendering process is finished.
    CrystalReportViewerBase.AfterRenderContent Event
    Event fires when the report content rendering process is finished.
    CrystalReportViewerBase.AfterRenderObject Event
    Event fires when the report object rendering process is finished.
    CrystalReportViewerBase.BeforeRender Event
    Event fires when the report rendering process starts.
    CrystalReportViewerBase.BeforeRenderContent Event
    Event fires when the report content rendering process starts.
    CrystalReportViewerBase.BeforeRenderObject Event
    Event fires when the report object rendering process starts.
    CrystalReportViewerBase.Error Event
    Event fires when the report object throws an exception.
    CrystalReportViewerBase.OnRenderScript Event
    Event fires when the HTML script generation starts.
    CrystalReportViewerBase.OnRenderStyle Event
    Event fires when the HTML style class generation starts.
    CrystalReportViewerBase.ReportPartBookmarkNavigation Event
    Event fires after navigation to a report part in the same report or another report is finished.

  • To get current view/jsff

    Guys,
    My application is desinged using oracle dynamica tab shell. At some moments, i want to check programatically what is the page (jsff/view) being displayed (which is seen by the user). is there anyway to do it?
    Basically i have the business requirement to find the logical context of the page which user is seeing...(accordingly we need to execute some kind of logic)
    any pointers would be appreciated...

    hi,
    maybe this is useful:
    http://biemond.blogspot.com/2009/03/some-handy-code-for-backing-beans-adf.html
    http://biemond.blogspot.com/2011/01/some-handy-code-for-your-managed-beans.html
    regards,
    Brano

  • Print "Current View" not avail in Acro 9

    I am trying to print a selected area on the page.  In prior versions, I could zoom in on the area, click print and then choose "Current view" under print range.  In Acrobat 9, I don't have "Current View", but I do have "Selected Pages".
    Is there a way to print the current view short of extracting the page, cropping it then printing it?
    The online help page at http://help.adobe.com/en_US/Acrobat/9.0/Standard/WS58a04a822e3e50102bd615109794195ff-7bde. w.html says it should be there, but it is not.

    Bernd,
    Just closing the "Pages" navigation panel does not do it.  What I figured out was that if a page is preselected in the "Pages" navigation panel, then I get "Selected Pages" in the print range. I get that even with the navigation panel closed.
    In order to get "Current View", I have to click off of the page in the navigation panel so that no page is preselected. Now I can print what is shown in the graphics window.
    Thanks for your help.
    Kirk

  • VBA Macro to Set Current View

    Does anybody know what command I could use in VBA to change the Current View in Excel for BPC 7M?
    Edited to add:
    I'm aware of the MNU_eTOOLS_MEMBERSELECTOR_x macro.  What I'm looking for is code to change the current view systematically without going through the member selector.
    Edited by: Will Leonard on Feb 22, 2010 1:26 PM

    Hi,
    Whenever I would like to change the current view via VBA, I use the methods which are released by opening a custom menu. However in most of the cases you dont want your end user to open a custom menu, but you would like to have the methods. Therefore I always do the following to simulate a custom menu (steps 1 to 4 can also be performed by opening a custom menu template and delete the unnessecary data).
    1) Create a new workbook and add the three new sheets
    2) Name the sheets, EV__RESULT,EV__MENUSTYLE and EV__DEFAULT
    3) In the sheet EV__DEFAULT type %DEFAULT% in range("A3")
    4) In the same sheet enter on row 4 the following items accross the columns:
    -%MenuItem%
    - Level
    - Action
    - P1
    - P2
    - P3
    - P4
    - CVOverride
    - NomalScreen
    5) Open the VBA editor and under thisworkbook module enter the following code:
    Private Sub Workbook_Open()
    Application.Run "MNU_ETOOLS_PSMANAGER_COMPILE"
    End Sub
    This code will compile the custom menu and will release all methods within it
    6) To change the current view enter the following code
    Sub Change_CV
    Application.Run "EVMACROCALL", "EVGOTOHOMESHEET", "", "", "", "", "<Your dimension>=<Your ID>", ""
    End sub
    Replace <Your dimension> with the dimension for which you would like to change the current view
    Replace <Your ID> with the member id code
    7) Hide the three sheet (EV__XXX).
    8) Close the file.
    9) Re-open the file and run the macro Change_CV and see if the CV has changed.
    You will now be able to change the current view via VBA. Only downside is that whenever the document is closed the methods will not be available anymore.
    BTW you can call any MNU command (e.g MNU_ETOOLS_REFRESH) and Custom menu function. For more information on the custom menu function see the help function and search for "Using custom menu functions". Refer to the CVoverride for an example on how to change the Current view between applications etc.
    HTH,
    Peter
    Edited by: d. G. PETER on Jun 4, 2010 4:23 PM

  • How to get elements in a multi-value field via javascript?

    The following will set variables.variable1 to variables.variable2 when the "Script Link" component is clicked...
    <Field>
    <Display class='Javascript'>
    <String>
    function myScript() {
    el=getElement(document.mainform,"variables.variable1");
    el2=getElement(document.mainform,"variables.variable2");
    el.value=el2.value;
    </String>
    </Display>
    </Field>
    <Field name='Script Link'>
    <Display class='Link'>
    <Property name='URL'>
    <String>javascript:myScript();submitCommand(document.mainform,%20'Recalculate');</String>
    </Property>
    </Display>
    </Field>
    My issue is, if variables.variabl2 is a list / multivalued, i get errors trying to traverse through the "array".
    How can i read and set an a list element via javascript function above? I've tried things like get() , and variables.variable2[0] .
    any help would be appreciated....
    is there an API somewhere i can reference?

    Hi,
    thanks for your reply!
    If I have the parameters in the URL and use the method GET it works all right.
    but I need the method to be POST. I suppose, I have the wrong way identifying the parameter name
    This is from VB
    varTarget = "http://localhost:9090/gm/getData" ' getData is my servlet
    xmlSendStr = "SQLStmt=SELECT TCPD_Cars.* From TCPD_Cars WHERE (((TCPD_Cars.CarIdent)=45));"
        xmlHttp.Open "POST", varTarget, True   'True means asynchronous
        xmlHttp.Send xmlSendStrthis is part of my Servlet
         protected void doPost(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              response.setContentType("text/html");
              PrintWriter writer  = response.getWriter();
              String SQLStmt = request.getParameter("SQLStmt") ;
            //make the database query and get the returns
            writer.println(GetSQLData(SQLStmt));
            //close the write
            writer.close();                    
         }I would appreciate any suggestions

  • How can I add a watermark via JavaScript that includes the current datestamp?

    Part of my daily work process here is to scan in a huge stack of inbound mail. I then OCR the scans, delete the blank pages, and add a watermark. I've got a batch process set up for the first two steps, but I can't make a watermark for the datestamp itself and need to do so via JavaScript, but I have a luddite-level understanding of it.
    As of right now, these are my settings I'm using to add the datestamp:
    What I want to do is run a script to do the same thing and insert the current date where I have mm-dd-yy currently, but I don't have the first clue of where to start. Any help you could offer would be hugely appreciated

    You can use the doc.addWatermarkFromText() method as a JavaScript step in an Action.
    for example
    var dt = new Date();
    var stoday = (dt.getMonth() + 1) + '-' + dt.getDate() + '-' + dt.getFullYear();
    this.addWatermarkFromText({
    cText: "Deposit\r" + stoday,
    nTextAlign: app.constants.align.right,
    nHorizAlign: app.constants.align.right,
    nVertAlign: app.constants.align.top,
    nHorizValue: -72, nVertValue: -72
    See the SDK Help files for information on what all the parameters do.

  • Q. 2:  Powerpoint for Mac 2011  Version 1     How do I get PRESENTER VIEW to work so I can see my notes and the audience only sees the slide show?  Currently PRESENTER VIEW shows up on the flatscreen and my laptop shows only the slide show....?!

    Q. 2:  Powerpoint for Mac 2011  Version 1     How do I get PRESENTER VIEW to work so I can see my notes and the audience only sees the slide show?  Currently PRESENTER VIEW shows up on the flatscreen and my laptop shows only the slide show....?!

    As PowerPoint it a Microsoft product, you may find that you get better answers to your question on their PowerPoint forums.
    Best of luck.

  • Jquery/JavaScript to get current browser's name and its version

    Hi,
    I using sharepoint 2010, 
    Is it possible using Jquery/JavaScript to get current browser's name and its version.
    when my sharepoint site home page opens i need to display a popup msg of current browser name and its version.
    can anyone help me on this.
    With Regards,
    RK

    Please use the below code snippet:
    And here is the source code that performed the browser detection:
    var nVer = navigator.appVersion;
    var nAgt = navigator.userAgent;
    var browserName = navigator.appName;
    var fullVersion = ''+parseFloat(navigator.appVersion);
    var majorVersion = parseInt(navigator.appVersion,10);
    var nameOffset,verOffset,ix;
    // In Opera 15+, the true version is after "OPR/"
    if ((verOffset=nAgt.indexOf("OPR/"))!=-1) {
    browserName = "Opera";
    fullVersion = nAgt.substring(verOffset+4);
    // In older Opera, the true version is after "Opera" or after "Version"
    else if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
    browserName = "Opera";
    fullVersion = nAgt.substring(verOffset+6);
    if ((verOffset=nAgt.indexOf("Version"))!=-1)
    fullVersion = nAgt.substring(verOffset+8);
    // In MSIE, the true version is after "MSIE" in userAgent
    else if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
    browserName = "Microsoft Internet Explorer";
    fullVersion = nAgt.substring(verOffset+5);
    // In Chrome, the true version is after "Chrome"
    else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
    browserName = "Chrome";
    fullVersion = nAgt.substring(verOffset+7);
    // In Safari, the true version is after "Safari" or after "Version"
    else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
    browserName = "Safari";
    fullVersion = nAgt.substring(verOffset+7);
    if ((verOffset=nAgt.indexOf("Version"))!=-1)
    fullVersion = nAgt.substring(verOffset+8);
    // In Firefox, the true version is after "Firefox"
    else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
    browserName = "Firefox";
    fullVersion = nAgt.substring(verOffset+8);
    // In most other browsers, "name/version" is at the end of userAgent
    else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) <
    (verOffset=nAgt.lastIndexOf('/')) )
    browserName = nAgt.substring(nameOffset,verOffset);
    fullVersion = nAgt.substring(verOffset+1);
    if (browserName.toLowerCase()==browserName.toUpperCase()) {
    browserName = navigator.appName;
    // trim the fullVersion string at semicolon/space if present
    if ((ix=fullVersion.indexOf(";"))!=-1)
    fullVersion=fullVersion.substring(0,ix);
    if ((ix=fullVersion.indexOf(" "))!=-1)
    fullVersion=fullVersion.substring(0,ix);
    majorVersion = parseInt(''+fullVersion,10);
    if (isNaN(majorVersion)) {
    fullVersion = ''+parseFloat(navigator.appVersion);
    majorVersion = parseInt(navigator.appVersion,10);
    document.write(''
    +'Browser name = '+browserName+'<br>'
    +'Full version = '+fullVersion+'<br>'
    +'Major version = '+majorVersion+'<br>'
    +'navigator.appName = '+navigator.appName+'<br>'
    +'navigator.userAgent = '+navigator.userAgent+'<br>'
    VARIABLES
    DESCRIPTION
    navigator.appCodeName 
    The code name of the browser 
    (e.g. Mozilla) 
    navigator.appName
    The name of the browser 
    (e.g. Netscape or Microsoft Internet Explorer) 
    navigator.appVersion
    The browser version (e.g. 3.0 or 4.0) 
    navigator.userAgent
    The header information for the browser. 
    (e.g. Mozilla/4.0) 
    navigator.platform
    The users operating system
    (e.g. WIN32)
    http://www.w3schools.com/js/js_window_navigator.asp
    Click on Propose as Answer if the solutions works for you.

  • How to get the current view name is displaying?

    Hi Experts,
    I have a requirement that I have to know the current view is displaying. At the header of the page, there is a component (BTCHIST) which is fix and common for the all others. It has a button called Finish. When the user clicks on it, it has a different behavior depending on the current view.
    Does anyone know any method in order to get this information? I searched up in CRM_UI_FRAME, however I didnu2019t find anything.
    Regards,
    André

    Hi,
    You need to redefine the method IF_BSP_WD_HISTORY_STATE_DESCR~GET_STATE_DESCRIPTION of the controller class to change the view description. Unfortunately, the effort is huge and we cannot do it dynamically and needs to be done for each view in question.
    Regards
    Prasenjit

  • How to get activity (outcome) which navigated to current view

    Hi!
    Is there a way to get activity (outcome string) that was cause of navigation to current view? For example, I have a view named SearchPage and I can navigate to this page from two outcomes (success and failed) from some taskflow (for example, the EditItem taskflow). I want to detect from which outcome (success or failed) I have returned to SerachPage. How to get this? I know I can use output parameters from taskflow, but I would like to simplify the case so I don't have to deal with output parameters but to rely on navigation rules / outcomes.
    Thanks,
    Pavle

    Hello Pavle,
    Unless I misunderstand your use case, this should really be a task flow input parameter previously set using a method call activity preceding the task flow call. From what I understand, you have 2 options:
    Option 1
    EditItem task flow:
    state1
      someTransition
      --> state2
        success
        --> method call that set a request attribute to success
        --> call the task flow, passing the request attribute as an input parameter
        failure
        --> method call that set a request attribute to failure
        --> call the task flow, passing the request attribute as an input parameter
    Option 1
    EditItem task flow:
    state1
      someTransition
      --> state2
        success
        --> call the task flow, passing success as an input parameter
        failure
        --> call the task flow, passing failure as an input parameterPersonally I prefer the first option as I prefer to duplicate method call state than task flow calls for easier maintenance as I consider task flow call to be more complex activities than simple method calls and thus prefer to duplicate the latter over the former.
    Regards,
    ~ Simon

Maybe you are looking for

  • Can't parse XMP metadata from files

    Hello, I am currently having troubles reading custom metadata from a file. I wrote a really simple test case to show you that, maybe I'm doing something wrong... Writing a simple property : static const char * kNS1 = "ns:test1/"; void Foo::writeSimpl

  • Cannot open resource file & missing character color option

    having 2 problems and unsure if they are related to each other or not. Running indesign cs6 v8.0.1 with no more updates showing in the Updater. When I open the program it gives me the error "cannot open resource file." this isnt too annoying as i jus

  • ActiveX COM issue in new LabVIEW instance

    I have a rather peculiar problem I'm running into with using a COM library from a company to read proprietary binary files. I'm not very familiar with this type of Labview programming, I just followed their examples and experimented, a lot. I have ta

  • Internal Order Budget - list

    Hi All, Do we have any transaction code  to display list of Internal Order Budget. In K023, we are able to see one Internal Order. Do suggest. Regards,

  • Comcast cable internet hook up

    How do you configure for comcast hi=speed internet?