Select to view content in your preferred language

Repeated Attribute value, togglefeaturerepeat

3190
9
11-24-2010 09:20 AM
EricMcPhee
New Contributor III
In ArcPad 10, is there a way to disable/remove the repeat attributes tool? Or is there a way to capture the buttons onclick event? If I knew when the button was pushed, I could use Application.ExcecuteCommand("togglefeaturerepeat") to turn the button off.
Tags (3)
0 Kudos
9 Replies
MikeDahm
Occasional Contributor
Did you ever find a work around this.  My field crews sometimes hit the button and then can't figure out why the next point has the same attributes.  It would be better to disable this button.
0 Kudos
EricMcPhee
New Contributor III
Nope, I haven't heard anything from anybody on this topic. I'm still hopeful that there is someway to disable it.
0 Kudos
WillLentz
New Contributor II
Is there a "clear all fields" command that can be added to a button? Haven't looked at it but it is a good idea.
0 Kudos
GarethWalters
Occasional Contributor III
Hi guys,

You can't access the Repeat attributes button directly but I have a work around for Shapefiles that you might want to try. P.s. The AXF version is coming!

Now, a little background for anyone else who stumbles across this thread. When you load a .shp, ArcPad reads the associated .APL to determine how the shape will be symbolised, at what scale etc.
When you edit in ArcPad it reads the .APL into memory and you can just use the repeat attributes tool for the session and turn it on and off manually.

But in ArcPad 10, "Field History" was introduced and is written into the .APL s. When you save the map the last feature that you edited will be saved, so if you exit for the day, or lunch or maybe (just maybe) ArcPad crashes, the values are stored in the APL and you can carry on from where you were.

So the tags looks like this in the .APL, and we can read them via a script.

  <FIELDHISTORY>
   <FIELDS repeat="true">
    <FIELD name="SOMETHING" value="fgaerge"/>
    <FIELD name="ID" value="ftgfg"/>
   </FIELDS>
  </FIELDHISTORY>

As I said, the important thing to remember is that the APL is loaded into memory every time a layer is opened and you cannot play with these tags. So the work around is to remove the layer, play with the .APL tags and then reload it. Therefore the next time you load the shapefile the tags that are read would look like this:

  <FIELDHISTORY>
   <FIELDS>
    <FIELD name="SOMETHING" value="fgaerge"/>
    <FIELD name="ID" value="ftgfg"/>
   </FIELDS>
  </FIELDHISTORY>

Here is a sample script that should "just work" for you on shapefiles.

Dim g_xmlDoc, g_cboLayerSelected, g_filePath

'find the editable layer
Set g_cboLayerSelected = Map.EditLayer
'Get the location of the file
g_filePath = g_cboLayerSelected.filePath
'Get the name of the shapefile
g_shpName = g_cboLayerSelected.name

LoadXML(g_cboLayerSelected)

Function LoadXML(cboLayer)
Set g_xmlDoc = CreateObject("Microsoft.XMLDOM")
g_xmlDoc.load Left(g_filePath,Len(g_filePath)-3) & "apl"
        GetSetFieldHistory(cboLayer)
End Function

Function GetSetFieldHistory(cboLayer)
        Dim FieldsNode, attrRepeat
        Set FieldsNode = g_xmlDoc.SelectSingleNode("//FIELDS")

        attrRepeat = FieldsNode.GetAttribute("repeat")

        If attrRepeat = "true" then
                Map.Layers.Remove(g_cboLayerSelected)
                Map.Refresh()
                Map.Save()

  FieldsNode.removeAttribute("repeat")
                g_xmlDoc.save Left(g_filePath,Len(g_filePath)-3) & "apl"
                Map.AddLayerFromFile(g_filePath)
                Map.Layers(g_shpName).editable = true
        End If

        Map.Save()
End Function

It is up to you when you run it and obviously it might need some tweaking for your project but it does what you are after. I think 🙂

Cheers,

Gareth
0 Kudos
EricMcPhee
New Contributor III
This sounds great Gareth. I'm patiently awaiting the AXF version.;)
0 Kudos
EddieViljoen
New Contributor III
I presume you guys are talking about the button that is next to the OK and Cancel buttons in an Edit form?

If so, I have a question:  Why do some of my edit forms have this button and some don't?
I can not find a way to switch this button off.

Eddie
0 Kudos
AlokSinha
New Contributor
Hey guys,
Has there been any updates on this feature? Any way to disable the repeated attributes button when using AXF files?
Thanks!
0 Kudos
cesartort
New Contributor
I presume you guys are talking about the button that is next to the OK and Cancel buttons in an Edit form?

If so, I have a question:  Why do some of my edit forms have this button and some don't?
I can not find a way to switch this button off.

Eddie


Hi

How can I avoid this??? did you get a workaround or something?
0 Kudos
DeniseKing
Esri Regular Contributor
All,

I researched (yet could have overlooked the Help topic) but don't believe it's currently possible to disable/remove the Repeat Attribute tool button from an AXF Edit form. Recent blog post from ArcPad Team is on Repeat Attributes Tool but doesn't include how to disable it. I recommend posting this on ArcGIS Ideas under the Mobile GIS category and tagged as: ArcPad. ArcGIS Ideas lets our customers get involved. You can suggest new products, promote favorite enhancements and interact with Esri Teams.

Cheers,
Denise
0 Kudos