Forum OpenACS Development: Re: ad_form element link

Collapse
2: Re: ad_form element link (response to 1)
Posted by Claudio Pasolini on
Hi Iuri,

you could use JavaScript to open a new window.

For example you can add to a field of the first form a specification like:

{html {onChange "javascript:window.open(....)}}

You can also pass parameters to the second window and receive back a result in one or more fields of the first form.

Collapse
3: Re: ad_form element link (response to 2)
Posted by Iuri Sampaio on
Option two is the one i would choose.

The issue i was stuck is the piece of code bellow. It's easier this way.

ad_form -extend -name bug -form {
{info4:text(inform),optional
{label ""}
{value "Adicionar Contato"}
}
}

by the way, about the javascript code...
is there a command to use in order to refresh the form.
I use this one
{html {onchange "document.bug.__refreshing_p.value='1';document.bug.submit()"}}

But this command actually gets ad_form submitted instead of refreshed

Collapse
4: Re: ad_form element link (response to 3)
Posted by Dave Bauer on
Why do you want two seperate forms? You can do this of course. One way is to add another form in the html and hide it, then display it when the use clicks the "link". You can detect which form is selected on the back end, and use background javascript to submit the embedded form if necessary.

I'd need a little more information about exactly what you are trying to accomplish. This seems sort of complex, what is the ultimate goal you have that two seperate forms solves?

Collapse
5: Re: ad_form element link (response to 4)
Posted by Iuri Sampaio on
I am using bug-tracker package. I created three more roles on workflow package.
Then i want the members able to add members in the system in the time they are adding a bug.

The reason is that workflow pkg controls and searches its roles among the members in the system.

So, in the time the user is adding a bug and somehow he wants to assign the new role to a new member. So he needs to add him first, and then go back to the form.

I was wondering if this would be a good approach.
I think i could just use contacts package to do the job.

One of the goals is to have a database of contacts, and not necessarily members.
I am doing this approach just in case in the future we need them inside the system, plus to avoid having three more packages installed and more code to debug.