Hi,
I have 2 tables: menus and menutexts. 'Menus' contains all the
information related to a menuitem (like action,active) and 'menutexts'
contains the text information related to a menuitem (text, tooltip).
There can be multiple menutext items associated to a menuitem where
each menutext item can be in a different language so I am able to
switch from e.g. English menus to Dutch.
I have a menuform where I can edit info related to a menuitem: I can
enter the menutext in different languages. When I submit this form I
update the menu info in the 2 tables like this [pseudo code]:
menu=transfer.get("menus.menus",1)
menu.setAction(rc.action) -- rc is the request scope with info from
the form
[...set some more properties on the menubean...]
-- get all menutexts related to this menuitem
menutextArray=menu.getMenuTextArray()
<cfloop array="#menutextArray#" index="menuTextItem">
<cfset transfer.delete(#menuTextItem#)>
</cfloop>
-- create a new menuitem beans for each entered menutext in the form
-- #languageText# is an array of structs; each struct contains a key
''menuText' (a text for this menuitem) and 'languageId' (the id of the
-- corresponding language)
<cfloop array="#languageText#" index="languageStruct">
<cfset menuText=transfer.new("menu.menuText")>
<cfset menuText.setMenutext(languageStruct.menuText)>
<cfset menuText.setLanguageId(languageStruct.languageId)>
<cfset menuText.setParentMenu(menu)>
<cfset transfer.save(menuText)>
</cfloop>
This works ok but I wonder if this is the way to do it or does
Transfer offer a better way? If it is somewhere in the docs I'm happy
to get a link and loo it up myself.
Thanks,
Marc
--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer
You received this message because you are subscribed to the Google Groups
"transfer-dev" 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/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---