Issue with selection in Screenshot manager - autodesk-forge

We have built custom state saving functionality into our web app, based largely on the "Screenshot Manager" extension that Philippe created. We are having an issue with selection, wherein some components that where hidden when the state was saved are being shown when the state is loaded. I have replicated it on viewer.autodesk.io with the vanilla states manager code.
To be precise, components already visible in the viewer that are hidden by CTRL-clicking them on the model browser initially disappear in the viewer. However, when you save this state and then recall the state at a later time, the components hidden in this way re-appear.
Can you please investigate - is this a bug in the states manager code (we had a look but can't find it - the hidden components are being recorded in the state) or in the viewer itself?
Thanks,
Chris

I check what happen when you select components, those 2 states are incompatible: the child gets hidden but the parent gets isolated, hence it is displaying all its children and hide the rest of the components in the model.
In order to get the behavior you "would" expect, you would need to hide all components without isolating the parent sub-assemlbly, then create your first state, then hide the child, create your second state. You may achieve that by writing your handler when clicking a browser node. For that you would need to implement your own ModelStructurePanel.
I've got a basic example which can help you getting started:
ModelStructurePanel
I will take a look at the click handler and add an example there. For the time being, you can check in the source of the viewer3D.js which methods you need to overwrite.
Hope that helps

Related

Issue with search functionality in Model Structure Panel of Forge Viewer

I am experiencing an issue with the search functionality of the Model Structure Panel. As a reference, I also tested my models using this configuration: https://github.com/wallabyway/federatedmodels-v7
I have two models loaded in the scene, A and B. A has one component called Columns. I open the model structure panel, type Columns, and hit enter. The model structure panel shows that all components, besides Columns, are hidden. HOWEVER, what actually happens in the viewer is that all components of A, besides Columns, are hidden BUT all of model B is still visible, even though the model structure panel shows that it should be hidden.
Is this expected behavior? Am I missing something in the configuration of the viewer that I should be doing?
If there is anything specific that needs to be done to support this workflow, please let me know.
Good catch, Rachel. This is a bug in the viewer. I've been able to reproduce it, too, and will report it to the viewer team. Please stay tuned to the viewer changelog to check when it's fixed.

Visual Studio 2013 LightSwitch HTML Cascading Dropdowns

I'm currently helping a small team create a HTML LightSwitch business app that has a tier of 4 Cascading dropdowns. These drop downs are linked together just as the common example of when you select your state it filters to cities only in that state. However, the issue that we have run into is that upon changing one of the parent boxes the child box doesn't reset or revert to a blank state. How would it be possible to accomplish, if possible, the clearing the child boxes upon parent change. Im pretty sure we need an OnChange event handler but I'm not sure where to put this in LightSwitch because it creates the code for you.
Any idea's or code snippets that are able to fix this problem would be appreciated.
Thank you in advance for the help,
Jeremy
I think you need a change listener event on page created method screen.addChangeListener("DropDown1",DropDown1Changed);
function DropDown1Changed(e){
screen.findContentItem("DropDown2").value ="";
screen.findContentItem("DropDown3").value ="";
};
I havent tested this code. But, something similar to this should work. This should give you general idea about the solution.
Dont forget to remove the listener.
Use pop-ups based on Queries instead of drop-downs. Make the parameters for your queries optional where necessary. LightSwitch will then update the page definition as selections are made. This is because the binding of the popup data values is done at run-time, whereas the binding for controls rendered when the page loads is static.
Michael Washington gives a pretty good summary of the technique in this article.

How to set focus on tab in tabcontrol in URL

I am trying to call a page in my customers webapplication (Exact Synergy Enterprise)
This is the link: http://someserveridontdisclose/Synergy/docs/CSCANEduCourseCard.aspx?ProjectNr=ACPGINTV
Within this page is an Ajax TabContainer with several TabPanels. One of them is called 'Doelgroepen'
I dont have the source for this application, as i am not the developer of it. We only develop custom extentions to it.
Here's the question: Is it possible to focus on one of the tabs USING ONLY AN URL? If so How?
Thank you very much for your thoughts about this.
try to set with javascript. you'll have to write your own js to get index number you want from url, then set like this
$find('<%=TabContainer1.ClientID%>').set_activeTabIndex(2);
http://forums.asp.net/t/1127834.aspx
http://www.aspforums.net/Threads/420684/ASPNet-AJAX-TabContainer-Set-Active-Tab-Client-side-using-JavaScript/
If you do not have access to the code and if this is not part of the requirement / design specification for the application you are using (ie: what you asked the developer to do), then the answer is No.
The control does not have "native" support for URL tab selection. There needs to be specific code in the application in order to handle this.
It is however very easy to implement, if you absolutely need it, it shouldn't take much time (about 15-30 lines of code, depending on how many tabs/urls combination you need).
You can find a running sample of the AjaxControlToolkit Tabs control at the following link (the available functionnalities are described in there):
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Tabs/Tabs.aspx
If the TAB has an ID you could make it visible by adding '#tabid' to the URL.

Using a single shared element across multiple partial views

I have a basic ASP.Net MVC 3 application which has a number of controllers and a number of actions (and subsequently views)
A common feature of the application is to show a pop-up dialog window for basic user input. One of the key features of this dialog process is a faded mask that gets shown behind the dialog box.
Each of these dialog window controls is in a separate Partial View page.
Now, some view pages may use multiple dialog boxes, and therefore include multiple partial views in them - which as is would mean multiple instances of the "mask" element.
What I am trying to find a solution for is to only need to create one instance of a "mask" element regardless of the number of dialog partial views I include, and then the script in each partial dialog will have access to this element (so basically it just needs to be on the page somewhere)
The only real idea I have come up with so far is to add the "mask" element to the master page (or in the original view page) and this will mean it only gets added once. The problem here is that it will be added even when it is not needed (albeit one small single element)
I can live with this, but I would like to know if there is a better way to handle these kinds of scenarios?
A quick idea that came to mind is some kind of master page inheritance hierarchy, So I may have a DialogMasterPage that inherits from the standard current master page. How does that sound for an approach?
Thanks
To do something like this, where each module can register their need for a certain thing in the master page, you can use HttpContext to store a flag of whether you need to write the mask div, and just set that property in each partial. At the end of the master page, if the flag is set, you can then write the mask div if its set to true.
Obviously to make this cleaner you could wrap it all in an HtmlHelper extension or something.
My initial thought is for you to use something like jQuery UI where it handles the masking for you or if you are using something custom you can load the content for the dialog via ajax then show it in the single dialog on the master page.

Access 97 - how to edit/explore existing toolbar?

My current job is updating an existing Access97-Project. I haven't worked with Access in a long time and i can't find out, how i can explore a toolbar called "sbmbDrucken" which is obviously user-created. I just need access to the action or the code which is called by the buttons...
Is there any menu entry i missed or do i need special code for self-inspection?
TIA!
There are three different ways for menus/toolbars to be instantiated:
the old way, using macros. Before A95, this was the only way, so a lot of older apps (i.e., those converted from earlier versions) may still use macros for the menus.
defining them by hand, using the CUSTOMIZE function that you get when you right click on a toolbar in Access.
in code, using the Application.Commandbar object.
For the first you can browse your macros and see if any of them are menu macros.
For the last, you can do a search in the code for CommandBar.
For the second, just look at them through the built-in menu customization tools. Keep in mind that you may have to check them off to get them to be visible, and that the list is in no rational order. Likewise, some menus/toolbars are hidden from the customization interface. Also, you might need to look at the CUSTOM toolbar menu item.
I don't have Access 97 on hand but you may take a look of this webpage: http://www.alvechurchdata.co.uk/hints-and-tips/accaddtoolbar.html
It seems that "user-created" toolbars could be defined by handwritten code at form.load or somewhere similar. You may search CommandBars.Add and see if you can find those relevant code segments.
Hope that helps.
In the design mode, you will be able to see the toolbar & actions assigned to each of the button.
Right click on the specific toolbar
Click on Customize...
Right click on the button you would like to edit the action of.
You will be able to see the action (which could either be macro or code).
Let me know, if that doesn't help at all.