0

I am creating an custom vf page for opportunity. I am having 5 input text box which has an lookup. on click of this lookup an pop up should get displayed(i.e custon child page) and should select required input on child page. But my problem is on selecting the input on child object i am not getting values on parent field. I have tried to get parent id by top.window.opener.document.getElementById({$component.elementId}).value but getting null id. Can any one help me solve this problem. An single example can also help me to solve this problem. I think i should pass the id field to child object but not getting how exactly should i work on this problem.

  • Are the text fields sobject fields or custom inputs ? How does the lookup window work - is it a link or std lookup window ? – CloudHugger Mar 1 '15 at 11:29
0

You can accomplish this by passing the parent ID in a URL parameter and then then retrieving it in the controller that backs your child VF page.

The link url will looking something like this.

/apex/MyChildPage?parentId={!ParentObject.Id}

And the controller for the child page can retrieve it using

String parentId = ApexPages.currentPage().getParameters().get('parentId');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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