• Luka Matovic 2
  • NEWBIE
  • 0 Points
  • Member since 2014

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

Hi all,
There is a problem I encountered. I came upon a bug, some page couldn't open, and it was working fine last time i looked. It threw System.LimitException for crossing the 100 SOQL limit. When i started digging, i couln't find that anything is changed or working beside usual. Dumping debug lines throughout extensions i figured that the page is being called two times. The main problem was I couldn't figure out why and who is requesting it. After hours spent on this, i finally figured out that actually SF Development mode is requesting page for it self and going through all my code and queries while the another instance of that page is presented to me. That was just enough to call every query twice, breaching the limit for SOQL in one context. I don't think this is desired behaviour as it can slow down development throwing us off the track. 
It would be great if someone with more experience shared his view on this. Thanks.
 

Cheers,
Luka Matovic

Hi all,

I have a problem regarding tying an attribute in a visualforce component to a Controller. THe thing is, i needed some new functionality so i created new controller PaginatorController2. There, i have a property defined like this: 
 

public object pCon {get;set;}

next I added an attribute to a component: 

<apex:component controller="PaginatorController2"> 
<apex:attribute name="pCon" description="" assignTo="{!pCon }" type="object" required="true"/>


The compiler reports an error: 

<apex:attribute assignTo> cannot be the same as the <apex:attribute name> ( pCon )

 

Ok, i change the name of the attribute to 'xxxx' or whatever else, but now compiler prints an error: 

Type mismatch for <apex:attribute assignTo>. Value binding to a property of type ANY is required, property specified (pCon) is of type Object.
 

Now, i can't do anything with this, i have a feeling it's some bug with compilor but it is veeery frustrating, can't create any new component. I didn't want to bother you so i tried the forum first but with no luck. 
http://salesforce.stackexchange.com/questions/54628/cant-create-attribute-with-type-object-in-custom-vf-component?noredirect=1#comment71901_54628  (http://salesforce.stackexchange.com/questions/54628/cant-create-attribute-with-type-object-in-custom-vf-component?noredirect=1#comment71901_54628)

After this, i tried setting the attribute type to be specific, type="BaseListExtension" and it worked, both component and controller compiled properly, but when i wanted to add the component to a page, like any other component, on any other page, it didn't want to accept my changes 
(MyController is of BaseListExtension type)

<c:Paginator2 controller="{!MyController }"></c:Paginator2>

The error produced is 

Wrong type for attribute <urbanhawks:paginator3 controller="{!MyController}">. Expected BaseListExtensionS, found String

And i know i am not doing anything wrong with the code because i am trying to accomplish something that works on several places throughout the project in the same way. 
I would appreciate any help I can get. Thanks.

 

Luka

Hi all,

I have a problem regarding tying an attribute in a visualforce component to a Controller. THe thing is, i needed some new functionality so i created new controller PaginatorController2. There, i have a property defined like this: 
 

public object pCon {get;set;}

next I added an attribute to a component: 

<apex:component controller="PaginatorController2"> 
<apex:attribute name="pCon" description="" assignTo="{!pCon }" type="object" required="true"/>


The compiler reports an error: 

<apex:attribute assignTo> cannot be the same as the <apex:attribute name> ( pCon )

 

Ok, i change the name of the attribute to 'xxxx' or whatever else, but now compiler prints an error: 

Type mismatch for <apex:attribute assignTo>. Value binding to a property of type ANY is required, property specified (pCon) is of type Object.
 

Now, i can't do anything with this, i have a feeling it's some bug with compilor but it is veeery frustrating, can't create any new component. I didn't want to bother you so i tried the forum first but with no luck. 
http://salesforce.stackexchange.com/questions/54628/cant-create-attribute-with-type-object-in-custom-vf-component?noredirect=1#comment71901_54628  (http://salesforce.stackexchange.com/questions/54628/cant-create-attribute-with-type-object-in-custom-vf-component?noredirect=1#comment71901_54628)

After this, i tried setting the attribute type to be specific, type="BaseListExtension" and it worked, both component and controller compiled properly, but when i wanted to add the component to a page, like any other component, on any other page, it didn't want to accept my changes 
(MyController is of BaseListExtension type)

<c:Paginator2 controller="{!MyController }"></c:Paginator2>

The error produced is 

Wrong type for attribute <urbanhawks:paginator3 controller="{!MyController}">. Expected BaseListExtensionS, found String

And i know i am not doing anything wrong with the code because i am trying to accomplish something that works on several places throughout the project in the same way. 
I would appreciate any help I can get. Thanks.

 

Luka