Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. <apex:form >
  2. <div id="menu">
  3. <apex:pageblock title="Category">
  4. <apex:repeat value="{!categories}" var="category">
  5. <apex:pageBlockSection >
  6. <apex:outputLink value="/apex/indexPage" styleClass="btn">{!category.Name}
  7. <apex:param name="id" value="{!category.id}"/>
  8. </apex:outputLink>
  9. </apex:pageBlockSection>
  10. </apex:repeat>
  11. </apex:pageblock>
  12. </div>
  13. <div id="col2">
  14. <apex:pageBlock >
  15. <apex:pageBlockSection >
  16. <apex:repeat value="{!items}" var="ite">
  17. <apex:outputField value="{!ite.Photo__c}"></apex:outputField>
  18. <apex:outputLink value="/apex/Items">{!ite.Name}
  19. <apex:param name="idItem" value="{!ite.id}"/>
  20. </apex:outputLink>
  21. <pageBlock>
  22. <apex:inputText value="{!count}">
  23. </apex:inputText>
  24. <apex:commandLink value="Add" action="{!add}" styleClass="btn">
  25.  
  26. <apex:param name="item" value="{!ite.id}"/>
  27. </apex:commandLink>
  28.  
  29. </pageBlock>
  30. </apex:repeat>
  31. </apex:pageBlockSection>
  32. </apex:pageBlock>
  33. </div>
  34. </apex:form>
  35. </apex:page>
  36.  
  37. public void add() {
  38. Cookie counter = ApexPages.currentPage().getCookies().get('item');
  39. Integer ig = count;
  40. System.debug('VALUE' + ig);
  41. if (counter == null) {
  42. globalItem = ApexPages.currentPage().getParameters().get('item');
  43. for (Integer i = 0; i < ig; i++) {
  44. globalItem = globalItem + ApexPages.currentPage().getParameters().get('item');
  45. }
  46.  
  47. CookieJar cookieJar = new CookieJar(globalItem);
  48. } else {
  49. System.debug('VALUE' + ig);
  50. String currentItem = ApexPages.currentPage().getParameters().get('item');
  51. for (Integer i = 0; i < ig; i++) {
  52. System.debug('i:' + i);
  53. currentItem = currentItem + ApexPages.currentPage().getParameters().get('item');
  54. }
  55. globalItem = counter.getValue() + currentItem;
  56. CookieJar cookieJar = new CookieJar(globalItem);
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement