cancel
Showing results for 
Search instead for 
Did you mean: 

Additional text beside the input field

Former Member
0 Kudos

Hello Experts,

I have one simple requirement where I need to display some additional text beside the input field.

Please check the attached picture for reference.

Can someone please help me get this?


Thank you.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks Ritu,

But, this is still a workaround. There must be some other way to display the text other than using the caption which is usually used to display the Captions.

Anyway, thanks for your response.

former_member214667
Contributor
0 Kudos

Hi Maren,

How about putting the text you want to show as suffix in the prefix itself? Like this:

Total Experience (in years)

This could be an option depending on what your requirement is.

Regards,

Shiromani

Former Member
0 Kudos

Hi,

Thanks for your reply.

Can you please explain how to use the caption element?

To explain in a simple line, I want to display two labels(Right side and Left side) for one input field.  Please check the sample taken from an online form.

The text "Total Experience" and the input field with be displayed by default (context node attributes from the UI Configuration).

I have to add the static text "Years" next to the input field.

Please help me with this. Thank you.

Former Member
0 Kudos

Hi Maren,

Step 1. Go to your component UI Configuration from tcode bsp_wd_cmpwb.

Step 2. Choose 'Add Caption'. A popup will ask you to enter Caption. Write your hint in the text box and click 'Continue'.

Step 3. Select your caption and click 'Show Field Properties'. Here you can select the row and fields for your caption.

Now you field will look like below:

Hint for date format has been added. It is underlined. If you don't want the underline then go to .htm page of your view and write the below code:

<style>

.th-tx-header1

{

border-bottom-style : none !important;

}

</style>

Now no underline will come.

Thanks,

Ritu

deepika_chandrasekar
Active Contributor
0 Kudos

HI,

You can add one attribute in context node and add the filed next to the input field and in configuration uncheck the box show fieldlable and make it display only.

Then in that attribute get method in pass value = "Years".

Regards,

Deepika.

Former Member
0 Kudos

Use caption, but if it's dynamic, then you may have to define it as a text element. Either ways, this can be easily achieved on configuration

former_member210661
Active Contributor
0 Kudos

Hi Maren,

In your view.htm there is tag thtmlb:label use this lable and provide your text where you want.

example :

<table>

   <tbody>

     <tr>

       <td>

<thtmlb:label id        = "text"

               text      = "additional text"

               labelType = "MEDIUM" />

</td><td>

<thtmlb:inputField id    = "add"

                    type  = "STRING"

                    value = "click" />

        </td>

     </tr>

   </tbody>

</table>

this will look like this..

Thanks & Regards,

Srinivas.

Former Member
0 Kudos

H Srinivas,

Thanks for your reply.

Let me explain in detail.

The Policy holder number and the input field will be by the context node. There are multiple fields in the context node and will be displayed on the view. For the Policy holder number field only, I have to add some additional text just next to the input box.

I tried to create the label in HTM page, but it will be displayed in the next line, not beside the input box.

The solution you provided is to create one input box and one label for that input box. I have already one input box and one label for that. I have to show an additional label to the right side of the input box.

Hope, it is clear now.

Thank you.

former_member210661
Active Contributor
0 Kudos

Hi Maren,

i got it now then in that case select any one text attribute or add one attribute under your context node and in get_p method declare field type as text.

like this..

CASE iv_property.

   WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.

     rv_value = cl_bsp_dlc_view_descriptor=>FIELD_TYPE_TEXTAREA.

   WHEN IF_BSP_WD_MODEL_SETTER_GETTER=>FP_TEXTAREA_ROWS.

     rv_value = 5. "Number of lines in you text box

ENDCASE.

adjust that field beside your input field in the config part and uncheck the lable check box in the field property.. go to get_field method. provide your text in the returning parameter.

ex:

value = 'additional text about policy'.

try this and let me know... fallow this link to add custom field in your context node based on requirement you have to choose which attribute you want this example is for value attribute..

Thanks & Regards,

Srinivas.