Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:form >
- <div id="menu">
- <apex:pageblock title="Category">
- <apex:repeat value="{!categories}" var="category">
- <apex:pageBlockSection >
- <apex:outputLink value="/apex/indexPage" styleClass="btn">{!category.Name}
- <apex:param name="id" value="{!category.id}"/>
- </apex:outputLink>
- </apex:pageBlockSection>
- </apex:repeat>
- </apex:pageblock>
- </div>
- <div id="col2">
- <apex:pageBlock >
- <apex:pageBlockSection >
- <apex:repeat value="{!items}" var="ite">
- <apex:outputField value="{!ite.Photo__c}"></apex:outputField>
- <apex:outputLink value="/apex/Items">{!ite.Name}
- <apex:param name="idItem" value="{!ite.id}"/>
- </apex:outputLink>
- <pageBlock>
- <apex:inputText value="{!count}">
- </apex:inputText>
- <apex:commandLink value="Add" action="{!add}" styleClass="btn">
- <apex:param name="item" value="{!ite.id}"/>
- </apex:commandLink>
- </pageBlock>
- </apex:repeat>
- </apex:pageBlockSection>
- </apex:pageBlock>
- </div>
- </apex:form>
- </apex:page>
- public void add() {
- Cookie counter = ApexPages.currentPage().getCookies().get('item');
- Integer ig = count;
- System.debug('VALUE' + ig);
- if (counter == null) {
- globalItem = ApexPages.currentPage().getParameters().get('item');
- for (Integer i = 0; i < ig; i++) {
- globalItem = globalItem + ApexPages.currentPage().getParameters().get('item');
- }
- CookieJar cookieJar = new CookieJar(globalItem);
- } else {
- System.debug('VALUE' + ig);
- String currentItem = ApexPages.currentPage().getParameters().get('item');
- for (Integer i = 0; i < ig; i++) {
- System.debug('i:' + i);
- currentItem = currentItem + ApexPages.currentPage().getParameters().get('item');
- }
- globalItem = counter.getValue() + currentItem;
- CookieJar cookieJar = new CookieJar(globalItem);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement