0

Forgive my incompetence...I have a visualforce "Wizard" I had working relatively well but I have had to change some key functionality to use Javascript to call a Web Service API and return some values. I use Jquery/Javascript tofinally map these to a range of input fields on the visualforce page. These inputs take the form:

<apex:outputlabel for="txtaddr1" value="Address Line 1:"/>
<apex:inputText id="txtaddr1" value="{!conAddressLine1}" styleClass="form-control" disabled="true"/>
<apex:outputlabel for="txtaddr2" value="Address Line 2:"/>
<apex:inputText id="txtaddr2" value="{!conAddressLine2}" styleClass="form-control" disabled="true"/>
<apex:outputlabel for="txtaddr3" value="Address Line 3:"/>
<apex:inputText id="txtaddr3" value="{!conAddressLine3}"  styleClass="form-control" disabled="true"/>
<apex:outputlabel for="txtaddr4" value="Address Line 4:"/>
<apex:inputText id="txtaddr4" value="{!conAddressLine4}" styleClass="form-control" disabled="true"/>

I simply set the value of the input fields with:

$('[id$=txtaddr1]').val(data[2]);
$('[id$=txtaddr2]').val(data[3]);
$('[id$=txtaddr3').val(data[4]);
$('[id$=txtaddr4]').val(data[5]);

And finally within my controller I have:

public String conAddressLine1{get;set;}
public String conAddressLine2{get;set;}
public String conAddressLine3{get;set;}
public String conAddressLine4{get;set;}

Some fields appear to populate and others don't, I am pretty sure I need to use Javascript Remoting to pass the values to the controller to correctly save the information to Salesforce. Any help would be grealty appreciated, I am currently re-reading the help online but I am clearly missing some understanding.

0

I was barking up the wrong tree. My input fields were all set to disabled, once I had marked them as enabled they worked. I expect to use readonly instead.

<apex:outputlabel for="txtaddr1" value="Address Line 1:"/>
<apex:inputText id="txtaddr1" value="{!conAddressLine1}" styleClass="form-control" disabled="false"/>
<apex:outputlabel for="txtaddr2" value="Address Line 2:"/>
<apex:inputText id="txtaddr2" value="{!conAddressLine2}" styleClass="form-control" disabled="false"/>
<apex:outputlabel for="txtaddr3" value="Address Line 3:"/>
<apex:inputText id="txtaddr3" value="{!conAddressLine3}"  styleClass="form-control" disabled="false"/>
<apex:outputlabel for="txtaddr4" value="Address Line 4:"/>
<apex:inputText id="txtaddr4" value="{!conAddressLine4}" styleClass="form-control" disabled="false"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.