Skip to main content
sandeep reddy ha preguntado en #Apex
wraper class

=============

public class wrapermap {

    public string name {set;get;}

    public string branch {set;get;}

    

}

second class

===============

public class wrapermap1 {

    public map<string,wrapermap> ma{set;get;}

    public wrapermap det{set;get;}

    public wrapermap1(){

        det=new wrapermap(); 

        wrapermap m =new wrapermap();

      ma=new map<string,wrapermap>();

       }

    public void mod(){

    ma.put(det.branch,det);

    ma.get(det.branch);

        

        

    

    }

}

vf page 

======================

<apex:page controller="wrapermap1" >

    <apex:form >

        <apex:pageBlock >

            name:   <apex:inputText value="{!det.name}"/><br/><br/>

            branch:    <apex:inputText value="{!det.branch}"/><br/><br/>

                    <apex:commandButton value="save" action="{!mod}"/>

        </apex:pageBlock>

        <apex:pageBlock >

        <apex:pageBlockTable value="{!Ma}" var="m" >

            

            <apex:column value="{!ma}" />

           

            </apex:pageBlockTable>

        

        </apex:pageBlock>

    </apex:form>

</apex:page>

this is the when i click save 

display the 

(branch,branch,name)

want to display like here

 
1 respuesta