• bella01
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies

Hi

 

I am trying to display the only first four lines of  a field not the whole field value in the dataTable's column. 

 

Any idea how to do this?

 

Thanks

Bella

Hi

 

I want to do the pagination with page navigation links. Like

"  previous       1  2  3       next    " 

I have achieved previous and next button functionalities but unable to do the navigation links.

 

Any idea how to implement this?

 

Thanks

Bella01

Hi

 

I am trying do display the content of a particular column of a dataTable into a new window. When user clicks on a particular link in a column, then that column content has to gets populated into the new window itself. 

If anybody has any idea about it plz share.

 

Thanks

Bella

Hi

 

Help in this would be appricated. I want to create templates for e-newsletter like we do for emails.

 

Thanks

Bella

Hi

 

I am trying to display the only first four lines of  a field not the whole field value in the dataTable's column. 

 

Any idea how to do this?

 

Thanks

Bella

How can I get Apex to mimic passing the field data from the visualforce page to the controllerexstension save method. I have looked at 100's of examples yet still cant find a solution.:smileysad:

 

vf:

 

<apex:page standardController="contact" showHeader="false" extensions="appExtension">

<apex:composition template="StdOCEITemplate">
<apex:define name="pagebody">
<apex:form rendered="{!(SelectedEvent.Name != '')}" >
<apex:pageMessages />
<apex:pageBlock title="{!SelectedEvent.Name} - Application Form">
<apex:pageBlockSection title="Main Details" columns="2" >

<apex:inputField value="{!contact.Salutation}" id="title" required="true" />
<apex:outputText >&nbsp;</apex:outputText>
<apex:inputField value="{!contact.FirstName}" id="firstname" required="true" />
<apex:inputField value="{!contact.LastName}" id="lastname" />
<apex:inputField value="{!contact.Email}" id="email" required="true" />

<!-- more vf page here -->

  <apex:pageBlockButtons location="bottom" title="Submit">
<apex:commandButton action="{!save}"
value="Submit New Application"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:define>
</apex:composition>
</apex:page>

 

controller 

 


public class appExtension {

// Decare Vars from Querystring
Id accountrecordtypeid = ApexPages.currentPage().getParameters().get('AccountRecordTypeID');
Id contactrecordtypeid = ApexPages.currentPage().getParameters().get('ContactTypeID');
Id eventid = ApexPages.currentPage().getParameters().get('eventID');


public appExtension(ApexPages.StandardController controller) {
this.contact =
(Contact)controller.getRecord();
}

 /*More Controller code hear */

//This is the method that will save the details to the database
public PageReference save()
{
//set savepoint at start so as to stop account information being set if applicant has already applied for event.
Savepoint sp = Database.setSavepoint();
// Logic to make sure first letter of name/surname is in upper case
String FirstName = Contact.FirstName;
String LastName = Contact.LastName;
if (FirstName != null && LastName != null && FirstName != '' && LastName != ''){

//test method never gets in here

}

 test method:

 

public static testMethod void testappExtensionBusApp() {
ApexPages.standardController controller = new ApexPages.standardController(new Contact());
// Business applicant test where Business applicant selects an existing account.
ApexPages.currentPage().getParameters().put('AccountRecordTypeID',[Select ID from RecordType Where SobjectType = 'Account' and Name = 'Business Organisation' Limit 1].id);
ApexPages.currentPage().getParameters().put('ContactTypeID',[Select ID from RecordType Where SobjectType = 'Contact' and Name = 'Business Applicant' Limit 1].id);
ApexPages.currentPage().getParameters().put('eventID',[select id from SBS_Event__c Where Display_on_website__c = True and Event_Start_Date__c > Today Limit 1].id);

appExtension busextension = new appExtension(controller);

//select a random existing account to associate with.
busextension.picklistValue = [select name from Account limit 1].id;


// this is a insert because email is new in system
//decalre fields from application form
/* Contact contact = new Contact(
Firstname = 'testier',
Lastname = 'tester',
Email = 'test@test.com');
Attempt 1 does not get into If statment*/


/* busextension = new appExtension(controller);
busextension = Firstname('test.');
busextension = Lastname('testier');
busextension = Email('test@test.com');

Attempt 2 does not complile Method does not exist incorrect signiture */

String nextPage = busextension.save().getUrl();


busextension.save.getURL();
// Verify that the success page displays
System.assertEquals('/events/confirmsave', nextPage);

}
}