function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jhon68Jhon68 

Urgent: button is not invoking by clicking each and every time

<apex:page StandardController="Activitie__c" StandardStylesheets="true" extensions="ActvityController"  >
 <apex:form >
  <apex:pageBlock >
   <apex:pageblockSection title="Activity" columns="4">
    <apex:pageBlocktable value="{!Activitie__c}" var="some">
     <apex:column headerValue="Step" >
      <apex:inputField value="{!Activitie__c.name}"/>
     </apex:column>
     <apex:column headerValue="Status" >
      <apex:inputField value="{!Activitie__c.Status__c}"/>
     </apex:column>
     <apex:column headerValue="Step" >
      <apex:inputField value="{!Activitie__c.Planned_Start_DateTime__c}"/>
     </apex:column>
     <apex:column headerValue="Planned End Time">
      <apex:inputField value="{!Activitie__c.Planned_End_Date_Time__c}"/>
     </apex:column>
     <apex:column headerValue="Billable">
      <apex:inputField value="{!Activitie__c.Billable__c}"/>
     </apex:column>
     <apex:column headerValue="Priority" >
      <apex:inputField value="{!Activitie__c.Priority__c}"/>
     </apex:column>
   </apex:pageBlockTable>
  </apex:pageblockSection>
  </apex:pageBlock>
  <apex:pageblock >
  <apex:pageBlockSection title="Technician Assignment" id="activitypage" >
  <apex:inputfield value="{!Activitie__c.Provider_Group__c}"/>
  </apex:pageBlockSection>
     <!--<apex:pageBlockSection id="start" >
    <apex:pageblockTable value="{!Activitie__c}" var="no">
    <apex:column headerValue="Provider Group Name" >
 <apex:inputfield value="{!Activitie__c.Provider_Group__c}"/>
    </apex:column>
    <apex:column headerValue="Technician Name" >
    <apex:inputfield value="{!Activitie__c.Lead_Technician__c}"/>
    </apex:column>
  </apex:pageblockTable>
  </apex:pageblockSection>-->
 
   <apex:pageBlockSection title="Technicain" >
  <apex:outputPanel id="bb">
 
<apex:repeat value="{!wraplist}" var="w1" >
 <apex:pageblockTable value="{!}" var="sn">
  <apex:column headerValue="Provider Grop Name">
<apex:inputField value="{!w1.ProviderGroup.Technician_Equipment__c}"/>
</apex:column>
<apex:column headerValue="Lead Technician">
<apex:inputField value="{!w1.ProviderGroup.Technician_Equipment__c}"/>
 </apex:column>
  </apex:pageblockTable>
</apex:repeat>
</apex:outputPanel>
</apex:pageBlockSection>
<apex:commandButton value="AddTechnician" action="{!sortthelist}" reRender="bb">

   </apex:commandButton>
      </apex:pageblock>
      <apex:outputtext id="abc" value="{!button}">value is{!button}</apex:outputtext>
      
      </apex:form>
  <!-- End Default Content REMOVE THIS -->
</apex:page>





public class ActvityController {
private Activitie__c activity {set; get;}
public list<wrap> wraplist{get; set;}
public integer button{set;get;}
public class wrap{
public Provider_Group__c ProviderGroup;
 public Provider_Group__c getProviderGroup()
  {
ProviderGroup = new Provider_Group__c();
return providerGroup;
  }
 }
 public void sortthelist()
  {
   button=1;
 wraplist=new list<wrap> ();
  for(integer i=0;i<button;i++)
  {
 
  wrap  w=new wrap();
  wraplist.add(w);
   //button--;
}
//button++;
//button=wraplist.size();
 }
 
    public ActvityController(ApexPages.StandardController controller) {
  activity=(Activitie__c) controller.getRecord();

    }
 
}



 

 Hi All

when i click the AddTechnicain command first time it is execteing  but when i click second time the method sortthelist is not excecting.

How to invoke the sortthelist method by click the AddTechnician button each and every time

kiranmutturukiranmutturu

some times this will hapeen but don't ask why..but as a quick remedy u can try the below

 

<apex:commandLink action="{!sortthelist}" reRender="bb" value="AddTechnician" styleClass="btn" style="color:white;text-decoration:none">
</apex:commandLink>
Jhon68Jhon68

Hi Kiran

Thanks for your great reply. kiran  it is also not working when I am clicking the button  2nd time the method is not executing.

Any help is Appreciated.

 

Thanks