• Rajgottipolu
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

hello...

 

I wanted to create a page block table with checkboxes that'll let the user select one checkbox at a time (more like a radio button). I used wrapper classes for that. Everything seems to work fine but occasionally when i select an option...nothing happens. 

 

 

Here is the vf page im using:

 

 

<apex:pageBlock Title="SELECT THE CONTACT ASSOCIATED TO THE CURRENT ACCOUNT"
            rendered="{!contactdisplay}" id="pageBlock">
                       
            <apex:outputLabel >Please click on 'Last Name' to sort</apex:outputLabel>
            <apex:pageBlockSection rendered="{!location}">

<apex:outputLabel ><p style="font-family:verdana;color:red;">
             Error: Please select atleast one option.
             </p>
         </apex:outputLabel>            </apex:pageBlockSection>
            <apex:pageBlockSection columns="1" collapsible="false">
                <apex:pageBlockTable value="{!contactlocations}" var="cl">
                    <apex:column >
                        <apex:facet name="header">
                        </apex:facet>
                        <apex:inputCheckbox value="{!cl.selected}" id="checkedone">
                            <apex:actionSupport event="onchange" action="{!GetSelected2}"
                                onsubmit="deselectOther2(this)" rerender="Selected_PBS" />
                        </apex:inputCheckbox>
                    </apex:column>
                    <apex:column value="{!cl.cin.FirstName}" />
                    <apex:column >
                        <apex:facet name="header">
                            <apex:commandLink action="{!ViewData}" reRender="pageBlock"
                                value="Last Name{!IF(sortExpression=='lastname',IF(sortDirection='ASC','▼','▲'),'')}"
                                id="cmdSort" status="sorting">
                                <apex:param value="lastname" name="column"
                                    assignTo="{!sortExpression}" />
                            </apex:commandLink>
                            
                        </apex:facet>
                        <apex:outputLink value="/{!cl.cin.LastName}" target="_blank" />{!cl.cin.LastName}
</apex:column>
                    <apex:column value="{!cl.cin.Phone}" />
                    <apex:column value="{!cl.cin.Email}" />
                    <apex:column value="{!cl.cin.Title}" />
                    <apex:column value="{!cl.cin.MailingCity}" />
                    <apex:column value="{!cl.cin.MailingState}" />
                    <apex:column value="{!cl.cin.AccountId}" />
                </apex:pageBlockTable>
            </apex:pageBlockSection>
            <apex:pageblockButtons >
            <apex:commandButton action="{!foundContact}"  value="NEXT"/>
           <apex:commandButton action="{!notFound1}" value="NOT FOUND"/>
           </apex:pageblockButtons></apex:pageblock>
 }
 
function deselectOther2(chkBox2) {
            if (chkBox2.checked) {
                if ((chkBox2 != selectedChkbox2) && (selectedChkbox2 != null)) {
                    selectedChkbox2.checked = false;
                }
                selectedChkbox2 = chkBox2;
            }             

hello...

 

I wanted to create a page block table with checkboxes that'll let the user select one checkbox at a time (more like a radio button). I used wrapper classes for that. Everything seems to work fine but occasionally when i select an option...nothing happens. 

 

 

Here is the vf page im using:

 

 

<apex:pageBlock Title="SELECT THE CONTACT ASSOCIATED TO THE CURRENT ACCOUNT"
            rendered="{!contactdisplay}" id="pageBlock">
                       
            <apex:outputLabel >Please click on 'Last Name' to sort</apex:outputLabel>
            <apex:pageBlockSection rendered="{!location}">

<apex:outputLabel ><p style="font-family:verdana;color:red;">
             Error: Please select atleast one option.
             </p>
         </apex:outputLabel>            </apex:pageBlockSection>
            <apex:pageBlockSection columns="1" collapsible="false">
                <apex:pageBlockTable value="{!contactlocations}" var="cl">
                    <apex:column >
                        <apex:facet name="header">
                        </apex:facet>
                        <apex:inputCheckbox value="{!cl.selected}" id="checkedone">
                            <apex:actionSupport event="onchange" action="{!GetSelected2}"
                                onsubmit="deselectOther2(this)" rerender="Selected_PBS" />
                        </apex:inputCheckbox>
                    </apex:column>
                    <apex:column value="{!cl.cin.FirstName}" />
                    <apex:column >
                        <apex:facet name="header">
                            <apex:commandLink action="{!ViewData}" reRender="pageBlock"
                                value="Last Name{!IF(sortExpression=='lastname',IF(sortDirection='ASC','▼','▲'),'')}"
                                id="cmdSort" status="sorting">
                                <apex:param value="lastname" name="column"
                                    assignTo="{!sortExpression}" />
                            </apex:commandLink>
                            
                        </apex:facet>
                        <apex:outputLink value="/{!cl.cin.LastName}" target="_blank" />{!cl.cin.LastName}
</apex:column>
                    <apex:column value="{!cl.cin.Phone}" />
                    <apex:column value="{!cl.cin.Email}" />
                    <apex:column value="{!cl.cin.Title}" />
                    <apex:column value="{!cl.cin.MailingCity}" />
                    <apex:column value="{!cl.cin.MailingState}" />
                    <apex:column value="{!cl.cin.AccountId}" />
                </apex:pageBlockTable>
            </apex:pageBlockSection>
            <apex:pageblockButtons >
            <apex:commandButton action="{!foundContact}"  value="NEXT"/>
           <apex:commandButton action="{!notFound1}" value="NOT FOUND"/>
           </apex:pageblockButtons></apex:pageblock>
 }
 
function deselectOther2(chkBox2) {
            if (chkBox2.checked) {
                if ((chkBox2 != selectedChkbox2) && (selectedChkbox2 != null)) {
                    selectedChkbox2.checked = false;
                }
                selectedChkbox2 = chkBox2;
            }             

Hello...

 

Im having one problem trying to convert values to show on my visualforce page:

 

How can i convert the following number to have to decimal places...

 

Sometimes i ll have a number like. 42.0 other time i ll have a number like 37.3333333333333

 

Im trying to solve it using what i found here. but the problem is always the same.

 

Tks for everything

I m trying to create a picklist in my visual force page using select list component...
 
this is my apex code:
 but its give me error: "Constructor not defined: [System.SelectOption].<Constructor>(Id, Double) at line 17 column 29"
what could be the reason??
Apex Code:
public String selectedContact {get;set;}
     
    public List<SelectOption> cardList;
   
    public List<SelectOption> getGiftCard ()
    {
        POS__c posclt = [select Client__c from POS__c where id = :ApexPages.currentPage().getParameters().get('TId')];
        if (contactList == null)
        {
         GiftCertificate__c[] gcard = [select Id,Name,GiftCardNo__c,Remaining__c,ExpiresOn__c
                        from GiftCertificate__c where Purchasedfor__c =: posclt.Client__c and ExpiresOn__c >=:System.today() and Remaining__c>0];           
         cardList = new List<SelectOption>();
         for(GiftCertificate__c gc : gcard)
         {
            cardList.add(new SelectOption(gc.id, gc.GiftCardNo__c));
         }
        }
        return cardList;
    }

 
 
Part of this is me struggling with the syntax and the other part is me not knowing what system method to use. A decimal method, math method?

Code:
Decimal parentlistPrice = 9995.00
Decimal svcPercent = .17
Decimal discount = .88
//oli.quantity = 2.0
        
oli.TotalPrice = ((parentListPrice * svcPercent) * discount) * oli.Quantity;

oli.TotalPrice  will equal 2990.504 but I would like to round this to only two decimal places so the value is 2990.50
 

  • September 05, 2008
  • Like
  • 0