I have to go to work for a couple of hours. I will digest your email when I return. Just did not want you to think I did not appriciate the response, just can't study it right now. Supposed to be at a job by 12:30.
Thanks, Mark -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of John Stanley Sent: Friday, August 26, 2005 11:56 AM To: '[email protected]' Subject: RE: [plum] mass update Mark, If I was going to do this I would approach it this way: (Sorry for duplicating any steps you may have already done) 1. Add the attribute pageMode to the displayList custom tag. Make the default value "Delete". 2. In the displayList custom tag replace all occurances of the word Delete with #attributes.pageMode#. 3. Call the displayList custom tag on the page you need it using the attribute pageMode as "Update". 4. Make sure you still call the delete check boxes for each row. (after this you may need to do some bug fixes as I have not tested this,but it should work.) 5. make sure updateaction page still uses the cf_validateform and validateinput tags so you can make sure the data is correct. 6. in place of a call to the normal update record custom tag you could just write your own update query like : Update myTable set thisValue = #whateverValueYouWantToUse# where myTableId in (#aCollectionOfTheCheckboxesSelected#) You could get aCollectionOfTheCheckboxesSelected by something like: This assumes that all the checkboxes have the following string in their name "checkbox". <cfset aCollectionOfTheCheckboxesSelected =""> <cfloop collection="#form#" item="formElement"> <cfif findNoCase("checkbox",formElement)> <cfset aCollectionOfTheCheckboxesSelected = ListAppend(aCollectionOfTheCheckboxesSelected,#Evaluate("formElement")#> </cfif> </cfloop> you will need the above code because there is alot of stuff that comes through in the form collection and you want to make sute you get the right stuff. If you wanted to make the update portion of this code portable you could put it into your own UDF or custom tag. Let me know if that is what you want to do and I'll write something up. Let me know if you have any questions or problems. -----Original Message----- From: Mark Fuqua [mailto:[EMAIL PROTECTED] Sent: Friday, August 26, 2005 11:22 AM To: [email protected] Subject: RE: [plum] mass update Yes John, But with one important distinction (which you may already have factored in). All the records that are checked will have the same update, which should make the action page much easier. When I was looking at the <cf_displayList> tag, it seemed like all the functionality was there, including error checking and validation, for the form page, by simply (simply may be the wrong word, but it seems simple) changing the action info (around line 955) and the link info at the bottom (around line 976) of the massDelete section of the <cf_displayList> tag. When I changed the action= attribute at the top, it did post to the specified page, but did so without the form fields I expected. I was unable to change the link info at the bottom (line 976+/-). It is a javascript function which I do not understand. I was thinking that this would be a great for all kinds of "mass actions" one might want to do since you could use a <cfswitch> tag to run through the different possibilities (mass delete, mass update, mass email) based on the value of the label attribute of the <cf_displayDeleteCheckboxInForm> as the <cfcase> value. Simply repeating the code (with some minor mods) between line 955-976 for each <cfcase> Mark Fuqua -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of John Stanley Sent: Friday, August 26, 2005 10:53 AM To: '[email protected]' Subject: RE: [plum] mass update Hi Mark, I'm coming into this discussion late but let me see if I get the gist of what you are trying to do. You have a bunch of records (with their own unique ID's) all to be listed on a single page. You then want to assign a different value to each of them based upon some user input. You want the user to click on one update button and have them all updated? Is that what you mean? -----Original Message----- From: Jeff Fleitz [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 8:36 AM To: [email protected] Subject: Re: [plum] mass update Hi Mark, I don't think asking for help is uncouth or offensive, however I personally don't have any time to chase this issue at this time, sorry. Jeff Mark Fuqua wrote: > Hey Jeff, > > I think I found an "easyish" way to cheat on the first page at least. If > you consider that any mass update or similar "mass" anything page, would > more than likely be easier to handle with a hand crafted (Churvis speak) > action page, I think it would be simple to put a <cfif> at the top of the > following code to check for the label attribute of the > <cf_displayDeleteCheckboxInList> tag (the attribute is referenced closer to > the top of the tag where the list table is formed). If the label attribute > = update or send an email, the form could post to your hand crafted action > page. Additionally, that would give the checkboxes a label of Update, or > Send Email or whatever and the link at the bottom could be changed as well > to say [Update Selected Items] or [Send email to Selected]. > > This code is from the very end of <cf_displaylist> > > IF YOU WERE TO PUT AN ADDITIONAL CRITERIA ON THE FIRST <CFIF> BELOW i.e. > ADD THE LABEL ATTRIBUTE OF THE DISPLAYDELETECHECKBOXINLIST, THEN YOU COULD > REPEAT THAT FIRST BLOCK OF CODE FOR THE DIFFERENT POSSIBILITIES. I KNOW > EVEN LESS ABOUT JAVASCRIPT THAN I DO ABOUT COLDFUSION SO I CAN'T CHANGE THE > CODE LOWER DOWN ABOUT WHERE TO POST THE MASS DELETE STUFF AND CHECKING TO > SEE THAT THERE ARE CHECKBOXES CHECKED, BUT I BET IF YOU DID, IT WOULD GIVE > YOU FORM VARIABLES WHICH WOULD BE THE PK'S OF ALL THE CHECKED ITEMS ON > WHATEVER ACTION PAGE YOU POSTED TO. > > John, Tim, David, Adam, Jeff...anyone feel so inclined? Not that it would > in anyway compensate in and of itself, but since I really can't help on the > coding end, I would be more than willing to contribute a $50 gift > certificate to the corporate restaurant of one's choosing or Amazon or > something (someone please tell me if that is uncouth or offensve on a > mailing list). > > Thanks, > > Mark > > > <cfoutput> > <cfif Request.lastPage GT 1 OR StructKeyExists(ThisTag, "massDelete")> > <form name="PageForm#Request.listInstanceNumber#" > action="#CGI.Script_Name#" method="get"> > <input type="hidden" name="rand" value="#CreateUUID()#"> > <cfset wedge = ""> > <cfif GetBaseTagList() CONTAINS "FORM"> > <cfloop collection="#URL#" item="currentKey"> > <cfif > ListFindNoCase("FromAction,FromSort,SortOrder,rand,#Attributes.table#Page", > ReReplaceNoCase(currentKey, "^amp;", "")) EQ 0> > <input type="hidden" name="#ReReplaceNoCase(currentKey, '^amp;', '')#" > value="#URL[currentKey]#"> > <cfset wedge = wedge & "&" & ReReplaceNoCase(currentKey, "^amp;", "") & > "=" & URLEncodedFormat(URL[currentKey])> > </cfif> > </cfloop> > </cfif> > <tr> > <td colspan="#Request.numListColumns#" nowrap> > <table cellpadding="0" cellspacing="0" border="0" width="100%"> > <tr class="#Application.Formatting.AlternateRowShading(currentRow)#"> > <cfif StructKeyExists(ThisTag, "massDelete")> > <td class="leftalign"> > [<a href="javascript:if(checkMassDelete#Request.listInstanceNumber#()) > document.MassDeleteForm#Request.listInstanceNumber#.submit();">Delete > selected items</a>] > </td> > </cfif> > > <cfif Request.lastPage GT 1> > <td class="rightalign"> > <cfif Evaluate("#Attributes.table#page") NEQ 1><a > href="#CGI.Script_Name#?#Attributes.table#page=1#wedge#"><< > First</a></cfif> > <cfif Evaluate("#Attributes.table#page") NEQ 1><a > href="#CGI.Script_Name#?#Attributes.table#page=#Evaluate('#Attributes.table# > page') - 1##wedge#">< Previous</a></cfif> > Page <select name="#Attributes.table#page" > onchange="document.PageForm#Request.listInstanceNumber#.submit();"> > <cfloop from="1" to="#Request.lastPage#" index="i"> > <option value="#i#"<cfif Evaluate("#Attributes.table#page") EQ i> > selected</cfif>>#i#</option> > </cfloop> > </select> of #Request.lastPage# > <cfif Evaluate("#Attributes.table#page") NEQ Request.lastPage><a > href="#CGI.Script_Name#?#Attributes.table#page=#Evaluate('#Attributes.table# > page') + 1##wedge#">Next ></a></cfif> > <cfif Evaluate("#Attributes.table#page") NEQ Request.lastPage><a > href="#CGI.Script_Name#?#Attributes.table#page=#Request.lastPage##wedge#">La > st >></a></cfif> > </td> > </cfif> > > </tr> > </table> > </td> > </tr> > </form> > </cfif> > </cfoutput> > > <cfoutput></table></cfoutput> > > <cfif Attributes.displayALinkToThisSearchForm NEQ "No" AND NOT > StructKeyExists(ThisTag, "searchForms")> > <cfoutput>[<a href="#Attributes.displayALinkToThisSearchForm#">Back to > Search</a>]</cfoutput> > </cfif> > </cfif> > <cfsetting enablecfoutputonly="No"> > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Jeff > Fleitz > Sent: Wednesday, August 24, 2005 4:43 PM > To: [email protected] > Subject: Re: [plum] mass update > > > Ok, I understand. I think your approach is sound and I can't think of a > better alternative. There is going to be a lot > of mods involved. You might just want to go the way of creating your own > custom tags by copying the ones being used for > mass deletes and then modifying them for updates, as opposed to trying to > mod the existing tags. All these tags are > nested and it makes it very hard to work with, as you saw from our endeavor > last week. > > I think these are the tags involved with mass deletes, but do the search to > verify: > > cf_DisplayList > cf_DeleteRecord > cf_DisplayDeleteCheckboxInList > > > I think having a mass 'action' tag would be great, for not just doing > updates, but sending mailings, etc. > > Jeff > > Mark Fuqua wrote: > >>Jeff, >> >>Here is the scenario, maybe you can offer an alternative. I am certainly >>not married to any one idea of how to get it done. >> >>I have a table called LaborSteps. Each labor step has a status column: >>Status=1=not complete; status=2=complete; status=3=complete and quality >>checked; status=4=complete, quality checked and paid. There are three >>additional fields that are involved: CompletedBy, CheckedBy, DatePaid. >> >>A list of these labor steps for each job is lengthy. Maybe 200-300+. So >>doing individual updates is not practical. The idea is to make the form >>submission quick and easy. Filter the list on status (there would be > > three > >>different forms but all would essentially increase the status value by one >>and insert a userId or date) On the form the user would choose a name > > from > >>a drop down list, or enter a date (DoneBy or CheckedBy or DatePaid), check >>the appropriate records to update and hit submit. >> >>This has been on my mind literally for three years, so what I just typed >>makes since to me (I see it in my sleep) but I know from trying to > > explain > >>this to others it might not make since to the person reading it. If it >>doesn't make since, let me know. I am eager for input and input is not >>possible if you can't understand what I am trying to do. >> >>Thanks, >> >>Mark >> >>-----Original Message----- >>From: [EMAIL PROTECTED] >>[mailto:[EMAIL PROTECTED] Behalf Of Jeff >>Fleitz >>Sent: Wednesday, August 24, 2005 3:54 PM >>To: [email protected] >>Subject: Re: [plum] mass update >> >> >>Have fun with this one. >> >>Most of the functionality for this is handled in the DisplayList and >>DeleteRecord tags (search on massDelete). The >>DeleteRecord tag will loop over the pk's provided by the DisplayList tag > > and > >>invoke the DeleteRecord method of the >>DatabaseBlocks component for each pk. >> >>You will have to make heavy mods to the DisplayList tag to mimic the >>massDelete functinality. >> >>I am curious as to why you need a mass update checkbox in the first place? >>Updates are done to discrete rows one at a >>time. I don't see the benefit of what you are trying to do. >> >>Jeff >> >> >>Mark Fuqua wrote: >> >> >>>I need to build a list with a "mass update" checkbox similar to mass >> >>delete. >> >> >>>I am guessing that the mass delete "action" takes place in the >>>databaseBlocks.cfc. >>> >>>I notice when I look at the <displayDeleteCheckBoxInList>, that there is >> >>an >> >> >>>attribute named label, which has a default value of "delete". My update >>>will change one field value from x to x+1 and another field value from >>>"null" to a plumUserId(integer) value. The PlumUserId value would be a >>>session variable. >>> >>>Does anyone have any idea how hard it would be to check the >> >>attribute.label >> >> >>>of the <displayDeleteCheckBoxInList> checked from within the >>>databaseBlock.cfc (or whatever does the mass delete) and if the value is >>>"update" have it run the code necessary for this type of multiple update, >>>instead of the mass delete? >>> >>>Would anyone else find such a functionality valuable? >>> >>>Mark >>> >>> >>> >>> >>> >>> >>>********************************************************************** >>>You can subscribe to and unsubscribe from lists, and you can change >>>your subscriptions between normal and digest modes here: >>> >>>http://www.productivityenhancement.com/support/DiscussionListsForm.cfm >>>********************************************************************** >>> >>> >> >> >>********************************************************************** >>You can subscribe to and unsubscribe from lists, and you can change >>your subscriptions between normal and digest modes here: >> >>http://www.productivityenhancement.com/support/DiscussionListsForm.cfm >>********************************************************************** >> >> >> >>********************************************************************** >>You can subscribe to and unsubscribe from lists, and you can change >>your subscriptions between normal and digest modes here: >> >>http://www.productivityenhancement.com/support/DiscussionListsForm.cfm >>********************************************************************** >> >> > > > ********************************************************************** > You can subscribe to and unsubscribe from lists, and you can change > your subscriptions between normal and digest modes here: > > http://www.productivityenhancement.com/support/DiscussionListsForm.cfm > ********************************************************************** > > > > ********************************************************************** > You can subscribe to and unsubscribe from lists, and you can change > your subscriptions between normal and digest modes here: > > http://www.productivityenhancement.com/support/DiscussionListsForm.cfm > ********************************************************************** > > ********************************************************************** You can subscribe to and unsubscribe from lists, and you can change your subscriptions between normal and digest modes here: http://www.productivityenhancement.com/support/DiscussionListsForm.cfm ********************************************************************** ********************************************************************** You can subscribe to and unsubscribe from lists, and you can change your subscriptions between normal and digest modes here: http://www.productivityenhancement.com/support/DiscussionListsForm.cfm ********************************************************************** ********************************************************************** You can subscribe to and unsubscribe from lists, and you can change your subscriptions between normal and digest modes here: http://www.productivityenhancement.com/support/DiscussionListsForm.cfm ********************************************************************** ********************************************************************** You can subscribe to and unsubscribe from lists, and you can change your subscriptions between normal and digest modes here: http://www.productivityenhancement.com/support/DiscussionListsForm.cfm ********************************************************************** ********************************************************************** You can subscribe to and unsubscribe from lists, and you can change your subscriptions between normal and digest modes here: http://www.productivityenhancement.com/support/DiscussionListsForm.cfm **********************************************************************
