|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
type BeforeSave()after a form submit to update a type in webtype, if a type property does not have a corresponding FORM field, it appears that Farcry drops in the previous value - somewhere before beforeSave() is fired.
The situation I have is with checkboxes - if none are checked, there is no form field (same for radiobutton). I need to be able to update the property to blank if no check boxes are checked - not leave it in it's previous state. So, normally I add cfparam for these sort of form fields Where would I need to add this in Farcry? Or is there another way of handling this situation? -- AJ Mercer Web Log: http://webonix.net --~--~---------~--~----~------------~-------~--~----~ You received this message cos you are subscribed to "farcry-dev" Google group. To post, email: farcry-dev@... To unsubscribe, email: farcry-dev+unsubscribe@... For more options: http://groups.google.com/group/farcry-dev -------------------------------- Follow us on Twitter: http://twitter.com/farcry -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: type BeforeSave()Don't understand "webtype" but maybe You could use "bSessionOnly? <ft:processForm action="Save" exit="true"> <ft:processFormObjects typename="yourtypename" bSessionOnly="true" /> <!--- if a yourtypename object was succesfully saved ---> <cfif len(lSavedObjectIDs)> <!--- get the yourtypename object data ---> <cfset stdata = getData(objectid=lSavedObjectIDs) /> <!--- write email to db ---> <cfset obj = createObject ('component',application.stcoapi.yourtypename.typePath) /> <cfset stprops = {} /> <cfset stprops.checkboxname = "" /> <cfset stprops.otherstuff = stdata.otherstuff /> <cfset stprops.otherstuff = stdata.otherstuff /> <cfset obj.createData(stProperties=stprops) /> </ft:processForm> On Oct 28, 7:00 am, AJ Mercer <ajmer...@...> wrote: > after a form submit to update a type in webtype, if a type property does not > have a corresponding FORM field, it appears that Farcry drops in the > previous value - somewhere before beforeSave() is fired. > > The situation I have is with checkboxes - if none are checked, there is no > form field (same for radiobutton). > > I need to be able to update the property to blank if no check boxes are > checked - not leave it in it's previous state. > > So, normally I add cfparam for these sort of form fields > Where would I need to add this in Farcry? > > Or is there another way of handling this situation? > > -- > AJ Mercer > Web Log:http://webonix.net You received this message cos you are subscribed to "farcry-dev" Google group. To post, email: farcry-dev@... To unsubscribe, email: farcry-dev+unsubscribe@... For more options: http://groups.google.com/group/farcry-dev -------------------------------- Follow us on Twitter: http://twitter.com/farcry -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: type BeforeSave()Hi AJ,
What are you using to render the form fields... Is it a farcry generated form or are you writing it yourself? FarCry checkboxes and radios handle this situation. -- -- Matthew Bryant Product Development Manager Daemon Internet Consultants Adobe Solutions Partner http://www.daemon.com.au/ p. 02 8302 4600 f. 02 9380 4204 On Wed, Oct 28, 2009 at 5:00 PM, AJ Mercer <ajmercer@...> wrote: after a form submit to update a type in webtype, if a type property does not have a corresponding FORM field, it appears that Farcry drops in the previous value - somewhere before beforeSave() is fired. --~--~---------~--~----~------------~-------~--~----~ You received this message cos you are subscribed to "farcry-dev" Google group. To post, email: farcry-dev@... To unsubscribe, email: farcry-dev+unsubscribe@... For more options: http://groups.google.com/group/farcry-dev -------------------------------- Follow us on Twitter: http://twitter.com/farcry -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: type BeforeSave()It is a facry type with custom ajax and edit functions
I am creating the checkboxes myself in the edit function So, I guess I need to do something extra would it be as simple as adding the objectID prefix? The checkboxes are also dynamically created via ajax functions as well 2009/10/29 Mat Bryant <mbryant@...> Hi AJ, -- AJ Mercer Web Log: http://webonix.net --~--~---------~--~----~------------~-------~--~----~ You received this message cos you are subscribed to "farcry-dev" Google group. To post, email: farcry-dev@... To unsubscribe, email: farcry-dev+unsubscribe@... For more options: http://groups.google.com/group/farcry-dev -------------------------------- Follow us on Twitter: http://twitter.com/farcry -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: type BeforeSave()I believe FarCry solves this by adding a hidden input by the same name with just a space. It forces the browser to submit somthing to the server for that field.
Blair On Thu, Oct 29, 2009 at 9:33 AM, AJ Mercer <ajmercer@...> wrote: It is a facry type with custom ajax and edit functions --~--~---------~--~----~------------~-------~--~----~ You received this message cos you are subscribed to "farcry-dev" Google group. To post, email: farcry-dev@... To unsubscribe, email: farcry-dev+unsubscribe@... For more options: http://groups.google.com/group/farcry-dev -------------------------------- Follow us on Twitter: http://twitter.com/farcry -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: type BeforeSave()seeing as it is 'my' field - I will just check the FORM scope
rather than stProperties 2009/10/29 Blair McKenzie <shib71@...> I believe FarCry solves this by adding a hidden input by the same name with just a space. It forces the browser to submit somthing to the server for that field. -- AJ Mercer Web Log: http://webonix.net --~--~---------~--~----~------------~-------~--~----~ You received this message cos you are subscribed to "farcry-dev" Google group. To post, email: farcry-dev@... To unsubscribe, email: farcry-dev+unsubscribe@... For more options: http://groups.google.com/group/farcry-dev -------------------------------- Follow us on Twitter: http://twitter.com/farcry -~----------~----~----~----~------~----~------~--~--- |
| Free embeddable forum powered by Nabble | Forum Help |