I am working on a Magento module that has a Form where a user has to enter a order number. So for this I have included a button in the form that opens a popup window that displays the list of orders.
Heres what i have done
This is the code for the button that opens the popup
<button type="button" class="form-button" onclick="window.open(\''
.Mage::helper("adminhtml")->getUrl('*/inventory_receipt/selectOrder',array()
.'\',\'\',\'height=500,width=550\');"><span>'
.Mage::helper('adminhtml')->__('Lookup Order')
.'</span></button>
Then i have created a selectOrder Action in the controller that displays a grid that is almost similar to the grid in the sales/order (just modified Grid.php from sales/order).
Now what i want to implement is when the user clicks on an order, the parent form should be populated with the selected order number and close the popup window.
Can any help on how to get this done? Any help would be appreciated.
Here is what I ended up doing.
I Followed the steps over here, created an extra column with a button that populates the parent window.
Code for the same is below