cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove a value help?

Former Member
0 Kudos

Hello,

I have the following UI structure:

An input field (Location) that has onChange action event with two possibilities:

- If one value is entered for Location, a value help is set for two other input fields (Job and Position).

- If two or more values are entered in Location, a value help is not set for Job and Position fields and the user can enter any String value in them.

The problem occurs if I put one value in the input field Location, execute the method that sets the value help and then enter more values. If I do so the value help for the Job and Position remains and I want it gone. The problem is that I do not know how to remove the value help that has already been generated. Any suggestions?

Thank in advance,

Grigor Nikolov

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Grigor,

You can try creating the context attribute with value help at runtime instead of at design time. When you need to clear the value help, just remove the attribute from the node info and then create it again.

Best Regards,

Petar

Former Member
0 Kudos

Hi Peter,

Thank you for your reply, your approach really solved my problem.

I deleted the “from” attributes from my Context and created them dynamically in my wdDoInit method.

When two or more Locations have been added, I save the values from attribute “from” in an ArrayList and then delete the attribute. Then I create new attribute “from” and save all values from my ArrayList in it.

@Amol, Jun Wu and Mr. Ram - I want to thank you for your suggestions as well.

Best regards,

Grigor Nikolov

Answers (2)

Answers (2)

junwu
Active Contributor
0 Kudos

currently how you add value help to the field?

Former Member
0 Kudos

Hi Jun,

I am using getModifiableSimpleValueSet() to add the value help.

Best regards,

Grigor Nikolov

Sreejith1
Contributor
0 Kudos

Hi Grigor,

just a thought,dont know whether it will suit to your requirement.

Use one input box and add small button near to that.When you need value help, give a pop up to select the value.and by selecting the value, you can assign it to input box. when you don't need that just hide that button.UI you can design in better look. But check whether this will solve your requirement?

Regars,

Ram

amolgupta
Active Contributor
0 Kudos

Hi Grigor,
You can control visibilty of UI elements in WebDynpro Java i.e. you can make some UI appear or disappear on an action by manipulating the visibility of a UI element by binding the visibility of a UI element to a Context attribute of type 'com.sap.ide.webdynpro.uielementdefinitions.Visibility'.

Does this approach solve your problem ?

Regards,

-Amol Gupta

Former Member
0 Kudos

Hi Amol,

First of all thank you for your reply.

I am aware that I can control the visibility of UI elements. I just don't see how this would help.

The problem is that I want the two input fields (Job and Position) to remain active and visible.

Let's say that I have an input field that already has a value help. How can I disable this value help and use this field again as a regular String input field?

amolgupta
Active Contributor
0 Kudos

Hi Grigor,

What is suggest is to make two UIs for the same thing -

- 1 input field with Value help

- 1 regular String input field

if you want the value help, make the regular String input invisible on action.

if you want the regular String input, make the value help invisible on action.

Do let me know if this solves your problem.

Regards,

-Amol Gupta

Former Member
0 Kudos

Hi Amol,

Unfortunitely I don't think that this will solve my problem either.

I would try to explain my UI im more details.

I have several input fields (11). The value property of every single of this fields is binded to a calculated attribute in my context. Every field also has a button (labeled "More") which when pressed triggers a pop-up window. This pop-up has two columns - operator (which can hold value = or !=) and from (which hold a string value). All values from the pop-up are filled in 11 different nodes (cardinality 1..n). The calculated attributes in the input fields are connected with the nodes and if you add something in the pop-up window this updates the input field and vice versa. I use a method that uses input from field Location and returns the values that I fill in the value helps as an output.

1. If I enter only one value in the Location field the method is executed. When I choose the "More" button for Job or Position field in the pop-up a value help is generated for every from value that I add.

2. If I enter two or more values for Location, in the the "More" button pop-up for Job or Position field I do not have value help and can add a String value for "from".

So far so good. This works as I want it.

The problem occurs if I execute step 1. then change Location field by adding another value. When I go to the "More" button pop-up I can still only choose values from the generated value help for the Location from step 1.. I want a normal String input field without value help.

Let's say I have the scenario:

I add a Location (single value) and the value helps are generated. I add two values from the value help in the from field of the Position pop-up. Then I add another Location (the Location values become two), the value help disappers and I add a String value (not present in the first value help). After this I change Location again to another single value and add new Position value from the newly generated value help.

amolgupta
Active Contributor
0 Kudos

Hi Grigor,

     I know it is too much to ask for but can you pls supplement the description above with screenshots that will help experts on the forum understand your query better.

Regards,

-Amol Gupta

Former Member
0 Kudos

Hi Amol,

I am sorry, but I am not supposed to share screenshots of the UI.

I hope I can clarify everything only by text.

Thanks in advance,

Grigor Nikolov