Replace an entity with another entity depending on the choice of the user

Author: juerg.fross@teamspirit.ch (jfro)

Hello all I should add on an old-fashioned "client-server form" some new functionality. Depending on the choice of the user I should hide an entity with some fields including labels and show in the same place another entity with other fields. How do I do this best? Thanks! Jürg

6 Comments

  1. Hi Jürg, if you are looking for a fast, reliable, "minimum invasive" solution, just contact me by email so I can give you some suggestions. Uli


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. (free-of-charge, as usual)


    Author: ulrich-merkel (ulrichmerkel@web.de)
  3. Hello I just finished in doing it with - $paintedfieldproperties - $labelproperties It works fine in my case, but has some restrictions: - You need for example to have some available space somewhere in your form to paint the fields which are sometimes visible and sometimes not. Even you are able to paint them outside of your "normal" formsize this didn't work for me as this produced some form scrollbars I didn't find any way to get rid off. - I lost some time in trying with the syntax mentioned under "Changing Form Layout Dynamically" in the Uniface-Help. The examples there are wrong - they don't work! Correct examples you find under "$paintedfieldproperties" - I had some troubles with "Header-Label". To change the Label-Text with $labelproperties it has to refer to an field and the field is not allowed to set on "HID". The label inherit the properties of the field and hides also when you set the related field on "HID". Same in setting the field on "Transparency ON" had the effect I saw the frame where the label was put on. Finally I painted a field and reduced the size on 0 (xsize=0•;ysize=0). However it worked.... Greetings Jürg


    Author: jfro (juerg.fross@teamspirit.ch)
  4. Hi Jürg, nice to see what you have done for the HEADER-LABEL reducing the field to a 0/0. Have you had multi-occurence entities on your component?


    Author: ulrich-merkel (ulrichmerkel@web.de)
  5. This can be done easily in Uniface 9.6 using Form Containers.


    Author: Theo Neeskens (tneeskens@itblockz.nl)
  6. Hi Jürg, As found in the blog I’ve been Sent to Coventry!, we have just a very easy solution which supports even multi-occurence displays: enclose the entities with horizontal splitbars, so we have for the code below S0,S1,S2 a small dito demo can be downloaded from uli-merkel.de, it's 9.6 and requires DICT. ********************************** entry toggle_displayed if ($displayed_entity$ = 1) call splitbar_reset() $windowproperties("<$formname>","splitbar")="splitbar=S2:MIN"; Move to the left $displayed_entity$ = 2 else call splitbar_reset() $windowproperties("<$formname>","splitbar")="splitbar=S1:MIN"; Move to the left $displayed_entity$ = 1 endif entry splitbar_reset $windowproperties("<$formname>","splitbar")="splitbar=S0:RESTORE" $windowproperties("<$formname>","splitbar")="splitbar=S1:RESTORE" $windowproperties("<$formname>","splitbar")="splitbar=S2:RESTORE" end ; splitbar_reset ******************************************************** I'm sure Theo Neeskens will object because of "undocumenetd feature" but the simplicity of code may outweight this argument. One may even encapsulate the $windowproperties .... in proc splitbar_restore, splitbar_min, splitbar_max so if CPWR really change the name, it is a modification in a single place only.


    Author: ulrich-merkel (ulrichmerkel@web.de)