• levon levon
  • NEWBIE
  • 25 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hell Helpers

I have a visual force page where i dispay an apex:inputfield component referencing a picklist member of a custom object

At a certain point I want to make this inputfield disabled

looking into the specification the component has no disabled attribute (like the custombutton for ex)

what option I have?

css style maybe?
i am not familiar with this so any example is appreciated


thanks in advance
csbaa
  • June 07, 2014
  • Like
  • 0
Hi, I am creating a simple multiplication table in which I should be selecting numbers from dropdowns which would be a range to generate a multiplication table. 
Below is the code I have developed so far. but I am unable to put this multiplicaiton table into proper format. Anyone can please help me.

<apex:page controller="tables">
    <apex:form id="frmId">
        <apex:sectionHeader title="tables"/>
            <apex:pageblock id="pgBlck">
                <apex:pageblockSection columns="2">
                    <apex:outputPanel >
                          <apex:commandButton value="Generate Table" action="{!generateTable}" />
                            <apex:commandButton value="Clear Table" action="{!clearTable}"/>  
                    </apex:outputPanel>
                    <br/>
                 
                    <apex:pageblocksectionitem >
                        <apex:outputPanel >
                            <apex:outputLabel value="Select Table Starting Number"> </apex:outputLabel>
                                <apex:selectList value="{!selectedNumberOne}" size="1">
                                    <apex:selectOptions value="{!TableNumberList}" />
                            </apex:selectList>               
                        </apex:outputPanel>              
                    </apex:pageblocksectionitem>
                   <apex:pageblocksectionitem >
                        <apex:outputPanel >
                            <apex:outputLabel value="Select Table Starting Number"> </apex:outputLabel>
                                <apex:selectList value="{!selectedNumberTwo}" size="1">
                                    <apex:selectOptions value="{!TableNumberList2}" />
                            </apex:selectList>               
                        </apex:outputPanel>              
                    </apex:pageblocksectionitem>
                  
                 
                </apex:pageblockSection>
            </apex:pageblock>
              <apex:repeat value="{!lstInt}" var="t">
              <table>
               <tr>
                   <td>
                       <apex:outputtext value="{!t}"/>
                  </td>
                </tr>
                </table>
           </apex:repeat>
     </apex:form>
</apex:page>


public with sharing class tables {
   
    public  List<Integer> lstInt {get;set;}
    public List<List<Integer>> LstIntTbl;
    public map<Integer,List<Integer>> mapIntToTableList{get;set;}
    public  List<Integer> lstOfIInt {get;set;}
   
    public PageReference generateTable() {
        mapIntToTableList = new map <Integer,List<Integer>> () ;
        lstOfIInt= new List<Integer> ();
         lstInt = new List<Integer> ();
        for(Integer i=selectedNumberOne; i<= selectedNumberTwo;i++) {
             for(Integer j=1; j<selectedNumberTwo;j++  ) {
                system.debug('j--'+j);
                Integer Sum = j*i;
                system.debug('Sum --'+Sum );
                lstInt.add(sum); 
                lstOfIInt.add(i);
                system.debug('lstOfIInt--'+lstOfIInt);
                if(!mapIntToTableList.ContainsKey(i)){
                      mapIntToTableList.put(i,lstInt);
                }
               
                system.debug('mapIntToTableList--'+mapIntToTableList);
            }
             
       }
        return null;
    }

   
    public integer selectedNumberOne{get;set;}
    public integer selectedNumberTwo{get;set;}
    //public list<SelectOption> selectOptions {get;set;}
   
   
    public list<SelectOption> getTableNumberList() {
        List<SelectOption> TableNumberList = new List<SelectOption>();
     
        for(Integer i=1; i<=10; i++){
            TableNumberList.add(new SelectOption(String.ValueOf(i),String.ValueOf(i)));
        }
        return TableNumberList;
    }
   
    public void clearTable(){
       lstInt.clear();
    }
   
       public list<SelectOption> getTableNumberList2() {
        List<SelectOption> TableNumberList2 = new List<SelectOption>();
     
        for(Integer i=11; i<20; i++){
            TableNumberList2.add(new SelectOption(String.ValueOf(i),String.ValueOf(i)));
        }
        return TableNumberList2;
    }
}


Thanks in advance,

Levon Levon

Hell Helpers

I have a visual force page where i dispay an apex:inputfield component referencing a picklist member of a custom object

At a certain point I want to make this inputfield disabled

looking into the specification the component has no disabled attribute (like the custombutton for ex)

what option I have?

css style maybe?
i am not familiar with this so any example is appreciated


thanks in advance
csbaa
  • June 07, 2014
  • Like
  • 0