• djathomson
  • NEWBIE
  • 25 Points
  • Member since 2009

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

It feels that this should be something very basic, but I simply cannot get it to work.

 

 

 

vf code:

 

<apex:page Controller="IndividualAccreditationFormController" >

  <apex:form >

              <apex:selectList value="{!value}" size="1">
                <apex:selectOptions value="{!USPersonAnswers}" />
              </apex:selectList>      
              <apex:commandButton value="Ugh this blows" action="{!signAndRegister}"></apex:commandButton>   
         </apex:form>
   
</apex:page>

 

 

in the controller, I have a very simple:

 

    public String value {get;set;}

 

and the method signAndRegister() simply tries to use the value string and assign it to an object's custom field:

 

public void signAndRegister() {

 System.debug('Before sign and register: '+value);
        
        if (this.value==null) {
            this.value = 'was null';
        }
        
            form.USPersonText__c = this.value;
                   insert form;
           }

 

Anyway, value is never getting set. Any ideas would be much appreciated.

 

David

Hello,

 

I am trying to create a visualforce "wizard". I would like to disable the form submit on pressing enter (particularly when all the fields are not filled out), and force the user to click "Next" instead. Any advice would be appreciated.

 

David

It feels that this should be something very basic, but I simply cannot get it to work.

 

 

 

vf code:

 

<apex:page Controller="IndividualAccreditationFormController" >

  <apex:form >

              <apex:selectList value="{!value}" size="1">
                <apex:selectOptions value="{!USPersonAnswers}" />
              </apex:selectList>      
              <apex:commandButton value="Ugh this blows" action="{!signAndRegister}"></apex:commandButton>   
         </apex:form>
   
</apex:page>

 

 

in the controller, I have a very simple:

 

    public String value {get;set;}

 

and the method signAndRegister() simply tries to use the value string and assign it to an object's custom field:

 

public void signAndRegister() {

 System.debug('Before sign and register: '+value);
        
        if (this.value==null) {
            this.value = 'was null';
        }
        
            form.USPersonText__c = this.value;
                   insert form;
           }

 

Anyway, value is never getting set. Any ideas would be much appreciated.

 

David

Hello everyone, just wanted to share with the community this custom component I made and give something back for the help I've received. :smileyhappy:

The purpose of the component is to enable autocomplete in lookup fields. I used the autocomplete js created by Jim Roos:
(http://www.jimroos.com/2007/05/ajax-autocomplete.html) but made some modifications to it so that it could interact with an Apex controller among some other things...

So my idea was that if you were making a VF page that had an inputfield that was related to a lookupfield you would just insert this autocomplete component to that inputfield. Something like this:

Code:
           <apex:inputField value="{!Contact.accountid}" id="accname" styleClass="cField">
<c:autocomplete ObjectName="Accounts" InputId="{!$Component.accname}" AutoCompleteId="accACid" ClassName="autocomplete300"/>
</apex:inputField>

The component has 4 parameters:

The name of the object or custom object that the inputfield relates to (new objects must be added inside the apex classes since i had some problems constructing a dynamic query).
The InputId which is used to relate the component to the input field
The id for the Component
A classname parameter that basically just defines the width of the suggestions menu.

Here's a screenshot of how it looks like in action:




Here's a link to the file containing the required files:

AutoCompleteComponent



Jonathan.


Message Edited by jonathan rico on 08-16-2008 01:55 PM

Message Edited by jonathan rico on 08-17-2008 09:04 AM
Message Edited by jonathan rico on 01-02-2010 05:01 PM