Skip to main content
deleted 6 characters in body
Source Link
- User clicks "Add Task" button inside a workItem component, which fires an application 'addTaskEvent' event. - At my application root I have a 'taskModal' component. The 'taskModal' has a handler listening for the application "addTaskEvent" event & when it handles it, it just unhides the modal. When the modal is open, the user can insert a new task name, then click either cancel or save. If save is hit in the modal, I fire another event application event, with the new task name packaged. - My workItem component has a handler definedefined for the application event the modal fired. My handler function for this event simply, grabs the new task name that the modal event gave me & I just push & update the tasks for the work Item. - **Problem**: when I push my new task, all of workItems get updated with the new task, instead of just the workItem I initially clicked. I realize this is because all of workItems are listening to the same event the modal triggered. 
- User clicks "Add Task" button inside a workItem component, which fires an application 'addTaskEvent' event. - At my application root I have a 'taskModal' component. The 'taskModal' has a handler listening for the application "addTaskEvent" event & when it handles it, it just unhides the modal. When the modal is open, the user can insert a new task name, then click either cancel or save. If save is hit in the modal, I fire another event application event, with the new task name packaged. - My workItem component has a handler define for the application event the modal fired. My handler function for this event simply, grabs the new task name that the modal event gave me & I just push & update the tasks for the work Item. - **Problem**: when I push my new task, all of workItems get updated with the new task, instead of just the workItem I initially clicked. I realize this is because all of workItems are listening to the same event the modal triggered. 
- User clicks "Add Task" button inside a workItem component, which fires an application 'addTaskEvent' event. - At my application root I have a 'taskModal' component. The 'taskModal' has a handler listening for the application "addTaskEvent" event & when it handles it, it just unhides the modal. When the modal is open, the user can insert a new task name, then click either cancel or save. If save is hit in the modal, I fire another application event, with the new task name packaged. - My workItem component has a handler defined for the application event the modal fired. My handler function for this event simply grabs the new task name that the modal event gave me & I just push & update the tasks for the work Item. - **Problem**: when I push my new task, all of workItems get updated with the new task, instead of just the workItem I initially clicked. I realize this is because all of workItems are listening to the same event the modal triggered. 
Tweeted twitter.com/StackSalesforce/status/794671793009262592
added 75 characters in body
Source Link
 <aura:application extends="force:slds">     <c:AA_taskboard /> ---> workList.cmp --> workItem.cmp  <c:AA_taskModal/> </aura:application> 
<aura:application extends="force:slds"> <c:AA_taskboard /> </aura:application> 
 <aura:application extends="force:slds">     <c:AA_taskboard /> ---> workList.cmp --> workItem.cmp  <c:AA_taskModal/> </aura:application> 
added 113 characters in body
Source Link

taskboard.cmp the taksboard controller simply fetches the work items on init & adds the work items to the workItems attribute.

taskboard.cmp

taskboard.cmp the taksboard controller simply fetches the work items on init & adds the work items to the workItems attribute.

added 2244 characters in body
Source Link
Loading
added 3 characters in body
Source Link
sfdcfox
  • 1
  • 21
  • 485
  • 850
Loading
added 988 characters in body
Source Link
Loading
added 12 characters in body
Source Link
Loading
Source Link
Loading