• kgoderis
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Hello

 

as part of a VF page I have the following javascript defined:

      <apex:actionFunction name="buildURL" action="{!generateURL}" rerender="outlink,schedbutton">
          <apex:param name="sessionID" assignTo="{!sessionID}" value="" />
          <apex:param name="Partner_Server_URL_150" assignTo="{!ServerURL}" value="" />
      </apex:actionFunction>

whereby the buildURL is called, in Apex, each time a user selects an Account from a list. All it does is compile an URL and rerender some  VF blocks. When the user clicks a button or link, he gets redirected to a server which unfortunately does not accept UTF-8 encoded URLs. I prefer buttons, but here is what I have defined on the page:

 

Elsewhere I have defined a OutputLink as follows:

 

   <apex:pageblock title="test" id="outlink">
      <apex:outputLink value="{!generatedURL}" target="_self" id="outurl">
        link is {!generatedURL}
    </apex:outputLink> 
   </apex:pageblock>

I also have a button defined as follows:

 

  <apex:pageBlockButtons >
        <apex:commandButton onclick="redirectToScheduler()" value="Schedule Calls" id="schedbutton" />  
   </apex:pageBlockButtons>
   
    <script type="text/javascript">
   function redirectToScheduler() {
   
    window.location.href=document.getElementById("outlink").value;
   }
   </script>

 

Problems:

 - the URL works perfectly fine, except for the fact that the redirect does not happen in the "right-hand" frame in SF

 - the button: does not work at all, but I am not a JavaScript expert either, but I think that the javascript is not picking up the ajax-modified value of the URL, but is rather taking the standard value as defined by the initial load of the page. Is there a way to read out value on a html page that were modified through Ajax?

 

any help is very much appreciated

 

Karel

 

 

 

 

 

This one puzzles me. 

 

As part of a callback from a button on an VF Page, I need to redirect to  a SF Partner server, but that server does not take UTF-8 encoded url's. I want the plain vanilla unescaped variant, e.g. a / stays a / etc

 

In the Apex Code of the controller I use a PageReference with is populated with getParameters, but each time all my URL parameters get UTF-8 encoded, which I do not want. Is there a way to redirect to this new url without going through the mandatory UTF-8 encoding? (even the PageReference constructor is urlencoding, so that does not work either)

 

a. in Apex code, using another mechanism than returning a PageReference reference?

b. in Javascript in the VF page itself, by passing back the url as a string to the (re)rendered VF page, and then doing the url redirect from within javascript?  (e.g. I would "build" the url in Apex as I need to iterate through some checkbox-selected items)

 

If Jeff Douglas is reading his : my code is base on your 

http://blog.jeffdouglas.com/2009/01/13/apex-search-with-checkbox-results/ and 

http://blog.jeffdouglas.com/2010/07/13/building-a-dynamic-search-page-in-visualforce/

examples.

 

Tx

Karel

 

Hello

 

as part of a VF page I have the following javascript defined:

      <apex:actionFunction name="buildURL" action="{!generateURL}" rerender="outlink,schedbutton">
          <apex:param name="sessionID" assignTo="{!sessionID}" value="" />
          <apex:param name="Partner_Server_URL_150" assignTo="{!ServerURL}" value="" />
      </apex:actionFunction>

whereby the buildURL is called, in Apex, each time a user selects an Account from a list. All it does is compile an URL and rerender some  VF blocks. When the user clicks a button or link, he gets redirected to a server which unfortunately does not accept UTF-8 encoded URLs. I prefer buttons, but here is what I have defined on the page:

 

Elsewhere I have defined a OutputLink as follows:

 

   <apex:pageblock title="test" id="outlink">
      <apex:outputLink value="{!generatedURL}" target="_self" id="outurl">
        link is {!generatedURL}
    </apex:outputLink> 
   </apex:pageblock>

I also have a button defined as follows:

 

  <apex:pageBlockButtons >
        <apex:commandButton onclick="redirectToScheduler()" value="Schedule Calls" id="schedbutton" />  
   </apex:pageBlockButtons>
   
    <script type="text/javascript">
   function redirectToScheduler() {
   
    window.location.href=document.getElementById("outlink").value;
   }
   </script>

 

Problems:

 - the URL works perfectly fine, except for the fact that the redirect does not happen in the "right-hand" frame in SF

 - the button: does not work at all, but I am not a JavaScript expert either, but I think that the javascript is not picking up the ajax-modified value of the URL, but is rather taking the standard value as defined by the initial load of the page. Is there a way to read out value on a html page that were modified through Ajax?

 

any help is very much appreciated

 

Karel