• saimadhu
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 12
    Replies

Hi,Iam planning to prepare for salesforce developer certification.

can any one help me and send the complete materials.

could anyone give me suggestions and guidance for how to prepare for this exam.

Hi, 

Iam trying to develop a testcase for controller.

here is my controller.

public with sharing class Handler_Account_CreateSA {


private boolean m_isExecuting = false;
private integer BatchSize = 0;

public Handler_Account(boolean Exe, integer size) {

Exe = isExecuting;
BatchSize = size;
}


public void OnAfterInsert(Account[] accounts) {

--

--
}
how can i write a test case for this.

any suggestions please

Hey, I want to to read 7 digit no 

i tried with input text like

 <apex:inputtext value="{!phoneno}" id="no" size="7"/>

 it showing 7 digit width but accepting many.how can i restrict this field to 7 digits.

Hi,

In a table I placed two checkboxes yes and no .if i click yes then checkbox NOshould deselect(if it already selected).

if a click  checkbox  NO it should deselect YES.

Here is my vf page:

<table class="list" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr border="1" class="dataRow even first" onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" onmouseout="if (window.hiOff){hiOff(this);}" onmouseover="if (window.hiOn){hiOn(this);}">
<td> </td>
<td> Higher Capacity Circuit </td>
<td class="actionColumn"><apex:inputCheckbox value="{!prihighcapacity}" id="checkyes" immediate="true">YES
<apex:actionSupport event="onclick" action="{!highcapacity}" rerender="PRIcapacity">
<apex:param name="checkyes" value="true" assignTo="{!yescheck}" />
</apex:actionSupport>
</apex:inputCheckbox>
</td>
<td class="actionColumn"><apex:inputCheckbox value="{!prinohighcapacity}" id="checkno" immediate="true">NO
<apex:actionSupport event="onclick" action="{!nohighcapacity}" rerender="PRIcapacity">
</apex:actionSupport>
</apex:inputCheckbox>
</td>
</tr>
</tbody>
</table>

 

the controller is:

public void highcapacity() {



if(prihighcapacity == true){
prinohighcapacity = false;
}

}

public void nohighcapacity(){


if(prinohighcapacity == true){
prihighcapacity = false;
}

}

 but it is not working as i expect if i click yes and then click no both are selecting .

we shuold select either one.any suggestion please.

Hi, Iam trying to place some checkboxes and trying to read those values in modal popup window, but my page is not recognising the actions.

Here is my code

<apex:outputPanel id="priModalPanelWrap" rendered="{!ap.pg.name == 'PRI Services'}">
<a href="#" id="modalButton{!p.b.Id}" class="actionLink">Select</a>

<apex:outputPanel rendered="{!ap.pg.name == 'PRI Services'}" >
<div id="theModal{!p.b.Id}" class="reveal-modal medium" style="width:320px;" >


<div style="line-height:18px; margin:0 0 20px; padding:0; border:0; font-weight:bold; font-size:13px; font-style:normal; text-align:left; display:block;">
<label style="font-size:14px;">Will this PRI be:</label>
<br />
<table border="1">
<tr border="1" class="dataRow even first" onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" onmouseout="if (window.hiOff){hiOff(this);}" onmouseover="if (window.hiOn){hiOn(this);}">
<td> </td>
<td> Higher Capacity Circuit </td>
<td class="actionColumn"><apex:inputCheckbox value="{!prihighcapacity}" id="checkyes">YES
<apex:actionSupport event="onclick" action="{!highcapacity}" rerender="PRIcapacity">
<!-- <apex:param name="selectedproductid" value="{!ap.pg.id}" assignTo="{!selectedproductid}" />-->
</apex:actionSupport>
</apex:inputCheckbox>

</td>
<td class="actionColumn"><apex:inputCheckbox value="{!prinohighcapacity}" id="checkno">NO
<apex:actionSupport event="onclick" action="{!nohighcapacity}" rerender="PRIcapacity">
<!--<apex:param name="selectedSiteABuildSiteId" value="{!epl.bs.Id}" assignTo="{!selectedSiteABuildSiteId}" />-->
</apex:actionSupport>
</apex:inputCheckbox>
</td>
</tr>
<tr>

</tr>
</table>

</div>

<a class="close-reveal-modal">&#215;</a>
<apex:commandButton value="Submit" action="{!prioptions}"/>

</div>
</apex:outputPanel>

<script type="text/javascript">
jQuery(document).ready(function(jQuery) {
jQuery('#modalButton{!p.b.Id}').click(function(e) {
e.preventDefault();
jQuery('#theModal{!p.b.Id}').reveal();
});
});
</script>


</apex:outputPanel>

 

in the controller:

 

public string selectedproductid {get;set;}
public boolean prihighcapacity {get;set;}
public boolean prinohighcapacity {get;set;}

public void highcapacity() {


system.debug('we are in highcapacity module');
if(prihighcapacity == true){
prinohighcapacity = false;
}
system.debug('value in highcapacity is'+prihighcapacity);
system.debug('value in highcapacity is'+prinohighcapacity);
}

public void nohighcapacity(){

system.debug('we are in non-high capacity module');
if(prinohighcapacity == true){
prihighcapacity = false;
}
system.debug('value in highcapacity is'+prihighcapacity);
system.debug('value in highcapacity is'+prinohighcapacity);
}


public void prioptions() {

system.debug('in pri options method');

}

 

 

when i execute my page , when i click yes or no, it is not executing the actions and not displaying system.debug messages.

is it not possible to place checkboxses in modal window?

Hi,

I have a select option with some existing contact list.

here is my code:

<apex:outputpanel id="contract" >
<apex:pageblocksection title="Existing contract" >

<apex:pageblocksectionitem >
<apex:outputlabel value="Select the contact"/>
<apex:selectList value="{!existcontactName}" size="1" >
<apex:selectOptions value="{!contactlist}" />
</apex:selectList>

</apex:pageblocksectionitem>
</apex:pageblocksection> 

controller() is

public void updatecontactlist() {



contactName = [select Id,Name,StageName,CloseDate from contact where AccountId = :acctid.AccountId];
contactlist.add(new selectOption('',' - Select contact Name -'));
for (contact ot: contactName) {
contactlist.add(new selectOption(ot.Id,ot.Name+' , '+ot.StageName+' , '+ot.CloseDate));

}
}

 

now instead of select option i want to display a table with this id,name,stage,closedate and also a checkbox.

by default all check boxes are deselcte and if i click a chekbox then it should get that contact id.

how can i write for this.

any sample code please

 

 

Iam creating a new contract for the existing account.

in my vf apge i have 2fileds to create a new contract.

name:

date:

in the name filed it should display the "current account name"-new contractname(user has to enter contract name)

here is my code:

<apex:outputLabel value="contract Name"/></b></td>
<td > <apex:inputText value="{!ctrName}" id="OppName"/> </td>(this ctrName should hold the contract name entered by the user)

 

the current account name is in !accountname variable.

 how can i include those.

 

 

In my vf page i have a date filed

date: input text 

i have to place calendar lookup for this date field

how to do this.

please give me sample code.

Hi,

 

In my visualforce page i have couple of buttons.

if I click a button then  it should open a jquery modal window and this modal window displays a dropdown list.

how can i do this.iam new to jquery .

 

 

My page has a search box . when i enter the groupname it displays related records underneath the search box and if i click  any record it pulls options and menus for that record.

if i want to search for another groupname ,it is still displaty the entire page with prevoius records. i want to refresh the page when i search a new item. how can I?

 

here is my code

<script type="text/javascript">
function doSearch() {

var t = setTimeout(function() {
searchServer(document.getElementById("pgName").value);
}, 500);
}
</script>


<apex:actionFunction name="searchServer" action="{!runSearch}" status="status2" rerender="soqlDebug,errors,pbtSearch">
<apex:param name="pgName" value="" />
</apex:actionFunction>

<label for="Product Search" style="color:#666;">Product Group Search</label>
<input name="Product Search" id="pgName" onkeyup="doSearch();"  type="text" style="width:220px;" />

</apex:toolbarGroup>

after this i have two more output panels.

hi,i have a label and input box.if i enter a name on the input it  is displaying  records related to that name.but when i enter the name and hit enter the name is not displaying on that label.it goes balnk ( displaying the records).

how to retain the entered value in the input box.

here is my code.

 

<apex:toolbarGroup location="left" style="padding-top:6px;">

<script type="text/javascript">
function doSearch() {
var t = setTimeout(function() {
searchServer(document.getElementById("pgName").value);
}, 500);
}
</script>

<apex:actionFunction name="searchServer" action="{!runSearch}" status="status2" rerender="soqlDebug,errors,pbtSearch">
<apex:param name="pgName" value="" />
</apex:actionFunction>

<label for="Product Search" style="color:#666;">Product Group Search</label>
<input name="Product Search" id="pgName" onkeyup="doSearch();" type="text" style="width:220px;" />

</apex:toolbarGroup>

 

 

 

 

 

 

 

 

Hi,

My controller and page is executing fine.but when i write a testcase it covered only 66% and showing red mark on comments and spaces between lines.How to get rid off this.

 

Hi,I am new to thissalesforce.I finishe my controller class now iam trying to write testclass for that

how do i write testcase for my controoler;

here is my controller:

public class status_ctrl_option{



public status_ctrl_option()
{
//statusop = false;
showselectlist = false;
updateshowResults();
count = 0;
showstatusdialog = false;

}



public integer count {get;set;}
public boolean statusop {get;set;}
public boolean showselectlist {get;set;}
public boolean showResults {get;set;}
public string pgName {get;set;}
public string productId {get;set;}
public string newstatus_Name {get;set;}
public string new_currentbuildstaus_Name{get;set;}
public string new_nexttbuildstaus_Name {get;set;}
public boolean showstatusdialog {get;set;}

public string status_Id{get;set;}
public string status_Name {get;set;}
public string status_CurrentBuild {get;set;}
public string status_NextBuild {get;set;}




public list<Product_Group__c> returnproductlist = new list<Product_Group__c>();
public list<Product_Group__c> getreturnproductlist()
{
return returnproductlist;
}



public void pgsearchlist()
{
returnproductlist = [SELECT Id, Name, Quick_Pricing__c, Quick_Pricing_Name__c, Pricing_Type__c,Contract_Template__c,Engineering_Engagement__c,Engineering_Cycle_Time__c
FROM Product_Group__c
WHERE Name = : pgName];
updateshowResults();
}

public void updateshowResults()
{

showResults = false;
if(returnproductlist.size() > 0)
{
showResults = true;
}
}



Product_Group__c selectepglist = new Product_Group__c();
public Product_Group__c getselectepglist()
{
return selectepglist;
}


public void selectedpgnamelist()
{

selectepglist = [SELECT Id, Name, Quick_Pricing__c, Quick_Pricing_Name__c, Pricing_Type__c,Contract_Template__c,Engineering_Engagement__c,Engineering_Cycle_Time__c
FROM Product_Group__c
WHERE Id = : productId limit 1];
if(selectepglist.Engineering_Engagement__c == 'Required' && selectepglist.Engineering_Cycle_Time__c != null)
{
updatestatusop();
updateBuildStatuses();
updateBuildStatusOptions();
}

editshowselectlist();

}
public void editshowselectlist()
{
showselectlist = false;
if(selectepglist != null)
{
showselectlist = true;
}
}



public PageReference pg_update()
{
Product_Group__c updatelist = new Product_Group__c();
updatelist = selectepglist;
updatelist.Quick_Pricing__c = selectepglist.Quick_Pricing__c;
updatelist.Pricing_Type__c = selectepglist.Pricing_Type__c;
updatelist.Engineering_Engagement__c = selectepglist.Engineering_Engagement__c;
updatelist.Contract_Template__c = selectepglist.Contract_Template__c;
update updatelist;
/*if(updatelist.Engineering_Engagement__c == 'Required')
{
updatestatusop();
updateBuildStatuses();
updateBuildStatusOptions();
}*/
PageReference pr = new PageReference('/apex/status_option');
pr.setRedirect(true);
return pr;

}

I have a inputtext.

if I enter 'a' then it should display  a menu with all itemnames  starts with a( from item object).

 and when a click any itemname(item names starts with a) it should display that record

how can i do this with jquery

sample code please

 

In my home page I displayed  some items and those values list.

Ex:  item1   price............ edit

       item2  price--------edit

if i click edit it open another page.once i change the values(like price of an item),and if i click back it should show my home page with the editable values

how can i do this

Hi, here is my controller:

 

public class status_option{
public integer optioncount {get;set;}
public list<Status_Option__c> statop = new list<Status_Option__c>();
public List<Status_Option__c> getstatop()
{
return statop;
}

}
public list<status_option> status_option_list = new list<status_option>();
public list<status_option> getstatus_option_list()
{
return status_option_list;
}
public list<Status_Option__c> temp_statop = new list<Status_Option__c>();
public List<Status_Option__c> gettemp_statop()
{
return temp_statop;
}
public list<Build_Status__c> status_option_picklist = new list<Build_Status__c>();
public List<Build_Status__c> getstatus_option_picklist()
{
return status_option_picklist;
}

/* public status_option getstatusobj()
{
return statusobj;
}*/


public void updatestatusop()
{
statusop = true;

status_option_picklist = [SELECT Name FROM Build_Status__c];
temp_statop = [select Name,Current_Build_Status__c,Next_Build_Status__c
from Status_Option__c
where Product_Group__c = :productId ];
integer k=0;
for(integer i=0;i<temp_statop.size();i++)
{
status_option statusobj = new status_option();
statusobj.statop.add(temp_statop.get(i));
statusobj.optioncount = ++k;
status_option_list.add(statusobj);
system.debug('value of optioncount is-'+status_option_list);
}


}

 

my VF page is:

 

<apex:pageblock title="STATUS OPTIONS" rendered="{!statusop}">
<apex:outputpanel >
<apex:pageblocktable value="{!status_option_list}" var="sl" columns="1">
<apex:column ><b><apex:outputlabel value="stausoption{!sl.optioncount}"/></b>
<apex:pageblocktable value="{!sl.statop}" var="statopl">
<apex:column ><apex:outputlabel value="Name"/><apex:inputfield value="{!statopl.Name}"/><br />
<apex:outputlabel value="CurrentBuildStatus"/><apex:inputfield value="{!statopl.Current_Build_Status__c}"/><br />

<apex:outputlabel value="NextBuildStatus"/><apex:inputfield value="{!statopl.Next_Build_Status__c}"/>
</apex:column>
</apex:pageblocktable>
</apex:column>
</apex:pageblocktable>

</apex:outputpanel>
</apex:pageblock>

 

the o/p is

status option1

name : text

nextbuildstatus: text

currentbuildstatus:text

 

status option2

name : text

nextbuildstatus: text

currentbuildstatus:text

 

now i want to change nextbuildstatus,currentbuildstatus as picklist with  values of sobject like(select name from buildstatus)

how can i change my code

any suggestion please.

hey, when i click the checkbox(list of checkboxes) i want to read the corresponding filed value.

 

here is my code:

<apex:outputpanel >
<table>
<apex:repeat value="{!parentlist}" var="p1">

<tr>
<td>
<h1><b> {!p1.statusName} </b></h1>
<apex:param name="statusopname" assignTo="{!newstatusname}" value="{!p1.statusName}"/>
</td>
</tr>
<tr><td>
<h5> <b> Next Status Option</b> </h5>
</td></tr>

<apex:repeat value="{!p1.statussubmenu}" var="p12" >

<td colspan='2'>

<apex:inputcheckbox value="{!p12.chklist}">{!p12.submenu}
<apex:param name="nextstatuschkbox" assignTo="{!chkbox}" value="{!p12.chklist}"/>
<apex:param name="nextstatusop" assignTo="{!nextstatus}" value="{!p12.submenu}"/>
<apex:actionSupport event="onclick" action="{!updatestatusoption}" rerender="statusdialog"/>
</apex:inputcheckbox>


</td>

</apex:repeat>
</tr>


</apex:repeat>

</table>
</apex:outputpanel>

here p1 is list of lists

the output is:

 

staus1

chbox status2 chkbox status3

chkbox status4 chkbox status4

 

status2

chkbox status1 chkbox status3

chkbox staus4  chkbox status5

...

now if i select status2 status 3under status1

i need to update the custom object with those values.

how can i get those values when click the checkbox

 

is there anyway to read values from those listof lists.

 

 

Hi, I want to display values inthis format

 ex-i have 5names

name1,name2,name3,name4,name5

format is:

name1

 name2  name3

name4   name5

 

name2

name1 name3

name4 name5

 

name3

name1 name2

name4name5

so on

I tried many ways but i didnt

 

my ocde is here:

public class statuslist{
public string statusName{get;set;}
public list<string> statussubmenu{get;set;}

 

public list<statuslist> parentlist = new list<statuslist>();

public list<statuslist> getparentlist()
{

return parentlist;
}

 

public void updatestatusop()
{
statusop = true;
List<Status_Option__c> statop = new List<Status_Option__c>([select                  Name,Current_Build_Status__c,Next_Build_Status__c
from Status_Option__c
where Product_Group__c = :productId ]);
system.debug('list size is:'+statop.size());


for(integer i=0;i<statop.size();i++)
{
statuslist tmp =new statuslist();  
system.debug('status name is'+statop.get(i).Name);     
tmp.statusName = statop.get(i).Name;

for(integer j=0;j<statop.size();j++)
{
if(i==j)
continue;
else
tmp.statussubmenu.add(statop.get(j).Name);


}
parentlist.add(tmp);

}
}

 

   but iam getting nummobject refernce error.can anybody help me

Controller:

List<Status_Option__c> statop = new List<Status_Option__c>([select     Name,Current_Build_Status__c,Next_Build_Status__c
from Status_Option__c
where Product_Group__c = :productId ]);
system.debug('list size is:'+statop.size());

public string var1{get;set;}

public string var{get;set;}


for(integer i=0;i<statop.size();i++)
{
system.debug('status name is'+statop.get(i).Name);
var1 = statop.get(i).Name;

for(integer j=0;j<statop.size();j++)
{
if(i==j)
continue;
else
system.debug('status name is'+statop.get(j).Name);
var = statop.get(j).Name;
}
}

in a visual force page i just want to print like this

 

     {!var1}

                 var

                 var

                var

              var

  {!var1}

                 var

                 var

                var

              var

like this it should display 3 times if l

 

please somebody help me

 

my code is

<apex:pageblock value="{!status}" var="s"}

<apex:column headerValue="name"   value="{!s.name"}/>

.

.

.

 

my controller is

status_option__c status=new status_option__c();

status= [select name,build_status__c from status_option__c];

but my page is displaying only the last record

Hey, I want to to read 7 digit no 

i tried with input text like

 <apex:inputtext value="{!phoneno}" id="no" size="7"/>

 it showing 7 digit width but accepting many.how can i restrict this field to 7 digits.

Hi,

In a table I placed two checkboxes yes and no .if i click yes then checkbox NOshould deselect(if it already selected).

if a click  checkbox  NO it should deselect YES.

Here is my vf page:

<table class="list" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr border="1" class="dataRow even first" onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" onmouseout="if (window.hiOff){hiOff(this);}" onmouseover="if (window.hiOn){hiOn(this);}">
<td> </td>
<td> Higher Capacity Circuit </td>
<td class="actionColumn"><apex:inputCheckbox value="{!prihighcapacity}" id="checkyes" immediate="true">YES
<apex:actionSupport event="onclick" action="{!highcapacity}" rerender="PRIcapacity">
<apex:param name="checkyes" value="true" assignTo="{!yescheck}" />
</apex:actionSupport>
</apex:inputCheckbox>
</td>
<td class="actionColumn"><apex:inputCheckbox value="{!prinohighcapacity}" id="checkno" immediate="true">NO
<apex:actionSupport event="onclick" action="{!nohighcapacity}" rerender="PRIcapacity">
</apex:actionSupport>
</apex:inputCheckbox>
</td>
</tr>
</tbody>
</table>

 

the controller is:

public void highcapacity() {



if(prihighcapacity == true){
prinohighcapacity = false;
}

}

public void nohighcapacity(){


if(prinohighcapacity == true){
prihighcapacity = false;
}

}

 but it is not working as i expect if i click yes and then click no both are selecting .

we shuold select either one.any suggestion please.

Hi, Iam trying to place some checkboxes and trying to read those values in modal popup window, but my page is not recognising the actions.

Here is my code

<apex:outputPanel id="priModalPanelWrap" rendered="{!ap.pg.name == 'PRI Services'}">
<a href="#" id="modalButton{!p.b.Id}" class="actionLink">Select</a>

<apex:outputPanel rendered="{!ap.pg.name == 'PRI Services'}" >
<div id="theModal{!p.b.Id}" class="reveal-modal medium" style="width:320px;" >


<div style="line-height:18px; margin:0 0 20px; padding:0; border:0; font-weight:bold; font-size:13px; font-style:normal; text-align:left; display:block;">
<label style="font-size:14px;">Will this PRI be:</label>
<br />
<table border="1">
<tr border="1" class="dataRow even first" onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" onmouseout="if (window.hiOff){hiOff(this);}" onmouseover="if (window.hiOn){hiOn(this);}">
<td> </td>
<td> Higher Capacity Circuit </td>
<td class="actionColumn"><apex:inputCheckbox value="{!prihighcapacity}" id="checkyes">YES
<apex:actionSupport event="onclick" action="{!highcapacity}" rerender="PRIcapacity">
<!-- <apex:param name="selectedproductid" value="{!ap.pg.id}" assignTo="{!selectedproductid}" />-->
</apex:actionSupport>
</apex:inputCheckbox>

</td>
<td class="actionColumn"><apex:inputCheckbox value="{!prinohighcapacity}" id="checkno">NO
<apex:actionSupport event="onclick" action="{!nohighcapacity}" rerender="PRIcapacity">
<!--<apex:param name="selectedSiteABuildSiteId" value="{!epl.bs.Id}" assignTo="{!selectedSiteABuildSiteId}" />-->
</apex:actionSupport>
</apex:inputCheckbox>
</td>
</tr>
<tr>

</tr>
</table>

</div>

<a class="close-reveal-modal">&#215;</a>
<apex:commandButton value="Submit" action="{!prioptions}"/>

</div>
</apex:outputPanel>

<script type="text/javascript">
jQuery(document).ready(function(jQuery) {
jQuery('#modalButton{!p.b.Id}').click(function(e) {
e.preventDefault();
jQuery('#theModal{!p.b.Id}').reveal();
});
});
</script>


</apex:outputPanel>

 

in the controller:

 

public string selectedproductid {get;set;}
public boolean prihighcapacity {get;set;}
public boolean prinohighcapacity {get;set;}

public void highcapacity() {


system.debug('we are in highcapacity module');
if(prihighcapacity == true){
prinohighcapacity = false;
}
system.debug('value in highcapacity is'+prihighcapacity);
system.debug('value in highcapacity is'+prinohighcapacity);
}

public void nohighcapacity(){

system.debug('we are in non-high capacity module');
if(prinohighcapacity == true){
prihighcapacity = false;
}
system.debug('value in highcapacity is'+prihighcapacity);
system.debug('value in highcapacity is'+prinohighcapacity);
}


public void prioptions() {

system.debug('in pri options method');

}

 

 

when i execute my page , when i click yes or no, it is not executing the actions and not displaying system.debug messages.

is it not possible to place checkboxses in modal window?

Hi,

I have a select option with some existing contact list.

here is my code:

<apex:outputpanel id="contract" >
<apex:pageblocksection title="Existing contract" >

<apex:pageblocksectionitem >
<apex:outputlabel value="Select the contact"/>
<apex:selectList value="{!existcontactName}" size="1" >
<apex:selectOptions value="{!contactlist}" />
</apex:selectList>

</apex:pageblocksectionitem>
</apex:pageblocksection> 

controller() is

public void updatecontactlist() {



contactName = [select Id,Name,StageName,CloseDate from contact where AccountId = :acctid.AccountId];
contactlist.add(new selectOption('',' - Select contact Name -'));
for (contact ot: contactName) {
contactlist.add(new selectOption(ot.Id,ot.Name+' , '+ot.StageName+' , '+ot.CloseDate));

}
}

 

now instead of select option i want to display a table with this id,name,stage,closedate and also a checkbox.

by default all check boxes are deselcte and if i click a chekbox then it should get that contact id.

how can i write for this.

any sample code please

 

 

In my vf page i have a date filed

date: input text 

i have to place calendar lookup for this date field

how to do this.

please give me sample code.

hi,i have a label and input box.if i enter a name on the input it  is displaying  records related to that name.but when i enter the name and hit enter the name is not displaying on that label.it goes balnk ( displaying the records).

how to retain the entered value in the input box.

here is my code.

 

<apex:toolbarGroup location="left" style="padding-top:6px;">

<script type="text/javascript">
function doSearch() {
var t = setTimeout(function() {
searchServer(document.getElementById("pgName").value);
}, 500);
}
</script>

<apex:actionFunction name="searchServer" action="{!runSearch}" status="status2" rerender="soqlDebug,errors,pbtSearch">
<apex:param name="pgName" value="" />
</apex:actionFunction>

<label for="Product Search" style="color:#666;">Product Group Search</label>
<input name="Product Search" id="pgName" onkeyup="doSearch();" type="text" style="width:220px;" />

</apex:toolbarGroup>

 

 

 

 

 

 

 

 

Hi, here is my controller:

 

public class status_option{
public integer optioncount {get;set;}
public list<Status_Option__c> statop = new list<Status_Option__c>();
public List<Status_Option__c> getstatop()
{
return statop;
}

}
public list<status_option> status_option_list = new list<status_option>();
public list<status_option> getstatus_option_list()
{
return status_option_list;
}
public list<Status_Option__c> temp_statop = new list<Status_Option__c>();
public List<Status_Option__c> gettemp_statop()
{
return temp_statop;
}
public list<Build_Status__c> status_option_picklist = new list<Build_Status__c>();
public List<Build_Status__c> getstatus_option_picklist()
{
return status_option_picklist;
}

/* public status_option getstatusobj()
{
return statusobj;
}*/


public void updatestatusop()
{
statusop = true;

status_option_picklist = [SELECT Name FROM Build_Status__c];
temp_statop = [select Name,Current_Build_Status__c,Next_Build_Status__c
from Status_Option__c
where Product_Group__c = :productId ];
integer k=0;
for(integer i=0;i<temp_statop.size();i++)
{
status_option statusobj = new status_option();
statusobj.statop.add(temp_statop.get(i));
statusobj.optioncount = ++k;
status_option_list.add(statusobj);
system.debug('value of optioncount is-'+status_option_list);
}


}

 

my VF page is:

 

<apex:pageblock title="STATUS OPTIONS" rendered="{!statusop}">
<apex:outputpanel >
<apex:pageblocktable value="{!status_option_list}" var="sl" columns="1">
<apex:column ><b><apex:outputlabel value="stausoption{!sl.optioncount}"/></b>
<apex:pageblocktable value="{!sl.statop}" var="statopl">
<apex:column ><apex:outputlabel value="Name"/><apex:inputfield value="{!statopl.Name}"/><br />
<apex:outputlabel value="CurrentBuildStatus"/><apex:inputfield value="{!statopl.Current_Build_Status__c}"/><br />

<apex:outputlabel value="NextBuildStatus"/><apex:inputfield value="{!statopl.Next_Build_Status__c}"/>
</apex:column>
</apex:pageblocktable>
</apex:column>
</apex:pageblocktable>

</apex:outputpanel>
</apex:pageblock>

 

the o/p is

status option1

name : text

nextbuildstatus: text

currentbuildstatus:text

 

status option2

name : text

nextbuildstatus: text

currentbuildstatus:text

 

now i want to change nextbuildstatus,currentbuildstatus as picklist with  values of sobject like(select name from buildstatus)

how can i change my code

any suggestion please.

hey, when i click the checkbox(list of checkboxes) i want to read the corresponding filed value.

 

here is my code:

<apex:outputpanel >
<table>
<apex:repeat value="{!parentlist}" var="p1">

<tr>
<td>
<h1><b> {!p1.statusName} </b></h1>
<apex:param name="statusopname" assignTo="{!newstatusname}" value="{!p1.statusName}"/>
</td>
</tr>
<tr><td>
<h5> <b> Next Status Option</b> </h5>
</td></tr>

<apex:repeat value="{!p1.statussubmenu}" var="p12" >

<td colspan='2'>

<apex:inputcheckbox value="{!p12.chklist}">{!p12.submenu}
<apex:param name="nextstatuschkbox" assignTo="{!chkbox}" value="{!p12.chklist}"/>
<apex:param name="nextstatusop" assignTo="{!nextstatus}" value="{!p12.submenu}"/>
<apex:actionSupport event="onclick" action="{!updatestatusoption}" rerender="statusdialog"/>
</apex:inputcheckbox>


</td>

</apex:repeat>
</tr>


</apex:repeat>

</table>
</apex:outputpanel>

here p1 is list of lists

the output is:

 

staus1

chbox status2 chkbox status3

chkbox status4 chkbox status4

 

status2

chkbox status1 chkbox status3

chkbox staus4  chkbox status5

...

now if i select status2 status 3under status1

i need to update the custom object with those values.

how can i get those values when click the checkbox

 

is there anyway to read values from those listof lists.

 

 

Hi, I want to display values inthis format

 ex-i have 5names

name1,name2,name3,name4,name5

format is:

name1

 name2  name3

name4   name5

 

name2

name1 name3

name4 name5

 

name3

name1 name2

name4name5

so on

I tried many ways but i didnt

 

my ocde is here:

public class statuslist{
public string statusName{get;set;}
public list<string> statussubmenu{get;set;}

 

public list<statuslist> parentlist = new list<statuslist>();

public list<statuslist> getparentlist()
{

return parentlist;
}

 

public void updatestatusop()
{
statusop = true;
List<Status_Option__c> statop = new List<Status_Option__c>([select                  Name,Current_Build_Status__c,Next_Build_Status__c
from Status_Option__c
where Product_Group__c = :productId ]);
system.debug('list size is:'+statop.size());


for(integer i=0;i<statop.size();i++)
{
statuslist tmp =new statuslist();  
system.debug('status name is'+statop.get(i).Name);     
tmp.statusName = statop.get(i).Name;

for(integer j=0;j<statop.size();j++)
{
if(i==j)
continue;
else
tmp.statussubmenu.add(statop.get(j).Name);


}
parentlist.add(tmp);

}
}

 

   but iam getting nummobject refernce error.can anybody help me

my code is

<apex:pageblock value="{!status}" var="s"}

<apex:column headerValue="name"   value="{!s.name"}/>

.

.

.

 

my controller is

status_option__c status=new status_option__c();

status= [select name,build_status__c from status_option__c];

but my page is displaying only the last record