Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Demo's for IWJQAccordion and IWJQPageControl
#1
Hi Alexandre,

Would it be possible to get some demo's for IWJQAccordion and IWJQPageControl?

Whatever I try, I constantly get Access Violations.

Thanks in advance!

Cheers, Paul
Reply
#2
Are you using the latest version? Where exactly do you get those AVs?

I'll be publishing a demo later today, with both components anyway, but it would be good to know in advance if I can recreate the issue here.
Reply
#3
Hi Alexandre,

I'm using Delphi 11.3, patch 1 with IW 15.3.3.

When creating my form, I have an empty Accordion and dynamically create Sections with:

    ...
    s := TIWJQSection.Create(AccordionRemarks);
    s.Name := 'Section_' + IntToStr(i);
    s.Caption := 'Section_' + IntToStr(i);
    s.SectionIndex := i;
    AccordionRemarks.AddSection(s);
    Inc(i, 1);
   ...

When publishing the form, I get an AV.
Reply
#4
Here is how you can easily create this. Use methods CreatePage and CreateSection of the IWjQPageControl and IWjQAccordion:

Code:
newSection := AccordionRemarks.CreateSection('Caption of the section here');

or

newPage := YourPageControl.CreatePage('Caption of the page here');

CreatePage and CreateSection do lots of things under the hood to guarantee that the new page or section will work correctly.

You also don't need to worry about index and name of the section. The methods will do that for you and you only need set these if you need to change.
Reply
#5
(04-20-2023, 07:46 AM)PaulWeem Wrote: Hi Alexandre,

I'm using Delphi 11.3, patch 1 with IW 15.3.3.

When creating my form, I have an empty Accordion and dynamically create Sections with:

    ...
    s := TIWJQSection.Create(AccordionRemarks);
    s.Name := 'Section_' + IntToStr(i);
    s.Caption := 'Section_' + IntToStr(i);
    s.SectionIndex := i;
    AccordionRemarks.AddSection(s);
    Inc(i, 1);
   ...

When publishing the form, I get an AV.

Pardon my aside on the subject, but I'm sure you know all the names must be unique to the entire page (DOM).  Otherwise strange things happen (not that I've ever made that mistake  Tongue).   But, I don't remember it causing an AV.  Probably not your problem, but definitely worth keeping in mind when you're building names at runtime.

Dan
Reply
#6
(04-21-2023, 12:39 AM)Alexandre Machado Wrote: Here is how you can easily create this. Use methods CreatePage and CreateSection of the IWjQPageControl and IWjQAccordion:

Code:
newSection := AccordionRemarks.CreateSection('Caption of the section here');

or

newPage := YourPageControl.CreatePage('Caption of the page here');

CreatePage and CreateSection do lots of things under the hood to guarantee that the new page or section will work correctly.

You also don't need to worry about index and name of the section. The methods will do that for you and you only need set these if you need to change.

Thank you, unfortunately, this isn't working in my app.
I'll wait for the demo and see what that does.

(04-21-2023, 01:29 AM)DanBarclay Wrote: Dan

Hi Dan,

Thanks for the heads up, but I'm pretty sure the names I created are unique.

Paul
Reply
#7
I tested it with IW15.2.69 but also get an AV using CreateSection().
Steps to reproduce:

  • New project
  • Add an empty TIWjQAccordion and a TIWButton to the project.
  • TIWButton.OnAsyncClick with following code
Code:
procedure TIWForm1.IWButton1AsyncClick(Sender: TObject; EventParams: TStringList);
begin
  // gives an AV
  IWjQAccordion1.CreateSection('Testing');
end;


I also tested \Demos\15\Delphi\AsyncRender and that example (other use case) is working.
Reply
#8
The demo is here and it works as expected:

https://github.com/Atozed/IntraWeb/tree/...ontrolDemo

@jeroen.rottink I'll test this other scenario and let you know.

Cheers
Reply
#9
@jeroen.rottink, the case where a new page is created in an async request (and the IWjQPageControl has been created before) fails with an AV, yes.

There is an easy workaround though:

procedure TIWForm1.IWButton1AsyncClick(Sender: TObject; EventParams: TStringList);
var
aPage: TIWjQTabPage;
begin
aPage := IWjQAccordion1.CreateSection('Testing');
Self.ComponentRemoved(aPage, '');
end;

The issue happens because the TIWjQTabPage shouldn't be rendered as a separate control, which is effectively happening in this case.

We will fix it in the next release, but in the meantime the workaround above can be safely used.
Reply
#10
Hi Alexandre,

I have taken the liberty take the IWPageControlDemo and create an IWAccordionDemo (attached).

What isn't working:
  • When starting the browser, sections are created, but activating the 1st section doesn't work.
  • When changing sections, the OnAsyncBeforeSectionChange is triggered, but the OnAsyncSectionChanged is not.

But the most annoying thing is, when you create a section in the IDE at design time and later on, when you delete this section and save the project, an AV presents itself (see attachment 2).


Attached Files Thumbnail(s)
   

.zip   IWAccordionDemo.zip (Size: 91.08 KB / Downloads: 1)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)