Child Page Include data overriding parent page's rendering condition

  • 1
  • Question
  • Updated 2 years ago
I'm having difficulty with a skuid pageInclude. Here are the deets.

I have conditional rendering on a tab on my main page. That tab contains a pageInclude of the same page type as the main page, but displays a different record.

The issue I'm experiencing is that the child page's data is determining the rendering for its' parent page's tab! Although, I found that the actual child page data was being loaded, just not displayed due to overriding its' parent page's rendering conditions.

Here's how I tested this.

Pretend we have an opportunity field called "ShouldILoad__c" and two opportunities named "OppThing1" and "OppThing2."

Our tab, "Deal Info On Renewed Deal" that contains the page include, will only render if ShouldILoad__c is true.

In scenario 1
OppThing1.ShouldILoad__c  == true
OppThing2.ShouldILoad__c  == false (which shouldn't matter since it's not the parent page)

So according to the rendering condition, this should load. And it does. But once I click on the tab, it disappears like so!


However In scenario 2 when
OppThing1.ShouldILoad__c  == true
OppThing2.ShouldILoad__c  == true

The tab loads and the pageInclude stays just as it should.

What can I do to fix this? Is this a bug? 
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb

Posted 2 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Are any of the model names in the page include the same as the page calling the page include?
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Yup, same page so all the same model names  :)
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
the parent Skuid page is calling an include of itself , correct? That would mean that all model names are exactly identical. As Pat is alluding to, this is probably your issue. You will probably need to make a clone of the Skuid page and change the model names then load this clone as the page include... That's my guess anyway...
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
That's correct , the model names are all identical. 

Hmm, that would be a pain to manage since it would mean changing both pages every time I want to make any change.

I guess I could use apex to automatically copy the data except the model names... What do ya'll think? Am I going about this right?
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
You may be able to do a template with an inline frame to the page instead of a page include. Not sure if it would still result in the model name conflict.
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Interesting! It does work, but it's kind of laggy and all of the tabs show up on top in the iframe.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
The only other idea I have is that you could bring the components from the page include into the main page so you don't need a page include. This would give you a second set of components that would need updating, but only one page to edit
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Hm that's a cool idea, how doI get the components from the child page without doing a page include?

Is there any documentation on that?