-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
4Questions
-
7Replies
How to Hide the 'X' in Custom Lightning Component
Hey Dev Community!
Im currently working on a Custom Lightning Component and there are a few edge cases that I'm trying to account for. This lightning component makes a few API calls and therefore, may take some time to complete. I need a way to determine if the user bailed mid stream and I can do this easily with a 'Cancel' button with an onclick event that does some logic before calling $A.get("e.force:closeQuickAction").fire();
However, if the user bails with the 'X' in the top right hand corner the API calls cease and I cannot figure out how to handle this. The two ways I have theorized are either react the same way as the button, or make the button the only option but I dont know if I can react to the 'X' click nor if I can hide the 'X' with CSS or some equivalent.
Any advice would be appreciated!!
Im currently working on a Custom Lightning Component and there are a few edge cases that I'm trying to account for. This lightning component makes a few API calls and therefore, may take some time to complete. I need a way to determine if the user bailed mid stream and I can do this easily with a 'Cancel' button with an onclick event that does some logic before calling $A.get("e.force:closeQuickAction").fire();
However, if the user bails with the 'X' in the top right hand corner the API calls cease and I cannot figure out how to handle this. The two ways I have theorized are either react the same way as the button, or make the button the only option but I dont know if I can react to the 'X' click nor if I can hide the 'X' with CSS or some equivalent.
Any advice would be appreciated!!
-
- Adam Tolbert
- June 28, 2019
- Like
- 0
- Continue reading or reply
Repeated Apex calls from a helper.Js
Can someone please explain to me why the following code doesnt execute on its own?? It will only run one time and then requires a touch interaction on the screen to continue to run. Code works as expected if you rapidly click the screen, but hangs itself if the user doesnt click the page.
testFunction : function(component, token, tempSo) { var action = component.get("c.forLoopTest"); action.setParams({ "I": 5 }) console.log("I ran") action.setCallback(this, function(res) { console.log("Callback ran") console.log(res.getReturnValue()) if(res.getReturnValue() < 20) { setTimeout(() => { console.log(res.getReturnValue()); action.setParams({ "I": (res.getReturnValue() + 1) }) $A.enqueueAction(action) }, 500) } else { console.log("You did it!") } }) $A.enqueueAction(action) },
Apex Controller class @AuraEnabled public static Integer forLoopTest(Integer I){ Integer newI = I; return newI; }
-
- Adam Tolbert
- May 29, 2019
- Like
- 0
- Continue reading or reply
Calling same Apex class API req from Lightning repeatedly while if(x='foo') else {<res.getReturnValue()>}
Alright community, Im in a real pickle here and hoping someone can shed some light on what I'm doing wrong, and/or what I can do to work around this particular problem.
I have a Custom lightning component that is calling out to a third party API over multiple synchronous steps and I need to call out to the same API multiple times over a period of 10-30 seconds in order to determine as soon as is reasonable, when that API response changes from Still Processing, to Finished Processing.
I am currently doing this as follows:
And this function will not recursively call itself... It will just hang there with a console.log() of "Still Processing Order" for up to 5 minutes... However when I click, anywhere on the screen, the task will run as expected. This should not require any user input after it has been fired and I cannot ask my users to just click the screen a ton until the screen goes away. What am i missing here??
Sidenote:
If I run this function without a set timeout, I will execute about 10 times in rapid succession before it hangs itself and awaits click input to get it back on track. I have exhausted my personal supply of potential hacks around/reasons for this problem and am coming up short. Prize goes to the bext answer!
I have a Custom lightning component that is calling out to a third party API over multiple synchronous steps and I need to call out to the same API multiple times over a period of 10-30 seconds in order to determine as soon as is reasonable, when that API response changes from Still Processing, to Finished Processing.
I am currently doing this as follows:
var seventhAction = component.get("c.APICall"); seventhAction.setParams({ "body": GetSalesOrderBody, "task": "GetSalesOrderDetails" }) seventhAction.setCallback(this, function(res) { if(res.getReturnValue().includes("InProcess")) { console.log("Still Processing Order") setTimeout(() => { $A.enqueueAction(seventhAction) }, 2000) } else { console.log(res.getReturnValue()) console.log('Congrats! This API has finished processing and has returned a new order id of ' + res.getReturnValue().Id + ''); }
And this function will not recursively call itself... It will just hang there with a console.log() of "Still Processing Order" for up to 5 minutes... However when I click, anywhere on the screen, the task will run as expected. This should not require any user input after it has been fired and I cannot ask my users to just click the screen a ton until the screen goes away. What am i missing here??
Sidenote:
If I run this function without a set timeout, I will execute about 10 times in rapid succession before it hangs itself and awaits click input to get it back on track. I have exhausted my personal supply of potential hacks around/reasons for this problem and am coming up short. Prize goes to the bext answer!
-
- Adam Tolbert
- May 29, 2019
- Like
- 0
- Continue reading or reply
Call an Apex Class Recursively from the JS Helper within an if condition
Alright community, Im in a real pickle here and hoping someone can shed some light on what I'm doing wrong, and/or what I can do to work around this particular problem.
I have a Custom lightning component that is calling out to a third party API over multiple synchronous steps and I need to call out to the same API multiple times over a period of 10-30 seconds in order to determine as soon as is reasonable, when that API response changes from Still Processing, to Finished Processing.
I am currently doing this as follows:
And this function will not recursively call itself... It will just hang there with a console.log() of "Still Processing Order" for up to 5 minutes... However when I click, anywhere on the screen, the task will run as expected. This should not require any user input after it has been fired and I cannot ask my users to just click the screen a ton until the screen goes away. What am i missing here??
Sidenote:
If I run this function without a set timeout, I will execute about 10 times in rapid succession before it hangs itself and awaits click input to get it back on track. I have exhausted my personal supply of potential hacks around/reasons for this problem and am coming up short. Prize goes to the bext answer!
I have a Custom lightning component that is calling out to a third party API over multiple synchronous steps and I need to call out to the same API multiple times over a period of 10-30 seconds in order to determine as soon as is reasonable, when that API response changes from Still Processing, to Finished Processing.
I am currently doing this as follows:
var seventhAction = component.get("c.APICall"); seventhAction.setParams({ "body": GetSalesOrderBody, "task": "GetSalesOrderDetails" }) seventhAction.setCallback(this, function(res) { if(res.getReturnValue().includes("InProcess")) { console.log("Still Processing Order") setTimeout(() => { $A.enqueueAction(seventhAction) }, 2000) } else { console.log(res.getReturnValue()) console.log('Congrats! This API has finished processing and has returned a new order id of ' + res.getReturnValue().Id + ''); }
And this function will not recursively call itself... It will just hang there with a console.log() of "Still Processing Order" for up to 5 minutes... However when I click, anywhere on the screen, the task will run as expected. This should not require any user input after it has been fired and I cannot ask my users to just click the screen a ton until the screen goes away. What am i missing here??
Sidenote:
If I run this function without a set timeout, I will execute about 10 times in rapid succession before it hangs itself and awaits click input to get it back on track. I have exhausted my personal supply of potential hacks around/reasons for this problem and am coming up short. Prize goes to the bext answer!
-
- Adam Tolbert
- May 29, 2019
- Like
- 0
- Continue reading or reply
How to Hide the 'X' in Custom Lightning Component
Hey Dev Community!
Im currently working on a Custom Lightning Component and there are a few edge cases that I'm trying to account for. This lightning component makes a few API calls and therefore, may take some time to complete. I need a way to determine if the user bailed mid stream and I can do this easily with a 'Cancel' button with an onclick event that does some logic before calling $A.get("e.force:closeQuickAction").fire();
However, if the user bails with the 'X' in the top right hand corner the API calls cease and I cannot figure out how to handle this. The two ways I have theorized are either react the same way as the button, or make the button the only option but I dont know if I can react to the 'X' click nor if I can hide the 'X' with CSS or some equivalent.
Any advice would be appreciated!!
Im currently working on a Custom Lightning Component and there are a few edge cases that I'm trying to account for. This lightning component makes a few API calls and therefore, may take some time to complete. I need a way to determine if the user bailed mid stream and I can do this easily with a 'Cancel' button with an onclick event that does some logic before calling $A.get("e.force:closeQuickAction").fire();
However, if the user bails with the 'X' in the top right hand corner the API calls cease and I cannot figure out how to handle this. The two ways I have theorized are either react the same way as the button, or make the button the only option but I dont know if I can react to the 'X' click nor if I can hide the 'X' with CSS or some equivalent.
Any advice would be appreciated!!
- Adam Tolbert
- June 28, 2019
- Like
- 0
- Continue reading or reply
Repeated Apex calls from a helper.Js
Can someone please explain to me why the following code doesnt execute on its own?? It will only run one time and then requires a touch interaction on the screen to continue to run. Code works as expected if you rapidly click the screen, but hangs itself if the user doesnt click the page.
testFunction : function(component, token, tempSo) { var action = component.get("c.forLoopTest"); action.setParams({ "I": 5 }) console.log("I ran") action.setCallback(this, function(res) { console.log("Callback ran") console.log(res.getReturnValue()) if(res.getReturnValue() < 20) { setTimeout(() => { console.log(res.getReturnValue()); action.setParams({ "I": (res.getReturnValue() + 1) }) $A.enqueueAction(action) }, 500) } else { console.log("You did it!") } }) $A.enqueueAction(action) },
Apex Controller class @AuraEnabled public static Integer forLoopTest(Integer I){ Integer newI = I; return newI; }
- Adam Tolbert
- May 29, 2019
- Like
- 0
- Continue reading or reply
Calling same Apex class API req from Lightning repeatedly while if(x='foo') else {<res.getReturnValue()>}
Alright community, Im in a real pickle here and hoping someone can shed some light on what I'm doing wrong, and/or what I can do to work around this particular problem.
I have a Custom lightning component that is calling out to a third party API over multiple synchronous steps and I need to call out to the same API multiple times over a period of 10-30 seconds in order to determine as soon as is reasonable, when that API response changes from Still Processing, to Finished Processing.
I am currently doing this as follows:
And this function will not recursively call itself... It will just hang there with a console.log() of "Still Processing Order" for up to 5 minutes... However when I click, anywhere on the screen, the task will run as expected. This should not require any user input after it has been fired and I cannot ask my users to just click the screen a ton until the screen goes away. What am i missing here??
Sidenote:
If I run this function without a set timeout, I will execute about 10 times in rapid succession before it hangs itself and awaits click input to get it back on track. I have exhausted my personal supply of potential hacks around/reasons for this problem and am coming up short. Prize goes to the bext answer!
I have a Custom lightning component that is calling out to a third party API over multiple synchronous steps and I need to call out to the same API multiple times over a period of 10-30 seconds in order to determine as soon as is reasonable, when that API response changes from Still Processing, to Finished Processing.
I am currently doing this as follows:
var seventhAction = component.get("c.APICall"); seventhAction.setParams({ "body": GetSalesOrderBody, "task": "GetSalesOrderDetails" }) seventhAction.setCallback(this, function(res) { if(res.getReturnValue().includes("InProcess")) { console.log("Still Processing Order") setTimeout(() => { $A.enqueueAction(seventhAction) }, 2000) } else { console.log(res.getReturnValue()) console.log('Congrats! This API has finished processing and has returned a new order id of ' + res.getReturnValue().Id + ''); }
And this function will not recursively call itself... It will just hang there with a console.log() of "Still Processing Order" for up to 5 minutes... However when I click, anywhere on the screen, the task will run as expected. This should not require any user input after it has been fired and I cannot ask my users to just click the screen a ton until the screen goes away. What am i missing here??
Sidenote:
If I run this function without a set timeout, I will execute about 10 times in rapid succession before it hangs itself and awaits click input to get it back on track. I have exhausted my personal supply of potential hacks around/reasons for this problem and am coming up short. Prize goes to the bext answer!
- Adam Tolbert
- May 29, 2019
- Like
- 0
- Continue reading or reply
how to close quick action close button in lightning?
I need to hide the close button of quick action model.
- javed786
- July 19, 2018
- Like
- 0
- Continue reading or reply
DateTime.parse () help
I have a date time string from external system that is represented as 10/13/2011 10:36:07 AM
Need to put it in datetime field on sf object. when try to do datetime.parse ('10/13/2011 10:36:07 AM'); it gives me type exception, invalid date time... any workarounds?
- _
- October 14, 2011
- Like
- 0
- Continue reading or reply