Select to view content in your preferred language

Adding Features to the Related Tables Example?

759
2
09-04-2013 02:04 PM
JHayes
by
Frequent Contributor
Hello,

Is there a way to add features to the editing related table example and still keep the voting functionality?  I've been trying for a while now but can't quite get it to work.  The infowindow with the vote button doesn't want to come back.

I can post some code if needed.

Thanks!
Tags (2)
0 Kudos
2 Replies
YueWu1
by Esri Regular Contributor
Esri Regular Contributor
Hi Joseph,

I assumed that you want to add features directly from the code without changing the feature server behind.
In this case, I am not positive that you can add any existed features or create a new category feature from the code behind.
Put another way, even though you can add the feature but you can't fully function the vote button, because the vote information will only update those features connect with the table behind. Like the description said in the example:

When you "click to vote", the "voteRecordAttributes" are populated; specifically the "sf_311_serviceoid" attribute is set to the "objectid" of the selected feature. These attributes are then included in the "voteRecord" graphic that is then saved through the feature layer "incidentVoteTable" using the apply edits method. Each time you vote a new record is added to the "Incident Priority" table.

1. Make sure the new feature/category you add in your feature server
2. Create the relationships both in ServiceRequest_IncidentPriority to Incident Priority and IncidentPriority_ServiceRequest

Hope my tips may help you.
0 Kudos
JHayes
by
Frequent Contributor
goldenlimit,

Thanks for the reply.  The scenario I'm attempting to complete is this;

  1. Someone creates a new feature with a comment.

  2. Another person sees the new feature on the map, selects it to read the comment, then has the ability to give it a 'Thumbs Up' vote if they agree with the comment.

I've worked out the AS not allowing existing comments/features to be editable once created.

It think my main challenges are;

  1. creating a new related entry in the related table once a new feature has been added to the map (I think you were getting at this in point #2).

  2. Allowing the related tables to be edited by voting.

I'm not sure I understand what you're getting at in point #1.

Thanks
0 Kudos