• alockrem
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 6
    Replies

I have come across this issue a number of times in the past few months and always found work-arounds.  I have never gotten this to work, which is obvously because I'm missing something.

 

I have a custom object called cpeRateElements.  I have a data table displaying the values in the list and a few of them should be editable.  The changes I make get ignored.  How do I pass values from data table form fields back to the custom object?

 

 

<apex:dataTable value="{!cpeRateElements}" var="cre" cellpadding="4" border="1">
<apex:column headerClass="tableHeader" headerValue="Qty">
<apex:selectList value="{!cre.quantity}" size="1">
<apex:selectOptions value="{!quantityOptions}" />
<apex:actionSupport event="onChange" rerender="reSummary" />
</apex:selectList>
</apex:column>
<apex:column headerClass="tableHeader" headerValue="Vendor" value="{!cre.vendor}" />
<apex:column headerClass="tableHeader" headerValue="Vendor Number" value="{!cre.vendorNumber}" />
<apex:column headerClass="tableHeader" headerValue="Part Number" value="{!cre.partNumber}" />
<apex:column headerClass="tableHeader" headerValue="MAT Code" value="{!cre.matCode}" />
<apex:column headerClass="tableHeader" headerValue="Cost" value="{!cre.cost}" />
<apex:column headerClass="tableHeader" headerValue="GL Type" value="{!cre.glType}" />
<apex:column headerClass="tableHeader" headerValue="Labor Units">
<apex:inputText value="{!cre.laborUnits}" style="width: 40px;"/>
</apex:column>
<apex:column headerClass="tableHeader" headerValue="Labor Rate" value="{!cre.laborRate}" />
<apex:column headerClass="tableHeader" headerValue="Maint Code" value="{!cre.maintenanceCode}" />
<apex:column headerClass="tableHeader" headerValue="Maint %" value="{!cre.maintenancePercentage}" />
<apex:column headerClass="tableHeader" headerValue="GM %">
<apex:inputText value="{!cre.gmPercentage}" style="width: 40px;"/>
</apex:column>
</apex:dataTable>

 

FYI - reSummary is an exact replica of this table that just displays the values from cpeRateElements on the screen without the form fields.  That is one of my attempts to see the updates happening.  Needless to say, when I update the quantity field in this table nothing happens in reSummary.

 

Any help is greatly appreciated.

 

I am trying to embed a DataTable inside of a DataTable.  Please help me understand what I'm doing wrong.

 

Note: I have never gotten this to work, so my approach may be completely off.

 

 

<apex:datatable id="tblQuotes" value="{!quotes}" var="q">
    <apex:column >
	<apex:outputText value="{!q.name}" />
    </apex:column>
    <apex:column>
	<apex:param name="provQuoteId" value="{!q.id}" />
	<apex:dataTable id="tblQlis" value="{!quoteLineItems}" var="qli">
	    <apex:column value="{!qli.id}" />
	</apex:dataTable>
    </apex:column>
</apex:datatable>

 

 

 

    public class quoteRecord
    {
        public String id {get;set;}
        public String name {get;set;}
        public Boolean selected {get;set;}
                
        public quoteRecord(
            String setId,
            String setName,
            Boolean setSelected)
        {
            id = setId;
            name = setName;
            selected = setSelected;
        }
    }


    public List<quoteRecord> getQuotes()
    {
        quoteRecords.clear();
        
        for (quote q : [SELECT id, name
                        FROM quote
                        WHERE opportunityId = : opportunityId])
        {
            quoteRecords.add(new quoteRecord(q.id, q.name, false));
        }
        
        return quoteRecords;
    }


    public List<quoteLineItem> getQuoteLineItems()
    {
        return [SELECT id, quote.name, pricebookentry.product2.name, provisioning_page__c
                FROM quoteLineItem
                WHERE quoteId = : ApexPages.currentPage().getParameters().get('provQuoteId')];
    }

 

 

Thank you for any help.

How do I set the following page to be in edit mode?

 

<apex:page standardController="Site__c">
    <apex:detail subject="{!Site__c.id}" />
</apex:page>

 

The following URL asked for this functionality a long time ago.  Is it available yet?

 https://sites.secure.force.com/features/ideaView?c=09a30000000D9xtAAC&id=08730000000BrQt&returnUrl=%2Fapex%2FideaList%3Fc%3D09a30000000D9xtAAC%26category%3DApex%2B%2526%2BVisualforce%26sort%3Dtop

 

Thank you for any help.

I have a custom object to hold site records (site__c).  In the process of working through a collection of Visual Force pages I want to provide the option for a user to quickly add a site and then continue with the process they are currently on.

 

Example:

1) User creates a new opportunity (id=000000001)

2) User clicks "Add Product Wizard" which launches /apex/AddProdWiz?id=000000001

3) User is prompted to select a site from the list of existing sites (associated at an account level)

4) If the site isn't listed the user should click "Add a site"

 

Here is where I need help.  I want the user to complete the same form displayed when the user accesses the site__c object and clicks "new".  I also want them to be returned to /apex/AddProdWiz?id=000000001 when he/she is done adding the site.  Ideally, I would like the user to be returned to /apex/AddProdWiz?id=000000001&siteID=000000002 so I can automatically select the newly added site.

 

Should I be sending the user to a Visual Force page that uses a standardController="site__c"?  If so, how do I tell it to display the add form on the screen?

 

Thank you for your help.

Using the code below, how do I select the selectOption who's id matches a pre-defined value?

 

            if (this.site != null)
            {
                for (market__c m : [SELECT id, name FROM market__c WHERE state__c = :siteState])
                {
                    markets.add(new selectOption(m.id, m.name));
                }
            }

 

I want the selectOption to be selected by default if m.id = :siteMarket.

 

Thank you for any help.

I am attempting to pull the state__c value from the site__c object where the site__c.id matches the selected value from a selectList.  I have tried 2 different ways and am unable to avoid errors. 

 

-----------------

Attempt #1

    public String siteState
    {
        get {return [SELECT state__c FROM site__c WHERE id = :site LIMIT 1]; }
        set;
    }

 

The error I receive is:

Error: Compile Error: Return value must be of type: String at line 17 column 14

-----------------

Attempt #2

    public String siteState
    {
        get
        {
            String tmpState = [SELECT state__c FROM site__c WHERE id = :site LIMIT 1];
            return tmpState;
        }
        set;
    }

 

The error I receive is:

Error: Compile Error: Illegal assignment from LIST:SOBJECT:Site__c to String at line 19 column 13

-----------------

 

Any help is greatly appreciated.

I have a collection of dependant selectLists on a Force.com page.  How can I populate an outputLabel with the price of the selection in the associated selectList?

 

Example:

SelectList1 - OutputLabel1

SelectList2 - OutputLabel2

SelectList3 - OutputLabel3

 

Note: I'm using the rerender action on each SelectList to update the next SelectList.  If your solution to my original question includes using the rerender action please also include instructions of how to use two rerenders on the same object.

 

Thank you for any assistance.

I need to populate a collection of drop-down boxes based on the previous selection.  The custom object structure is:

 

Categories

CategoryID

CategoryName

ParentCategoryID

 

The first drop-down box should be populated with everything with a ParentCategoryID of 0.  The subsequent drop-down boxes should appear and be populated with CategoryNames where the ParentCategoryID is equal to the value from the previous drop-down box.

 

Any help is greatly appreciated.

How do I set the following page to be in edit mode?

 

<apex:page standardController="Site__c">
    <apex:detail subject="{!Site__c.id}" />
</apex:page>

 

The following URL asked for this functionality a long time ago.  Is it available yet?

 https://sites.secure.force.com/features/ideaView?c=09a30000000D9xtAAC&id=08730000000BrQt&returnUrl=%2Fapex%2FideaList%3Fc%3D09a30000000D9xtAAC%26category%3DApex%2B%2526%2BVisualforce%26sort%3Dtop

 

Thank you for any help.

I have a custom object to hold site records (site__c).  In the process of working through a collection of Visual Force pages I want to provide the option for a user to quickly add a site and then continue with the process they are currently on.

 

Example:

1) User creates a new opportunity (id=000000001)

2) User clicks "Add Product Wizard" which launches /apex/AddProdWiz?id=000000001

3) User is prompted to select a site from the list of existing sites (associated at an account level)

4) If the site isn't listed the user should click "Add a site"

 

Here is where I need help.  I want the user to complete the same form displayed when the user accesses the site__c object and clicks "new".  I also want them to be returned to /apex/AddProdWiz?id=000000001 when he/she is done adding the site.  Ideally, I would like the user to be returned to /apex/AddProdWiz?id=000000001&siteID=000000002 so I can automatically select the newly added site.

 

Should I be sending the user to a Visual Force page that uses a standardController="site__c"?  If so, how do I tell it to display the add form on the screen?

 

Thank you for your help.

Using the code below, how do I select the selectOption who's id matches a pre-defined value?

 

            if (this.site != null)
            {
                for (market__c m : [SELECT id, name FROM market__c WHERE state__c = :siteState])
                {
                    markets.add(new selectOption(m.id, m.name));
                }
            }

 

I want the selectOption to be selected by default if m.id = :siteMarket.

 

Thank you for any help.

I am attempting to pull the state__c value from the site__c object where the site__c.id matches the selected value from a selectList.  I have tried 2 different ways and am unable to avoid errors. 

 

-----------------

Attempt #1

    public String siteState
    {
        get {return [SELECT state__c FROM site__c WHERE id = :site LIMIT 1]; }
        set;
    }

 

The error I receive is:

Error: Compile Error: Return value must be of type: String at line 17 column 14

-----------------

Attempt #2

    public String siteState
    {
        get
        {
            String tmpState = [SELECT state__c FROM site__c WHERE id = :site LIMIT 1];
            return tmpState;
        }
        set;
    }

 

The error I receive is:

Error: Compile Error: Illegal assignment from LIST:SOBJECT:Site__c to String at line 19 column 13

-----------------

 

Any help is greatly appreciated.

I need to populate a collection of drop-down boxes based on the previous selection.  The custom object structure is:

 

Categories

CategoryID

CategoryName

ParentCategoryID

 

The first drop-down box should be populated with everything with a ParentCategoryID of 0.  The subsequent drop-down boxes should appear and be populated with CategoryNames where the ParentCategoryID is equal to the value from the previous drop-down box.

 

Any help is greatly appreciated.