Tell me more ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I want to create visualforce component similar to say pageblocktable. If you see the behaviour of pageblocktable it can only be included inside a pageblock. similarly columns can be included inside pageblocktable/datatable.

I want to replicate the same in my custom visualforce component such that component B can only be included inside component A.(both A and be are custom visualforce component)

share|improve this question

2 Answers

I would use <apex:attribute name="myValue"> and assign it to a boolean variable inside of component a and than use that to determine if it's coming from component b to determine if the parent is correct.

share|improve this answer
well this do the work but while developing(using the component in the page) I have to manually set the value for this attribute. Any other work around? – Avidev9 Sep 19 '12 at 15:59

If component B is always required within component A... why not build your B component within A component. Pass in "null" for attributes if you want component A without a component B.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.