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
DRobi83DRobi83 

Help with visualforce layouts using correct layout types

Hi Comm.

 

This code work perfectly, however i would like my records under headervalue="Line Items" to display hosizontally, not vertically. I think it has to do with me using a column. Does anyone have a suggestion how i can restyle it?

 

Below is my VF code for my page which is using correct code for my means, but not displaying correclty. Below that is code which displays the way i want, but does not use correct code for what i want to achieve. Im trying to achieve using both versions into 1, which is hosizontal records displaying in vf1

 

<apex:page standardController="Invoice__c" extensions="newInvoiceLineItems,CurrencyPL,TaxPL,ProductPL">
    <apex:form >
    <apex:sectionHeader title="Invoice and Credit Memo Edit" subtitle="New Invoice and Credit Memo"  /> 
    <apex:pageBlock title="Invoice Details" >
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" rerender="error" />
            </apex:pageBlockButtons>
            <apex:pageMessages ></apex:pageMessages>
        <apex:pageBlockSection title="Information" columns="2" collapsible="false">
            <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Currency"/>
                <apex:outputPanel layout="block" styleClass="requiredInput" >
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!Invoice__c.Currency__c}" 
                     required="True" size="1" id="invoicecurr">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>
                </apex:pageBlockSectionItem> 
            <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" /> 
            <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />
            <apex:inputField value="{!Invoice__c.Type__c}" required="true" />  
            <apex:inputTextarea value="{!Invoice__c.Description__c}" required="true" /> 
        </apex:pageBlockSection>   
            <apex:pageBlockTable value="{!lines}" var="li" id="table">      
                <apex:column headerValue="Line Items">
                    <apex:facet name="header">Line Items</apex:facet>           
                    <apex:outputLabel value="Currency"/>
                    <apex:inputField value="{!li.Amount_Inc_Tax__c}" required="true"/>
                    <apex:inputField value="{!li.Invoice__c}"/>
                    <apex:commandLink value="Add Row" action="{!addRow}" rerender="table,error" immediate="true" />&nbsp;|&nbsp;&nbsp;
                    <apex:commandLink value="Remove Row" action="{!removeRow}" rerender="table,error" immediate="true" />
                 </apex:column>    
            </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>
</apex:page>

 

this displays my records the way i want, but cannot get my code to work the way i want

 

<apex:page StandardController="Invoice__c" extensions="MultiAdd,TestCurrencyPL,TaxPL,ProductPL" id="thePage">
<apex:form >
<apex:sectionHeader title="Invoice and Credit Memo Edit" subtitle="New Invoice and Credit Memo"  /> 
<apex:pageblock id="pb" >
    <apex:pageBlockButtons >
        <apex:commandbutton value="Add Line Item" action="{!Add}" rerender="pb1"/>
        <apex:commandbutton value="Save Invoice" action="{!Save}"/>
    </apex:pageBlockButtons>
    <apex:pageMessages ></apex:pageMessages>
    <apex:pageBlockSection title="Information" columns="2" collapsible="false">
        <apex:inputField value="{!Invoice__c.Customer__c}" required="true" />
                
                <apex:pageBlockSectionItem >
                <apex:outputLabel value="Currency"/>
                <apex:outputPanel layout="block" styleClass="requiredInput" >
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!Invoice__c.Currency__c}" 
                     required="True" size="1" id="invoicecurr">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>
                </apex:pageBlockSectionItem>
        
        <apex:inputField value="{!Invoice__c.Date_Document__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Type__c}" required="true" />
        <apex:inputField value="{!Invoice__c.Due_Date__c}" required="true" />  
        <apex:inputTextarea value="{!Invoice__c.Description__c}" required="true" />   
    </apex:pageBlockSection>    
        
        <apex:pageblock id="pb1">
            
        <apex:repeat value="{!lstInner}" var="e1" id="therepeat">
                <apex:panelGrid columns="9">
                
                <apex:panelGrid headerClass="Name">
                    <apex:facet name="header">&nbsp;</apex:facet>
                    <apex:commandButton value="Remove" action="{!Del}" rerender="pb1">
                        <apex:param name="rowToBeDeleted" value="{!e1.recCount}" assignTo="{!selectedRowIndex}"></apex:param>
                    </apex:commandButton>
                </apex:panelGrid>   
                
                <apex:panelGrid title="SPD" >
                    <apex:facet name="header">Display Name</apex:facet>
                    <apex:inputfield value="{!e1.acct.Display_Name__c}" required="true"/>
                </apex:panelGrid>
                
                <apex:panelGrid >
                <apex:facet name="header">Product</apex:facet>
                <apex:outputPanel layout="block" styleClass="requiredInput">
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!e1.acct.Product_For_Sale__c}" 
                     required="True" size="1" id="lineitemdisplayname">
                    <apex:selectOptions value="{!getProduct}"/>
                </apex:selectList>
                </apex:outputPanel>
                </apex:panelGrid>

                <apex:panelGrid >
                <apex:facet name="header">Tax</apex:facet>
                <apex:outputPanel layout="block" styleClass="requiredInput">
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!e1.acct.Tax__c}" 
                     required="True" size="1" id="lineitemtax">
                    <apex:selectOptions value="{!getTax}"/>
                </apex:selectList>
                </apex:outputPanel>
                </apex:panelGrid>

                <apex:panelGrid >
                <apex:facet name="header">Currency</apex:facet>
                <apex:outputPanel layout="block" styleClass="requiredInput">
                <apex:outputPanel layout="block" styleClass="requiredBlock"/>
                <apex:selectList value="{!e1.acct.Currency__c}" 
                     required="True" size="1" id="lineitemcurr">
                    <apex:selectOptions value="{!getCurrency}"/>
                </apex:selectList>
                </apex:outputPanel>
                </apex:panelGrid>
                
                <apex:panelGrid >
                    <apex:facet name="header">Quantity</apex:facet>
                    <apex:inputfield value="{!e1.acct.Quantity__c}" required="true" />
                </apex:panelGrid> 

                <apex:panelGrid >
                    <apex:facet name="header">Amount inc Tax</apex:facet>
                    <apex:inputfield value="{!e1.acct.Amount_Inc_Tax__c}" required="true" />
                </apex:panelGrid>                              
                
                <apex:panelGrid >
                    <apex:facet name="header">Invoice</apex:facet>
                    <apex:inputfield value="{!e1.acct.Invoice__c}" required="true" />
                </apex:panelGrid>                  
                
                <apex:panelGrid >
                <apex:facet name="header">&nbsp;</apex:facet>
                <apex:commandbutton value="Add Line Item" action="{!Add}" rerender="pb1"/>               
                
                </apex:panelGrid>  
                
            </apex:panelgrid>
        </apex:repeat>
    </apex:pageBlock>
</apex:pageblock>
</apex:form>
</apex:page>