Dynamic value objects in flex and coldfusion 9
I'm writing a program for a company that does registrations for conventions and trade-shows. The problem I'm having is that each different client wants to store different data for each show. Most of the data is the same (attendee's name, address, etc...), but each show has some customizations that it wants to have... So each database for each show is going to be different...
Right now, the only way I know how to transfer data from Flex to ColdFusion is via a Value Object. (Well, the only good way to do it, that is.) My problem comes when a client wants a particular database customized. I have MANY questions about this...
1) How do I tell my Value Object what fields we've added to or changed in the database without re-writing the entire VO (in both the .AS and .CFC files) and re-compiling my program? In other words, I need a dynamic VO that changes automatcially with the database.
2) If there is a way to dynamically create a VO in Flex (and from a few blog posts I've seen, it seems there is a way), how do I tell CF9 what the structure of that dynamically-created VO is? Without re-writing a bunch of .CFC files every time I add or change a field in the database, that is...
3) How do I reference the dynamically-created fields in my Flex program? Right now, for example, I can define a variable called attendeeInfo as type attendeeInfoVO, and then reference things like attendeeInfo.first_name, attendeeInfo.last_name, etc... How do I reference a field programmatcially when I don't know what it's going to be called beforehand?
4) How do I make my program display/modify those dynamically-created fields? Right now, using the attendeeInfo example above, I can create a TextInput with an id="firstNameInput" and just say firstNameInput.text = "{attendeeInfo.first_name}". That won't work when I have no clue how many dynamically-created fields there are, or even what kind of data they're going to store... How do I deal with this?
5) Is there something other than VOs that would fit this situation better? Am I limiting myself by using VOs in the first place? Is it just plain impossible to do this with VOs? And if so, what are my alternatives? I need a structured object that can be passed around with a single reference -- I absolutely DO NOT want to pass a bunch of references to a bunch of different variables -- that's why I used VOs from the very beginning.
6) Can I simply PAY someone at Adobe for one-on-one help here? Do they have experts that you can "buy" for a few hours? What's the charge for that, if such a thing is available? Or, is this problem well-explained somewhere on the Web, and I just haven't found it yet?
I'm very confused here, and it seems like I might have to re-write a ton of code, which I'm not looking forward to... Ugh... I appreciate any help you can give me...
Thanks,
Laurence MacNeill
Mableton, Georgia, USA
This blog post is pretty close to what I want:
http://justinjmoses.wordpress.com/2008/10/10/flex-dynamic-bindable-value-objects/
So there are the dynamic value objects I was looking for. But the blog-poster is using LINQ and .Net 3.5. I'm using ColdFusion9.
So, how do I get ColdFusion9 to deal with that? How do you get CF9 to recognize the fact that you've changed the VO, and deal with it appropriately?
Thanks,
L.
Similar Messages
-
How do I save a file to a server using flex and coldfusion?
How do I save a file to a server using flex and coldfusion?
On the CF side I might need to use this:
<cffile action="UPLOAD" filefield="Filedata"
destination="#expandpath('..\somepath)#"
nameconflict="overwrite">
And on the flex side I might need to use something like this:
var sendVars:URLVariables = new URLVariables();
sendVars.action = "upload";
var request:URLRequest = new URLRequest();
request.data = sendVars;
request.url = _strUploadScript;
request.method = URLRequestMethod.POST;
_refUploadFile = new FileReference();
_refUploadFile = _arrUploadFiles[_numCurrentUpload].data;
_refUploadFile.addEventListener(ProgressEvent.PROGRESS,
onUploadProgress);
_refUploadFile.addEventListener(Event.COMPLETE,
onUploadComplete);
_refUploadFile.addEventListener(IOErrorEvent.IO_ERROR,
onUploadIoError);
_refUploadFile.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
onUploadSecurityError);
_refUploadFile.upload(request, "file", false);
I just don't know how to put it all together in Coldfusion.try this...
http://cf-creations.co.uk/blog/index.cfm/2008/9/20/Flex--File-Upload-Form--Part-One--Build ing-The-Initial-Form -
Anyone know how to gernerate CRUD applications with flex and coldfusion?
Anyone know how to gernerate CRUD applications with flex and
coldfusion? I am working with a remote coldsfusion installation
with MS SQL and I don't have RDS.You might investigate "squidhead". It is CF based. I'm not
sure if it has any Flex related features.
http://squidhead.riaforge.org/ -
Flex and Coldfusion error handling
Hello! I was wondering if someone could point me in the right direction regarding error handling in a Flex app thats using an HTTPSERVICE RPC to a Coldfusion component.
If a user is entering form data in Flex and clicks submit... the data is sent via the HTTPSERVICE send method as XML to the CFC. But what if there is a Coldfusion SQL insert statement error? Say a user enters a character in a number field (now i know the best thing to do would be to have actionscript ensure that the values entered are numbers but lets keep that aside just for this example). How could I alert the user to let them know the CFC encountered a SQL error? Or better yet... alert them that everything went "A" ok and their data was successfully submitted.
I originally thought to put CFTRY and CFCATCH around the CFC code. I could do that fine, but had trouble passing back a message string so that FLEX could use it in an Alert.Show window.
Thanks!
-BosDogHey Mike,
Sorry after I posted I thought "this may be a question for CF guys as well".
I definitely use and love RemoteObjects. Its great for binding to datagrids and to run SQL to return data from the server back to Flex. I've struggled with successfully passing variables from Flex to CF using RemoteObject though. Say a dataform with 5 text fields & 2 combo box dropdowns.
I think you may have forgotten to post the link to the article for me to read... i didnt see it in your last post?
Thanks! -
How to get and disply dynamic values on the fly and display in applet
hello all ,
i have a problem in refreshing a applet.
i have a scrolling applet which will get the share values from the database and display in a scrolling applet in the browser . i am getting the values and displaying it.
but the problem is , if i enter a new record in the database, until and unless i press refresh button of the browser, i am not getting the new values . please help me if anybody having the idea. please mail me to [email protected]
thank you all.
by
sambaYou want a database update to trigger an applet refresh? Can't be done.
However, you can have the applet periodically re-query the database and update its display with the information it retrieves. Just kick off a Thread that sleeps for a bit, wakes up, queries the db, updates the display, and goes back to sleep. -
How to dynamically add an object into flex and animate it.
im planning to implement a dynamic animation which can be used to show some trend of a variable
this is my case..
suppose i have data in a table
Y | X
12 | 3
32 | 5
34 | 10
what i want to do is i want to insert a circle to (3,12) i.e. the first point.. then animate it with the time to next points
(3,12) --> (5,32) --> (10,34)
this process hv to be totally dynamic.. becos im planning to fetch data from a table.. so the no of rows also can be any amount.
is thr a method to do those stuff in flex. ?
thanks in advanceAnyone got any suggestions?
-
Flex and ColdFusion web services
I have a simple CFC created that encompasses a function that
has a query. I want to be able to use the web service in my Flex
app, but I am having issues with getting the information from the
CFC.
My function is simple:
<cffunction name="listBySubject" access="remote"
returntype="query" output="false" hint="I grab the newest
stories">
<cfargument name="subject" type="string"
required="yes">
<cfquery name="list" datasource="#myDataSource#">
SELECT linktext, story, photo
FROM pressreleases
WHERE rss_feed = <cfqueryparam
value="#arguments.subject#" />
OR rss_feed2 = <cfqueryparam value="#arguments.subject#"
/>
ORDER BY releaseDate DESC
</cfquery>
<cfreturn list>
</cffunction>
How can I modify that to use in a Flex app's
<mx:WebService>? Do I have to use cfsavecontent and return
XML or can I keep it a query and use it with an ArrayCollection?
Something like:
<cffunction name="listBySubject" access="remote"
returntype="xml" output="false" hint="I grab the newest
stories">
<cfargument name="subject" type="string"
required="yes">
<cfquery name="list" datasource="prmc-media">
SELECT linktext, story, photo
FROM pressreleases
WHERE rss_feed = <cfqueryparam
value="#arguments.subject#" />
OR rss_feed2 = <cfqueryparam value="#arguments.subject#"
/>
ORDER BY releaseDate DESC
</cfquery>
<cfsavecontent variable="storyList">
<magStories>
<cfoutput query="list">
<magStory id="#ISBN#">
<linkURL>#XMLFormat(linkURL)#</booktitle>
<story>#XMLFormat(story)#</teaser>
<photo>#XMLFormat(photo)#</price>
</magStory>
</cfoutput>
</magStories>
</cfsavecontent>
<cfreturn storyList>
</cffunction>
Locally I can use RemoteObject all day with the way it is
normally, but since UofMichigan has BlueDragon, I am forced to
convert my apps to WebServices.Hi,
Here is how to do the web services in coldfsuion.
http://www.quackit.com/coldfusion/tutorial/coldfusion_web_services.cfm
No in flex you call the webservices like:
<mx:WebService id="webService"
wsdl="
http://www.flash-mx.com/ws/months.cfc?wsdl">
<mx:operation name="getMonths"
resultFormat="object"
result="getMonths_result(event);"
fault="getMonths_fault(event);" />
</mx:WebService>
http://blog.flexexamples.com/2008/04/14/calling-a-simple-web-service-from-flex-using-the-w ebservice-class/
I hope this give you the idea.
Rgds
JFB -
Hi everyone,
Can someone tell me how I can enable and disable a button on
my flex application based on access level using coldfusion mx 7.
Please help me, thanks
Cliffyjust add a field in your db for the "access level" like
1,2,3,etc then get that value from the select * from login where
user=var and pass=var, that should give you back the level then you
can use it however you want once you are returning it. -
Flex and ColdFusion and session facade?
I want to deploy a flex application on an existing ColdFusion
server. This server is already in production and uses a root
Application.cfc to set session variables as well as authenticate
the user to AD with getAuthUser. When I deploy my flex application,
it fails because of the OnRequestStart cfcomponent within
Application.cfc. I am wondering if this would be proper use of
session facade? How do I best encapsulate session variables from
the root Application.cfc within my new flex application? Basically
I will need to follow the same authentication and cfset session
guidelines that all of my other CF applications use, and my flex
app needs to have theses session variables available to it, but I
am not sure the best approach. Any insight is welcome.Did you enable session management in the Application.cfc or
Application.cfm? -
Can someone tell me how I can create a popup login system
using a coldfusion mx 7 backend. thank you.Check credentials then remove pop up? How can I remove the
Popup login box after successful login? please help me...
private function handleLoginSucess(eventObj:Event):void {
//Get the member object from the LoginForm component
PopUpManager.removePopUp(this)
LoginForm.mxml
public function
resultGetMemberByUserNameAndPassword(event:ResultEvent):void {
//used for debugging - shows details about result
//returned by the CFC method
//Alert.show( ObjectUtil.toString(event.result) );
/*result returned is a Member object
cast the result returned to a Member class
and assign it to our Member object*/
__member = event.result as Member ;
//remove text in the login input fields
username.text="";
password.text="";
// Define event object, initialize it, then dispatch it.
dispatchEvent(new Event("loginSuccess"));
PopUpManager.removePopUp(this)
} //end function getMemberByUserNameAndPassword
private function processLogin():void {
//change state back to the default so the errorLogin state
doesn't appear again
currentState = '';
//Alert.show("Processing Login...");
MemberService.getMemberByUserNameAndPassword(username.text,
password.text);
}//end function processLogin
} -
Is there any bapi returns dynamic value of reorder point and safety stock
Hi all,
Is there any bapi returns the runtime value of ROP and SS by passing changenr/objectid taken from CDPOS.
if exists please send me with code.
Thanks
PRR Rhi,
As far as i know is static means manual entry of reorder point.
The dynamic or automatic reorder point is used for Forecast based planning...
the sysstem wii automatically calculate the reoder point evrytime there is the forecast run.
So, it dependig on ur scenario , select either manual or automatic.
First entry for both is always manual entry....
hope u got this..
Regards,
Smitha -
Navigating through objects in flex and refreshing them
In an mxml file called Rate,
I have a vertical box called stepsVB and an array called steps.
This stepsVB is activated in a state called "states"
when currentState = "" i see something else.
steps contain objects of mxml files. step1.mxml, step2.mxml, step3.mxml and step4.mxml
when i click on the next button, I navigate from step1 to step2 and so on using
stepsVB.removeChildAt(0);
stepsVB.addChildAt(steps[2], 0);
when i move from step1 to step2 and step2 to step3 and change my currentState to "", if I press my next button, i see step3 instead of step1.
How do I move to step1 instead of step3. Also, I need to execute my creation complete method for each step as I move.
In other words, I need to set it up in such a way that the whole flex file refreshes. How do I accomplish this?
Your help is greatly appreciated.
Thank you very much
NikhilHi,
If you want to map your actionscript class to your server's
Java class. You can run a util function
registerClassAlias("dev.echoservice.Book",Book);
where "dev.echoservice.Book" is the fully qualify name of
your java class. Book is your actionscript class.
Calling this util before you make your remoteobject call. You
can put this in your actionscript class constructor, it makes this
call whenever you create your class. However, it seems to be better
to call it when the class is loaded. To do so you can declare it as
static
public static var a:* =
registerClassAlias("dev.echoservice.Book",Book);
OR
You can also declare it as metaData in your class as:
[RemoteClass(alias="dev.echoservice.Book")]
However, I found someone saying that it didn't work in sdk
compilation, but webtier compilation. It might be some
configuration issue. I haven't tried it yet.
To display the properties in the dataGrid, you just have to
either use Array or ArrayCollection. If databinding is involved,
the datagrid need to know the Collection.Change event. It is better
to use ArrayCollection, therefore, adding new item to
arrayCollection the datagrid get repopulate.
hope it helps!
William Chan -
How to uoload file with Flex and Coldfusion?
Hi,
I try some application but they can not work well.
Please give me a hit for upload files.
Thanks
MarkSee these FB help topics:
Working with file upload and download
Example: Uploading and downloading files
Class FileReference -
Flex SDK pdf class and ColdFusion 9
Regarding the Pdf class (which is wrapper for ColdFusion 9's cfpdf).
I am trying to determine if it is worth upgrading to Flash Builder 4, just
to use the Pdf class.
How well does the Pdf class work?
When generating thumbnails, does the Pdf class rasterized pdf page?
Does Pdf class require an image object to display the Thumbnail page?
Any opinions?This blog post is pretty close to what I want:
http://justinjmoses.wordpress.com/2008/10/10/flex-dynamic-bindable-value-objects/
So there are the dynamic value objects I was looking for. But the blog-poster is using LINQ and .Net 3.5. I'm using ColdFusion9.
So, how do I get ColdFusion9 to deal with that? How do you get CF9 to recognize the fact that you've changed the VO, and deal with it appropriately?
Thanks,
L. -
Need help regarding Value Object Concept in flex/java
I need to map the java objects to flex use value objects in flex.
The problem is I have a class in java which is referring to another class and again that class referring another class.
For instance
Class A
protected User user;
Class User
protected Address address;
Now I need to map class A to the flex using value object concept and I have to display the user info in the grid as well.
Need some help to get started.You need to set the "scope" property in your remoting destination definition to "session" or "application".
Maybe you are looking for
-
I am creating a document in Indesign CS4 that is to be exported as a pdf. Within this one page document, there are approximately 40 listed products, one after the other and each product has been set up to hyperlink to a specific pdf in the same direc
-
Split Window View in MAC ver 7.7??? Yes or NO?
I just moved to MAC and love my Skype PC version because of the Split Window View. Is this possible in MAC version 7.7? I don't see that option anywhere. You answer is appreciated! LH Solved! Go to Solution.
-
Dual Display - help with Cinema Display for MacBook Pro where MB won't detect displays.
I just got a Cinema Display (a1081 20") ("CD") off eBay to use as a dual screen with my Macbook Pro OS X 10.6.8 ("MB"). However, I can't get MB to recognize CD! I've tried power cycling both the MB and the CD with and without USB cord connected. MB w
-
How to move Google custom search
Hi guys, This is frustrating me like mad, if you can help you are a life saver! I do not know how to move the search bar around my site. It is stuck behind an image atm and looks stupid. After messing around with code for hours I have also made an un
-
frnds! while calling a method from statelesssession bean the exception is thrown:-- Error 500 An error has occured while processing request:http://192.168.1.61/MyApp/TradeSession/TradeClient.jsp Message: Server caught unhandled exception from servlet