pe:triStateCheckbox incompatible with p:inplace shows number

Community Driven Extensions Project
Post Reply
webel
Posts: 87
Joined: 18 Sep 2010, 09:29
Location: Sydney, Australia
Contact:

10 Jul 2012, 09:46

Firstly my thanks for the very useful pe:triStateCheckbox component.
I make heavy use of the null state of Boolean values in my application.

Because pe:triStateScheckbox uses number Strings "0","1","2" and
because p:inplace seems to use outputText in default display mode,
it is hard to use pe:triStateScheckbox as the editor for a p:inplace.
The inline editing works fine, but after editing it shows a number String.

Would it be possible to instead or additionally use: "null", "true", "false" ?
These would be more compatible with p:inplace, and make sense to users.
And writing a converter for these is just as easy as for the Strings "0","1","2".

Related:

- Forum: Feature suggestion for p:inplace: output component facet

- Issue 4330: Feature suggestion for p:inplace: output component facet
Primefaces 6.1
JSF Mojarra 2.3.0
(Netbeans 8.2+Glassfish 4.1.1 OR Payara 4.1)
Mac OS X "Yosemite" 10.10.5 / Linux CentOS 6.7

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

11 Jul 2012, 10:19

Hi,

I don't think this is a problem of TriStateCheckbox / TriStateManyCheckbox. The problem is p:inplace because it displays value and not label. If you have e.g.

Code: Select all

<pe:triStateCheckbox value="..." />
    <f:selectItem itemValue="..." itemLabel="..."/>
</pe:triStateCheckbox>
the itemLabel should be shown and not value. If you have

Code: Select all

<pe:triStateCheckbox value="..." />
    <h:outputText value="My Tri State"/>
</pe:triStateCheckbox>
the text "My Tri State" should be shown and not value.

Does p:inplace not work as expected?
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

webel
Posts: 87
Joined: 18 Sep 2010, 09:29
Location: Sydney, Australia
Contact:

06 Aug 2012, 23:02

Thanks Oleg for reply. You wrote:

> Does p:inplace not work as expected?

Well that's what I described, it works "as expected" for the current design of p:inplace, but as I have suggested elsewhere (see forum feature suggestion already given above) there is a need to override the apparent default outputText component of p:inplace.

> I don't think this is a problem of TriStateCheckbox / TriStateManyCheckbox. The problem is p:inplace because it displays value and not label.

But if TriStateCheckbox used "null", "true", "false", instead of "0","1","2" it would work ok with (be compatible with) the current design and implementation of p:inplace. It can't for the sake of implementation make any difference for TriStateCheckbox which strings you use. And since usually only the itemLabel is shown it has no impact on existing users - except on those who have custom converters, and these are easily changed to use "null", "true", "false" strings (which are more descriptive anyway) instead of the rather arbitrary "0", "1", "2".
Primefaces 6.1
JSF Mojarra 2.3.0
(Netbeans 8.2+Glassfish 4.1.1 OR Payara 4.1)
Mac OS X "Yosemite" 10.10.5 / Linux CentOS 6.7

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest