Thanks MartOn, very helpful and a very quick response.
After your advice I'm nearly there, I have got the desired behaviour
using the or-cancel tag but by adding the cancel param value to the
def in the generated pages.dryml. Obviously I need to define it in a
non generated file to preserve the behaviour.
This is the pages.dryml:
<def tag="new-for-project-page" polymorphic/>
<def tag="new-for-project-page" for="Review">
.
.
<section param="content-body">
<form owner="project" method="post" param>
<field-list: skip="project"/>
<submit: label="Create Trade Review"/>
<!--<cancel: with="&this.project"/> Need to
provide this via a specific .dryml file-->
</form>
</section>
.
.
</def>
So now the question is what should the file be called and how to
supply the cancel param value?
I have tried a new.dryml file as follows:
<new-for-project-page>
<form:>
<cancel: with="&this.project"/>
</form:>
</new-for-project-page>
But no joy, I'm guessing that I need to merge the form tag ?
Thanks again
Clarksta
On Apr 14, 3:59 pm, MartOn <[email protected]> wrote:
> If you look at the taglibs in cookbook, you find this
> tag:http://cookbook.hobocentral.net/api_tag_defs/or-cancel
> If you look at the source, you can see that the <or-cancel> tag take
> parameters.
>
> Then:
>
> I recommend going through the Agility tutorial in detail and try to
> understand what is going on:http://cookbook.hobocentral.net/tutorials/agility.
> Agility tutorial has an example of replacing/adding a cancel button
> inside a app/view/xxx/edit.dryml
>
> <edit-page>
> <form:>
> <cancel: with="&this.story"/>
> </form:>
> </edit-page>
>
> This may be a bit confusing, since <cancel: xx> is not <or-cancel>
>
> to explain what happens inside the edit.dryml page, the <edit-page>
> tag will "run" your default edit-page tag for the model, which by
> default is stored inside app/view/taglibs/auto/rapid/pages.dryml (like
> <def tag="edit-page" for="your model">)
> This <edit-page> tag then again calls the app/view/taglibs/auto/rapid/
> forms.dryml. If you look inside that file, you will see that the <or-
> cancel> takes a param called cancel:. There is the link between <or-
> cancel> and <cancel:>. <cancel:> is the paramteter given to <or-
> cancel> tag, like a procedure or function when programming.
> ..
> Back to your case, you should then pass the object that you want user
> to be redirected to (for instance: &this.parent_object)
>
> Also reading the DRYML guide will brighten your day, at least it did
> it for me.
>
> Hope this helps you along
>
> /MartOn
>
> On Apr 14, 4:29 pm, Clarksta <[email protected]> wrote:
>
>
>
> > Hi, havent been using Hobo for long so please bear with me.
>
> > I'm having trouble with the cancel button/link, from any new-page,
> > going to the home page. I'd like it to go to the previous page.
>
> > I'm using auto actions in the controller so that when a table of items
> > are shown in the show-page of the parent, a new item can be created
> > from that page.
>
> > So for the show-page of Project for example, a table of reviews are
> > shown via table-plus :
>
> > <collection: replace>
>
> > <table-plus with="&@reviews"
> > fields="this,type,activity,rating,status">
> > <empty-message:>No reviews match your criteria</empty-message:>
> > </table-plus>
>
> > </collection:>
>
> > I tried editing the new.dryml with no joy. (Its not used by the
> > auto_actions_for)
> > I can see the pages.dryml has a generated tag for the "new-for-project-
> > page" but I cant seem to provide the cancel param to the form in this
> > page.
>
> > Am I even looking in the right place ?
>
> > Thanks for any pointers.
>
> > Clarksta- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---