3

I want to display the whole password requirements in the shortdesc attribute of Inputtext. But every time I pass a String, it is displaying the text in the same row. For example I am attaching the code with 'hello world' as shortdesc.Below is the screen for the same:

Image

I want 'hello' in one line and 'world' in another line.Can it be done?If yes, Can anyone help me.

Thanks in advance.

Juan Carlos Mendoza
  • 5,736
  • 7
  • 25
  • 50
Phani
  • 31
  • 3
  • Possible duplicate of [How to put "new line" in JSP's Expression Language?](https://stackoverflow.com/questions/1908365/how-to-put-new-line-in-jsps-expression-language) – Cedric Sep 26 '17 at 13:05

2 Answers2

0

The only way that have worked for me is editing the proper underlying css class of the "shortDesc component" (AFNoteWindowShortDesc) in the skin file and reading the value with the breakline character from a managed bean if you want to control where to break each line:

In my css-skin file:

.AFNoteWindowShortDesc {
    white-space: pre; /* To produce the line break */
}

In a managed bean:

private String multilineText = "Hello\nWorld";

public String getMultilineText() {
    return multilineText;
}

Finally in the page fragment:

<af:inputText label="Multiline shortDesc in ADF" id="it1"
                  shortDesc="#{pageFlowScope.departmentManagedBean.multilineText}"/>

Result:

enter image description here

But if your shortDesc text is long and you only want it break automatically, then do this:

Skin file:

.AFNoteWindowShortDesc {
    word-break: break-word;
}

Result:

enter image description here

Juan Carlos Mendoza
  • 5,736
  • 7
  • 25
  • 50
-1

It can be done by adding escape="false" and a <br/> in the middle of your shortDesc.

<af:inputText label="label" id="dc_it1" shortDesc="hello &lt;br /> world" escape="false"/>

The escape=false allow the <br/> to not being HTML-escaped.

For more info see: How to put "new line" in JSP's Expression Language?

Cedric
  • 977
  • 2
  • 11
  • 23