ArcGIS for Windows Mobile 10.1.1 - How to add custom Attribute Edit Page?

2732
5
03-04-2013 02:55 PM
VishApte
Esri Contributor
Hi,

I am implementing an ArcGIS for Windows Mobile solution for a telecom client to do survey of Communcation Pits and equipment.

The Pit feature class being surveyed has about 30 attributes, some are domain bound. However, many attributes are conditional attributes and need to be set only if some attribute has a specific value. I tried hiding/showing attributes in standard Edit Attributes page but customer wants wizard like interface where by additional attribute edit form pops up when certain value is set. E.g. in the Attribute Edit form, if user clicks "Yes" for "Is Hazardous Pit" attribute with YesNo domain, a new edit attribute page should pop-up showing hazard specific attributes for the Pit being edited.

I am trying to add a new  EditFeatureAttributesPage class, set required attributes using EditFeatureAttributesViewModel and then transition the page to this new page. However, I cannot find approriate event handler to launch this EditFeatureAttributesPage. I tried DataColumnFeatureAttribute.PropertyChanged but it does not launch custom Edit Attribute page. Am I missing something? I must admit here I am new to Mobile SDK. So any help is much appreciated.

Cheers,
Vish
0 Kudos
5 Replies
AkhilParujanwala
New Contributor III
I believe I understand what you are trying to do.
I am still using the old ArcGIS Mobile 10.0 SDK.
I too want to create my own custom EditAttributesPage.

I may just end up creating my own dynamic and automatic EditAttributesPage class from scratch to implement custom features.

A quick way to solve your problem may be to run some code that will look for the following:
1) If isHazard == Yes
2) Then load a custom IPage (WPF form) that will show specific attributes of the pit.
3) The user will click on the attributes and they will be saved to the newly created feature.

Another way to solve this is to make your own custom IPages and create a wizard.
Override the EditAttributesPage with your own custom IPages forms and create your own wizard.

I hope this helps.
0 Kudos
TimDonoyou
Occasional Contributor
Hi Vish,

I may be way off the mark in understanding what you are trying to do but we have accomplished similar workflows using a combination of sub-types and domains...

http://resources.arcgis.com/en/help/main/10.1/index.html#/A_quick_tour_of_subtypes/005r0000000100000...

Cheers

Tim
0 Kudos
JulieGuillory
New Contributor
All projectextensions you get into within the OnOwnerInitialized Sub.  Declare an EditFeatureAttributesPage property.  On starting data collection make sure to assign your global feature. 

    Public ReadOnly Property EditFeatureAttributesPage As EditFeatureAttributesPage
            Get
                 Me._editAttributesPage = New EditFeatureAttributesPage(New EditFeatureAttributesViewModel(Me._feature))
                Me._editAttributesPage.Title = pageTitle
                Me._editAttributesPage.Note = _collectFeaturesTask.Description
                Me._editAttributesPage.ImageSource = _collectFeaturesTask.ImageSource
                AddHandler Me._editAttributesPage.ClickOk, AddressOf _editFeatureAttributesPage_ClickOk
                AddHandler Me._editAttributesPage.ClickCancel, AddressOf _editFeatureAttributesPage_ClickCancel
                         Return Me._editAttributesPage
            End Get
        End Property


        Private Sub StartCollection(ByVal featureType As FeatureType, ByVal itemArray As Object())
            Me.CancelDataCollection()
            Me._featureType = featureType
            Me._feature = New Feature(Me._featureType, itemArray)
            Me._feature.BeginEdit()
  
            MobileApplication.Current.Transition(Me.EditFeatureAttributesPage)

        End Sub
0 Kudos
KierenTinning1
New Contributor II
Interesting we've done a lot with the EditAttributesDialog and pre-setting variable prior to opening the dialog with the "collection feature.

Might be another option, the challenge there is trying to determine programatically which group a user has clicked on if you are attempting to determine attribute combinations at this stage.

Something not figured out yet here, if anyone has any ideas it would be greatly appreciated
0 Kudos
JulieGuillory
New Contributor
I took out some of my code in the StartCollection Sub from above, but here I am querying and assigning variables:

Private Sub StartCollection(ByVal featureType As FeatureType, ByVal itemArray As Object())
            Me.CancelDataCollection()
            Me._featureType = featureType
            Me._feature = New Feature(Me._featureType, itemArray)
            Me._feature.BeginEdit()
            Dim fieldname As String = Me._featureType.Name.ToUpper
            If fieldname.Contains(faLayerName) Then
                Dim fdr As FeatureDataRow = _feature.FeatureDataRow
                'populate all profile fields not the current survey to the new ground

                For Each dc As DataColumn In fdr.FeatureSource.Columns
                    ' find the userid field, and populate current userID to this field
                    If dc.ColumnName.ToUpper().IndexOf("MISSION") <> -1 Then
                        fdr(dc.ColumnName) = _currentMission

                    ElseIf dc.ColumnName.ToUpper().IndexOf("ACTIVITY") <> -1 Then
                        fdr(dc.ColumnName) = "SURVEY"
                    End If
                Next

                pageTitle = "Collect " & Me._featureType.Name

            Else
                Dim fdr As FeatureDataRow = _feature.FeatureDataRow
                For Each dc As DataColumn In fdr.FeatureSource.Columns
                    ' find the SEQ_NR field, and populate current SEQ_NR to this field
                    If dc.ColumnName.ToUpper().IndexOf("SITE_ID") <> -1 Then
                        fdr(dc.ColumnName) = Me.SelectedSiteID

                    End If
                Next
                pageTitle = "Collect " & Me._featureType.Name & " for Survey at " & Me.SelectedSiteID

            End If




            MobileApplication.Current.Transition(Me.EditFeatureAttributesPage)

        End Sub
0 Kudos