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
HarryHHHarryHH 

Null Values passed from CustomButtom to Controller

HEllo,

 

I've written the following VF Page code:

 

.

.

        <apex:panelBarItem label="Genehmigungen" rendered="{!NOT(ISNULL(Genehmigungen_prop))}">
            <apex:PageBlock ID="GenBlock" >
            <apex:pageBlockSection title="Genehmigungen"
                collapsible="false" id="GenBlocksection" >
                <apex:pageBlockTable style="text-align:center;white-space: pre;"
                    value="{!Genehmigungen_prop}" var="AP" id="GenBlockTable">
                    <apex:column headerValue="Kopieren" >
                        <apex:commandButton id="GenKop" action="{!GenKopieren}"
                            rerender="BarForm,RezeptForm,Gesamtpreis" value="Kopieren">
                            <apex:param name="genkop" assignTo="{!applylfdNr}" value="{!AP.lfdNr}" />
                             <apex:param name="testTyp" assignTo="{!applyTyp}" value="Genehmigung" /> 
                        </apex:commandButton>
                    </apex:column>
                    <apex:column headerValue="LZ bearb" >
                        <apex:commandButton id="LZGenBearb" action="{!BarVerkaufAposLaufzettel}"
                            value="LZ bearb">
                            <apex:param name="LZGb" assignTo="{!applylfdNr}" value="{!AP.lfdNr}" />
                            <apex:param name="genT" assignTo="{!applyTyp}" value="Genehmigung" /> 
                        </apex:commandButton>
                    </apex:column>
                    <apex:column headerValue="Positionsart">
                        <apex:outputField value="{!AP.theRecord.Positionsart__c}" />
                    </apex:column>


 

And the following controller code:

 

    public Integer applylfdNr {
        get;
        set{
                applylfdNr = value;
                system.debug('############################ ApplylfdNr ' + applylfdNr);
        }
    }


    public String applyTyp {
        get{
            return applyTyp;
        }
        set{
                applyTyp = value;
                system.debug('############################ ApplyTyp ' + applyTyp);
        }
    }


 

If I now press the second buttom with id LZGenBearb both variables applylfdNr and applyTyp are null in the controller. If I press the first buttom with the id GenKop both variables are set in the controller. If I then again press the second buttom the values of the first buttom are in the controller. What is wrong in my code?

 

Thanks for your help!

 

Harry

HarryHHHarryHH

Hello Chamil,

 

I got an email, with your advice, but I cannot see it here. I tried your code even though I could not find any changes to my code. The result is the same, as with my code. Maybe, you forgot to change my code?  Thanks for your help!

 

Harry