You need to sign in to do that
Don't have an account?
Jyothsna Reddy
Problem facing with SelectList values
Hello everyone.
I am struggling with this problem Please anyone try to help me............
Have a glance on code.
Here I have two records having m.Fieldtype as Combo.so 2 times getItems() will be called right?
So, options (returntype of getItems()) will store 2nd time value .And these values will be displayed in two SelectList values
( I want both values should be different)
How can i get this..?
Visualforce Code
Controller Code:
I am struggling with this problem Please anyone try to help me............
Have a glance on code.
Here I have two records having m.Fieldtype as Combo.so 2 times getItems() will be called right?
So, options (returntype of getItems()) will store 2nd time value .And these values will be displayed in two SelectList values
( I want both values should be different)
How can i get this..?
Visualforce Code
<apex:selectList value="{!inputFields[m.Id]}" size="1" rendered="{!if(m.FieldType__c == 'Combo' ,true,false)}" > <apex:selectoptions value="{!items}" ></apex:selectoptions> </apex:selectList>
Controller Code:
public List<SelectOption> getItems() { List<SelectOption> options = new List<SelectOption>(); comStr=null; for(Mapping__c map1:keylist){ if(map1.FieldType__c=='Combo'){ comStr= map1.FieldValue__c; System.debug('comStr value is::::::::::'+comstr); } } strList1=comStr.split(','); for(String str1:strList1){ options.add(new SelectOption(str1,str1)); } return options; }
It is not clear what are you trying to achieve here.. could you describe more? or provide full code?
VisualforceCode:
Controller Code:
I have MappingObject -----> Fields are::::::::::::::FieldName__c,FieldCaption__c && FieldType__c etc----
Records are
FieldName FieldCaption FieldType FieldValue
_____________________________________________________
Status Status Combo Active,In-Active
gender Gender Combo Male,Female
Here I am trying to get the records based on FieldType__c(like ::::combo).
Here I have two records having m.Fieldtype as Combo.so 2 times getItems() will be called right?
So, options (returntype of getItems()) will store 2nd time value .And these values will be displayed in two SelectList values
( I want both values should be different)
Is this possible? If not is there any other way to acheive this?
Did u got this now?
Here Constructor is XXForm not XXFormBuildCombo (line no:16)
In this case you have to first create 2 piclist in VF page like below.
Note: pickList1 and pickList2
Now in controller you have to return List<List<SelectOptions> like
in getItems method prepare values for pickList1 and pickList2 .
Please try and let us know.
Basically I am not gettting Items.Picklist1...
But here I dont want to hardcode items.picklist1 & items.picklist2.
As of now I am getting only 2 records (i.e., status,gender) but in future it may increase..So I cant hardcode ....
Here I want to assign values for picklist1and picklist2 in Controller..
But I am getting error
Error: Unknown property 'VisualforceArrayList.pickList1'
Please help me how to fix this?