• uxtx_tim
  • NEWBIE
  • 25 Points
  • Member since 2010

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

hello everyone

i have noticed strange behavior using media queries in visualforce pages.  to demonstrate i have created a page with some simple structural markup.  the expected behavior would be to stack two inline  divs with the .panel class when the viewport is sized between 320 and 400 px by setting their width to from 45% to  99%.

 

this is exactly what happens when you take the markup and put in in a 'real' html page.  but within a visualforce page, the width never gets set.  the strange thing is that it seems to be only this query that is failing; the other media queries for sizes over 400px work!

See code below:

 

here's the markup for the vf page:

<apex:page controller="Lists"  standardStylesheets="false" showHeader="false"  sidebar="false">
  
	<style>
	  	#view {
	  		overflow: auto;
		  	border: 4px solid black;
		  	margin-left: auto;
		  	margin-right: auto;
			width: 768px;
	  	}
	  	.panel, .section, .article{
	  			display:inline;
				float: left;
				position: relative;
				margin-left: 1%;
				margin-right: 1%;
		}
	/* testing borders */	
	  	#view .panel {
	  		border: 3px solid blue;
	  		width: 45%;
	  	}
	  	#view .section {
	  		border: 2px solid gray;
	  		width: 99%;
	  	}
	  	#view .article {
	  		border: 1px solid black;
	  		width: 99%;
	  	}
	/* media queries */	
		@media all and (max-width: 400px) and (min-width: 320px) {
			#view {
				width: 320px;
			}	
			#view .panel {
				width: 99%;
			}
		}
		@media all and (max-width: 640px) and (min-width: 401px) {
			#view {
				width: 400px;
			}	
		}
		@media all and (max-width: 799px) and (min-width: 641px) {
			#view {
				width: 768px;
			}	
		}
		@media all and (max-width: 959px) and (min-width: 800px) {
			#view {
				width: 800px;
			}	
		}
		@media all and (max-width: 1023px)and (min-width: 960px) {
			#view {
				width: 960px;
			}	
		}	
  		@media all and (max-width: 1299px) and (min-width: 1024px) {
			#view {
				width: 1024px;
			}
		}
		@media all and (min-width: 1300px) {
			#view {
				width: 1280px;
			}		
		}
  	</style>
  	
  	
<div id="view">
	<p>test view</p>
	<div class="panel">
		<p>test panel</p>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
	</div>
	<div class="panel">
		<p>test panel</p>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
	</div>
</div>

</apex:page>

 

and here's the exact same markup taken out of the visualforce context:

<doctype html>
<head>
<style>
	  	#view {
	  		overflow: auto;
		  	border: 4px solid black;
		  	margin-left: auto;
		  	margin-right: auto;
			width: 768px;
	  	}
	  	.panel, .section, .article{
	  			display:inline;
				float: left;
				position: relative;
				margin-left: 1%;
				margin-right: 1%;
		}
	/* testing borders */	
	  	#view .panel {
	  		border: 3px solid blue;
	  		width: 45%;
	  	}
	  	#view .section {
	  		border: 2px solid gray;
	  		width: 99%;
	  	}
	  	#view .article {
	  		border: 1px solid black;
	  		width: 99%;
	  	}
	/* media queries */	
		@media all and (max-width: 400px) and (min-width: 320px) {
			#view {
				width: 320px;
			}	
			#view .panel {
				width: 99%;
			}
		}
		@media all and (max-width: 640px) and (min-width: 401px) {
			#view {
				width: 400px;
			}	
		}
		@media all and (max-width: 799px) and (min-width: 641px) {
			#view {
				width: 768px;
			}	
		}
		@media all and (max-width: 959px) and (min-width: 800px) {
			#view {
				width: 800px;
			}	
		}
		@media all and (max-width: 1023px)and (min-width: 960px) {
			#view {
				width: 960px;
			}	
		}	
  		@media all and (max-width: 1299px) and (min-width: 1024px) {
			#view {
				width: 1024px;
			}
		}
		@media all and (min-width: 1300px) {
			#view {
				width: 1280px;
			}		
		}
  	</style>
  	
  	<script>
  	$j=jQuery.noConflict();
  	$j(function(){
  		console.log("dom loaded");
  		
  	});  	
  	</script>
</head>
<body>
<div id="view">
	<p>test view</p>
	<div class="panel">
		<p>test panel</p>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
	</div>
	<div class="panel">
		<p>test panel</p>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
	</div>
</div>

</body>
</html>

 

 

i suspect it has to do with the the way the server is generating the html from the vf code but I dont know what it might be.  there are gaps in my knowledge of visual force and of using media queries. 

 

thanks in advance for  any help in understanding what is going on here.

I am attempting to add items to a list and update the page to show the items in the list.  To start off with the list is empty.  The idea is to enter text into the inputText box and it gets added to the list, the command button refreshes the apex:repeat element and displays what was just entered.  Instead, when I click the action button, I get a system null pointer exception error - attempt to de-reference a null object.

 

Heres the visualforce

 

 

                <apex:repeat id="List" value="{!testStringList}" var="str">
                   <apex:outputText >{!str}</apex:outputText>
                </apex:repeat>
                    <apex:pageBlock id="NewListItem">                                           
                            <apex:inputText value="{!testString}"/>
                    </apex:pageBlock>
                
               <apex:commandButton action="{!addToTestStringList}" styleClass="formButton" value="+ Add Year" rerender="List"/> 

 

 

 

Here is the apex controller:

 

  public List<String> testStringList {get;set;}
    
  public String testString {get; set;}
       
  public PageReference addToTestStringList(){   
      testStringList.add(testString);   
      return null;
    }

 

Furthermore, how can I initialize my list with one empty string?

I'm trying to combine jquery's ajax settings object with the force.com ajax toolkit in order to create an ajax enabled tree hierarchy.

 

My thought was that by specifying a synchronous soql query within the settings object, i could use jquery's success setting for my callback instead of the toolkit's onSuccess.  Looking at my js console, it looks like the query is running and im getting a response with the contents of my query back.  However, right after I get a response I run into a javascript error in connection.js saying writer is undefined.

 

What is writer looking for?

 

 

jQuery.ajax({
             "type" : "POST",
             "data" : sforce.connection.query(
                     "Select Name, Id,Signal_ID__c,parent__c From Signal_Element__c WHERE parent__c = null LIMIT 3"),
             "success" : function(){    alert ("successful query");}
  
	});

 writer is undefined in connection.js

 

My code runs fine in visualforce but when I publish to site it gives me an error indicating that the api is disabled for a particular user.

 

Coincidentally, there isn't any custom code here - it's taken directly from the example in the ajax toolkit developer's guide:

 

 

<apex:page >
    <script type="text/javascript">
    var __sfdcSessionId = '{!GETSESSIONID()}';
    </script>
    <script src="../../soap/ajax/21.0/connection.js"
          type="text/javascript"></script>
    <script type="text/javascript">     window.onload = setupPage;
    function setupPage() {
      //function contains all code to execute after page is rendered  
    

      var state = { //state that you need when the callback is called  
    
          output : document.getElementById("output"),
          startTime : new Date().getTime()};

      var callback = {
          //call layoutResult if the request is successful  
    
          onSuccess: layoutResults,

          //call queryFailed if the api request fails  
    
          onFailure: queryFailed,
          source: state};

      sforce.connection.query(
          "Select Id, Name, Industry From Account order by Industry",
           callback);
  }

  function queryFailed(error, source) {
    source.output.innerHTML = "An error has occurred: " + error;
  }

  /**
  * This method will be called when the toolkit receives a successful
  * response from the server.
  * @queryResult - result that server returned
  * @source - state passed into the query method call.
  */  
    
  function layoutResults(queryResult, source) {
    if (queryResult.size > 0) {
      var output = "";

      //get the records array  
    
      var records = queryResult.getArray('records');

      //loop through the records and construct html string  
    
      for (var i = 0; i < records.length; i++) {
        var account = records[i];

        output += account.Id + " " + account.Name +
            " [Industry - " + account.Industry + "]<br>";
      }

    //render the generated html string  
    
    source.output.innerHTML = output;
    }
  }
  </script>

    <div id="output"> </div>
   
</apex:page>

 

So my questions are:

can the ajax toolkit be enabled on force.com sites for an anonymous, read only user?

if so, how? 

if not, is there a workaround?

 

 

 

I'm evaluating two ways of embedding vf pages inside each other, essentially two ways of doing the same thing:

 

The first with an iframe
<iframe src="{!pageUrlString}" width="800" height="700" ></iframe>


The second with a page include         
<apex:include id="pageArea" pageName="{!pageUrlString}" rendered="true"/>

The iframe renders the second page just fine.

The apex include gives an internal server error.

 

 

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com! 

Error ID: 949465384-11147 (680958693)

 

My question is am I using the apex include component wrongly or do I need to open a ticket?

 

 

what I'm trying to do is use an <apex:include component to include a page with a google visualization chart on it.  The chart looks at the url for it's chart values e.g.  

 

 

 salesforce instance + "/apex/GoogleTimeChart?signal=00000484&start=2011-1-28%200:0:0&end=2011-1-28%2023:59:59";  

 

 

im generating the parameters dynamically as a string - but when I assign the string value to an <apex:param I get an error saying - the page ... can only contain alphanumeric characters, must begin with a letter, and must be unique. 

 

In other words, I can't pass the full string with datetimes and expressions as a url.  

How might I get around this?

Trying to figure out how to set a string constructed in javascript to a pageReference partialURL object.

 

So Im generating a string in javascript that relates to a field in one of my objects.  If I could set that string to a pageReference('partialURL ')  in my controller, I could navigate to thepage for that specific object.  However, I can't figure out how to reference apex controller variables with javascript., specifically PageReference parameters.   Any suggestions or documentation you can point me to?

 

 

Im trying to figure out how to build soql queries based on user input.  For example a getter method called getChildren() will return a list of elements that have the selected element as a parent.  Should be pretty simple...

 

 

 public List<Element__c> getChildren(){
        return [select name,id  from Element__c where parent__c = the select field of the record I clicked];
    }

I tried giving an argument to the getter based on the value of an apex:param component like so:

 

 

VF:
<apex:param name="elementId" value="{!r.Signal_ID__c}"/>
<apex:dataList value="{!children({!$CurrentPage.parameters.elementId})}" var="c">
 {!c.name}
</apex:dataList>
Apex:
public List<Element__c> getChildren(PageReference thisRec){
return [select name,id,parent__c from Signal_Element__c where parent__c = thisRec];
}

But I get an error: unexpected token; 'thisRec' 

 

So I have two questions about this:

1.  How do I refer to a user selected element in a soql query?

 

2.  Why does the getter not seem to accept a an argument?

 

 

 

What I'm trying to do is quite simple but I just can't seem to figure out how to do it in VF.
I have a list of elements in a dataTable component represented as command links.
 <apex:form >   
     <apex:dataList value="{!roots}" var="r">
         <apex:commandLink action="{!showChildren}" reRender="renderArea"> 
             {!r.name}        
         </apex:commandLink>
     </apex:dataList>
     </apex:form>

 what i want to do now is this:

 

        when an item is clicked, i want to return a list of child elements and display their name in the outputPanel named renderArea

 

 

this is what my action method showChildren looks like:

 

 

    public List<Element__c> showChildren(){
        return [select name,id  from Element__c where parent__c = the ID of the record I clicked];
    }

 

 

Two questions:

1.  How do I refer to the selected element in a soql query?  I have tried the this keyword with no success eg this.Element_Id__c.

 

2.  I know one reason why this isnt working is because an action method must return a page reference.  is there a way to create a custom action in apex that doesn't rely on page references or am i barking up the wrong tree here?

 

 

I am using standardList controller for a custom object where the list entries are referred to as 'entry'

When you click on an individual entry (as a commandLink) the <apex:detail> area shows the standard detail for the object ie name, owner, modified, custom fields, etc.

Much like "Implementing Partial Page Updates with Command Links and Buttons" in the VF Dev Guide

 

How do I reference the individual fields for the entry in the detail?  

 

For example, how would I show only the name or a customField__C in the detail?  Is there another VF component I could use that will take an url+ object id as an argument to use in a redirect?

 

 Here's my detail area on the VF page - takes the url of the selected object id as 'subject' and displays all of the fields in the detail tag.

 

 

            <apex:outputPanel id="sigDetail">
                 <apex:detail subject="{!$CurrentPage.parameters.eid}" relatedList="false" title="false"/>   
             </apex:outputPanel> 
            
 I thought I could say something like {!$CurrentPage.parameters.eid.name} or {!$CurrentPage.parameters.eid.customField__c} but it doesn't seem to work that way.  What I'm actually trying to do involves much more than simply displaying a single field, but I do need to isolate the fields individually in order to get started.
Any help would be much appreciated.

 

Experiencing something strange with VisualForce - I created a simple page to display the field values for a list of custom objects using a standard list controller with a page block table.

 

I can save and view that page with no problem.

 

My colleague however gets an error when trying o open the url:

^ ERROR at Row:1:Column:73 field 'Signal_ID__c' can not be sorted in a query call

 

Obviously its using a soql query to sort the the table according to Signal_ID - the thing is...i didn't define a soql query.  Where is this query coming from and how do i modify it?  Why would it work for me but not for anyone else on my dev team?

 

Developed a quick test page to display data on a custom object named  Receiving.  Im using a list controller to display all entries and it works fine when I visit the url of the page from my machine.
However, my colleague gets the following error:
Visualforce Error
T_Data__c FROM Receiving__c ORDER BY S_ID__c ASC LIMIT 10000 ^ ERROR at Row:1:Column:67 field 'S_ID__c' can not be sorted in a query call
It's important to note that my colleague created the custom object to begin with.
Why would the page behave for me and not for someone else?
Here's the code - not much to it.
As you can see it's using the standardController which I'm guessing is responsible for generating the SOQL query.  
<apex:page standardController="Receiving__c" recordSetVar="entries" showHeader="false">
<apex:pageBlock >
    <apex:pageBlockTable value="{!entries}" var="entry">
        <apex:column value="{!entry.name}" />
        <apex:column value="{!entry.S_ID__c}" />
        <apex:column value="{!entry.T_Data__c}" />  
    </apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Visualforce Error
T_Data__c FROM Receiving__c ORDER BY S_ID__c ASC LIMIT 10000 ^ ERROR at Row:1:Column:67 field 'S_ID__c' can not be sorted in a query call

 

I'm going through the Visualforce Developer's guide and trying to get my head around how to begin our app.  Right now im looking at $CurrentPage and what all can be done with that.  This is from the documentation:

 

"Using $CurrentPage you can access the query string parameters for the page by specifying the parameters attribute, after which you can access each individual parameter"

 

The example references id and cid.  What are the other parameters?  Is there a piece of documentation with a list of all the individual parameters for $CurrentPage?

 

hello everyone

i have noticed strange behavior using media queries in visualforce pages.  to demonstrate i have created a page with some simple structural markup.  the expected behavior would be to stack two inline  divs with the .panel class when the viewport is sized between 320 and 400 px by setting their width to from 45% to  99%.

 

this is exactly what happens when you take the markup and put in in a 'real' html page.  but within a visualforce page, the width never gets set.  the strange thing is that it seems to be only this query that is failing; the other media queries for sizes over 400px work!

See code below:

 

here's the markup for the vf page:

<apex:page controller="Lists"  standardStylesheets="false" showHeader="false"  sidebar="false">
  
	<style>
	  	#view {
	  		overflow: auto;
		  	border: 4px solid black;
		  	margin-left: auto;
		  	margin-right: auto;
			width: 768px;
	  	}
	  	.panel, .section, .article{
	  			display:inline;
				float: left;
				position: relative;
				margin-left: 1%;
				margin-right: 1%;
		}
	/* testing borders */	
	  	#view .panel {
	  		border: 3px solid blue;
	  		width: 45%;
	  	}
	  	#view .section {
	  		border: 2px solid gray;
	  		width: 99%;
	  	}
	  	#view .article {
	  		border: 1px solid black;
	  		width: 99%;
	  	}
	/* media queries */	
		@media all and (max-width: 400px) and (min-width: 320px) {
			#view {
				width: 320px;
			}	
			#view .panel {
				width: 99%;
			}
		}
		@media all and (max-width: 640px) and (min-width: 401px) {
			#view {
				width: 400px;
			}	
		}
		@media all and (max-width: 799px) and (min-width: 641px) {
			#view {
				width: 768px;
			}	
		}
		@media all and (max-width: 959px) and (min-width: 800px) {
			#view {
				width: 800px;
			}	
		}
		@media all and (max-width: 1023px)and (min-width: 960px) {
			#view {
				width: 960px;
			}	
		}	
  		@media all and (max-width: 1299px) and (min-width: 1024px) {
			#view {
				width: 1024px;
			}
		}
		@media all and (min-width: 1300px) {
			#view {
				width: 1280px;
			}		
		}
  	</style>
  	
  	
<div id="view">
	<p>test view</p>
	<div class="panel">
		<p>test panel</p>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
	</div>
	<div class="panel">
		<p>test panel</p>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
	</div>
</div>

</apex:page>

 

and here's the exact same markup taken out of the visualforce context:

<doctype html>
<head>
<style>
	  	#view {
	  		overflow: auto;
		  	border: 4px solid black;
		  	margin-left: auto;
		  	margin-right: auto;
			width: 768px;
	  	}
	  	.panel, .section, .article{
	  			display:inline;
				float: left;
				position: relative;
				margin-left: 1%;
				margin-right: 1%;
		}
	/* testing borders */	
	  	#view .panel {
	  		border: 3px solid blue;
	  		width: 45%;
	  	}
	  	#view .section {
	  		border: 2px solid gray;
	  		width: 99%;
	  	}
	  	#view .article {
	  		border: 1px solid black;
	  		width: 99%;
	  	}
	/* media queries */	
		@media all and (max-width: 400px) and (min-width: 320px) {
			#view {
				width: 320px;
			}	
			#view .panel {
				width: 99%;
			}
		}
		@media all and (max-width: 640px) and (min-width: 401px) {
			#view {
				width: 400px;
			}	
		}
		@media all and (max-width: 799px) and (min-width: 641px) {
			#view {
				width: 768px;
			}	
		}
		@media all and (max-width: 959px) and (min-width: 800px) {
			#view {
				width: 800px;
			}	
		}
		@media all and (max-width: 1023px)and (min-width: 960px) {
			#view {
				width: 960px;
			}	
		}	
  		@media all and (max-width: 1299px) and (min-width: 1024px) {
			#view {
				width: 1024px;
			}
		}
		@media all and (min-width: 1300px) {
			#view {
				width: 1280px;
			}		
		}
  	</style>
  	
  	<script>
  	$j=jQuery.noConflict();
  	$j(function(){
  		console.log("dom loaded");
  		
  	});  	
  	</script>
</head>
<body>
<div id="view">
	<p>test view</p>
	<div class="panel">
		<p>test panel</p>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
	</div>
	<div class="panel">
		<p>test panel</p>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
		<div class="section">
			<p>test section</p>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
			<div class="article">
				<p>test article</p>
				<p>test article</p>
			</div>
		</div>
	</div>
</div>

</body>
</html>

 

 

i suspect it has to do with the the way the server is generating the html from the vf code but I dont know what it might be.  there are gaps in my knowledge of visual force and of using media queries. 

 

thanks in advance for  any help in understanding what is going on here.

I am attempting to add items to a list and update the page to show the items in the list.  To start off with the list is empty.  The idea is to enter text into the inputText box and it gets added to the list, the command button refreshes the apex:repeat element and displays what was just entered.  Instead, when I click the action button, I get a system null pointer exception error - attempt to de-reference a null object.

 

Heres the visualforce

 

 

                <apex:repeat id="List" value="{!testStringList}" var="str">
                   <apex:outputText >{!str}</apex:outputText>
                </apex:repeat>
                    <apex:pageBlock id="NewListItem">                                           
                            <apex:inputText value="{!testString}"/>
                    </apex:pageBlock>
                
               <apex:commandButton action="{!addToTestStringList}" styleClass="formButton" value="+ Add Year" rerender="List"/> 

 

 

 

Here is the apex controller:

 

  public List<String> testStringList {get;set;}
    
  public String testString {get; set;}
       
  public PageReference addToTestStringList(){   
      testStringList.add(testString);   
      return null;
    }

 

Furthermore, how can I initialize my list with one empty string?

My code runs fine in visualforce but when I publish to site it gives me an error indicating that the api is disabled for a particular user.

 

Coincidentally, there isn't any custom code here - it's taken directly from the example in the ajax toolkit developer's guide:

 

 

<apex:page >
    <script type="text/javascript">
    var __sfdcSessionId = '{!GETSESSIONID()}';
    </script>
    <script src="../../soap/ajax/21.0/connection.js"
          type="text/javascript"></script>
    <script type="text/javascript">     window.onload = setupPage;
    function setupPage() {
      //function contains all code to execute after page is rendered  
    

      var state = { //state that you need when the callback is called  
    
          output : document.getElementById("output"),
          startTime : new Date().getTime()};

      var callback = {
          //call layoutResult if the request is successful  
    
          onSuccess: layoutResults,

          //call queryFailed if the api request fails  
    
          onFailure: queryFailed,
          source: state};

      sforce.connection.query(
          "Select Id, Name, Industry From Account order by Industry",
           callback);
  }

  function queryFailed(error, source) {
    source.output.innerHTML = "An error has occurred: " + error;
  }

  /**
  * This method will be called when the toolkit receives a successful
  * response from the server.
  * @queryResult - result that server returned
  * @source - state passed into the query method call.
  */  
    
  function layoutResults(queryResult, source) {
    if (queryResult.size > 0) {
      var output = "";

      //get the records array  
    
      var records = queryResult.getArray('records');

      //loop through the records and construct html string  
    
      for (var i = 0; i < records.length; i++) {
        var account = records[i];

        output += account.Id + " " + account.Name +
            " [Industry - " + account.Industry + "]<br>";
      }

    //render the generated html string  
    
    source.output.innerHTML = output;
    }
  }
  </script>

    <div id="output"> </div>
   
</apex:page>

 

So my questions are:

can the ajax toolkit be enabled on force.com sites for an anonymous, read only user?

if so, how? 

if not, is there a workaround?

 

 

 

I'm evaluating two ways of embedding vf pages inside each other, essentially two ways of doing the same thing:

 

The first with an iframe
<iframe src="{!pageUrlString}" width="800" height="700" ></iframe>


The second with a page include         
<apex:include id="pageArea" pageName="{!pageUrlString}" rendered="true"/>

The iframe renders the second page just fine.

The apex include gives an internal server error.

 

 

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com! 

Error ID: 949465384-11147 (680958693)

 

My question is am I using the apex include component wrongly or do I need to open a ticket?

 

 

what I'm trying to do is use an <apex:include component to include a page with a google visualization chart on it.  The chart looks at the url for it's chart values e.g.  

 

 

 salesforce instance + "/apex/GoogleTimeChart?signal=00000484&start=2011-1-28%200:0:0&end=2011-1-28%2023:59:59";  

 

 

im generating the parameters dynamically as a string - but when I assign the string value to an <apex:param I get an error saying - the page ... can only contain alphanumeric characters, must begin with a letter, and must be unique. 

 

In other words, I can't pass the full string with datetimes and expressions as a url.  

How might I get around this?

Trying to figure out how to set a string constructed in javascript to a pageReference partialURL object.

 

So Im generating a string in javascript that relates to a field in one of my objects.  If I could set that string to a pageReference('partialURL ')  in my controller, I could navigate to thepage for that specific object.  However, I can't figure out how to reference apex controller variables with javascript., specifically PageReference parameters.   Any suggestions or documentation you can point me to?

 

 

Im trying to figure out how to build soql queries based on user input.  For example a getter method called getChildren() will return a list of elements that have the selected element as a parent.  Should be pretty simple...

 

 

 public List<Element__c> getChildren(){
        return [select name,id  from Element__c where parent__c = the select field of the record I clicked];
    }

I tried giving an argument to the getter based on the value of an apex:param component like so:

 

 

VF:
<apex:param name="elementId" value="{!r.Signal_ID__c}"/>
<apex:dataList value="{!children({!$CurrentPage.parameters.elementId})}" var="c">
 {!c.name}
</apex:dataList>
Apex:
public List<Element__c> getChildren(PageReference thisRec){
return [select name,id,parent__c from Signal_Element__c where parent__c = thisRec];
}

But I get an error: unexpected token; 'thisRec' 

 

So I have two questions about this:

1.  How do I refer to a user selected element in a soql query?

 

2.  Why does the getter not seem to accept a an argument?

 

 

 

What I'm trying to do is quite simple but I just can't seem to figure out how to do it in VF.
I have a list of elements in a dataTable component represented as command links.
 <apex:form >   
     <apex:dataList value="{!roots}" var="r">
         <apex:commandLink action="{!showChildren}" reRender="renderArea"> 
             {!r.name}        
         </apex:commandLink>
     </apex:dataList>
     </apex:form>

 what i want to do now is this:

 

        when an item is clicked, i want to return a list of child elements and display their name in the outputPanel named renderArea

 

 

this is what my action method showChildren looks like:

 

 

    public List<Element__c> showChildren(){
        return [select name,id  from Element__c where parent__c = the ID of the record I clicked];
    }

 

 

Two questions:

1.  How do I refer to the selected element in a soql query?  I have tried the this keyword with no success eg this.Element_Id__c.

 

2.  I know one reason why this isnt working is because an action method must return a page reference.  is there a way to create a custom action in apex that doesn't rely on page references or am i barking up the wrong tree here?

 

Experiencing something strange with VisualForce - I created a simple page to display the field values for a list of custom objects using a standard list controller with a page block table.

 

I can save and view that page with no problem.

 

My colleague however gets an error when trying o open the url:

^ ERROR at Row:1:Column:73 field 'Signal_ID__c' can not be sorted in a query call

 

Obviously its using a soql query to sort the the table according to Signal_ID - the thing is...i didn't define a soql query.  Where is this query coming from and how do i modify it?  Why would it work for me but not for anyone else on my dev team?

 

Developed a quick test page to display data on a custom object named  Receiving.  Im using a list controller to display all entries and it works fine when I visit the url of the page from my machine.
However, my colleague gets the following error:
Visualforce Error
T_Data__c FROM Receiving__c ORDER BY S_ID__c ASC LIMIT 10000 ^ ERROR at Row:1:Column:67 field 'S_ID__c' can not be sorted in a query call
It's important to note that my colleague created the custom object to begin with.
Why would the page behave for me and not for someone else?
Here's the code - not much to it.
As you can see it's using the standardController which I'm guessing is responsible for generating the SOQL query.  
<apex:page standardController="Receiving__c" recordSetVar="entries" showHeader="false">
<apex:pageBlock >
    <apex:pageBlockTable value="{!entries}" var="entry">
        <apex:column value="{!entry.name}" />
        <apex:column value="{!entry.S_ID__c}" />
        <apex:column value="{!entry.T_Data__c}" />  
    </apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
Visualforce Error
T_Data__c FROM Receiving__c ORDER BY S_ID__c ASC LIMIT 10000 ^ ERROR at Row:1:Column:67 field 'S_ID__c' can not be sorted in a query call

 

I'm going through the Visualforce Developer's guide and trying to get my head around how to begin our app.  Right now im looking at $CurrentPage and what all can be done with that.  This is from the documentation:

 

"Using $CurrentPage you can access the query string parameters for the page by specifying the parameters attribute, after which you can access each individual parameter"

 

The example references id and cid.  What are the other parameters?  Is there a piece of documentation with a list of all the individual parameters for $CurrentPage?

 

 

This error appears with increasing frequency:

 

 

Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary

 

 

Unfortunately, I never have any information indicating why it has happened. I am logged in as the System Administrator and I should have access to everything.

 

Perhpas this message also appears when a managed package throws an error?