Page 1 of 1

Accordion and Dropdown

PostPosted: 14 Mar 2016 19:57
by assapan
Hi,
i build runtime a frame containing different component related to application parameters .
parameters are grouped in sections , so parameters are grouped in a cggroupbox without problem so far , to void necessity to scroll i wanted to group them in accordiontab instead of groupbox , there i face a problem with dropdowns , they display the accordiontab caption instead of the selected option in dropdown.

here is cggroupbox version , you can see at tema , hot-sneaks is displayed
Image

now with accordion version, accordion tab caption is displayed instead of hot-sneaks
Image

but the component works fine
Image

do you have any idea of what can cause the problem ?

Re: Accordion and Dropdown

PostPosted: 15 Mar 2016 10:48
by Alexander Bulei
Hi assapan,

I have never seen this before...
How are you creating the controls?

Maybe you can reproduce it in simple testcase?

Best Regards.

Re: Accordion and Dropdown

PostPosted: 15 Mar 2016 11:31
by assapan
Hi alexander,
First of all , sorry i told you lies , component is a comboboxex not a dropdown .

I tried to reproduce it but there is so many others components involved in this frame ....

maybe we could do it with remote session using a ticket , are you available today ?

Re: Accordion and Dropdown

PostPosted: 15 Mar 2016 11:45
by Alexander Bulei
Hi assapan,

Let's schedule the remote session time by email.

Best Regards.

Re: Accordion and Dropdown

PostPosted: 16 Mar 2016 18:41
by assapan
So first of all i want to thank CGDevtools for the professionalism of the support Image


Second the end of the story was i was creating a frame in between disable and enable ajaxresponse
Code: Select all
function CreeFrame(FrameClass: TFrameClass; WebApp: TIWApplication; Owner: TComponent; Parent: TWinControl; Name: String; Align: TAlign = alNone): TIWCGJQFrame;
var
  NewName: string;
begin
  NewName := CGFindUniqueComponentName(Owner, Name);

  if CGIsCallBackProcessing then
  begin
    // SINCE THE FRAME IS GOING TO BE RENDERED BY AJAX, DON'T NEED TO GENERATE AJAX RESPONSE.
    CGCallBackDisableAjaxResponse;
  end;

  Result := FrameClass.Create(Owner);

  Result.Name := NewName;
  Result.Parent := Parent;
  if Align <> alNone then
    Result.Align := Align;

  if WebApp.CallBackProcessing then
    CGCallBackEnableAjaxResponse;
end;

function CreeFrame(FrameClass: TFrameClass; WebApp: TIWApplication; Owner: TComponent; Parent: TIWCGJQRegion;Align: TAlign = alClient;CommandToProcess:Integer=0): TIWCGJQFrame;
begin
  Result := CreeFrame(FrameClass, WebApp, Owner, TWinControl(Parent), 'Frame',Align);
  Result.ProcessCommand(CommandToProcess);
end;


But i was creating components in processcommand which was not protected !!!!!
here is what have to be done
Code: Select all
function CreeFrame(FrameClass: TFrameClass; WebApp: TIWApplication; Owner: TComponent; Parent: TIWCGJQRegion;Align: TAlign = alClient;CommandToProcess:Integer=0): TIWCGJQFrame;
begin
  Result := CreeFrame(FrameClass, WebApp, Owner, TWinControl(Parent), 'Frame',Align);

  if CGIsCallBackProcessing then
  begin
    // SINCE THE FRAME IS GOING TO BE RENDERED BY AJAX, DON'T NEED TO GENERATE AJAX RESPONSE.
    CGCallBackDisableAjaxResponse;
  end;
  try
    Result.ProcessCommand(CommandToProcess);
  finally
    if WebApp.CallBackProcessing then
      CGCallBackEnableAjaxResponse;
  end;

end;