Re: Ajax Query
thanks Tony :) -- From: "Tony Bentley" Sent: Thursday, November 12, 2009 12:03 AM To: "cf-talk" Subject: Re: Ajax Query > > Looks like everything is using Ext objects. Try building a function that > grabs each set value and places it in a corresponding hidden input on your > page.You need to store this collection somehow either in DOM or in form > elements. Easiest way to see your results is by using form elements that > are hidden to the user. I'm not sure how to grab the selected values but > I'm sure Ext has something built into the API for each object. > > A universal function would look something like this: > > //using jquery > function save(sourcevalue, elementIdToSaveTo){ > $("#"+elementIdToSaveTo).val(sourcevalue); > } > //standard js notation > function save(sourcevalue, elementIdToSaveTo){ > document.getElementById(elementIdToSaveTo).value = sourcevalue; > } > > You would run this for every item that you want to store. > > I'm not sure if this helps. Without seeing what your client side looks > like and being able to inspect the elements, it is a little tough to > figure out a viable solution. > > ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328291 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Ajax Query
Looks like everything is using Ext objects. Try building a function that grabs each set value and places it in a corresponding hidden input on your page.You need to store this collection somehow either in DOM or in form elements. Easiest way to see your results is by using form elements that are hidden to the user. I'm not sure how to grab the selected values but I'm sure Ext has something built into the API for each object. A universal function would look something like this: //using jquery function save(sourcevalue, elementIdToSaveTo){ $("#"+elementIdToSaveTo).val(sourcevalue); } //standard js notation function save(sourcevalue, elementIdToSaveTo){ document.getElementById(elementIdToSaveTo).value = sourcevalue; } You would run this for every item that you want to store. I'm not sure if this helps. Without seeing what your client side looks like and being able to inspect the elements, it is a little tough to figure out a viable solution. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328276 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Ajax Query
replace("article_number", "quantity")).focus(false, 50); } else { Ext.get(String(field.name).replace("article_number", "article_name")).set({value : ""}); this.focus(false, 50); } } } }); c = new Ext.form.TextField({//Dynamic article_name Field allowBlank: true, hideLabel: true, name: "article_name"+row, id: "article_name"+row, readOnly: true, width: 180, dummy: true }); d = new Ext.form.NumberField({ //Dynamic Quantity Field allowBlank: false, allowDecimals: false, decimalPrecision: 0, hideLabel: true, name: "quantity"+row, id: "quantity"+row, width: 50, dummy: true }); e = new Ext.form.NumberField({ //Dynamic Price Field allowBlank: false, allowDecimals: true, decimalPrecision: 2, hideLabel: true, name: "price"+row, id: "price"+row, width: 50, dummy: true }); f = new Ext.form.NumberField({ //Dynamic Total Price Field allowBlank: false, allowDecimals: true, decimalPrecision: 2, hideLabel: true, name: "t_price"+row, id: "t_price"+row, width: 50, dummy: true }); Ext.getCmp("columnID").insert(row, a ); Ext.getCmp("columnArticleNumber").insert(row, b ); Ext.getCmp("columnArticleName").insert(row, c ); Ext.getCmp("columnQty").insert(row, d ); Ext.getCmp("columnPrice").insert(row, e ); Ext.getCmp("columnTPrice").insert(row, f ); Ext.getCmp("columnID").doLayout(); Ext.getCmp("columnArticleNumber").doLayout(); Ext.getCmp("columnArticleName").doLayout(); Ext.getCmp("columnQty").doLayout(); Ext.getCmp("columnPrice").doLayout(); Ext.getCmp("columnTPrice").doLayout(); //Ext.getCmp("new_order_form").getForm().add( a ); //Ext.getCmp("new_order_form").getForm <div id="test2"></div> <script type="text/javascript"> Ext.onReady(function(){ var PANEL821 = new Ext.Panel({ autoHeight: true, autoWidth: true, id: "myPanel", renderTo: "test2", items: [ new Ext.Button({ handler: testHandler, iconCls: "icon-save", text: "Save Form", dummy: true }) ], dummy: true }); function testHandler() { //var b = document.getCmp('myWin'); var a = this.findParentByType('panel').id; a = a.findParentByType('window').id; Ext.Msg.alert('Test', a); //new_order_form.form.findField('quantity2').setValue('12'); } }); ().add( b ); //addAfter( a, c ); //Ext.getCmp("new_order_form").doLayout(); } -- From: "Arsalan Tariq Keen" Sent: Wednesday, November 11, 2009 7:50 AM To: "cf-talk" Subject: Re: Ajax Query > > Attached is my code for the Parent window (order_new_form.cfm) and the > child > window (order_new_gridPrice.cfm). > > The code is lengthy and may seem filthy too...so I m summarising my > goal > Initially a form is displayed in a parent window in which the user enters > Article Number. The article number filed upon 'change' opens a child > window > in which I have to display a grid for further user selection. However to > keep things simple for now I am just displaying a button which on click > shall set the value of field quantity (to any arbitrary integer value for > now) in the parent window and also then close the child form. > > Many thanks in advance! > > -- > From: "Tony Bentley" > Sent: Wednesday, November 11, 2009 5:44 AM > To: "cf-talk" > Subject: Re: Ajax Query > >> >> Sure, please provide some code. >> >> > > ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328241 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Ajax Query
Attached is my code for the Parent window (order_new_form.cfm) and the child window (order_new_gridPrice.cfm). The code is lengthy and may seem filthy too...so I m summarising my goal Initially a form is displayed in a parent window in which the user enters Article Number. The article number filed upon 'change' opens a child window in which I have to display a grid for further user selection. However to keep things simple for now I am just displaying a button which on click shall set the value of field quantity (to any arbitrary integer value for now) in the parent window and also then close the child form. Many thanks in advance! -- From: "Tony Bentley" Sent: Wednesday, November 11, 2009 5:44 AM To: "cf-talk" Subject: Re: Ajax Query > > Sure, please provide some code. > > ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328238 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Ajax Query
Sure, please provide some code. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328237 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Ajax Query
Tony, Can you please provide me the code snippets of what you are talking about. I mean how will I set values of hidden fields... well actually I have visible ReadOnly TextFields in the parent window and upon the closure of the child window I need the values to be passed from the child window to these TextFields in the parent window. Kindly plz help. -- From: "Tony Bentley" Sent: Wednesday, November 11, 2009 2:53 AM To: "cf-talk" Subject: Re: Ajax Query > >> I know this is not the place to post such queries, but I am very >> stressed out now and can not find solution to my problem. Maybe >> someone hase had similar experience while using ExtJS with ColdFusion. >> >> >> My scenario is simple. Upon clicking a menu item on my homepage, a >> window opens. After filling out sertain textfields, when these fields >> loose focus, another modal window is opened having a grid. Now I want >> to the user to select one of the values listed in the grid and then >> press 'Done' button. Once this 'done' button is hit, I want the child >> window to close and the selected record in the grid of childWindow >> must be passed to the initial parent window. >> >> How can this be achieved? >> >> Regards, > Arsalan > > Window is pretty loosely described. Is it a browser window or a DIV? There > would be different solutions for either situation. Modal window sounds > like a div. If so, you use javascript to get the value of each element > based on the id. Instead of using grid, can't you use something else that > would be easier to get values from? Even an 'li' would suffice. Then use > placeholders in your parent window, like hidden inputs to store the passed > values. > > ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328236 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Ajax Query
> I know this is not the place to post such queries, but I am very > stressed out now and can not find solution to my problem. Maybe > someone hase had similar experience while using ExtJS with ColdFusion. > > > My scenario is simple. Upon clicking a menu item on my homepage, a > window opens. After filling out sertain textfields, when these fields > loose focus, another modal window is opened having a grid. Now I want > to the user to select one of the values listed in the grid and then > press 'Done' button. Once this 'done' button is hit, I want the child > window to close and the selected record in the grid of childWindow > must be passed to the initial parent window. > > How can this be achieved? > > Regards, Arsalan Window is pretty loosely described. Is it a browser window or a DIV? There would be different solutions for either situation. Modal window sounds like a div. If so, you use javascript to get the value of each element based on the id. Instead of using grid, can't you use something else that would be easier to get values from? Even an 'li' would suffice. Then use placeholders in your parent window, like hidden inputs to store the passed values. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328227 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Ajax Query
I know this is not the place to post such queries, but I am very stressed out now and can not find solution to my problem. Maybe someone hase had similar experience while using ExtJS with ColdFusion. My scenario is simple. Upon clicking a menu item on my homepage, a window opens. After filling out sertain textfields, when these fields loose focus, another modal window is opened having a grid. Now I want to the user to select one of the values listed in the grid and then press 'Done' button. Once this 'done' button is hit, I want the child window to close and the selected record in the grid of childWindow must be passed to the initial parent window. How can this be achieved? Regards, Arsalan ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328224 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4