You need to sign in to do that
Don't have an account?
Selected value from picklist always returns Null.
Hello!
I'm trying to do the following:
When the user select a different value on the picklist on the page. It has to call an action function that on the controller, will check what is the value selected and do different things depending on what was select.
PAGE:
...
<apex:inputField label="Modal: " value="{!Opc.Modal__c}" onchange="return VModal()"/>
...
<apex:actionFunction action="{!Verifica}" name="VModal" immediate="TRUE"/>
CONTROLLER:
Public pageReference Verifica(){
if(Opc.Modal__c == '01'){
visible = TRUE;
}
Return null;
}
When I select the option '01' the variable 'Visible' doens't turns TRUE. The thing is that the value from the picklist is returning Null. Whatever option from the list I select it always returns null.
I tried to create a variable called "message" to show the value selected from the picklist, and the value is Null.
All of this is on a TabPanel, I don't know if it changes something, but is the first time I use Tabs and things doesn't seem to work as it should on then.
Can anybody help?
Thx
Felipe.
<apex:actionFunction action="{!Verifica}" name="VModal" immediate="TRUE"/>
When I do this, and select the picklist the page tries to validate the requiered fields. And then don't complete the action.
thx
<apex:actionFunction action="{!Verifica}" name="VModal" rerender="x"/>
It didn't work.
It still doesn't became TRUE. : (
Yes I am. Now the code is like this:
Page:
<apex:actionFunction action="{!Verifica}" name="VModal" rerender="PainelRod"/>
<apex:outputPanel id="PainelRod" rendered="{!Visivel}">
Controller:
Public pageReference Verifica(){
if(Opc.Modal__c == '01'){
visible = TRUE;
}
Return null;
}
System.debug('######Opc.Modal__c###########'+Opc.Modal__c);
if(Opc.Modal__c == '01'){
visible = TRUE;
}
Return null;
}
Check the debug log if the value is being set.
Another thing try to rerender the parent component of "PainelRod"
Something like
<apex:actionFunction action="{!Verifica}" name="VModal" rerender="PainelRodParent"/>
<apex:outputPanel id="PainelRodParent" >
<apex:outputPanel id="PainelRod" rendered="{!Visivel}">
10:22:54.172 (172911000)|USER_DEBUG|[271]|DEBUG|RetornoPicklist:null
It really returns null. I'm using a picklist from a custom object. 'll try creating a pickilist on the page and adding the items to check what it will return.
The seems to be somewhere else
Yes, here it is:
I created this selectlist picklist Modal2 as I said before, but it also returns null.
PAGE:
CONTROLLER:
Thanks man.
Yes, here it is:
I created this selectlist picklist Modal2 as I said before, but it also returns null.
PAGE:
CONTROLLER:
Thanks man.
You dont seem to have setter methiod for "OpcCte".
Do you have something like this in your code ?
Oh yes, I forgot it.
Now I put it. But nothing changed.