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
mukesh khandve786mukesh khandve786 

hi how to get blank textbox in datatbale?

NagendraNagendra (Salesforce Developers) 
Hi Mukesh,

May I suggest you please try the sample code below which works fine for me. Tweak the code with the data table instead of page block table which should probably do the trick for you.

Apex Controller:
public class MyController {

    Wrapper[] wrappers;

    // return list of wrappers containing the account records
    public Wrapper[] getWrappers(){

        if (wrappers == null)
        {

            wrappers = new Wrapper[]}{};
            Account[] record = [SELECT AccountID__c,Name,(SELECT PerformDate__c FROM AssService__r) FROM  ResService__c];

            for (Account record:records)
            {
                wrappers.add(new Wrapper(record));
            }
        }

        return wrappers;
    }

    // wrap account and service records
    public class Wrapper {

        public Account account {get;set;}
        public AssService__c service {get;set;}

        public Wrapper(Account record){
            this.account = record;
            // use existing service or init a new one
            this.service = record.AssService__r.length() > 0 ? record.AssService__r : new AssService__c()
        }

    }
}
Visualforce Page:
<apex:pageBlockTable value="{!wrappers}" var="wrapper" id="perfservices">
    <apex:column >
       <apex:facet name="header">Field Check</apex:facet>
       <!-- MODIFIED -->
       <apex:inputField value="{!wrapper.service.PerformDate__c}"/>
    </apex:column>
    <!--

    <apex:column >
        <apex:facet name="header">No Of Occurrence</apex:facet>
        <apex:repeat value="{!Service}" var="c">
        <apex:inputField value="{!c.Occurrence__c}" />
        </apex:repeat>
    </apex:column>
    -->
    <apex:column value="{!wrapper.account.Name}"/>
    <apex:column value="{!wrapper.record.AccountID__c}"/> 
</apex:pageBlockTable>

Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra 
 
Deepali KulshresthaDeepali Kulshrestha
Hi Mukesh,
Please try the following code as it may be helpful in solving your problem:

add below code after these div tag
<div class="slds-modal__footer">
        <div class="slds-x-small-buttons--horizontal">
          <button class="slds-button slds-button--neutral">Create Contact</button>
          
        </div>
      </div>

add these
<table>
        <th class= "slds-space">
        <tr>
        </tr>
        </th>       
    </table>

and in css
.THIS .slds-space{
    border: 5px;    
    background: blue;
    height: 10px;
    margin: 5px;       
}

colour which is blue indicates as blank space, you can increase height and colour.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha