UA-17470720-3

Jump to content


Photo
- - - - -

Add button tapped


  • Please log in to reply
4 replies to this topic

#1 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 07 September 2015 - 11:37 AM

Is there an equivalent of  actions.cancelButtonTapped and actions.doneButtonTapped for the add button? I am looking for an addButtonTapped but don't seem to find one.

 

I need this because i want to save and validate the currently displayed detail item before allowing the user to create another.

 

thanks

karl


Edited by Karl1348790294, 07 September 2015 - 11:38 AM.


#2 ozie

ozie

    ¯\_(ツ)_/¯

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 526 posts
  • LocationAustralia
Reputation: 169
Popular

Posted 07 September 2015 - 02:09 PM

are you using a splitview or something?? because normally there is no add button when you are creating or editing an item

 

maybe on the detailview you can use the validate actions to test before allowing the detail view to change to a new view

or use the detailview to enable/disable the add button depending on the edit objects validation


Edited by ozie, 07 September 2015 - 02:10 PM.

  • Tarek likes this

P.S. I hate Swift.. don't talk Swift.. Too old school to learn yet another programming language.


#3 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 08 September 2015 - 12:04 AM

yes, it's on the array of objects section in the master pane of a split view



#4 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 08 September 2015 - 02:37 PM

Hi Karl,

 

As Ozie suggested, the best way is to implement cellActions.valueIsValid for each cell you want to validate, and STV will automatically take care of the rest.

 

Additionally, you could also accept or reject the inserted item by implementing sectionActions.willInsertItem . Also, you could control if the detail view controller should be dismissed by implementing: sectionActions.detailModelShouldDismiss . 



#5 Karl1348790294

Karl1348790294

    Experienced Member

  • STV 5.0 Std
  • PipPipPipPip
  • 90 posts
Reputation: 6
Good

Posted 09 September 2015 - 03:52 AM

Thank you

I'll take a look at those

karl






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users