cancel
Showing results for 
Search instead for 
Did you mean: 

NONE property of wdVisibility not working

Former Member
0 Kudos

Hello everyone,

I'm having a very weird problem. I'm editing an old project that has a grid layout transparent container with some labels and inputFields. Two of those fields will only be visible in certain conditions if-then-else. If not visible, they must be NONE so that the layout ignore them completely from the design. But that is not happening.

When i run the application, both fields really have disappeared but they still ocuppy their spot in the layout as blanks. It's like if webdynpro is ignoring the property NONE and using the BLANK instead. Anyone had this error before ?

thank you in advance,

Nuno Santos

Accepted Solutions (0)

Answers (4)

Answers (4)

roberto_tagliento
Active Contributor
0 Kudos

I don´t know if i understood good, but....

for show or hide UI Element, create into Context attribute of this type:

com.sap.ide.webdynpro.uielementdefinitions.Visibility




and bind it to visible properties of UI element.

And inside code when you wish change the attribute of context with this kind of value:

WDVisibility.NONE
WDVisibility.VISIBLE
WDVisibility.BLANK

Hope can help.

Former Member
0 Kudos

I suggest switching to MatrixLayout. Especially for form-like layouts it is preferable to GridLayout as it gives you proper spacing by default.

Armin

Former Member
0 Kudos

Hello again,

I allready tried switching to matrix layout, but the problem persists. I even erased the transparent container i had, created a new one with matrix layout and cut-pasted all fields to there. Still, the fields appear blank

lajitha_menon
Contributor
0 Kudos

which version are you in?

Are you sure this element whose visibility is set to NONE, comes directly under a matrix layout?

lajitha_menon
Contributor
0 Kudos

Hi Nuno,

I dont think it works as you are expecting it to do in GridLayout. It would have worked if its a matrix layout. Reason being, grid layout has already allocated space for the element in the grid column. Say for example, that this column contained a transparent container, with 2 elements, one of which is NONE visibility, then it would automatically compress the space and display it accordingly. But here, there is only one element, and its in that space of the grid layout. It does not automatically put the next element in this space when visibility is NONE.

Others please correct me if Im wrong.

Regards,LM

Former Member
0 Kudos

HI,

Are you using None property first time or before it is working?

Thanks,

Lohi.

Former Member
0 Kudos

Lohitha,

I'm using none property in wdDoModify event, in a second view in a window, outside if (firstTime) condition.

Former Member
0 Kudos

Hi,

Post your code do it as follows.

Create an attribute name some visiblefield and type to be declared as com.sap.ide.webdynpro.uielementdefinitions.Visibility.

And what UI element u want to make it enable and disable.

It is working in any where

u can write the code like this.

wdContext.currentContextElement.set<visiblefield>(WDVisibility.NONE);

It should work ,

Other wise verify ur code once.

Thanks,

Lohi.

Former Member
0 Kudos

Thank you very much for your replies, but everything you said i allready did.

I'll explain better how things are right now:

- I have a view combined with other view in the same window.

- The first view has a table.

- The second view has label+inputFields in a "form style" of way, in wich all fields are mapped to the row lead selected in the table of the first view.

- all fields of this second view are now inside the main root container of the view, with matrix layout.

- The fields i want to hide, if a determined condition applies, have their visibility property mapped into a wdvisibility variable, that is set with NONE or VISIBLE, according to the condition.

- This processing of affecting the visibility variable is done in the wdDoModify event.

When i say that variable visibility = VISIBLE, all fields are visible, but when i do visibility = NONE, all fields are blank, not none, creating big white spaces where they should be.

Any ideas ?

Message was edited by:

Nuno Santos

roberto_tagliento
Active Contributor
0 Kudos

Do not apply the mapping to each field, but only to the matrix container visible properties.

Former Member
0 Kudos

I would do that, Roberto, but there are fields inside the container that i want to show allways, despite the condition.

I'm thinking if this behaviour has got anything to do with the fact that the application is using a viewset to show both views, and there's some property in there i need to set to ignore blank spots...

Former Member
0 Kudos

Hi,

yes it will come blank spots.

Thanks,

Lohi.

roberto_tagliento
Active Contributor
0 Kudos

Separate more the UI element in other container, distinct between visible part and none.

I guess the matter is the MatrixLayout, the spot is because there exist element, also if are invisible!

Change the structure.