• timrnichols
  • NEWBIE
  • 0 Points
  • Member since 2008

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

 

Hi, 

 

I have a radio button table in VF and I want to flip it to where it is lined up vertical. 

 

Here is the code: 

 

 

<apex:dataTable value="{!category.questions}" var="question" id="questionList" width="1000px" rowClasses="odd,even" cellPadding="3px;" border="0"> <apex:column > <B><apex:outputText value="{!question.Assessment_Question_Template__r.Question_Text__c}" /></B> </apex:column> <apex:column colspan="4"> <apex:selectRadio style="width: 100%" border="0" id="radioTable" value="{!question.Value__c}" disabled="true"> <apex:selectOption itemValue="1" itemLabel="1" /> <apex:selectOption itemValue="2" itemLabel="2" /> <apex:selectOption itemValue="3" itemLabel="3" /> <apex:selectOption itemValue="4" itemLabel="4" /> <apex:selectOption itemValue="5" itemLabel="5" /> <apex:selectOption itemValue="6" itemLabel="6" /> <apex:selectOption itemValue="7" itemLabel="7" /> </apex:selectRadio> <script> var radioTable = document.getElementById("{!$Component.radioTable}"); var el = radioTable.getElementsByTagName("TD"); el[0].style.width = "175px"; el[0].align = "center"; el[1].style.width = "95px"; el[2].style.width = "95px"; el[3].style.width = "95px"; el[4].style.width = "95px"; el[5].style.width = "95px"; </script> </apex:column>

 

 

Ideallly, it would be <column> radio button <column> < text>  

                             <column> radio button < column> <blank>

                             <column> radio button <column> < text>

                             etc. 

 

 

Might be a silly question, but from what I've read about radio buttons is they can't be stacked like that.. is that true? 

 

Thanks in advance. 

T

 

 

 

 


Has anyone developed a help section to browse solutions using SF Sites?   Can you create a multi-language based solution depending on the URL?  Something like www.foobar.com/help/es, www.foobar/com/en?

 

Thanks

Tim


I'm attempting to build a test class for a connection between two contacts using the contact connector.  The idea is using VF to show the contacts on both sides of the contact for a many to many contact relationship.

Problem is I'm not sure of the process for the test case.   I assume the steps are:

-Create a instance of the object between the two contacts
-Create a contact and "related contact" and populate it
-The test to see if I can see the Contact2 ID from Contact1.  

Works fine in Sandbox but not sure how to write up the test as sometimes Eclipse give me the error "Error in code" but without specifics, but can't get it to pass 75%. 

Any advice would be super helpful.  

Some of this code was taken from the NPSF chat.

Code:
public class Contact_Connection {
 
   private final Contact cont;
    
    // The extension constructor initializes the private member
    // variable acct by using the getRecord method from the standard
    // controller.
    
    public Contact_Connection(ApexPages.StandardController stdController) {
        this.cont = (Contact)stdController.getRecord();
    } 

public String getName(){
       return 'Inbound and Outbound Connections';
 }
      public list <SFDC_Contact_Connector__c> getConnections() {
        
        List <SFDC_Contact_Connector__c> connections;
        
        connections = [select id, name, Contact__r.name,
  Related_Contact__r.name, Relationship__c, Description__c,
  Related_Organization__r.name, Related_Organization_Role__c from
  SFDC_Contact_Connector__c where Contact__c
  = :System.currentPageReference().getParameters().get('id') OR
  Related_Contact__c = :System.currentPageReference().getParameters().get('id')];
  
        return connections;
 
 }

 

Code:
<apex:page standardController="Contact" extensions="Contact_Connection">
 <apex:pageBlock title="This contact has made the following connections" helpTitle="" helpUrl="">
  <apex:pageBlockTable value="{!connections}" var="connection"
    id="cList" width="100%">
   <apex:column >
     <apex:facet name="header">Contact</apex:facet>
     <apex:outputLink value="/{!if(LEFT(connection.Contact__c,15) ==
            $CurrentPage.parameters.id,
            if(not(isnull(connection.Related_Contact__c)),
            connection.Related_Contact__c, connection.Related_Organization__c),
            connection.Contact__c)}">{!if(LEFT(connection.Contact__c,15)==
            $CurrentPage.parameters.id,
            if(not(isnull(connection.Related_Contact__c)),
            connection.Related_Contact__r.name,
            connection.Related_Organization__r.name),
            connection.Contact__r.name)}
    </apex:outputLink>
  </apex:pageBlockTable>
 </apex:pageBlock>
</apex:page>

 





Message Edited by timrnichols on 09-26-2008 03:30 PM

 

Hi, 

 

I have a radio button table in VF and I want to flip it to where it is lined up vertical. 

 

Here is the code: 

 

 

<apex:dataTable value="{!category.questions}" var="question" id="questionList" width="1000px" rowClasses="odd,even" cellPadding="3px;" border="0"> <apex:column > <B><apex:outputText value="{!question.Assessment_Question_Template__r.Question_Text__c}" /></B> </apex:column> <apex:column colspan="4"> <apex:selectRadio style="width: 100%" border="0" id="radioTable" value="{!question.Value__c}" disabled="true"> <apex:selectOption itemValue="1" itemLabel="1" /> <apex:selectOption itemValue="2" itemLabel="2" /> <apex:selectOption itemValue="3" itemLabel="3" /> <apex:selectOption itemValue="4" itemLabel="4" /> <apex:selectOption itemValue="5" itemLabel="5" /> <apex:selectOption itemValue="6" itemLabel="6" /> <apex:selectOption itemValue="7" itemLabel="7" /> </apex:selectRadio> <script> var radioTable = document.getElementById("{!$Component.radioTable}"); var el = radioTable.getElementsByTagName("TD"); el[0].style.width = "175px"; el[0].align = "center"; el[1].style.width = "95px"; el[2].style.width = "95px"; el[3].style.width = "95px"; el[4].style.width = "95px"; el[5].style.width = "95px"; </script> </apex:column>

 

 

Ideallly, it would be <column> radio button <column> < text>  

                             <column> radio button < column> <blank>

                             <column> radio button <column> < text>

                             etc. 

 

 

Might be a silly question, but from what I've read about radio buttons is they can't be stacked like that.. is that true? 

 

Thanks in advance. 

T