• Randall Petit
  • NEWBIE
  • 0 Points
  • Member since 2021

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

Hi All,

 

I am crating the Visualforce page. I use the <dataTable> tag for displaying data, but it does not have any highlight on the selected row same as using <pageBlockTable> tag.

 

Could anyone give me the suggestion, how I can control it? I am very new in visualforce and web coding.

  • March 09, 2010
  • Like
  • 0

I also posted this thread in the java forum but i didn't get any response there so i'll try it here. I have a problem concerning the query method in the ajax toolkit (both tested with beta 1 and beta 2). What i want to do is the following: I want to create a treeview with different categories and each categorie has his items. So i build up my own control instead of using other be just hiding en showing divs. An example of a simple tree looks like this:

Code:

<DIV id=category>category</DIV>
  <DIV id="categoryitems" onclick="setChecks(this);">
    <DIV id=item1><INPUT id=citem1 type=checkbox>item1 in category</DIV>
    <DIV id=item2><INPUT id=citem2 type=checkbox>item2 in category</DIV>
  </DIV>

 

When i click on category i have the following code that query's for each item in the categoryitems section for that category:

Code:

function setChecks(parentobj) {	 //parentobj = categoryitems	
	var pobj = parentobj;
	var counter = pobj.childNodes.length;   //= 2
	for (i=0;i<counter;i++) {
		var parchild = pobj.childNodes[i];
		query(parchild.id);				
	}	
}


 Code:

function query(id) {
	document.getElementById("erroroutput").innerHTML += "<br> Select Id from Node_Item__c Where Account__c = '{!Account_ID}' And Path__c = '" + id + "'";
	var qr = sforceClient.Query("Select Id from Node_Item__c Where Account__c = '{!Account_ID}' And Path__c = '" + id + "'");
	
	if (qr.getClassName() == "QueryResult") { 
		if (qr.size > 0) {
			document.getElementById("erroroutput").innerHTML += "<br><b>found for:</b>" + id + qr.records[0].get("Id");
			//normally i set the checkbox for that item to true
		} else {
			document.getElementById("erroroutput").innerHTML += "<br><b>not found for:</b>" + id;
			//i set the checkbox for the item to false
		}
	} else {
		document.getElementById("erroroutput").innerHTML += "<br><b>no valid queryresults found for:</b>" + id;
	}					
}

 

In the query method i simply output some debug info into a div. Before showing the result, i have for the 2 items (with id=item2 and id=item1) a record in salesforce so they exist. The result in the debug div output when i execute is the following:

Select Id from Node_Item__c Where Account__c = '00130000009onzj' And Path__c = 'INST_BASE_INF_NAPP' found:INST_BASE_INF_NAPPa0330000000jisDAAQ

This is ok but then it stops my for loop and doesn't execute the query anymore for the second item although there is a record. The weird thing is when i only debug and not call the sforceClient.query() it does the loop 2, so i think the problem doesn't exist in my code but in the query method. Is this a known bug or am i using bad code ?