• Shon
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I have custom component which combined to dropdown list, and I did binding to custom object fields, no issue to get the value from object, but can not save the change..need helps.

 

custom component clss

public with sharing class cComponetCombinedList {
  public string basecolorvalue {get;set;} 
  public string stripecolorvalue {get;set;}
  private list<SelectOption> items;
  public list<SelectOption> getItems(){
    List<SelectOption> items = new List<SelectOption>();
    items.add(new SelectOption('','--None--'));
    items.add(new SelectOption('BG','BG'));
    items.add(new SelectOption('BK','BK'));
    items.add(new SelectOption('BU','BU'));
    items.add(new SelectOption('BU (LT BL)','BU (LT BL)'));
    items.add(new SelectOption('BN','BN'));
    items.add(new SelectOption('DB','DB'));
    items.add(new SelectOption('DG','DG'));
    items.add(new SelectOption('GN','GN'));
    items.add(new SelectOption('GN (LT GN)','GN (LT GN)'));
    items.add(new SelectOption('GY','GY'));
    items.add(new SelectOption('OG','OG'));
    items.add(new SelectOption('PK','PK'));
    items.add(new SelectOption('RD','RD'));
    items.add(new SelectOption('VT','VT'));
    items.add(new SelectOption('WH','WH'));
    items.add(new SelectOption('YE','YE'));
    return items;
  }
  

}

 

Custom Component

 

<apex:component controller="cComponetCombinedList">
	<apex:attribute name="basecolor" description="the base color of the cable" 
			type="String" required="true" assignTo="{!basecolorvalue}">
	</apex:attribute>
	<apex:attribute name="stripecolor" description="the stripe color of the cable" 
			type="String" required="true" assignTo="{!stripecolorvalue}">
	</apex:attribute>
	<apex:selectList value="{!basecolorvalue}" size="1">
		<apex:selectOptions value="{!items}">
		</apex:selectOptions>
	</apex:selectList>
	<apex:selectList value="{!stripecolorvalue}" size="1">
		<apex:selectOptions value="{!items}">
		</apex:selectOptions>
	</apex:selectList>
</apex:component>

 

below is the component referenced in VF:

apex:PageBlockSectionItem >
					<apex:outputLabel value="Pin 1 Base / Stripe Color:"/>
					<c:ComponentCombinedList basecolor="{!SRS_Product_Configuration__c.Pin_1_Base_Color__c}" 
								stripecolor="{!SRS_Product_Configuration__c.Pin_1_Stripe_Color__c}">
					</c:ComponentCombinedList>
				</apex:PageBlockSectionItem>

 

rendered in page correct:

 

1

 

when I change the values and save:

2

 

the value still as old:

 

Any ideas, comments are apperiated. Thanks

 

Qingsong