[pmwiki-users] Page Action: send Input form page with two variables already loaded
Sivakatirswami
katir at hindu.org
Mon Jan 15 20:43:45 CST 2007
Hans wrote:
> You could put the "Add New To Do" link into Site.PageTopMenu or
> Site.PageFootMenu to be part of your standard action links. The
> difficulty is that you really want to use a form with a form submit
> button instead of a standard link. You got the form already. So you
> can add the form and submit button (relabel it) to, for instance,
> PageTopMenu. You may have to wrap it into a div and float it right:
>
>>> rfloat<<
> ...your form and submit button markup..
>>> <<
> ...list of action links...
>
> If the submit form button sticks out too much, because it is a button
> and not a standard link, you can style it via css to look like the
> others.
Hmmm I think I'm not making myself clear. Or perhaps I'm not understanding
the solution you propose.
First let me describe my current set up. The ToDoForm is set up as a
"template" form in
Site.ToDoForm (a ZAPdata form that saves data to a new data page that is
created on submit, works great...)
Now, I am using "(:include Site.ToDoForm:) in Sight.RightBar, where it
presents itself as empty.
The user fills in all fields submits.. one field is prefilled with
"{$Group}" which is labeled "Project"
But... I don't want the "To Do Form" to appear *until*
the user clicks on a link. At which point the form appears, with
a submit button.
Can I get it to "magically" appear on the page itself without some
fancy java pop-up thing? A go-to-page scenario might work: create in
advance
"Main.ToDoEntry" and on that page put "(:include Site.ToDoForm:) and
then add a kind of "page action" link on the top menu that
is simply [[Main.ToDoEntry | Add New Task]] and click that.
but, I want that two variables be passed in the process:
1) {$Group} and 2) {$Fullname} of the "starting" page... e.g.
Let's say I am on this page:
PartyTime.LiquidEntertainment
when the user clicks on [[Main.ToDoEntry | Add New Task]] we need to
pass two variable to the form as already filled in "PartyTime"
(goes in fld "Project" value for text variable {$:Project}) and
"PartyTime.LiquidEntertainment"
is saved in a hidden input text variable called "returnPage."
Of course the problem with my Main.ToDoEntry model is that
once you get to that page then {$Group} = Main and not
"PartyTime" and {$Fullname}= "Main.ToDoEntry" and not
"PartyTime.LiquidEntertainment"
But... I'm out of my depth here. I see from PM docs I can define my own
session variables,
I rather use runtime params in the top layer page syntax if possible, though
happy to add a couple of variables to my farmconfig.php if that's
imperative.
but still I won't understand how to "Poke" those with values inside a link
before using them in the "Main.ToDoEntry". I dream of some PM syntax
for passing parameters along with simple page links like
[[Main.ToDoEntry,$Project={$Group},$ReturnPage={$FullName} | Enter New
To Do]]
Like any command syntax where params are passed along with it.
The algorithm in another environment I would write in Revolution
transcript (software headquartered near you in Edinburgh...btw...)
would be something like
globals gProject, gReturnPage
on mouseup # a link on an existing page
put {$GRoup} into gProject
put {$FullName} into gReturnPage
Go page "Main.ToDoEntry"
end mouseup
now...on the form on Main.ToDoEntry we have form input fields like
Project: (:input text name="Project" value={$gProject}:)
(:input hidden name="returnPage" value={$gReturnPage}:)
Make sense? of course if we can "manifest" the do form magically right
on the PartyTime.LiquidEntertainment page itself, then we dont' need
all that... we just use $Group and $Fullname of the current page.
Of course AJAX solutions would work but that's complicated.
Sivakatirswami
More information about the pmwiki-users
mailing list