• vepa1012
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hi everyone,

 

I am new developer in Salesforce. I'm using Salesforce for two month now. I have to do a project for my studies, so it's only a prototype. The project will be used as a mobile application.

The application is about events and fairs.

Now i want to have Page, which lists every stand on the fair. With a click you will get more information about the stand like location, name etc...

I have a problem with passing the parameters.

I've got 2 Pages. The standList and standInfo.  How can I connect both Pages? I hope you can understand my explanation.

 

Here are my Pages and Controllers:

 

LIST:

<apex:page standardController="Account" extensions="standList_Controller" showHeader="false">
<apex:form >
    <head>
        <meta charset="utf-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css"/>
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
        
        <style type="text/css">
              
            #caption2{
                font-size: 15px;
            }
            
            #caption3{
                color: #06FC01;
                font-size: 15px;
                vertical-align: middle;
                weight: 40px;
            }
        </style> 
    </head>
    <body>
        <div data-role="page" id="standInfo" data-theme="b">
        
            <div id="header" data-role="header" data-theme="b">
                <a id="zurueck" data-icon="arrow-l" class="ui-btn-left" style="margin-top:10px;" href="SlidingMenu">Zurück</a>
                <h1 align="center" style="margin-top:15px; font-size:20px;">Stand Liste</h1>
            </div>
            
            <div id="content" data-role="content" > 
               <table border="1" width="100%">              
                  <tr id="caption2">
                    <th><h2>Name</h2></th>
                    <th><h2>Messestand</h2></th>
                    <th><h2>Kategorie</h2></th>
                  </tr>
                  
                  <apex:repeat var="accs" value="{!accounts}">
                    <tr id="caption2">
                       <td onclick="location.href='StandInfo?name=' + {!accs.Name}';" style="cursor:pointer;">{!accs.Name}</td>
                        <td>{!accs.located__c}</td>
                        <td>{!accs.category__c}</td>
                    </tr>
                  </apex:repeat> 
               </table>
            </div> 
            
        </div>
    </body>
  </apex:form>
</apex:page>

 Controller:

 

global with sharing class standList_Controller {

    public standList_Controller(ApexPages.StandardController controller) {

    }
    
    List<Account> accounts;

    public List<Account> getAccounts() {

        if(accounts == null) accounts = [select name, located__c, category__c from account]; // limit 1  where category__c != ''

        return accounts;

    }  
    
    public PageReference test(){
        return null;
    } 
}

 

Standinformation:

 

<apex:page standardController="Account" extensions="StandInfo_Controller" showHeader="false">
  <apex:form >
    <head>
        <meta charset="utf-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css"/>
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
        
        <style type="text/css">
              
            #caption2{
                font-size: 15px;
            }
            
            #caption3{
                color: #06FC01;
                font-size: 15px;
                vertical-align: middle;
                weight: 40px;
            }
        </style> 
    </head>
    <body>
        <div data-role="page" id="standInfo" data-theme="b">
        
            <div id="header" data-role="header" data-theme="b">
                <a id="zurueck" data-icon="arrow-l" class="ui-btn-left" style="margin-top:10px;" href="SlidingMenu">Zurück</a>
                <h1 align="center" style="margin-top:15px; font-size:20px;">{!account.Name}</h1>
            </div>
            
            <div id="content" data-role="content">
                <table border="1" width="100%">              
                  <tr id="caption2">
                    <td><h1>Headquarter</h1></td>
                    <td>{!account.Headquarter__c}</td>
                  </tr>
                  
                  <tr id="caption2">
                    <td><h2>Employees</h2></td>
                    <td>{!account.NumberOfEmployees}</td>
                  </tr>
                  
                  <tr id="caption2">
                    <td><h2>located on fair</h2></td>
                    <td>{!account.located__c}</td>
                  </tr>
                  
                  <tr id="caption2">
                    <td><h2>Contact Person</h2></td>
                    <td>{!account.ContactPerson__c}</td>
                  </tr>
                
                  <tr id="caption2">
                    <td><h2>Website</h2></td>
                    <td>{!account.Website}</td>
                  </tr>
                 </table>
            </div> 
            
        </div>
    </body>
  </apex:form>
</apex:page>

 Controller:

global with sharing class StandInfo_Controller {

    public StandInfo_Controller(ApexPages.StandardController controller) {

    }
    
    Account account;
    
    public Account getAccount() {
        if(account == null) account = [select name, phone, website, ContactPerson__c, Headquarter__c, located__c, NumberOfEmployees FROM Account
                WHERE id = :ApexPages.currentPage().getParameters().get('name')];
        return account;
    }
    
    public PageReference test(){
         PageReference page = new PageReference('http://company-developer-edition.eu2.force.com/SlidingMenu');
         page.setRedirect(true);
         return page;
    }
}