on 11-23-2006 11:36 AM
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
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
WDVisibility.NONE
WDVisibility.VISIBLE
WDVisibility.BLANK
Hope can help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I suggest switching to MatrixLayout. Especially for form-like layouts it is preferable to GridLayout as it gives you proper spacing by default.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Are you using None property first time or before it is working?
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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...
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.