Dave, good to know we think alike. We are in the same page.
I need to:
1) Figure out the name of the select form element
The name of the form element is mounted in this line
set element "${prefix}$role(short_name)"
the output is: role_resolver
API workflow::role::get_assignee_widget
file wrokflow/tcl/role_procs.tcl line 740
2) Find out where the matching variable is set.
This is exactly what i was trying to do all the time i am debuging the APIs listed before
There's no matching of variables, or at least i haven't found it yet
Two main procs build the ad_form element
1. workflow::role::add_assignee_widgets
2. workflow::role::get_assignee_widget
1. It has the line
ad_form -extend -name $form_name -form [list [get_assignee_widget -role_id $role_id -prefix $prefix -mode $mode]]
2. It has the line
return [list "${element}:search(search),optional" [list label $role(pretty_name)] [list mode $mode] [list search_query $query] [list options $picklist]]
If we combine the output of 1 and 2 we have
ad_form -extend -name $form_name -form {
{role_submitter:search(search),optional {
label #bug-tracker.Submitter#}
{mode display}
{search_query {select distinct acs_object__name(p.party_id) || ' (' || p.email || ')' as label, p.party_id
from cc_users p
where upper(coalesce(acs_object__name(p.party_id) || ' ', '') || p.email) like upper('%'||:value||'%')
order by label}}
{options {
{ "Unassigned" "" }
{{carl manager (mailto:iuri_sampaio@yahoo.com.br)} 1134}
{{iuri sampaio (mailto:iuri.sampaio@gmail.com)} 643}
{{jim dispatcher (mailto:iuri_sampaio@computer.org)} 1137}
{{john dispatcher (mailto:iuri.sampaio@computer.org)} 1795}
{ "Other..." ":search:"}}
}}
}
}
That's everything the APIs do. Where is the matching that sets the correct values to show up on display mode then?
At first i thought the var list $query would do the match but i confirmed it doesn't by removing it from the code and i didn't get errors.
But then I see it is acs-templating that does the magic! The matching is in the API ad_proc -public template::widget::search
input type="hidden" name="role_resolver:select" value="t" select name="role_resolver" id="role_resolver"
option value="" Unassigned /option
option value="1127" selected="selected" bob technician (mailto:iuri@dcc.ufba.br)</option>
option value=":search:" Other.../option
/select
option value="1127" selected="selected" bob technician (mailto:iuri@dcc.ufba.br) /option
Now i need to figure out how to get the selected user id