Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1. <apex:pageBlockTable id="thetable" title="Invoice line item" var="acc" value="{!contactList}">
  2. <apex:column headerValue="S.No" style="width:20px; text-align:center;" headerClass="centertext">
  3. <apex:inputField value="{!acc.Row_Num__c}" id="getindex" style="width:25px" />
  4. </apex:column>
  5. <apex:column headerValue="Nicomatic Part No"><apex:inputField value="{!acc.Name}" required="true" /></apex:column>
  6. <apex:column headerValue="Description"><apex:inputField value="{!acc.Description__c}" style="height:30px" /></apex:column>
  7. <apex:column headervalue="Client Part No"><apex:inputField value="{!acc.Client_Part_No__c}" style="width:150px" /></apex:column>
  8. <apex:column headerValue="HSN"><apex:inputField value="{!acc.HSN__c}" style="width:60px"/></apex:column>
  9. <apex:column headervalue="Quantity">
  10. <apex:inputField value="{!acc.Quantity__c}" style="width:60px">
  11. <apex:param name="cal" value="{!op2}"/>
  12. <apex:actionSupport event="onchange" reRender="tot"/>
  13. </apex:inputField>
  14. <apex:variable var="op1" value="{!acc.Quantity__c}"/>
  15. </apex:column>
  16. <apex:column headerValue="Rate(Per Item)">
  17. <apex:inputField value="{!acc.Rate_Per_Item__c}" style="width:80px">
  18. <apex:param name="cal" value="{!op2}"/>
  19. <apex:actionSupport event="onchange" reRender="tot"/>
  20. </apex:inputField>
  21. <apex:variable var="op2" value="{!acc.Rate_Per_Item__c}"/>
  22. </apex:column>
  23. <apex:column headerValue="total">
  24. <apex:outputpanel id="tot">
  25. <apex:outputText value="{!(acc.Quantity__c*acc.Rate_Per_Item__c)}">
  26. <apex:actionSupport event="onchange" rerender="to"/>
  27. </apex:outputText>
  28. </apex:outputPanel>
  29. </apex:column>
  30. <apex:column headerValue="Discount"><apex:inputField value="{!acc.Discount__c}" style="width:60px">
  31. <apex:actionSupport event="onchange" rerender="to"/>
  32. </apex:inputField>
  33. </apex:column>
  34. <apex:column headerValue="Taxable Value">
  35. <apex:outputText id="to" value="{!((acc.Quantity__c*acc.Rate_Per_Item__c)-acc.Discount__c)}" />
  36. </apex:column>
  37.  
  38. <apex:column headerValue="Action" >
  39. <apex:commandButton value="Delete" onmouseout="insert_numbers()" action="{!deleteRow}" reRender="pb">
  40. <apex:param name="rowIndex" value="{!rowNumber}"/>
  41. </apex:commandButton>
  42. <apex:variable var="rowNumber" value="{!rowNumber+1}"/>
  43. </apex:column>
  44. <apex:column HeaderValue="Row Up">
  45. <apex:commandButton onClick="insert_numbers()"
  46. rerender="mytable" action="{!swap}" value="Up" >&#8679;
  47. <apex:param name="RowIndex" assignTo="{!rowNumber}" value="{!rowNumber}" />
  48.  
  49. </apex:commandbutton>
  50. </apex:column>
  51. <apex:column HeaderValue="Row Down">
  52. <apex:commandButton onClick="insert_numbers()"
  53. rerender="mytable" action="{!swap}" value="Down" >&#8681;
  54. <apex:param name="RowIndex" assignTo="{!rowNumber}" value="{!rowNumber}" />
  55.  
  56. </apex:commandbutton>
  57. </apex:column>
  58. </apex:pageBlockTable>
  59.  
  60. Public Void Swap(){
  61. //Here this **"contactList"** is normal list that I'm passing information to //VF page to pageblock table
  62. //I don't know what to do now for Swapping
  63. For(Invoice__c li:contactList){
  64.  
  65. If(li.name=='656555'){
  66.  
  67. li=li[0];
  68. }
  69. }
  70.  
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement