POST
|
I abstracted the code for handling opening the widget in the sidebar into a separate method in a mixin (so that I can use it multiple feature actions). If the widget being opened is not in tab position 1-4, adding some code to set the selected property of tabs 1 thru 4 to false and hide the indicator seems to do the trick. showSidebarControllerTab: function () {
var controller = WidgetManager.getInstance().getWidgetsByName( 'SidebarController' )[ 0 ];
if ( !controller ) {
return;
}
controller.setOpenedIds( [ this.widgetId ] );
var configs = controller.getAllConfigs();
var configIds = array.map(configs, function(g) {
if (g && g.id) {
return g.id;
}
return null;
});
var idx = configIds.indexOf( this.widgetId );
if (idx > 3) {
array.forEach( [0,1,2,3], function ( tabIndex ) {
controller.tabs[ tabIndex ].selected = false;
controller._hideIndicator( tabIndex );
} );
}
}
... View more
11-11-2016
08:19 AM
|
0
|
1
|
1911
|
POST
|
After a bit more testing, I think the problem occurs when a widget is opened by calling setOpenedIds, which calls _openLastTab, when that widget is NOT in positions 1-4 (i.e. it's in the more widgets group). When the widget is not in positions 1-4, rather than calling selectTab, the _addGroupToMoreTab method is called. It does not appear that this method updates the selected property of the other tabs so whichever tab was selected prior to calling this method still has it's selected property set to true. Thus, a subsequent call to setOpenIds -> _openLastTab passing in the id of a widget exits the selectTab method early if that widget was previously selected.
... View more
11-11-2016
07:37 AM
|
0
|
2
|
579
|
POST
|
First off, thanks for your help! I do appreciate it! I've gone back to calling the setOpenIds method and can tell you definitively that while it does call the selectTab method, the right widget is not being shown. I suspect it may have something to do with having more than 4 widgets configured in the sidebar and one of the widgets I'm trying to open is configured as the last widget in the sidebar so it shows up in the more widgets group. I'm trying to track that down now. The problem seems to stem from calling a feature action of a custom widget that's not configured to be in one of the first four widgets in the sidebar. While the widget is shown, if I then invoke a custom feature action on a widget that is configured to be in one of the first 4 positions, the selectTab method is indeed called, the icon for that widget is highlighted but the widget that is displayed is the previous custom widget. Can you confirm that calling setOpenedIds works for you with more than 4 widgets configured with widgets that have custom feature actions configured in positions 1-4 and one in position greater than 4?
... View more
11-11-2016
07:15 AM
|
0
|
3
|
1332
|
POST
|
Hmm..not quite working. Digging thru the SidebarController\Widget code, the setOpenedIds method simply calls the _openLastTab method passing in the array of ids it was passed. This method retrieves the tab index for each id passed in but will only call the selectTab method (which I assume would actually show the widget correctly) if the tab index is less than 4. The setOpenedIds method in the HeaderController code (foldable theme) works a bit different and looks like would hide or close any opened widget and then show the widget id(s) passed into the method. Looks like I'll need to detect whether the app uses a HeaderController or SidebarController and then if it uses a HeaderController, call the setOpenedIds method but if it uses a SidebarController then I'll need to get the tab index from the widget configs and then call the selectTab method.
... View more
11-11-2016
05:39 AM
|
0
|
5
|
1332
|
POST
|
Nevermind that last question. The SidebarController can expand and collapse which is why your code is needed also is not needed for the HeaderController. Unfortunately, this doesn't entirely fix the issue. In my case, the app I am including the widget in has another widget in the Sidebar which is open by default. The problem I'm having is a little more subtle. I actually have two custom widgets in my app both which have custom feature actions. The first call to triggerWidgetOpen seems to work fine. Any existing widget which is open gets replaced with the widget being opened by the custom feature action. However, if another custom widget/feature action is invoked, it almost seems the second widget is being opened on top of the first widget and so if you invoke the first custom widget/feature action again, since the widget it is opening is already open but sitting underneath another widget, nothing happens, i.e. the widget isn't shown. Seems like there needs to be a call to some method on the Controller widget to tell it which widget to show. Hopefully, this explanation isn't too confusing!
... View more
11-10-2016
07:40 PM
|
0
|
7
|
1332
|
POST
|
Also, I've noticed similar behavior in the foldable theme. I imagine you would also want to check for the HeaderController as well to make the action truly portable?
... View more
11-10-2016
07:02 PM
|
0
|
8
|
1332
|
POST
|
Thanks Robert! One question, when you call the .maximizeWidget() function are you passing in the Controller widget or the widget you just opened? In your code above you pass in the the controller widget but it would seem you want to maximize the widget being opened?
... View more
11-10-2016
07:01 PM
|
0
|
1
|
1332
|
POST
|
I'm developing a Feature Action for a custom widget. Following the instructions at Create a feature action in your widget—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developers , I have everything working except when I add my custom widget to an application using the Tab theme, my widget is not shown. Here's the code for my onExecute method: onExecute: function(featureSet){
WidgetManager.getInstance().triggerWidgetOpen( this.widgetId )
.then( lang.hitch( this, function ( myWidget ) {
this.widget = myWidget;
var feature = featureSet.features[0];
this.showLinksForFeature( feature );
}));
}, Am I doing something wrong? I'm using Web AppBuilder 2.1.
... View more
11-10-2016
03:37 PM
|
0
|
13
|
2883
|
POST
|
Does Portal have to be federated with ArcGIS Server? Licensing prevents this from being a feasible option for us.
... View more
11-03-2016
12:17 PM
|
0
|
0
|
2177
|
POST
|
I'm looking for recommended paths to inject custom code in a supportable manner moving forward. One use case is to create a class that persists a users secured services token as long as the token is valid. This provides a better user experience in an environment where we have a lot of applications that link to our wab application. Without persisting a users credentials, they end up being forced to log in repeatedly. The problem with the widget approach is that widgets are not loaded until after the map is instantiated and the user is prompted for credentials. I'm currently using a separate require block in the init.js file that loads my custom class. Another use case is to provide an external interface for the search widget. Several of our applications are being loaded inside a native webview application which supports custom url schemes that launch the application and execute a search. Rather than reload the whole application whenever the custom url handler takes over and completely lose the losers state, the application uses the external interface to programmatically execute a search. Currently, I'm extending the Search widget with a mixin which exposed a property and method on the window object that are callable from the native application (iOS). I have both of the use cases working but I'm trying to figure out what the best path moving forward is. I'm afraid upgrading to a newer version of WAB will break things if I don't remember to go back and re-introduce all my customizations. I haven't found a good way to use version control with WAB either. I've tried putting my entire WAB installation under version control but then I'm tracking a lot code that I'm not modifying. I've also tried just putting my custom widgets under version control but this is sort of a pain when you want to use the widget in multiple WAB projects. Curious to see what others are doing...how are you using WAB in team environments? Anyway, looking for ideas/suggestions. Thanks!
... View more
10-31-2016
08:50 AM
|
0
|
0
|
852
|
POST
|
I'm trying to configure some links in a popup on a layer in a web map that are based on url schemes for a custom ios app that we are developing. My link should look something like this: my-custom-url-scheme://building={BUILDING} When the user clicks the link on a mobile device, it should open our custom application and use the host value to display the appropriate content. If I enter this value in the link settings dialog, all appears well until I reload the web map. When I reload the web map, the link is converted to an anchor link and only the host portion of the url scheme is included: my-custome-url-scheme://building={BUILDING} becomes #building={BUILDING} I've tried manually updating the web map's JSON using the AGOL assistant and it seems the JSON gets parsed and any non-HTTP(S) links get replaced. Is there a way to get around this?
... View more
10-24-2016
10:57 AM
|
0
|
0
|
691
|
POST
|
I do agree, I would prefer to use the database if possible, that way the same business logic can be enforced regardless of client among other reasons.
... View more
10-20-2016
06:38 AM
|
1
|
0
|
1051
|
POST
|
Biggest reason we are looking at them is that it seems different ArcGIS clients (Collector, ArcMap, AGOL/Portal web maps) handle sending new features and updates to the database differently. For instance, ArcMap and the web maps seems to create a new blank record in the db as soon as you add the feature to the map where as Collector will only do this once the user hits submit and therefore the record will contain data for any attribute fields the user entered. Depending on what you are trying to do, it can be tricky to trap specific scenarios. It would be nice if there was documentation out there on how different clients handle CRUD operations but unfortunately, I haven't been able to find it!
... View more
10-20-2016
06:37 AM
|
2
|
1
|
1051
|
POST
|
We've implemented many triggers and this can work but you need to be really careful if your are using archiving or versioning. We've had less success in those scenarios and are starting to look at SOIs.
... View more
10-20-2016
05:56 AM
|
0
|
1
|
1051
|
POST
|
I don't think that would be possible in Collector itself but I imagine that would be possible with a Server Object Interceptor. Post-processing responses—Additional information from separate business systems not supported by ArcGIS Server could be added to outgoing responses in order to join spatial data with other types of business intelligence data. I'll be interested to hear what others say!
... View more
10-20-2016
05:54 AM
|
0
|
2
|
1051
|
Title | Kudos | Posted |
---|---|---|
2 | 06-08-2017 06:28 AM | |
1 | 01-03-2018 11:04 AM | |
1 | 10-07-2015 02:01 PM | |
1 | 01-15-2018 12:18 PM | |
1 | 01-15-2018 12:38 PM |
Online Status |
Offline
|
Date Last Visited |
01-16-2024
05:27 AM
|