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
Jacob W LandisJacob W Landis 

lookup field in wrapper class can not get value from vf page.

I have a wrapper class which have a boolean value for checkbox and an identifier class, in Identifier class, there is a lookup field attribute_value__c. It seems that I can not get the picked value for attribute_value__c field in controller, always return null value. any clues?

 <apex:pageBlockTable id="tblIden" value="{!IdentifiersList}" var="i">
                    <apex:column width="25px">                       
                            <apex:inputCheckbox value="{!i.selected}" />                               
                    </apex:column>
                    <apex:column value="{!i.identifier.Identifier_Type__c}" headerValue="Type"/>  
                    <apex:column value="{!i.identifier.name}" headerValue="Name"/>  
                    <apex:column >
                        <apex:facet name="header">Attribute Value</apex:facet>
                        <apex:inputField value="{!i.identifier.Attribute_Value__c }" rendered="{!IF(i.identifier.Identifier_Type__c='Attribute','True','False')}"/>                     
                    </apex:column>
                </apex:pageBlockTable>
sslodhi87sslodhi87
Hi Jingli,

You mean value is not setting from vf page?

Is there is any required field which is not selected or are you using any jquery in page.

Thanks
Jacob W LandisJacob W Landis
I do not use any jquery, and there is no required field which is not selected. I have tried to use picklist instead of lookup. samething, always just return null.
Jacob W LandisJacob W Landis
I have tried the code below (use picklist instead of lookup )too, still not working.

The vf page portion is 

<apex:pageBlockTable id="tblIden" value="{!IdentifiersList}" var="i">
                    <apex:column width="25px">
                        <apex:actionRegion >
                            <apex:inputCheckbox value="{!i.selected}" >
                                <apex:param name="selectedIdenId" assignto="{!selectedItemId}" value="{!i.identifier.Id}"/>
                                <apex:actionSupport event="onclick" action="{!processSelect}" rerender="identifiers">    
                                    <apex:param name="selectedIdenId" assignto="{!selectedItemId}" value="{!i.identifier.Id}"/>
                                </apex:actionSupport>
                            </apex:inputCheckbox>
                        </apex:actionRegion>
                    </apex:column>
                    <apex:column value="{!i.identifier.Identifier_Type__c}" headerValue="Type"/>  
                    <apex:column >
                        <apex:facet name="header">Identifier Name</apex:facet>
                            {!IF(i.identifier.Identifier_Type__c='Attribute',i.identifier.Name,i.identifier.Special_Feature_Code__c + ' - ' + i.identifier.Name)}
                    </apex:column>
                    <apex:column >
                        <apex:facet name="header">Attribute Value</apex:facet>
                        <apex:selectList size="1" value="{!i.attValue}" rendered="{!IF(i.identifier.Identifier_Type__c='Attribute','True','False')}">
                            <apex:selectOptions value="{!i.valueList}"/>
                        </apex:selectList>
                    </apex:column>
                </apex:pageBlockTable>

The wrapper class is 

        public identifierWrapper(Boolean selected , ECMS_Identifier__c identifier, list<ECMS_Attribute_Value__c> vlist,String avalue){
            this.selected = selected;
            this.identifier= identifier;
            if (vlist!=null){
                valueList= new list<SelectOption>();
                for (ECMS_Attribute_value__c v:vlist){
                    if (String.isEmpty(attvalue)){
                        attValue=v.name;
                    }
                    this.valueList.add(new SelectOption(v.name,v.name));
                }
            }
            if (String.isEmpty(avalue)){
                this.attValue=avalue;
            }
        }