add title to dynaform label

Community Driven Extensions Project
Post Reply
evaleah
Posts: 44
Joined: 10 Jul 2012, 20:26

17 Sep 2012, 14:16

I have a need for hover tips on the label portion of a dynaform. Any suggestions of how I could acheive this? I had thought I could add a title attribute but it seems that is not available from the dynaform control portion or the label portion.

Thanks!
PrimeFaces 3.5 | Glassfish 3.1.2 | IntelliJ IDEA 12.1.4 | Windows 7, Firefox 14.0.1

User avatar
Oleg
Expert Member
Posts: 3803
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

17 Sep 2012, 14:35

Simple. You normally pass an arbitrary Object to controls in Java. If your object has "title" attribute, you can use it for corresponding label (its title). Look this example please http://fractalsoft.net/primeext-showcas ... atures.jsf You can see that you can use pe:dynaFormControl without "type" attribute. E.g. as

Code: Select all

<pe:dynaFormControl styleClass="pe-dynaform-label">  
    <h:outputText value="#{data.value}" title="#{data.title}"/>  
</pe:dynaFormControl>
That will be used for label. On the server-side you can create a label as a quite normally control. Like

Code: Select all

row = model.createExtendedRow();  
  
row.addControl(new SomeDataObject("My Value", "My Title"), 1, 1);   // label (without "type", but you can specify "type" too)
row.addControl(new InventoryProperty("(4,2)", false), "input", 1, 1);  // control with type "input"
If you want to have a built-in "title" support for built-in labels, please create an issue ticket in our issue tracker http://code.google.com/p/primefaces-ext ... ssues/list Thanks.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

evaleah
Posts: 44
Joined: 10 Jul 2012, 20:26

17 Sep 2012, 22:06

Of course, I can just add a control of an output text and not bother with the label at all. I have no idea why I had not thought of it before. Obvious :)

Thank you!
PrimeFaces 3.5 | Glassfish 3.1.2 | IntelliJ IDEA 12.1.4 | Windows 7, Firefox 14.0.1

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests