![]() |
|
Possibile errors in IWBootStrap Library - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: Possibile errors in IWBootStrap Library (/thread-1226.html) Pages:
1
2
|
Possibile errors in IWBootStrap Library - Anto90 - 09-09-2019 Good afternoon. I write for possible errors on the Bootstrap library. I have attached an example project. 1) I have an iwbsinputform with iwbsfile and an iwbsbutton inside it. I put the ButtonType property btsubmit. The onsubmit event with this code is associated with the iwbsinputform: if aRequest.Files.Count> 0 then begin FileUpload: = THttpFile (aRequest.Files [aRequest.Files.Count - 1]). FileName; WebApplication.ShowMessage ('File upload name:' + FileUpload); end else WebApplication.ShowMessage ('No file selected'); After executing this code I get the error 404 - Not found. I think it's two to the rewriting of the iwbsrestserver.pas unit and the change in the management of callbacks in Intraweb 15.1.4. 2) In the iwbsradiobutton component the OnAsyncClick event does not fire and the Checked property when it changed is always False if I try to read it from code. 3) HiddenInput I have a callback registered in the form WebApplication.RegisterCallBack ('CalcolateValue', CalcolateValue); In a CalcolateValue procedure: js: = Format ('addHiddenInput ("% s",% s);', ['Test_Input', 'Test ()']); WebApplication.CallBackResponse.AddJavaScriptToExecute (js); the javascript function is defined as follows: with JavaScript do begin Add ('function addHiddenInput (aName, aValue) {'); Add ('var frm = $ (getSubmitForm ());'); Add ('if (! Frm.length) return false;'); Add ('var hid = frm.find ("input [name =" + aName + ""] ");'); Add ('if (! Hid.length) {'); Add ('hid = $ ("<input type =" hidden "name =" + aName + ""> ");'); Add ('frm.append (hid);'); Add ('}'); Add ('hid.val (aValue);'); Add ('AddChangedControl (aName);'); Add ('}'); Add (''); Add ('function Test ()'); Add ('{'); Add ('return 5;'); Add ('}'); end; In a button in the scriptevents property I have ajaxCall ("CalcolateValue", "& CallBack = 1", false); and in the AsyncCLick event I have: Value: = EventParams.Values ['Test_Input']; WebApplication.ShowMessage (Value); When I run ajaxcall the callback is executed but then in the button in the AsyncClick event the Value returned is always empty and not 5 as it should be. (In the same button is it possible to return the value of the variable through the callbak?) (I use intraweb 15.1.4 and iwbootstrap 3.4.1) Thanks for your help Andrea RE: Possibile errors in IWBootStrap Library - Anto90 - 09-11-2019 Can anyone give me some feedback? Thank you RE: Possibile errors in IWBootStrap Library - Alexandre Machado - 09-14-2019 Hi, I tested your example and at least the "Test click" button is not working as expected, as it seems. I'll debug it and get back to you ASAP RE: Possibile errors in IWBootStrap Library - Alexandre Machado - 09-16-2019 Hi, I have an update. The event handlers of IWBSRadioButton has an issue and it is not working properly. I have already fixed it but I still need to check the other issues. The issues related to the callback execution seems to have the same origin. It should be simple to fix, but I still need to work on it. I'll keep you posted. RE: Possibile errors in IWBootStrap Library - Anto90 - 09-16-2019 (09-16-2019, 10:24 AM)Alexandre Machado Wrote: Thanks for the reply RE: Possibile errors in IWBootStrap Library - Alexandre Machado - 09-17-2019 Most issues are fixed except (3) There are a few things there that are clearly not supported: a) Your parameter is named "Callback". You can chose any name of parameter you want except "Callback". "Callback" is exactly the name of the parameter which is supposed to carry the name of the callback call. So you need to chose something else. b) Your button named IWBSButton2 (Get value hidden input) has 2 distinct events attached to it. You trigger an Async request with script events (via ajaxCallback() call) and there is another Async request triggered via standard OnAsyncClick event. I don't know exactly what is your goal there, but I don't see why you need 2 callbacks in sequence like that. RE: Possibile errors in IWBootStrap Library - Anto90 - 09-17-2019 (09-17-2019, 10:39 AM)Alexandre Machado Wrote: Thank you for the response. RE: Possibile errors in IWBootStrap Library - Anto90 - 09-26-2019 (09-17-2019, 11:03 AM)Anto90 Wrote:(09-17-2019, 10:39 AM)Alexandre Machado Wrote: Thank you for the response. RE: Possibile errors in IWBootStrap Library - Alexandre Machado - 10-09-2019 You are clearly relying on an implementation detail in order to make this "work" (even in IW 14.1.14). There is no obligation for the ajax subsystem to wait for the first request/response cycle to be fully processed in order to send the next request... I'll have a second look at your application and find the best way to solve it. Please hold on. RE: Possibile errors in IWBootStrap Library - kudzu - 10-09-2019 In the JS world this is normal. They use Promises and other async mechanisms to deal with it on the client side. |