**Newb Alert**

With a basic Extension, I populate a field with a SOQL. The desired behavior is when the lookup field is populated by a user, the second field shows a picklist with only the relevant values. A commandButton then allows the user to quicksaves a record and rerender the main form to show the "generated" link (formula field on the newly created record). Everything works as intented and each time I choose a different value in the lookup field the picklist shows the appropriate related list. 

My challenge is when I click the commandButton the behavior stops working and the picklist doesn't update anymore. 

For the sake of simplicity I only kept relevant code: 

**Extension.:**

```
public class TESTGenerator { 

private final Link_Generator__c linkgen;

public TESTGenerator(ApexPages.StandardController stdController) {  
     this.linkgen = (Link_Generator__c)stdController.getRecord(); 
    }  

// Offer URL list options before saving new Link Generator Record  
public SelectOption[] getOfferUrlOptions() {  
       SelectOption[] OfferUrl = new SelectOption[]{};  
         for (Offer_URL__c l : [SELECT id, name FROM Offer_URL__c WHERE Offer__c = :linkgen.Offer__c ORDER by name ASC]) {  
         OfferUrl.add(new SelectOption(l.id, l.name));  
    }  
   return OfferUrl;
    }
 }

```

**VisualPage.:**

```
<apex:form id="myForm">
<apex:pageBlock >

        <!--Section - Main Infos--> 

<div class="bodystyle">
<apex:pageBlockSection title="Main Infos" columns="1" collapsible="false">

   <apex:inputField taborderhint="2" value="{!Link_Generator__c.Offer__c}" required="true" style="font-size: 10pt" >
   <apex:actionSupport event="onchange" rerender="myForm" />
   </apex:inputField>

   <apex:selectList id="OfferURLLookupPicklist" title="Offer URL" value="{!Link_Generator__c.Offer_URL__c}" size="1" >
   <apex:selectOptions value="{!OfferUrlOptions}" />
   <apex:actionSupport event="onchange" rerender="myForm"  />
   </apex:selectList>

</apex:pageBlockSection>
</div>

        <!--Section - Buttons-->

  <apex:pageBlockButtons location="bottom">
   <apex:commandButton value="Generate Link" style="background:#055fa8;color: white;width:95px;font-size: 9pt" action="{!quicksave}" rerender="myForm" />
   <input type="button" class="btn" onclick="location.reload();" value="Reset"/> 
</apex:pageBlockButtons>

        <!--Section - Result--> 

<div class="bodystyle"> 
<apex:pageBlockSection title="Result" columns="1" collapsible="false" >
  <apex:pageBlockSectionItem dataStyle="width:10%">
   {!Link_Generator__c.Link__c} 
   <br/>
   <br/>
   <span style="color:green; font-weight:bold;font-size: 10pt">  
   {!IF(ISBLANK(Link_Generator__c.Link__c),"","Use Control-C to directly copy this link")}   
   </span> 

            <!--Javascript - Allows user to use Control-C only to directly copy link to clipboard -->

<script type="text/javascript">
    document.addEventListener('copy', function(e){
    e.clipboardData.setData('text/plain', '{!Link_Generator__c.Link__c}');
    e.preventDefault(); 
    });
</script>    

 </apex:pageBlockSectionItem> 
</apex:pageBlockSection>
</div>

</apex:pageBlock>
</apex:form>

```