close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Diable the "delete" if in use?

Thread began 4/19/2010 6:33 pm by MikeH | Last modified 4/20/2010 9:50 am by MikeH | 775 views | 7 replies |

MikeH

Diable the "delete" if in use?

Hi
I have a DA results page with a "delete" record button as setup with the wizard.

The results are showing the BRANDS I have (these brands have an Id column)

The Id column is linked to the BrandsId in the Product Table.

Is there a way to disable the delete option if a product is using that Brand?

Thanks in advance

Mike

Sign in to reply to this post

CraigRBeta Tester

what you need to do is have a recordset on your page which will return rows if the brandsid is present.

you can then use a dreamweaver server behavior to show 'content' if your recordset is not empty.

follow this with a dreamweaver server behavior to show 'other content' if your recordset is empty.

Sign in to reply to this post

MikeH

Hi
Thanks for the reply.

Im ok with the show region if(if not) just a bit stuck on geting the second recrdset to return rows depending on the first recordsets brandid.

Obviously the first set is in a repeat region to show all the brands my second set is not in that region so it only reads a first record.

Any ideas?

Thanks

Sign in to reply to this post

CraigRBeta Tester

i presume the first recordset is filtered by brandid from a form/url/session variable ?

use this same variable as your filter for your second recordset.

if i am missing the mark here, can you post a link to the pages ?

Sign in to reply to this post

MikeH

Hi Craig
The first recordset is created by the DA Wizard so it the admin results page (BTW sites on a local testing server so cannot show page).

Basically the first sets results are disaplayed in a repeat region of a table:

ID | Brand Name | Logo | {Edit} {delete}

Thats repeated until the whole list is shown.

I would have liked that a check would be done to the first RS to check if a product in the second RS is using that brand so if it is the {delete} button would not be available so something in use by a product cannot be removed.

I hope that makes it clearer?

Mike

Sign in to reply to this post

MikeH

Hi
just an update. I have managed to do it with a bit of manual php and a really useful library called: good_query_ library.

Thanks for your help though.

Mike

Sign in to reply to this post

CraigRBeta Tester

i have looked back at something i did with DA recently,

what i had was 2 sets of results pages (and associated insert, edit and delete pages), one for items and one for itemcategories.

with the wizard, i created a set of pages for items and a set for itemcategories.

what i wanted to ensure was that i couldn't delete an itemcategory if it had items associated with it.

in my itemcategory result page, i can open the delete itemcategory page

on this page i use the itemcategoryid passed as a url variable from the results page to filter my recordset, (basically select * from tblitemcategory where itemcategoryid = urlvariable)

is this what you're after ?


**ok, never mind, you sorted it whilst i was typing this**

Sign in to reply to this post

MikeH

Hi
Yes thats the same idea.

With what I have done is literally the delete button is not there for any Brand (in your case Category) that has an associated item.

Mike

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...