Hellow, FS Team, I have a question about FS performance when dealing with Panel, hiding and showing fields.

Lets say I have panel MyPanel, and button MyButton

I dont know every time if the button is visible or not Which code is better.

a) Always hide or show regardless if button is already visible or hidden

Procedure hide_or_show(p_yn in varchar2 ) is begin apicomponent.setvisible('MyPanel.MyButton',p_yn); end;

b) Always check if the action is needed ( if ir is already visible or not)

Procedure hide_or_show(p_yn in varchar2 ) is begin if apicomponent.isvisible('MyPanel.MyButton')=p_yn then / already visible or hidden / null; / nothing to do / else apicomponent.setvisible('MyPanel.MyButton',p_yn); end if;

end;

c) Set some field on the panel, wich remembers button visibility lets say field "button_state"

Procedure hide_or_show(p_yn in varchar2 ) is begin if apicomponent.getvaluetx('MyPanel.button_state')=p_yn then / already visible or hidden / null; / nothing to do / else

apicomponent.setvisible('MyPanel.MyButton',p_yn); apicomponent.setvalue('MyPanel.button_state',p_yn);

end if;

end;

Thank You, vytenis

asked 25 Sep '14, 07:47

vytenis's gravatar image

vytenis
112
accept rate: 0%


Hi Vytenis,

If you are doing just one set operation the difference between these options is negligible, do as your heart pleases.

If you are going to do 30-40 set operations at once, store the current state in a session (api_session API package) variable and decide accordingly.

If the reason your are doing this is user rights (such as enabling disabling buttons depending on the user's privileges) use Formspider Security Repository. That's the fastest option.

However, never choose option C) to remember the state the application is currently in. You don't need to use UI elements to remember the state of the application. Use session parameters. You can manage session parameters with the api_session.add and api_session.getValueTX/NR/DT API's.

Kind Regards,
Yalim

link

answered 25 Sep '14, 07:57

Yalim%20Gerger's gravatar image

Yalim Gerger ♦♦
1.8k5
accept rate: 15%

edited 25 Sep '14, 08:27

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×34
×4
×3

Asked: 25 Sep '14, 07:47

Seen: 1,018 times

Last updated: 25 Sep '14, 08:27


© Copyright Gerger 2017