POST
|
I am able to access and query a DataSource just fine from a custom widget. But I need to insert/update some records programmatically as well. When I try to use ds.updateRecord() I get an error "Editing source is not ready yet". Any ideas how to make it ready? I confirmed the DataSource is coming from the Feature Service and the capabilities say "Query,Create,Update,Uploads,Editing" //Get update data source
const ds = DataSourceManager.getInstance().getDataSource(props.useDataSources[1].dataSourceId) as FeatureLayerDataSource
//Get record to update
ds.query({
where: "UserId='" + props.user.username + "'"
}).then((result) => {
if (result.records && result.records.length > 0)
{
//Get record data and change
const record = result.records[0]
const dat = record.getData()
dat.TypeCode = "New Value"
//Process update --ERROR HERE: Editing source is not ready yet
ds.updateRecord(dat).then((success) => {
})
}
}) Examples seem to show creating an editor widget. I am just wanting to call the service on the backend and do some edits though. In this case for a non-spatial table even. Worst case I suppose I could use the JS API or call the service endpoint directly, but assuming I am missing something with ExB objects. Thanks for any help!
... View more
01-04-2024
03:36 PM
|
0
|
1
|
317
|
POST
|
I was afraid of that, thanks for that information @JeffreyThompson2. Seems backwards that they let you set another components state but won't let you read it. I am new to React, probably should take a step back and learn it better first. Thanks again!
... View more
11-17-2023
11:30 AM
|
0
|
0
|
255
|
POST
|
I am trying to get the current state of an out of the box widget (filter) but not finding a way to get it. I can easily set the state of that widget with: getAppStore().dispatch(appActions.widgetConfigUpgraded("widget_65", config)). But how can I get the current state from "widget_65" (which is inside a sidebar and navigation section if that matters)? getAppStore().getState().widgetsRuntimeInfo?.["widget_65"]?.state state is never set. The runtime info only has one property for isClassLoaded which is true. getAppStore().getState().widgetsState["widget_65"] widgetsState does not contain the widget, it only has a list and the sidebar. Neither which seem to expose their state either. getAppStore().getState().appConfig.widgets["widget_65"] I can get the state from this, but it is not the current state and is the initially loaded one, which makes sense coming from appConfig. WidgetManager.getInstance() not seeing any option in it to get the state. Can I use getAppStore().subscribe, not seeing how to get the state though. I feel like I am missing something simple, any advice is greatly appreciated!
... View more
11-17-2023
09:46 AM
|
0
|
2
|
333
|
POST
|
Great news, thanks @DanJiang. Follow-up question if I may, will this session save/restore include filters?
... View more
11-14-2023
10:55 AM
|
0
|
1
|
584
|
POST
|
Two questions about setting the time extent in an ExB app using the Timeline widget. 1. I am using the "Customize time settings" in the Timeline widget as it allows nice control over setting the min/max date range based off today (+/- 3 months). But from what I can tell there is no way to initialize the time to today. It always starts at the start time. Am I missing something to set the initial slider time? 2. How I handled this in WAB was in a custom background widget I would just set the initial time to today. Trying the same in ExB while it does set the initial map time, the Timeline widget does not update. Is there a way to get it to refresh to the time extent? Some event I can fire to tell it to update? Is it even using the maps time extent? //Set initial map date to today
var currentDate = new Date(Date.now());
currentDate.setHours(0,0,0,0);
map.view.timeExtent = {
start: currentDate,
end: currentDate
}
//Timeline does not refresh to show this time and upon opening resets the map's time to it's own. Thanks for any thoughts!
... View more
11-06-2023
11:31 AM
|
0
|
0
|
144
|
POST
|
Thanks for sharing @DevonReed. I like the idea and will stew on it. We need the coordinates a bit more real-time though so would have to batch process more often. Or potentially could wire up a trigger in the database for any updates which could update the geometry. My original though was to build a widget that could be an icon in the list view, when clicked it would switch to an edit cursor to choose a location and on map click would call the update feature service with the coordinate geometry. Have done similar in WAB but pretty new to ExB development. You got my wheels turning now, thank you!
... View more
10-26-2023
04:44 PM
|
0
|
0
|
272
|
POST
|
We have a use case where we want to allow users to set geometries on features which are missing them. The records are already existing and can be selected from a table or list view. But from what I can tell the Edit widget can only either insert new records or update existing geometries. Not seeing how to place the geometry for an existing record when it is missing. Hoping maybe I am missing something and if not, maybe someone has ideas for a workaround? Or an easy means to extend the current Edit Widget? Thank you for any thoughts or ideas!
... View more
10-24-2023
10:43 AM
|
1
|
2
|
397
|
POST
|
I am no ExB expert and also new to the standalone version but found a fix. In the file "\ArcGISExperienceBuilder\client\dist\jimu-core\index.js", search for "CHAR_LENGTH" and replace with "LEN". Not sure what the ramifications are for this change when deploying, but for the Builder and Published Item it seems to work. It likely will break when using other flavors of databases though. Hopefully this gets a proper fix in an update.
... View more
10-04-2023
02:51 PM
|
0
|
0
|
326
|
POST
|
Thanks for the tip @JeffreyThompson2 , I tried re-adding the filter, tried a brand new ExB app, and tried connecting to a completely different geodatabase (Oracle instead of SQL Server). They all unfortunately error on the filter query. Seemingly because they try to use the CHAR_LENGTH() function. Only option that works for me currently is with the Portal built in 1.10 ExB filter. Thanks again though for the idea to try!
... View more
10-04-2023
08:01 AM
|
0
|
0
|
330
|
POST
|
Hi, we are running an 11.1 Portal and no issues with the built in ExB 1.10. But using the latest 1.12 external from the Portal with an app registration and having troubles. The Filter widget is not loading the unique value list and seeing a handful of errors in the console. The main one being it cannot execute a query against the AGS endpoint. Example Endpoint: https://x.domain.com/arcgis/rest/services/Global/Task/MapServer/0/query Example WHERE: (FIELD_NAME IS NOT NULL AND CHAR_LENGTH(FIELD_NAME) > 0) With some trial and error testing, see the issue is with the CHAR_LENGTH function. The error in Server Manager is: "'CHAR_LENGTH' is not a recognized built-in function name.]". The underlying geodatabase is on SQL Server 2016. Any way to bypass this CHAR_LENGTH() check? Or have it use LEN() instead? The seems to be a bug depending on the underlying database that was introduced between 1.10 and 1.12. Thanks for any help!
... View more
10-03-2023
03:53 PM
|
0
|
4
|
427
|
BLOG
|
Thanks @Jianxia for all the updates about the ExB road map. Having the Filter widget support multiple layers (with shared attributes) is what I came to this page to see and very glad to hear it is coming. Now I just need to figure out what to do in the meantime. Also, thanks for the new Near Me widget as that is something we needed. I do have two requests if I may: 1. The option to hide the Closest Address text. Our use case is in an oil field, so the nearest address is not relevant. A bonus option could be to use some other layer to grab the nearest feature, but not necessary for us. Mainly just want to hide the text, so hope that might be an easy one. 2. The old WAB Near Me tool had the option for an integrated search, in lieu of clicking a location on the map. Would be nice to have that option back. Thanks a lot and keep up the great work!
... View more
10-02-2023
02:23 PM
|
1
|
0
|
2688
|
POST
|
Just ran into this same issue. Had to install 2.7 on another machine to publish the service. Very unfortunate that Pro cannot publish backwards compatible versions of GP tools to a server.
... View more
02-15-2022
10:15 AM
|
0
|
0
|
304
|
POST
|
Thanks for the example. This works for me except on initial load of the widget. Tried it in postCreate, startup, onOpen... based on the lifecycle of a widget docs, onOpen is the last to be called so currently have it there. Opening the first time the widget size does not resize but after closing and reopening then the resize does work each time thereafter. It seems to be a timing issue because if I put a breakpoint on this line then let it continue, it works on initial load too. Also, if I add a setTimeout for like 1 second it works. Anyone know if there is an event to subscribe to for whatever else needs to happen first? BTW, I am doing this in a Portal 10.8.1 web app custom widget, not stand alone WAB.
... View more
12-10-2021
08:31 AM
|
0
|
1
|
361
|
POST
|
Years ago we created some widgets and hosted with Portal for ArcGIS 10.6 (not AppBuilder directly). Recently we upgraded Portal to 10.8.1 and thought everything was fine. But just found a temperamental issue with our off-panel widget that is set to open on web app startup from the Anchor Bar. In IE the issue is very noticeable and in Chrome and Edge it is more subtle but still there. Please see the attached screenshots for what the issue looks like. The widget works fine when toggled off and on, or if not set to open on startup. But we want this widget to open on startup as it does a query to set the maps initial time extent. Things tried and didn’t work: Different initial event functions: startup, postCreate, setPosition, onOpen, etc. Making sure map created events trigger first Dynamically injecting the widget’s html at runtime innerHTML html.place Dynamically injecting html after an asynchronous delay causes no visuals to be rendered Striping out CSS and other position related styles Another newer widget also has the same issue when set to open on load, so its newer uses on dojo dijit not helping Potential workarounds (not crazy about any): Place the widget in one of the non Anchor Bar slots Could create a separate widget with no visuals that initializes the maps time. Then the user would need to open this Time Slider window manually Also, I know there is a Time Slider widget out of the box from ESRI and wish we could use it. But needed this custom version to set the maps initial time and also the slider notches based off a lookup from a mosaic dataset. The dates need to be dynamic over a 2 year period based on the data. Thanks for any help or ideas!
... View more
05-04-2021
04:14 PM
|
0
|
0
|
419
|
POST
|
Using Portal 10.6 and its built in WAB which I think is 2.6. Trying to add a FeatureLayer to a 3D scene but getting the mentioned error that multipoint geometries are not supported. That's a bummer. Each record in this dataset has two points. Short of creating a new feature class and duplicating data that would need to stay in sync, anyway to tell the API to just plot the first point and ignore the other parts? Thanks much!
... View more
09-05-2018
01:31 PM
|
0
|
2
|
871
|
Title | Kudos | Posted |
---|---|---|
1 | 10-24-2023 10:43 AM | |
1 | 10-02-2023 02:23 PM | |
1 | 11-16-2016 02:05 PM | |
1 | 07-05-2017 09:30 AM | |
13 | 11-19-2010 08:05 PM |
Online Status |
Offline
|
Date Last Visited |
03-13-2024
12:38 AM
|