This discussion is archived
2 Replies Latest reply: Dec 4, 2013 11:49 AM by Andreas Weiden RSS

Sychronizing items on different canvases

MVM Newbie
Currently Being Moderated

Hi,

 

I am having an "existing" multirecord database datablock (say No. of records = 5) in form which consists of items and a checkbox.

It has an Order by clause.For some records the checkbox is updatable.

 

Now I want all these items (checkbox + other items) to be replicated on another canvas which will be shown in a popup window. But this time no. of records displayed is more say 10.

 

For this, I did a copy-paste of existing datablock and renamed it (say popup block).This copied all existing triggers on block and on items.

I modified the canvas of the items of this popup block to new popup canvas.

I modified the block name in triggers too.

 

Reason behind another popup block:

If no. of records fetched (say 7) > "existing" block no. of records to be displayed (i.e. 5), then control goes to popup block (which displays 15 records) else control goes to "existing" block.

 

This popup canvas is displayed either when I launch the screen or I click a specific button.

 

Now my problem is:

If I click the checkbox in popup canvas, the checkbox in "existing" block must be in sync for the same record.

If I click the checkbox in "existing" block, the checkbox in popup block must be in sync for the same record.

 

This is required because some controls/ processing are performed on the "existing" block checkbox.

 

Note: There is a button on popup block to return to main canvas.

 

I think using record group can solve the issue.

 

Can somebody help me with this.

 

Thanks,

  • 1. Re: Sychronizing items on different canvases
    MVM Newbie
    Currently Being Moderated

    Hi,

     

    I did the following and it worked.

     

    In WHEN-CHECKBOX-CHANGED trigger of checkbox in "existing" block, do the following:

     

    1) Declare a variable r to store the system.cursor_record

    2) GOTO popup block

    3) Goto record r ===> This we can directly write because both blocks are same (except for name of block and No. of records displayed) and having same order by clause.

    4) Copy value in existingblock.checkbox into popupblock.checkbox

    5) GO back to existingblock

    6) Goto record r ==> it is the same record from where we started

     

     

    In WHEN-CHECKBOX-CHANGED trigger of checkbox in "popup" block, do the following:

     

    1) Declare a variable r to store the system.cursor_record

    2) GOTO existing block

    3) Goto record r ===> This we can directly write because both blocks are same (except for name of block and No. of records displayed) and having same order by clause.

    4) Copy value in popupblock.checkbox into existingblock.checkbox

    5) GO back to popup block

    6) Goto record r ==> it is the same record from where we started

     

     

    This is working, but in case if you think I might face any issue, please let me know.

     

    Thanks.

  • 2. Re: Sychronizing items on different canvases
    Andreas Weiden Guru
    Currently Being Moderated

    I would use only one block. Duplicate all the items, for each item set the property "Synchronize with item" accordingly. Set the number of records displayed to the may of both canvases (e.g. 15), set the number of records displayed for the items on the canvas with less records to the lower number. Done. Now everything is synchronized automatically.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points