function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Arvind1Arvind1 

Code working in developer edition but not in pilot edition

I am using Account fields Billing Address and Shipping Address.
I have a requirement where I have to provide a checkbox on checking which the Billing Address values should be populated to Shipping Address values and on unchecking
it the original shipping address should be populated.
I am using the following code for this purpose.
Code:
Boolean SA;
public Boolean getBooleanCheck(){return SA;}
public void setBooleanCheck(Boolean b) {SA=b;}
String billingcity,billingstate,billingcountry,billingcode;
 public void setbillcity(String s){billingcity=s;}
public string getbillcity()
{
billingcity=SPP_Account_Renewal.BillingCity;
return billingcity;
}
public void setbillstate(String a){billingstate=a;}

public string getbillstate()
{
billingstate=SPP_Account_Renewal.BillingState;
return billingstate;
}
public void setbillcountry(String b)
{
billingcountry=b;
}
public string getbillcountry(){
billingcountry=SPP_Account_Renewal.BillingCountry;
return billingcountry;
}
public void setbillcode(string c)
{
billingcode=c;
}
public string getbillcode(){

billingcode=SPP_Account_Renewal.BillingPostalCode;
return billingcode;
}
String shippingcity,shippingstate,shippingcountry,shippingcode;

public void setshipcode(string c)
{
shippingcode=c;
}
public string getshipcode()
{

if((shippingcode==NULL)||(SA==FALSE))
    shippingcode=SPP_Account_Renewal.ShippingPostalCode;
      
else if(SA==TRUE)
shippingcode=billingcode;

    return shippingcode;

}

public void setshipcity(string e)
{
shippingcity=e;
}
public string getshipcity(){
if((shippingcity==NULL)||(SA==FALSE))
shippingcity=SPP_Account_Renewal.ShippingCity;
else if(SA==TRUE)
shippingcity=billingcity;

return shippingcity;
}
public void setshipcountry(string f)
{
shippingcountry=f;
}
public string getshipcountry(){
if((shippingcountry==NULL)||(SA==FALSE))
shippingcountry=SPP_Account_Renewal.ShippingCountry;
else if(SA==TRUE)
shippingcountry=billingcountry;


return shippingcountry;
}
public void setshipstate(string g)
{
shippingstate=g;
}
public string getshipstate(){
if((shippingstate==NULL)||(SA==FALSE))
shippingstate=SPP_Account_Renewal.ShippingState;
else if(SA==TRUE)
shippingstate=billingstate;

return shippingstate;
}


 
I am using the following in page editor.
Code:
<apex:inputCheckbox selected="false" id="shipping"/>
          <apex:actionSupport event="onclick" rerender="detail">
            </apex:actionSupport>


            <apex:pageblock >

            <apex:outputLabel value="Same as Billing Address"/><br></br>
            <apex:outputPanel>
            <b>Billing City</b><apex:inputText value="{!billcity}" ></apex:inputText>
            <b>Billing State/Province</b><apex:inputText value="{!billstate}"></apex:inputText>
            <b>Billing Country</b><apex:inputText value="{!billcountry}"></apex:inputText>
            <b>Billing Zip/Postal Code</b><apex:inputText value="{!billcode}"></apex:inputText>
            </apex:outputPanel>
       <apex:outputPanel id="detail">
       <b>Shipping Zip/Postal Code</b><apex:inputText id="shipc" value="{!shipcode}"></apex:inputText><br></br>
       <b>Shipping City</b><apex:inputText value="{!shipcity}"></apex:inputText><br></br>
       <b>Shipping State/Province</b><apex:inputText value="{!shipstate}"></apex:inputText><br></br>
       <b>Shipping Country</b><apex:inputText value="{!shipcountry}"/>
        </apex:outputPanel>
       </apex:pageblock> 

 
I have a similar code which is working in my developer edition.
 
Code:
Boolean cb;
public void setBooleanCheck(Boolean b)
{
cb=b;
}
public boolean getBooleanCheck()
{
return cb;
}
public void setzipc(String s)
{
z=s;
}
public string getzipc()
{
return z;
}
public void setzipcode(String s)
{
zc=s;
}
public string getzipcode()
{
return zc;
}
public void setcity(String s)
{
c=s;
}
public string getcity()
{
if((c==Null)||(cb==False))
c='Raj';
else if(cb==True)
c=z;


return c;
}
String co,st,ts;
public void setsts(String s)
{
co=s;
}
public string getsts()
{
if((co==Null)||(cb==False))
co='Shekar';
else if(cb==True)
co=zc;

return co;
}

 
And this is the Page Editor code.
Code:
<apex:inputCheckbox selected="{!BooleanCheck}" id="theCheckbox"/>
<apex:actionSupport event="onclick" rerender="detail">
</apex:actionSupport>

<apex:pageBlock >
<apex:outputPanel >
<apex:inputText id="zip" value="{!zipc}">
</apex:inputText>
<apex:inputText id="zipcode" value="{!zipcode}">
</apex:inputText>


</apex:outputPanel>
<br></br>
<br></br>
<br></br>


<apex:outputPanel id="detail">
<apex:inputText id="cit" value="{!city}">
</apex:inputText>
<apex:inputText id="ts" value="{!sts}">
</apex:inputText>

</apex:outputPanel>
</apex:pageBlock>

 But i have one more problem in the developer edition code. Since i have placed the textbox in outputpanel, i am not able to edit those textboxes directly.
But in y pilot edition i have to give the shipping address as editable.
 
Any suggestion on this will be of a great help.
 
Thanks
Arvind 
 
Ron HessRon Hess
your statement

Since i have placed the textbox in outputpanel, i am not able to edit those textboxes directly.


is not true, fields are not controlled by outputPanel.

You must have the fields set to read-only in your pilot edition. 
Also there is no such edition as pilot edition.

Arvind1Arvind1

Hi Ron,

Pilot I mean Sandbox. I am not using fields in the outputpanel. I am using textboxes. If i click inside the checkboxes which are placed in the outputpanel

the pointer will blink for some 10 seconds and it goes. I am not able to edit the text boxes inside outputpanel.

Thanks

Arvind