You need to sign in to do that
Don't have an account?
Nikita Dhamal 4
Error: Unknown property 'String.Visible'
VVisualforcepage:
<apex:page controller="Paginationtesttrial" docType="html-5.0" sidebar="false" standardStylesheets="false">
<apex:form >
<apex:actionFunction name="landingPage" action="{!refreshPage}"/>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta charset="utf-8"/>
<title>Metronic | Dashboard 2</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="https://c.eu6.visual.force.com/resource/1456381571000/jquery_min_js"></script>
<script>
jQuery.noConflict();
function proxyHideItem(accId){
//uncomment this to hide via jquery, currently hiding via actionFunction
//jquery selector using the class, which is accountId for each row
//jQuery("."+accId).hide();
hideItem(accId);
}
</script>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script type="text/javascript" src="https://c.eu6.visual.force.com/resource/1456381571000/jquery_min_js"></script>
<script>
jQuery.noConflict();
function proxyHideItem(accId){
//uncomment this to hide via jquery, currently hiding via actionFunction
//jquery selector using the class, which is accountId for each row
//jQuery("."+accId).hide();
hideItem(accId);
}
</script>
<script>
function SubmitFrm(){
alert('in SubmitFrm !!');
window.open('https://www.facebook.com/');
}
function show()
{
landingPage();
}
</script>
<apex:pageBlock title="Lead List" id="Details">
<apex:pageblockbuttons location="top">
<apex:commandbutton action="{!saveAccounts}" value="Save" id="saveButton" />
</apex:pageblockbuttons>
<apex:pageBlockTable value="{!accounts}" var="a" rowClasses="oddrow,evenrow" styleClass="fontfamily" id="Details1">
<apex:dataTable value="{!accountList}" var="a">
//notice how the styleClass is the accountId, to select using Jquery
<apex:column rendered="{!a.Visible}">
<apex:facet name="header"><b>Hide</b></apex:facet>
<apex:outputPanel onclick="proxyHideItem('{!acc.accId}');" >Hide</apex:outputPanel>
</apex:column>
<apex:column value="{!a.Date_Time_first_visit__c}" rendered="{!a.Visible}">
<apex:facet name="header">
<apex:commandLink action="{!ViewData}" value="Date / Time{!IF(sortExpression=='Date_Time_first_visit__c',IF(sortDirection='ASC','▼','▲'),'')}">
<apex:param value="Date_Time_first_visit__c" name="column" assignTo="{!sortExpression}" ></apex:param>
</apex:commandLink>
</apex:facet>
</apex:column>
<apex:column headerValue="Company" rendered="true">
<apex:outputField value="{!a.Lead__c}">
<apex:inlineEditSupport showOnEdit="saveButton" event="ondblclick"/>
<apex:commandLink action="{!ViewData}" value="{!IF(sortExpression=='Lead__c',IF(sortDirection='ASC','▼','▲'),'')}">
<apex:param value="Lead__c" name="column" assignTo="{!sortExpression}" ></apex:param>
</apex:commandLink>
</apex:outputField>
</apex:column>
</apex:pageBlockTable>
</apex:pageblock>
</body>
</html>
</apex:form>
</apex:page>
Controller:
public with sharing class Paginationtesttrial {
public String acc { get; set; }
public PageReference search() {
return null;
}
Public Integer noOfRecords{get; set;}
Public Integer size{get;set;}
Decimal totalcount =0;
public decimal percentage{get;set;}
public boolean test = false;
Public List<Lead_Inspector__c> getLeads{get;set;}
public Date startDate{get;set;}
public Date endDate{get;set;}
public string searchstring {get;set;}
public List<SelectOption> countrieLst {get;set;}
public String selectedCountry{get;set;}
public String selectedValues {get;set;}
private List<Lead_Inspector__c> accounts;
private String sortDirection = 'ASC';
private String sortExp = 'name';
public Date datename{ get; set; }
public String val1 {get; set;}
public user currentuser{get;set;}
Map<Id,AccountWrapper> accMap = new Map<Id,AccountWrapper>();
public List<AccountWrapper> getAccountList(){
if (accMap == null || accMap.isEmpty()){
for(Lead_Inspector__c acc : [Select Id, Name from Lead_Inspector__c LIMIT 25]){
// System.debug('****************************888888888888888888888888888888888888888888'+a);
accMap.put(acc.Id, new AccountWrapper(acc));
}
}
return accMap.Values();
}
//this method is invoked via the action function
public PageReference hideAccount (){
Id accToHide = (Id)ApexPages.currentPage().getParameters().get('accToHide');
System.debug('**************************** Hiding ' + accToHide);
if(accToHide != null)
accMap.get(accToHide).visible = false;
//here is where you can bolt on behaviour to store the Lead_Inspector__c hide event
//either a field on Lead_Inspector__c if hide is global for all users, or a dedicated
//hide object, if the hiding is user specific
return null;
}
public class AccountWrapper{
public Lead_Inspector__c at {get; set;}
public Id aId {get { return at.Id ; }}
public String aName {get { return at.Name ;} }
public boolean visible { get; set; }
public AccountWrapper(Lead_Inspector__c acc){
this.visible = true;
this.at = acc;
}
}
}
<apex:page controller="Paginationtesttrial" docType="html-5.0" sidebar="false" standardStylesheets="false">
<apex:form >
<apex:actionFunction name="landingPage" action="{!refreshPage}"/>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta charset="utf-8"/>
<title>Metronic | Dashboard 2</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
<script type="text/javascript" src="https://c.eu6.visual.force.com/resource/1456381571000/jquery_min_js"></script>
<script>
jQuery.noConflict();
function proxyHideItem(accId){
//uncomment this to hide via jquery, currently hiding via actionFunction
//jquery selector using the class, which is accountId for each row
//jQuery("."+accId).hide();
hideItem(accId);
}
</script>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script type="text/javascript" src="https://c.eu6.visual.force.com/resource/1456381571000/jquery_min_js"></script>
<script>
jQuery.noConflict();
function proxyHideItem(accId){
//uncomment this to hide via jquery, currently hiding via actionFunction
//jquery selector using the class, which is accountId for each row
//jQuery("."+accId).hide();
hideItem(accId);
}
</script>
<script>
function SubmitFrm(){
alert('in SubmitFrm !!');
window.open('https://www.facebook.com/');
}
function show()
{
landingPage();
}
</script>
<apex:pageBlock title="Lead List" id="Details">
<apex:pageblockbuttons location="top">
<apex:commandbutton action="{!saveAccounts}" value="Save" id="saveButton" />
</apex:pageblockbuttons>
<apex:pageBlockTable value="{!accounts}" var="a" rowClasses="oddrow,evenrow" styleClass="fontfamily" id="Details1">
<apex:dataTable value="{!accountList}" var="a">
//notice how the styleClass is the accountId, to select using Jquery
<apex:column rendered="{!a.Visible}">
<apex:facet name="header"><b>Hide</b></apex:facet>
<apex:outputPanel onclick="proxyHideItem('{!acc.accId}');" >Hide</apex:outputPanel>
</apex:column>
<apex:column value="{!a.Date_Time_first_visit__c}" rendered="{!a.Visible}">
<apex:facet name="header">
<apex:commandLink action="{!ViewData}" value="Date / Time{!IF(sortExpression=='Date_Time_first_visit__c',IF(sortDirection='ASC','▼','▲'),'')}">
<apex:param value="Date_Time_first_visit__c" name="column" assignTo="{!sortExpression}" ></apex:param>
</apex:commandLink>
</apex:facet>
</apex:column>
<apex:column headerValue="Company" rendered="true">
<apex:outputField value="{!a.Lead__c}">
<apex:inlineEditSupport showOnEdit="saveButton" event="ondblclick"/>
<apex:commandLink action="{!ViewData}" value="{!IF(sortExpression=='Lead__c',IF(sortDirection='ASC','▼','▲'),'')}">
<apex:param value="Lead__c" name="column" assignTo="{!sortExpression}" ></apex:param>
</apex:commandLink>
</apex:outputField>
</apex:column>
</apex:pageBlockTable>
</apex:pageblock>
</body>
</html>
</apex:form>
</apex:page>
Controller:
public with sharing class Paginationtesttrial {
public String acc { get; set; }
public PageReference search() {
return null;
}
Public Integer noOfRecords{get; set;}
Public Integer size{get;set;}
Decimal totalcount =0;
public decimal percentage{get;set;}
public boolean test = false;
Public List<Lead_Inspector__c> getLeads{get;set;}
public Date startDate{get;set;}
public Date endDate{get;set;}
public string searchstring {get;set;}
public List<SelectOption> countrieLst {get;set;}
public String selectedCountry{get;set;}
public String selectedValues {get;set;}
private List<Lead_Inspector__c> accounts;
private String sortDirection = 'ASC';
private String sortExp = 'name';
public Date datename{ get; set; }
public String val1 {get; set;}
public user currentuser{get;set;}
Map<Id,AccountWrapper> accMap = new Map<Id,AccountWrapper>();
public List<AccountWrapper> getAccountList(){
if (accMap == null || accMap.isEmpty()){
for(Lead_Inspector__c acc : [Select Id, Name from Lead_Inspector__c LIMIT 25]){
// System.debug('****************************888888888888888888888888888888888888888888'+a);
accMap.put(acc.Id, new AccountWrapper(acc));
}
}
return accMap.Values();
}
//this method is invoked via the action function
public PageReference hideAccount (){
Id accToHide = (Id)ApexPages.currentPage().getParameters().get('accToHide');
System.debug('**************************** Hiding ' + accToHide);
if(accToHide != null)
accMap.get(accToHide).visible = false;
//here is where you can bolt on behaviour to store the Lead_Inspector__c hide event
//either a field on Lead_Inspector__c if hide is global for all users, or a dedicated
//hide object, if the hiding is user specific
return null;
}
public class AccountWrapper{
public Lead_Inspector__c at {get; set;}
public Id aId {get { return at.Id ; }}
public String aName {get { return at.Name ;} }
public boolean visible { get; set; }
public AccountWrapper(Lead_Inspector__c acc){
this.visible = true;
this.at = acc;
}
}
}
Atul Gupta
Hi Nikita, remove this line from the vf page and try again