Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Possibile errors in IWBootStrap Library
Good afternoon.
I write for possible errors on the Bootstrap library.
I have attached an example project.
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
FileUpload: = THttpFile (aRequest.Files [aRequest.Files.Count - 1]). FileName;
WebApplication.ShowMessage ('File upload name:' + FileUpload);
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
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 ('}');

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


Attached Files Thumbnail(s)

.zip (Size: 54.88 KB / Downloads: 3)
Can anyone give me some feedback?
Thank you

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

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.
(09-16-2019, 10:24 AM)Alexandre Machado Wrote: Thanks for the reply

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.
(Yesterday, 10:39 AM)Alexandre Machado Wrote: Thank you for the response.
I understood the problem about callback name.
For b the goal is to obtain with standard async click event the value of a client variable( ex. bootstrap table json) that a callback has calculate before with the call in scriptevents .
I know that for retrieve the value with hidden input i need two callback.

In the first

js:= Format('addHiddenInput("%s",%s);',['Test_Input','Test()']);

in the second i get the value (in the onAsyncClick Button)
Value := EventParams.Values['Test_Input'];

this work in intraweb 14.1.14 for example.

Could be a better different solution?


Forum Jump:

Users browsing this thread: 1 Guest(s)