I'm trying to reproduce the functionality shown on this video - http://vimeo.com/7908830 .
Everything worked fine except from updating view after form submission.
Author said that he used AHAH request that updates a Views Attach display.
Unfortunately, I have no idea how can I do this. Can anyone help me please?

Comments

liquidcms’s picture

same issue. Not sure i get what part of this recipe is doing the refresh of the attached view back on the node edit form after submitting noderefence field form

etomilin’s picture

It seems like I managed to reproduce desired functionality. It may be not the most elegant solution, but it is very simple and it works))
The main idea is to use AJAX functionality that is already implemented in Views.

In Views Attach display settings I have:
1) Enabled AJAX.
2) Exposed one filter. It could be any filter, I used "published: yes", since it was already there. It won't be show to users.

In JS file that is injected in ModalFrame Parent window I have:
1) Set style.display='none' for the exposed filter (since really I don't want to show this filter).
2) In onSubmitCallback I emulated click on filter submit button via document.getElementById('ID').click();

Thats all )
I'm still testing this solution, but it seems to work fine.

liquidcms’s picture

is any of this on the EDIT form (like in video) or do you have it on the node?

i can't get the "add another" llink on the parent form. Also, if i have an exposed filter on the edit form (via views_attach) and i apply the filter; then the entire parent form get's submitted.

etomilin’s picture

It works fine on Full Node. It should have worked in Edit too, but it seems like there is a bug with AJAX in Views Attach, which breaks exposed filters in Edit Node (I reported it here http://drupal.org/node/956600).

WRT "add another" llink - you can add it via Node Reference URL like in the video, or you can place it in Views Attach footer.

Crell’s picture

Status: Active » Postponed (maintainer needs more info)

What they're doing in that video is not a supported feature of views attach. It looks like they're doing some sort of custom code that they're not describing. In fact I don't really get what views attach is doing there at all. :-)

If you can get them to hop into this issue and give more info that would be appreciated, since otherwise I've no clue what they're doing.

liquidcms’s picture

I think the part views_attach is doing is adding the table view that shows below the noderef field. Have played around with these and various other modules though and don't get how this can be done without custom functionality.. which is too bad since it seems like a pretty reasonable use of a noderef field, i.e:

- see what the content is that is referenced when editing the parent (before deciding to edit the referenced node)
- then popup a modal window to do the edit
- then have the attached content updated when the modal form is submitted.

sadly, not sure it is that put that video together.

Crell’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)