This topic is locked

Individual menus on table view

1/4/2006 06:18:25
ASPRunnerPro General questions
Pfeiffer author

How to implement many functions based on marked records in table view

------------------------------------------------------------------------------------
1.) The function delete is changed. I look at the value action = delete
if (Request("action")="delete") then

....
2. the value of action can have other values than 'delete' , changed by the menue-link

For Example : in this case the value wil be changed to x_freischalten

  

<a href="#" onClick="if (confirm('User freischalten ?')) { document.forms.deleteform.action.value = 'xfreischalten';document.forms.deleteform.submit(); return false; } else {return true;}">[Mail: User freischalten]</a>
3. In ...list.asp I inserted the following code

if (left(Request("action"),2)="x
") or (left(Request("action"),2)="X_") then

Eval (Request("action"))

end if
4. The function_name is exact the name of action and is defined in <..>_inc.asp

Function x_freischalten()

...

end Function
5. To show the different menu_actions above the table contents I defined a function in <..>_inc.asp with the name

function show_menu()

%>

&nbsp;&nbsp;

<a href="#" onClick="if (confirm('User freischalten ?')) { document.forms.deleteform.action.value = 'x_freischalten';document.forms.deleteform.submit(); return false; } else {return true;}">[Mail: User freischalten]</a>
&nbsp;&nbsp;

<a href="#" onClick="if (confirm('User um Rückruf bitten ?')) { document.forms.deleteform.action.value = 'x_rueckruf';document.forms.deleteform.submit(); return false; } else {return true;}">[Mail: Rückruf]</a>
&nbsp;&nbsp;

<a href="#" onClick="if (confirm('Sichterweiterungsmail versenden ?')) { document.forms.deleteform.action.value = 'x_sichterweiterung';document.forms.deleteform.submit(); return false; } else {return true;}">[Mail: Sichterweiterung]</a>
<% end Function %>
6. The function show_menu() is called in ...list.asp before table header.
I hope this will give you an idea of how to increase properties of ASPRunner.

I think the individual menus should have a 1:n relation to the table(View).

Because not all users will be allowed to call a special menu it would be good to have a small

before() funktion, to decide whether the menu-text will be shown or not.
Best regards

Uwe Pfeiffer

Sergey Kornilov admin 1/5/2006

With ASPRunnerPro there is a simpler way to implement this if you like to sacrifice "delete" function. Just a simple demo of what events can do for you.

  1. Define BeforeDelete event and put your custom code there. Make sure to return FALSE to prevent actual record deletion.
  2. Change "Delete selected" label accordingly.

Pfeiffer author 1/6/2006

That's right,

you can manipulate "delete" function.
Nevertheless you must integrate the display of the user-functions above the table view and you need a

request on the action variable to make a difference which user-function is to be called.

Because you now integrate the event source-codes within the project-file it may be easy to integrate

the user-definied menus too.
Best regards

Uwe Pfeiffer