Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7533905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:51:50+00:00 2026-05-30T05:51:50+00:00

I have objects of wrapper class in a list and in my Vf page

  • 0

I have objects of wrapper class in a list and in my Vf page i am checking if the object of the wrapper contains null, if it has null then i am displaying ‘Free’ else displaying the appointment details.

I want to have a button create Appointment instead of ‘Free’.

What would the correct way to insert the button code ?

<apex:repeat var="slot" value="{!liTimeSlots}">

<tr class="{!IF(ISNULL(slot.sAppointment), 'Free', 'Fill')}">
    <td ><apex:outputText value="{!slot.tstart1}"/></td>

      <td><apex:outputText value="{!IF(ISNULL(slot.sAppointment), 'Free', slot.sAppointment.name)}"/></td>
      <td><apex:outputText value="{!IF(ISNULL(slot.sAppointment), '', slot.sAppointment.Appointment_Type__c)}"/></td>
      <td><apex:outputText value="{!IF(ISNULL(slot.sAppointment), '', slot.sAppointment.Patient__c)}"/></td>
        </tr> 
    <tr>
    <td></td>

      <td><apex:outputText value="{!IF(ISNULL(slot.sAppointmentOverlap), ' ', slot.sAppointmentOverlap.name)}"/></td>
      <td><apex:outputText value="{!IF(ISNULL(slot.sAppointmentOverlap), '', slot.sAppointmentOverlap.Appointment_Type__c)}"/></td>
      <td><apex:outputText value="{!IF(ISNULL(slot.sAppointmentOverlap), '', slot.sAppointmentOverlap.Patient__c)}"/></td>
        </tr>   

EDIT :
Before i read the answers from mmmix and LaceySnr i implemented with use of css classes. not sure if this is the best way. But now the issue is of the param value not coming up on the controller method.

<apex:repeat var="slot" value="{!liTimeSlots}">

<tr class="{!IF(ISNULL(slot.sAppointment), 'Free', 'Fill')}">
    <td ><apex:outputText value="{!slot.tstart1}"/></td>

      <td><apex:outputText value="{!IF(ISNULL(slot.sAppointment), 'Free', slot.sAppointment.name)}"/></td>
      <td><apex:outputText value="{!IF(ISNULL(slot.sAppointment), '', slot.sAppointment.Appointment_Type__c)}"/></td>
      <td><apex:outputText value="{!IF(ISNULL(slot.sAppointment), '', slot.sAppointment.Patient__c)}"/></td>
      <td><div Class="{!IF(ISNULL(slot.sAppointment), 'ShowButton', 'HideButton')}">
      <apex:commandButton action="{!Book}" Value="Book">
      <apex:param name="Timev" value="{!slot.tstart1}"/></apex:commandButton></div></td>
        </tr> 
    <tr>
    <td></td>

      <td><apex:outputText value="{!IF(ISNULL(slot.sAppointmentOverlap), ' ', slot.sAppointmentOverlap.name)}"/></td>
      <td><apex:outputText value="{!IF(ISNULL(slot.sAppointmentOverlap), '', slot.sAppointmentOverlap.Appointment_Type__c)}"/></td>
      <td><apex:outputText value="{!IF(ISNULL(slot.sAppointmentOverlap), '', slot.sAppointmentOverlap.Patient__c)}"/></td>
        </tr>   

public  PageReference Book()
{
String Timeval=ApexPages.CurrentPage().getParameters().get('Timev');
system.debug('timeval +++++++++++++++'+Timeval) ;// This is returning null
pr=Page.Appointment;
pr.setRedirect(true);
pr.getParameters().put('App_start',Timeval);
pr.getParameters().put('App_start_Date',string.valueof(Appointment.Start_Date__c));

return pr;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:51:52+00:00Added an answer on May 30, 2026 at 5:51 am

    Not sure I understand the thing about the button, but you also have an alternative way of doing !IF, for example:

    <apex:outputText value="{!field}" rendered="{!condition"} />
    

    If for button you are thinking about inserting apex:commands into a repeater and tie event handler to specific row, that can be done through parameters

    for example I used this to crete a comamnd link in every table row:

    <apex:column headerValue="Action">
        <apex:commandLink id="cmdDetachService" action="{!detachService}" value="Detach" rerender="mainBlock, errors" status="ajaxPostStatus" >
            <apex:param value="{!item.id}" name="activeService" />
        </apex:commandLink>
    </apex:column>
    

    Then in the event handler you can extract parameter from page parameters, for example ApexPages.CurrentPage().getParameters().get('activeService')

    Also, if you want to have if/then/else text/button rendering inside a td tag you can use this

    <td>
        <apex:outputText .... rendered="{!condition"} />
        <apex:commandButton .... rendered="{!NOT(condition)"} />
    </td>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got essentially an elaborate wrapper around a list of dictionaries: class Wrapper(object): def
I use Spring MVC 3.0 and JSP. I have an object: public class ObjectWrapper
I have objects that has a DateTime property, how can i query for the
I have method that parses a list of String records into objects and returns
I have a set of model objects and a set of wrapper objects to
I have created a simple repository class that is returning a list of Projects:
We have an object with java.util.Calendar objects. We would like to display the data
I have a strange phenomenon while continuously instantiating a com-wrapper and then letting the
I am designing a wrapper class (a bit similar to std::autoPtr but I have
I have a class as following: public class Wrapper { public Wrapper(); public Class1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.