tags:

views:

584

answers:

3

I have a table within a form that has many identical rows. At the beginning of each row is a text field and a button that creates a cfwindow so that the user can browse an inventory and select a single item. Then I need that item's name and ID to get sent back to the main page and populate the text box. The main page form works fine. The cfwindow works fine (search, display, etc..). I cannot figure out a way to get the variable being set in the cfwindow back to the main page and just populate the text field for that specific row and not redraw the entire page. I can't even get the cfwindow to access any variable on the main page and I thought that it was just a floating div and would have access to all of the main page variables that are set. This is one row of the main page (the index is for looping through to create unique names for each row variables): .

in the cfwindow, a query populates a list of items, each with a radio button. User needs to select one and it needs to return that item's ID back to the main page for that row:

Any help/guidance is greatly appreciated.

A: 

In ColdFusion you could put something into the session scope or you could use javascript to set hidden fields on the calling page. There may be a nicer solution but that's a couple of quick ones.

Ian
A: 

Use a Javascript function call in your link on the parent window.

From the Javascript function, use ColdFusion.Window.create to create the child window with a dynamic url passing the vars you need.

Et voilà.

Vincent Buck
Thanks for the quick replies guys. I should have been more clear; I can definitely pass the variables via url to the cfwindow, I am stuck on getting them back into the main form and just reloading the 1 field, not the entire page.
JS
A: 

I appreciate the feedback. Here's what I ended up doing: - passed the variables to the cfwindow via url with a button and an onClick="ColdFusion.Window.create..." - in the cfwindow, I used the url variables as a reference and I have a search dialogue that then sends the search results along with the url variable (via url variables) to a simple action page that just displays a form with the variables populated via an onclick="javascript:ColdFusion.navigate..." - back in the main page I have a cfdiv that binds to the action page via a url

So by starting with a reference that I pass to my search function, I keep it "tagged" and then every time it is refreshed it shows up in the main page correctly.

So it's working now and the last thing that I need to do is put all my dynamic variables in an array to reduce the overhead.

JS