You need to sign in to do that
Don't have an account?
vanessa veron
Get value into pageBlockTable
Hello...
I tried to get a value into pageBlockTable and to delete the line table (a job)... but the job isnt deleted.
Why??
Thank you
I tried to get a value into pageBlockTable and to delete the line table (a job)... but the job isnt deleted.
Why??
Thank you
public String strJobName {get;set;} //CONSTRUTOR: global Class() {strJobName='';} public void deleteJob() { if(strJobName != '') { idJobDel= new List<CronTrigger>(); idJobDel= [SELECT Id FROM CronTrigger where CronJobDetail.Name =: strJobName]; System.abortJob(idJobDel[0].id); } else { system.debug('NOT NAME'); } } PAGE: <apex:actionfunction name="callDeleteJob" action="deleteJob" rerender="pbBlockTable"> <apex:param name="JobName" value="" assignTo="{!strJobName}" /> </apex:actionFunction> <apex:pageBlockTable value="{!jobRecords}" var="ac" id="pbBlockTable"> <apex:column headervalue="Name Job" value="{!ac.CronJobDetail.Name}"/> <apex:column headervalue="Status" value="{!ac.State}"/> <apex:column headervalue="Expression" value="{!ac.CronExpression}"/> <apex:column><apex:commandButton value="X" onClick="callDeleteJob('{!ac.CronJobDetail.Name}')"/> </apex:column> </apex:pageBlockTable>
And try this:
If no "action" is set for the commandButton, there will be a postback that "cancels" the "callDeleteJob" call. in this way (the "return false;" in the onClick) you are sure that only the callDeleteJob callback is working.
Hope this helps
--
May the Force.com be with you
All Answers
And try this:
If no "action" is set for the commandButton, there will be a postback that "cancels" the "callDeleteJob" call. in this way (the "return false;" in the onClick) you are sure that only the callDeleteJob callback is working.
Hope this helps
--
May the Force.com be with you
but the page isn't refreshed:
Why??? I used oncomplete="refreshPage();"
The code:
<apex:actionfunction name="callDeleteJob" action="{!deleteJob}" rerender="pbBlockTable">
<apex:param value="" name="ParamNom" assignTo="{!strJobName}" />
</apex:actionFunction>
The rerender will rerender only the "pbBlockTable", but sometimes I found a bug that made the pabeblockTable not rerendering.
To bypass this, I create an <apex:outputPanel id="aNewPanel"/> that contains the apex:pageBlockTable and the rerender will be with this component.
Try this
I used:
<apex:actionfunction name="callDeleteJob" action="{!deleteJob}" rerender="aNewPanel">
Try this:
Or else you can rerende the whole form:
<script>
function refreshPage(){
location.reload(0);
return false;
}
</script>
I will try this after...
I have to go now!!!!
THANK YOUUUUUUUU!
I'm still having the same problem and I added a new button also not run the action that I desire.
Help me!
It work now...
I used: oncomplete="refreshPage(); into actionfunction declaration
But the modify dont work!!!
Bye
Enrico
...the code: