cancel
Showing results for 
Search instead for 
Did you mean: 

How to get tooltip in morethan oneline

Former Member
0 Kudos

Hi all,

Please provide me solution how to get tooltip text to be displayed more than in one line.

For Example

I want to display like this

Freespace

Totalsize

I think u got my question.

Regards

Ravi

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

solved

pravesh_verma
Active Contributor
0 Kudos

Hi,

Try this, this will resolve your issue:

You can set the tool tip of any UI element.



IWDLabel lbl = (IWDLabel)view.getElement("Your_Label_ID");
lbl.setTooltip("\n"+"Freespace "+"\n"+"Totalsize");

Thanks and Regards,

Pravesh

Former Member
0 Kudos

Hi Pravesh,

I have my label Text as Measured (in centimeters):

I want it to be displayed as

Measured :

(in centimeters)

Can i use the above method for that also..?

Jithin

pravesh_verma
Active Contributor
0 Kudos

Hi,

Yes you can use that fopr setting the Label text as well.


IWDLabel lbl = (IWDLabel)view.getElement("Your_Label_ID");
lbl.setText("\n"+"Freespace "+"\n"+"Totalsize");

I hope this helps.

Thanks and Regards

Pravesh

Former Member
0 Kudos

Hi Pravesh,

It is not working for the Label Text but it is working fine for tooltip.

Jithin

Former Member
0 Kudos

Hi,

Is the Tool Tip getting displayed in two lines?

For me neither the toolTip nor the lable text is getting displayed in two lines.

Pls let me know if it works or it could be the problem with my IDE build.

Thanks n Regards,

Archana

Former Member
0 Kudos

Hi Archana,

Yes tooltip is coming in two lines but label Text comes up in the same line itself.

Jithin

Former Member
0 Kudos

Hi Archana,

We can display label name in two lines.

In label go to properties then set wrapping field as true then it will work.try it

I have worked it.

Regards

Ravi

pravesh_verma
Active Contributor
0 Kudos

Hi Ravi,

If your problem is solved then kindly close the thread!

Thanks and Regards,

Pravesh

Former Member
0 Kudos

Hi my problem is not solved.

Explain with example.

Regards

Ravi

Former Member
0 Kudos

Hi pravesh

IWDLabel lbl = (IWDLabel)view .getElement("Name");

lbl.setTooltip("\n""Freespace ""\n"+"Totalsize");

Iam getting error in the first line.***view cannot be resolved**

Is there any need to provide settings for the input field.

Please help me.

Thanks in advance.

I created input field of type sting in my application.

Former Member
0 Kudos

Hi,

U need to write this code in WdDoModifyView

Jithin

Former Member
0 Kudos

Where i have to give the tooltip data.

In the label or input field or Implementation tab.

we tried giving in the imp tab.

But its showing in the same line.I want data to be displaayed in 2 lines.

Former Member
0 Kudos

HI,

If u want to create the tooltip for an Input field then do as given below.

in wdDoModify write the below code.

IWDInputField iF = (IWDInputField)view.getElement("id_of_your_inputField");
iF.setTooltip("Freespace "+"\n"+"Totalsize");

Get back if it is not clear..

Jithin

pravesh_verma
Active Contributor
0 Kudos

Hi,

For which UI element you have to set the tool tip for? Whatever is the Ui element the approach will remain the same.

get the instance of the UI element and then using the code set the tool tip.

Please refer to my first reply it clearly shows the same thing with an example.

I hope that should clear your issue. Please revert back incase the issue is not resolved.

Thanks and Regards

Pravesh

Former Member
0 Kudos

where we have to enter the text data for that tooltip input field...

Former Member
0 Kudos

HI PRAVESH

we followed like that only.But text is not displaying in 2 lines.

Please tell me where we have to give the text.

Former Member
0 Kudos

Hi,

IWDInputField iF = (IWDInputField)view.getElement("id_of_your_inputField");
iF.setTooltip("Freespace "+"\n"+"Totalsize");

Here Freespace

Totalsize is your tool tip text.

Hope it is clear now.

Jithin

Former Member
0 Kudos

we given like this "free space -text1" and "total size - text2"

In the output ,,,displaying side by side..

text 1--- enter name

text2 ---enter surname

These two texts should be displayed in two lines in the tooltip for my input field element.

Please provide the code for that.

gill367
Active Contributor
0 Kudos

Hi

"\n" is used to use a new line in the string to be displayed in web dynpro application.

tooltip is the property of the input field which you want to modify and want to have tooltip of more than one line

Then do the following

1. check id of your inputfield (say it is "inpt").

2. now go to wddomodifyview() method in implementation part of your view.

3. write the followin code there

IWDInputField i = (IWDInputField)view.getElement("inpt");

i.setTooltip("Enter name " + "\n" + "Enter Surname");

4. now save all the metadata and deploy the application and run.

your input field will come with tooltip in two lines.

Hope it is clear.

Sarbjeet Singh Gill