10 Replies Latest reply on Nov 18, 2008 2:23 AM by Newsgroup_User

    A change in perspective..

    Level 7
      I need to think about this process in a different way.. So the site I'm
      building is for a nutritionist, and she wants to have a "Recipe Of The
      Week".. where she wants to be able to look a list of recipes, and choose
      which one she wants to dynamically populate a certain page after selecting
      it.

      So this means that we need to return a series of records (all of the recipes
      in the table), and have her be able to choose one.. obviously, this means
      also de-selecting anything previously selected, and then all records
      updated.

      I need someone smarter than me to help me figure out how to do this with the
      DW behaviors.. or is this beyond DW capability? Thanks-


        • 1. Re: A change in perspective..
          Level 7
          > or is this beyond DW capability?

          It's quite within DW's capability but is it beyond *your* capability?

          Maybe this will help you understand what I mean -

          http://www.adobe.com/devnet/dreamweaver/articles/develop_web_application.html

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          ==================


          "_adrian" <adrian @ test.com> wrote in message
          news:gfd5i1$8bq$1@forums.macromedia.com...
          >I need to think about this process in a different way.. So the site I'm
          >building is for a nutritionist, and she wants to have a "Recipe Of The
          >Week".. where she wants to be able to look a list of recipes, and choose
          >which one she wants to dynamically populate a certain page after selecting
          >it.
          >
          > So this means that we need to return a series of records (all of the
          > recipes in the table), and have her be able to choose one.. obviously,
          > this means also de-selecting anything previously selected, and then all
          > records updated.
          >
          > I need someone smarter than me to help me figure out how to do this with
          > the DW behaviors.. or is this beyond DW capability? Thanks-
          >

          • 2. Re: A change in perspective..
            Level 7
            Ummm... yeah, Murray. I've actually built quite a large number of dynamic
            apps using Dreamweaver (and been a pretty devoted client to Macromedia) over
            the last 10 years.

            I guess what I'm missing is some help in figuring out the architecture for
            this.. I know it seems like an easy (go look in the FAQs) kind of answer,
            but those answers aren't fixing this problem... which is why I came to this
            forum.

            Perhaps someone else might be willing to help me flesh this out a bit? I've
            gotten some great direction from folks on this forum before. We *do* still
            have discussion here, yes?

            Anyways, maybe I've just been staring at this problem too long.. but if
            someone has built something similar and can tell me why I might be getting
            this EOF error after adding the UPDATE behavior, I'd appreciate it. Or
            suggestions on a different way of handling the process would be great too..


            • 3. Re: A change in perspective..
              Level 7
              On Wed, 12 Nov 2008 10:14:04 -0800, "_adrian" <test@test.com> wrote:

              >Anyways, maybe I've just been staring at this problem too long.. but if
              >someone has built something similar and can tell me why I might be getting
              >this EOF error after adding the UPDATE behavior, I'd appreciate it. Or
              >suggestions on a different way of handling the process would be great too..

              Your question was, and still is, a bit vague. You mention an EOF error, but
              nothing in either of your two posts to this thread really tells anything about
              how you've gone about trying to accomplish your goal. In your first post, you
              mention, "how to do this with the DW behaviors." Dreamweaver doesn't have a
              built-in behavior to do what you want.

              If I were doing it, I'd probably build a form that displays all of the records
              and use a radio button to select the one you want to use. I'd just write the
              value of the primary key for that record to a text file. Then, when the page
              that displays the recipe of the week is loaded, it could read that file and
              determine which record to display. Alternatively, you could create a table that
              contained only a single record that contained the ID of the desired recipe, but
              that seems like overkill for something like this.

              Gary
              • 4. Re: A change in perspective..
                Level 7
                Hi Gary.. well thats part of the challenge. I'm not sure how to accomplish
                this, so am not sure why the error is happening. I'll try to give better
                details here...

                I have a table where the row populates dynamically with a record. This row
                contains a radio button where it dynamically is set or not (1,0). I want
                only one record to be able to have this radio button value at 1 at any given
                time. The result is a list of records on the page, each showing a radio
                button, but only one is selected.

                I want the user to be able to select a different record (via radio button)
                and have the page Update all records so that the newly selected radio button
                is set, and the old one updated to not being set.

                So I need to be able to update multiple records from one SUBMIT - thats one
                function I need to accomplish.

                Problem is, I can't even get that far, because when I add the UPDATE
                behavior from DW8 to this form (containing the dynamically populated table),
                I get the EOF or BOF error, and I don't know why. Is it maybe because I'm
                applying it to a Repeated dynamic region? I don't know.. I'm just looking
                for guidance and suggestions here..


                • 5. Re: A change in perspective..
                  Level 7
                  On Thu, 13 Nov 2008 10:01:00 -0800, "_adrian" <test@test.com> wrote:

                  >I have a table where the row populates dynamically with a record. This row
                  >contains a radio button where it dynamically is set or not (1,0). I want
                  >only one record to be able to have this radio button value at 1 at any given
                  >time. The result is a list of records on the page, each showing a radio
                  >button, but only one is selected.

                  Okay. I never use the built-in server behaviors, so all I can do is give you the
                  general idea of what you want to do. First, forget your zero and one. You need
                  to have a <form> tag before you populate the page with the records. For each
                  record, you output a radio button. It's VERY important that each of the radio
                  buttons have exactly the same "name" attribute. Use the primary key of each
                  recipe record as the "value" attribute of the radio button. You don't mention
                  which server model/programming language you're using, but the finished radio
                  button code in the page containing the form might look something like:

                  <input type="radio" name="chosen" value="x">

                  Where x would be the primary key of the record that radio button corresponds to.
                  As long as all the radio buttons have the same name, only one of them can be
                  selected. The code that processes the form would look at the value of the chosen
                  field and set that specific record to be the one used in the recipe of the week.

                  Like I said, you haven't mentioned what language your script is written in. You
                  also haven't mentioned whether you're trying to write the selected record to a
                  file, use a separate table, or perhaps even add a field to the recipe table to
                  identify which record you're using for the recipe of the week. If you give that
                  information, perhaps I or someone else can suggest a more specific solution.

                  Gary
                  • 6. Re: A change in perspective..
                    Level 7
                    Hi Gary, I'm doing ASP/VBScript/SQL... yes, everything that you mentioned
                    here in your previous post is already in place, and should work as you have
                    described it.. In truth, when compiled by the browser, the table does
                    populate properly with each of the records, and the radio button in
                    particular IS dynamically selected as expected.

                    A single update function won't work as expected simply because (I'm
                    realizing) the browser will think that its just updating a single record,
                    and if only 1 record existed in that form, that would be the case. Actually,
                    I'm needing to update every record, since the previously selected record
                    needs to have the radio button value changed, as well as the newly selected
                    record.


                    • 7. Re: A change in perspective..
                      Level 7
                      _adrian wrote:
                      > I need to think about this process in a different way.. So the site I'm
                      > building is for a nutritionist, and she wants to have a "Recipe Of The
                      > Week".. where she wants to be able to look a list of recipes, and choose
                      > which one she wants to dynamically populate a certain page after selecting
                      > it.
                      >
                      > So this means that we need to return a series of records (all of the recipes
                      > in the table), and have her be able to choose one.. obviously, this means
                      > also de-selecting anything previously selected, and then all records
                      > updated.
                      >
                      > I need someone smarter than me to help me figure out how to do this with the
                      > DW behaviors.. or is this beyond DW capability? Thanks-

                      You need a page that has 2 update behaviours, the first sets all records
                      to not featured, the second sets the required record as featured. Time
                      to get your hands dirty I reckon, personally I would just use a stored
                      procedure that is triggered from a recordset (as ASP commands don't work).

                      Dooza

                      --
                      Posting Guidelines
                      http://www.adobe.com/support/forums/guidelines.html
                      How To Ask Smart Questions
                      http://www.catb.org/esr/faqs/smart-questions.html
                      • 8. Re: A change in perspective..
                        Level 7
                        Best answer all week... thanks Dooza!


                        • 9. Re: A change in perspective..
                          Level 7
                          On Fri, 14 Nov 2008 06:36:19 -0800, "_adrian" <adrian @ test.com> wrote:

                          >A single update function won't work as expected simply because (I'm
                          >realizing) the browser will think that its just updating a single record,
                          >and if only 1 record existed in that form, that would be the case. Actually,
                          >I'm needing to update every record, since the previously selected record
                          >needs to have the radio button value changed, as well as the newly selected
                          >record.

                          You still don't say how you are recording the selected record. It sounds like
                          you are doing it with a field in the table containing all the recipes. If that's
                          the case, then yes, you will need to run two separate updates. First, run one
                          that clears the previous selection. Then run one to record the current
                          selection.

                          Gary
                          • 10. Re: A change in perspective..
                            Level 7
                            _adrian wrote:
                            > Best answer all week... thanks Dooza!

                            Glad I could help!

                            --
                            Posting Guidelines
                            http://www.adobe.com/support/forums/guidelines.html
                            How To Ask Smart Questions
                            http://www.catb.org/esr/faqs/smart-questions.html