• forcewithu
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 8
    Replies
I’m having a problem getting my Visualforce radio buttons to work as designed in a wizard.
 
The original design was to have a table with multiple rows where the first column was a radio button and the subsequent columns were various fields associated with a particular contact.  The idea was that someone could use the information displayed on each row to select a contact for use on subsequent pages.  I discovered that it wasn’t really possible to split up the radio buttons for use on different table rows using Visualforce.
 
So, I went to a backup plan to display a group of radio buttons along with the name of the associated contact.  Below the group of buttons is a table to display the other information for the selected contact.  The desired behavior is to have the contact’s information automatically display when selecting the radio button.  I can get it to display when using a Select button (CommandButton), but I can’t seem to get the radio buttons to fire an event that I can use to re-render the table.
 
I’ve gone through multiple designs and am currently attempting a hybrid of one suggested by an instructor after the original one didn’t work.  Because selectRadio doesn’t have a rerender attribute, he suggested that I use actionSupport to add that functionality.
 
Here’s the Visualforce code for the radio buttons as it currently stands:
 
Code:
<apex:pageBlockSection title="Select Contact">
     <apex:selectRadio id="Contact_Selection" value="{!ContactAssignment}" layout="pageDirection" onchange="{!ContactInfo}" immediate="true" required="true">
          <apex:selectOptions value="{!ContactList}">
          <apex:actionSupport event="onchange" action="{!getContactInfo}" reRender=”out" status="status" immediate="true"/>
          </apex:selectOptions>
     </apex:selectRadio>
     <p/>
     <apex:commandButton value="Select" action="{!getContactInfo}" rerender="out" status="status"/>
</apex:pageBlockSection>

 
The code shown includes the Select commandButton that works well.  But I’ve tried every event I could think of in both the actionSupport and selectRadio tags: onChange, onClick, onSelect, you name it.  None of them will fire the getContactInfo action to rerender the page.  If you select a radio button and do NOT click on the Select button, it still captures the information for further processing.  I just can’t get it to rerender the outpanel so the user can see the additional contact information.
 
All I need to do is find a way to get the selection of a radio button to execute getContactInfo the way the Select button does.
In my custom controller for a Visualforce page, I'm dynamically building a URL to an external vendor site that looks something like this in my sandbox:
 
Code:
externalURL + '—id=' + objectId + '&sessionid=' + mySessionId + '&url=https://tapp0-api.salesforce.com/services/Soap/class/my_Web_Service'

 
For this, the externalURL is something like https://thevendor.urlhere.com.  Of course, objectId is my Salesforce object and mySessionId is my Salesforce session so the vendor can connect to my webservice.
Once I build the URL, I want to open it in a new window (like target="_blank" for a hyperlink), leaving the original Visualforce page open in the Salesforce window.
 
I have the basic functionality working using a Redirect, but I've been unable to determine how to open it in a new window instead of overlaying the page in the existing one.
 
I've only been developing in Salesforce for a few weeks, but in all my searching around the site I cannot find a definitive list of all the methods available for the various Globals.  I can find discussions or examples for certain pieces, like UserInfo.getSessionId(), or System.currentPageReference().getURL(), but I can't find a reference that tells me everythign available for UserInfo or currentPageReference.
 
Can anyone point me to such a reference?

Here is an odd one.  We've created a new Note object, with Notes & Attachments as a Related list.  We created the new Note object in order to have some custom fields, and still have attachments.

 

We've created a VF page for the upload, and everything works properly on some machines using IE9 and for all (?) machines using Firefox.

 

Pretty standard stuff.  Here is the pertinent VF code:

 

<apex:inputfile value="{!myfile.body}" fileName="{!myfile.Name}" />

 

It saves the attachment in the N&A related list on the new Note object, and sets the Name to the filename.  Everything works great, and as intended.

 

However, on certain machines using IE9, the filename is set to the full path+filename (minus any slashes) when the file is saved.  This seems to have happened recently (last few weeks) for some machines, but no settings were changed in IE9 during that time that we know of.

 

Example:

 

File located at C:\Users\UserName\Desktop\file.doc on the user's machine

 

So, on the machines where it is working correctly, the file is is uploaded and is saved with a fileName of "file.doc."

 

However, on the machines where it is NOT working correctly, the file is uploaded and is saved with a fileName of "C:UsersUserNameDesktopfile.doc".

 

We've tried clearing cache and cookies in IE on those machines.  Those same machines will create the file with the proper title (file.doc) when using Firefox.  We figure it must be a setting or cache in IE on certain machines that is causing the problem.

 

Any ideas?

 

Thanks in advance.

  • December 11, 2012
  • Like
  • 0
I’m having a problem getting my Visualforce radio buttons to work as designed in a wizard.
 
The original design was to have a table with multiple rows where the first column was a radio button and the subsequent columns were various fields associated with a particular contact.  The idea was that someone could use the information displayed on each row to select a contact for use on subsequent pages.  I discovered that it wasn’t really possible to split up the radio buttons for use on different table rows using Visualforce.
 
So, I went to a backup plan to display a group of radio buttons along with the name of the associated contact.  Below the group of buttons is a table to display the other information for the selected contact.  The desired behavior is to have the contact’s information automatically display when selecting the radio button.  I can get it to display when using a Select button (CommandButton), but I can’t seem to get the radio buttons to fire an event that I can use to re-render the table.
 
I’ve gone through multiple designs and am currently attempting a hybrid of one suggested by an instructor after the original one didn’t work.  Because selectRadio doesn’t have a rerender attribute, he suggested that I use actionSupport to add that functionality.
 
Here’s the Visualforce code for the radio buttons as it currently stands:
 
Code:
<apex:pageBlockSection title="Select Contact">
     <apex:selectRadio id="Contact_Selection" value="{!ContactAssignment}" layout="pageDirection" onchange="{!ContactInfo}" immediate="true" required="true">
          <apex:selectOptions value="{!ContactList}">
          <apex:actionSupport event="onchange" action="{!getContactInfo}" reRender=”out" status="status" immediate="true"/>
          </apex:selectOptions>
     </apex:selectRadio>
     <p/>
     <apex:commandButton value="Select" action="{!getContactInfo}" rerender="out" status="status"/>
</apex:pageBlockSection>

 
The code shown includes the Select commandButton that works well.  But I’ve tried every event I could think of in both the actionSupport and selectRadio tags: onChange, onClick, onSelect, you name it.  None of them will fire the getContactInfo action to rerender the page.  If you select a radio button and do NOT click on the Select button, it still captures the information for further processing.  I just can’t get it to rerender the outpanel so the user can see the additional contact information.
 
All I need to do is find a way to get the selection of a radio button to execute getContactInfo the way the Select button does.
In my custom controller for a Visualforce page, I'm dynamically building a URL to an external vendor site that looks something like this in my sandbox:
 
Code:
externalURL + '—id=' + objectId + '&sessionid=' + mySessionId + '&url=https://tapp0-api.salesforce.com/services/Soap/class/my_Web_Service'

 
For this, the externalURL is something like https://thevendor.urlhere.com.  Of course, objectId is my Salesforce object and mySessionId is my Salesforce session so the vendor can connect to my webservice.
Once I build the URL, I want to open it in a new window (like target="_blank" for a hyperlink), leaving the original Visualforce page open in the Salesforce window.
 
I have the basic functionality working using a Redirect, but I've been unable to determine how to open it in a new window instead of overlaying the page in the existing one.
 
I've only been developing in Salesforce for a few weeks, but in all my searching around the site I cannot find a definitive list of all the methods available for the various Globals.  I can find discussions or examples for certain pieces, like UserInfo.getSessionId(), or System.currentPageReference().getURL(), but I can't find a reference that tells me everythign available for UserInfo or currentPageReference.
 
Can anyone point me to such a reference?