Skip navigation
Isis_Pena
Currently Being Moderated

highlight fields that changed its value

Mar 28, 2011 12:51 PM

Hi all,

 

I'm working on a form that goes from one user to another.  It's a fairly large and complex form (about 7 pages) with calls to multiple web  services.

 

After the form is opened and some information is  populated into the fields, a user will be able to change the values of some  fields, and then will submit the form.  The next user in the process will get the form and open it up from  his/her To-Do queue.  The fields with the  changed values (changed by the previous user) would need to be visually  identified to this next user.  When that  user finishes working on the form and submits it, it is opened by the next user  in line. and the changed information STILL needs to be visually identified.  We have found it is easy to highlight a  changed field while a user is working on the form (using the change event) but  it is more difficult to make that highlight stay visible all the way through the  process as different people get the form. I thought about making a hidden field  for every field in the form and compare the values in the validation event. but  this would effectively double the size of the form and all those hidden values  would need to be included in the XML schema (doubling the size of the XML  schema).

 

We would appreciate ANY assistance on a proper  approach.

 
Replies
  • Currently Being Moderated
    Mar 28, 2011 1:06 PM   in reply to Isis_Pena

    I have an idea for a cool way to do this, but it will take a little time (overnight) to be able to put together a simple test form.  In the meantime maybe someone else has some thoughts...

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 28, 2011 1:14 PM   in reply to Kevin Cavallo

    If you are changing the background color then that shoudl be maintained throughout. In Designer on the File/Form Properties/Defaults tab do you have the Keep scripting changes checkbox set on Automatic?

     

    Paul

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 28, 2011 1:38 PM   in reply to pguerett

    Good point; I assumed (probably incorrectly) that only the xml data was being submitted.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 15, 2011 7:54 AM   in reply to Isis_Pena

    OK, can you give me a little more info on how the workflow is implemented?  When the user submits the form, is the entire PDF submitted or just the XML data?  When the next user gets the form do you re-render the form combined with the XML data?  Is the XML data persisted between form renderings?  And, do any of the web services that are called store data related to each specific form, or are they just fetching generic data to be displayed?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 15, 2011 12:01 PM   in reply to Isis_Pena

    That does make things clearer.  You will have to save the change information in the XML.  I realize that you don't want to save an xml node for every field, but there is a better way.  You can use scripting to add data nodes to the XML data in the form.  I'm thinking of the following:

     

    Include an empty container node in your XML schema: <HighlightedFields></HighlightedFields>

     

    When a field is changed, in the field's change event call a common script: HighlightChangedField, passing in the object.  The script will highlight the field (set the border a certain color or whatever).  It will also add node underneath the HighlightedFields data node with the SOM expression of the field.  The SOM expression is the "path" of the object in the form heirarchy, sort of like an xpath.  So if you have a subform named Subform1 and you change the Name and Address textfields, you might end up with something like:

     

    <HighlightedFields>

        <HighlightedField>

            <SOMExpression>xfa[0].form[0].myform[0].Subform1[0].Name[0]</SOMExpre ssion>

         </HighlightedField>

        <HighlightedField>

            <SOMExpression>xfa[0].form[0].myform[0].Subform1[0].Address[0]</SOMEx pression>

         </HighlightedField>

    </HighlighedFields>

     

    The upside of this is that you only store XML nodes for what is changed instead of needing a specific XML node for each field.  The downside is that you will need a call to the common script in every field's change event: HighlightChangedField(this);

     

    Now, to make this work when a form is loaded the next time, in the initialize event at the topmost subform in the hierarchy you add a script that walks the HighlightedFields data node, and for each HighlighedField entry you highlight the contained object.  You can get a reference to an object using its SOM expression, so just take the SOM expression from each entry and do an xfa.resolveNode(SOMExpression) to get the object, then set whatever attributes you want to highlight the field.

     

    The big issue I see with this would be if you have dynamically added objects on your form.  In that case you would probably need to store the instance index along with the SOM expression for each changed object, then use that instance number when highlighting on form load.

     

    I don't know how much you know about scripting, so I hope the above makes sense.  If you need more help I can try to mock something up.

     

    Regards,

    Kevin

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points