Results 1 to 9 of 9

Thread: cancel field input programmatically

  1. #1
    Senior Member
    Join Date
    Oct 2012
    Posts
    125

    cancel field input programmatically

    when editing a field begins, two small icons will appear (Save, CancelName:  save_cancel.png
Views: 40
Size:  3.2 KB). Can I access the Cancel feature programmatically? more precisely: Can this feature be called from the Change delegate custom code (if the input has to be rejected due to validation)?

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,967
    Hi Strato,

    Lianja.get("pageid.sectionid").cancel()

    e.g.


    Lianja.get("sales.section2").cancel()

    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Senior Member
    Join Date
    Oct 2012
    Posts
    125
    thanks Barry!
    section.cancel () does work! but ....
    the result of the method call is a bit similar to how the action bar's Undo Changes Name:  edit_save_cancel.png
Views: 19
Size:  1.6 KB works, but not exactly the same (better in my case!). By calling section.cancel (), the edited field did return to its original value, while the other fields retained their new values ​​while the section editor status was complete. (Undo Changes in my case is no different from Save Changes ... I don't know why)
    Is there possibly a function that cancel only the input of the edited field and restores only the original state of that field (like the Cancel button?

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,967
    You are talking about two completely different things.

    you asked about in-line editing of fields regarding the save and cancel icons on inline edited fields.

    niw you talk about the operation of section editing. What exactly are you wanting to accomplish and why?
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Senior Member
    Join Date
    Oct 2012
    Posts
    125
    It is primarily about inline editing. There is a field where the contents of field.value and table.column are different (get data mapping, set data mapping are set) This field has a Change delegate. In some cases, the custom delegate offers a choice with a dialog panel. If the user chooses Cancel here, I want the effect to be the same as for inline editing's Cancel button.
    Of course, I can solve the restoration of the original field and table content - as I did before - by saving the old value in gotFocus, but I wondered if it was easier with Cencel().

  6. #6
    Senior Member
    Join Date
    Oct 2012
    Posts
    125
    but of course I am also interested in section editing. It would be nice to know what and how to change in custom delegates so that the whole section edit can be discarded with Undo Changes.

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,967
    For inline editing you just need to refresh() the formitem.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  8. #8
    Senior Member
    Join Date
    Oct 2012
    Posts
    125
    thanks Barry, yes it works. (this was my first attempt, but I seem to have messed something up then ...)

    Is it possible that the autosync property has an effect on how undo changes work? (when the page works with a virtual table)

  9. #9
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,967
    No, thatís only effective with updates.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us