You need to sign in to do that
Don't have an account?

price list not displaying unless I use two forms
<apex:page standardController="OpportunityLineItem" extensions="addQuoteLineItem">
<apex:form id="mainForm">
<apex:outputPanel id="quoteInfo">
<apex:pageBlock title="Quote Line">
<apex:pageBlockButtons location="bottom">
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!saveAndNew}" value="Save & New"/>
</apex:pageBlockButtons>
<apex:messages />
<apex:pageBlockSection id="priceData" columns="4">
<apex:pageBlockSectionItem >
<apex:outputText value="Price: "/><apex:inputField id="unitPriceField" value="{!OpportunityLineItem.UnitPrice}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputText value="Quantity: "/><apex:inputField value="{!OpportunityLineItem.Quantity}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:outputPanel>
</apex:form>
<apex:form >
<apex:selectList value="{!viewProductField}" id="productFields" size="1">
<apex:selectOptions value="{!products}"/>
<apex:actionSupport event="onchange" action="{!refreshPricing}" reRender="priceList,priceListCanada"/>
</apex:selectList>
<apex:outputPanel id="priceList">
<apex:pageBlock title="Pricing" rendered="{!usRendered}">
<apex:pageBlockTable value="{!pricingResult}" var="p">
<apex:column >
<apex:facet name="header">
<apex:outputText value="FOB"/>
</apex:facet>
<apex:outputText value="{!p.FOB__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:outputPanel>
<apex:outputPanel id="priceListCanada">
<apex:pageBlock title="Canadian Pricing" rendered="{!canadaRendered}">
<apex:pageBlockTable value="{!pricingCanadaResult}" var="p">
<apex:column >
<apex:facet name="header">
<apex:outputText value="FOB"/>
</apex:facet>
<apex:outputText value="{!p.FOB__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:outputPanel>
</apex:form>
</apex:page>
If I use this, it doesn't work. What's the deal? We'd like to have the select list at the top of the page but it appears we can't. Notice I changed where the select list is and removed one form.
<apex:page standardController="OpportunityLineItem" extensions="addQuoteLineItem">
<apex:form id="mainForm">
<apex:selectList value="{!viewProductField}" id="productFields" size="1">
<apex:selectOptions value="{!products}"/>
<apex:actionSupport event="onchange" action="{!refreshPricing}" reRender="priceList,priceListCanada"/>
</apex:selectList>
<apex:outputPanel id="quoteInfo">
<apex:pageBlock title="Quote Line">
<apex:pageBlockButtons location="bottom">
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!saveAndNew}" value="Save & New"/>
</apex:pageBlockButtons>
<apex:messages />
<apex:pageBlockSection id="priceData" columns="4">
<apex:pageBlockSectionItem >
<apex:outputText value="Price: "/><apex:inputField id="unitPriceField" value="{!OpportunityLineItem.UnitPrice}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputText value="Quantity: "/><apex:inputField value="{!OpportunityLineItem.Quantity}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:outputPanel>
<apex:outputPanel id="priceList">
<apex:pageBlock title="Pricing" rendered="{!usRendered}">
<apex:pageBlockTable value="{!pricingResult}" var="p">
<apex:column >
<apex:facet name="header">
<apex:outputText value="FOB"/>
</apex:facet>
<apex:outputText value="{!p.FOB__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:outputPanel>
<apex:outputPanel id="priceListCanada">
<apex:pageBlock title="Canadian Pricing" rendered="{!canadaRendered}">
<apex:pageBlockTable value="{!pricingCanadaResult}" var="p">
<apex:column >
<apex:facet name="header">
<apex:outputText value="FOB"/>
</apex:facet>
<apex:outputText value="{!p.FOB__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:outputPanel>
</apex:form>
</apex:page>
I'm not sure why it doesn't work... not much detail to go on. Generally what happens is there's some sort of validation that's failing because of the form submit that happens form the actionSupport. Use actionRegion to control the parts of your form that get submitted. Should be doable using only one form and one or more actionRegion (for starters you'll want an actionRegion around your selectList only I would guess).
If you put a apex: pageMessages component on your page you should see any validation errors.
All Answers
I'm not sure why it doesn't work... not much detail to go on. Generally what happens is there's some sort of validation that's failing because of the form submit that happens form the actionSupport. Use actionRegion to control the parts of your form that get submitted. Should be doable using only one form and one or more actionRegion (for starters you'll want an actionRegion around your selectList only I would guess).
If you put a apex: pageMessages component on your page you should see any validation errors.