• Hussain
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies

Hi,

 

I want to change the row of color in a pageblock data table.

<apex:page standardcontroller="account">

<apex:form id="form1">
       <apex:sectionHeader title="Interviwe Five"/>
        <apex:pageBlock >
          <apex:pageMessages escape="false"></apex:pageMessages>
            <apex:pageBlockTable value="{!acc}" var="a" >
            <apex:column headerValue="Name" id="col1">
                <apex:commandLink action="{!selectedaccount}" reRender="form1"  id="cmdlink" onclick="ChangeColor(this)">
                    {!a.name}
                    <apex:param value="{!a.name}" name="name"  assignTo="{!name}"/>
                </apex:commandlink>
            </apex:column>
            <apex:column value="{!a.BillingState}" id="col2" />
            <apex:column value="{!a.phone}" id="col3" />

</apex:form>

<apex:page >

 

This is the code to change color but it's not working.

Null value is passed as id, when i checked with alert function.

<script>
        function ChangeColor(clr)
        {   alert(document.getElementById(clr)); 
            var ctrl = document.getElementById(clr); 
            ctrl.style.color = 'red';
           
        }
    </script>

 Any help will be appreciated.

hi

i have a controller like

 

public with sharing class assignment5
{
    public string name{get;set;}
    public assignment5(ApexPages.StandardSetController controller)
     {

      }
    
    public void selected_name()
    {
             //name.fontstyle='bold';      
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.info, 'you selected  '+name);
            Apexpages.addMessage(mymsg);
    }
}

 

page:-

<apex:page standardController="account" recordSetVar="acc" >
    
    <apex:form id="f1">
       <apex:sectionHeader title="Assighment 5"/>
        <apex:pageBlock >
          <apex:pageMessages ></apex:pageMessages>
            <apex:pageBlockTable value="{!acc}" var="a" >
            <apex:column headerValue="Name" id="col1">
                <apex:commandLink action="{!selected_name}" reRender="f1" >
                    {!a.name}
                    <apex:param value="{!a.name}" name="n"  assignTo="{!name}"/>
                </apex:commandlink>
            </apex:column>
            <apex:column value="{!a.BillingState}" id="col2" />
            <apex:column value="{!a.phone}" id="col3" />
            <apex:column value="{!a.website}" id="col4"/>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

in vf page the font style of   "name" should be in bold.

ex: you selected  xxxxx

Dears

 

Please could you help me to parse a XML code that contain the latitude and longitude of address? Below the XML code I try with the manual but I has for soap and the another example is too simple to parse this complicated XML of google.

 

I want to take the value of latitude and longitude.

 

Thanks in advances

 

<GeocodeResponse> 
 
<status>OK</status>
 
<result>
 
<type>street_address</type>
 
<formatted_address>1600 Amphi Pkwy, Mountain, CA 94043, USA</formatted_address>
 
<address_component>
   
<long_name>1600</long_name>
   
<short_name>1600</short_name>
   
<type>street_number</type>
 
</address_component>
 
<address_component>
   
<long_name>Amphitheatre Pkwy</long_name>
   
<short_name>Amphitheatre Pkwy</short_name>
   
<type>route</type>
 
</address_component>
 
<address_component>
   
<long_name>Mountain View</long_name>
   
<short_name>Mountain View</short_name>
   
<type>locality</type>
   
<type>political</type>
 
</address_component>
 
<address_component>
   
<long_name>San Jose</long_name>
   
<short_name>San Jose</short_name>
   
<type>administrative_area_level_3</type>
   
<type>political</type>
 
</address_component>
 
<address_component>
   
<long_name>Santa Clara</long_name>
   
<short_name>Santa Clara</short_name>
   
<type>administrative_area_level_2</type>
   
<type>political</type>
 
</address_component>
 
<address_component>
   
<long_name>California</long_name>
   
<short_name>CA</short_name>
   
<type>administrative_area_level_1</type>
   
<type>political</type>
 
</address_component>
 
<address_component>
   
<long_name>United States</long_name>
   
<short_name>US</short_name>
   
<type>country</type>
   
<type>political</type>
 
</address_component>
 
<address_component>
   
<long_name>94043</long_name>
   
<short_name>94043</short_name>
   
<type>postal_code</type>
 
</address_component>
 
<geometry>
   
<location>
   
<lat>37.4217550</lat>
   
<lng>-122.0846330</lng>
   
</location>
   
<location_type>ROOFTOP</location_type>
   
<viewport>
   
<southwest>
     
<lat>37.4188514</lat>
     
<lng>-122.0874526</lng>
   
</southwest>
   
<northeast>
     
<lat>37.4251466</lat>
     
<lng>-122.0811574</lng>
   
</northeast>
   
</viewport>
 
</geometry>
 
</result>
</GeocodeResponse>
  • April 27, 2010
  • Like
  • 0