You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Steve Thompson <th...@gmail.com> on 2008/06/03 23:36:35 UTC

Extra control needed for PropertyColumn

I'm creating a AjaxFallbackDefaultDataTable, just as shown in the live
examples, and things are working great.  My only problem though is
that I would like to scramble one of the columns of information that I
present depending on the user (in this case, the column holds SSN, and
I want it to appear as XXX-XX-1234 for most users).

Is there a way to do this easily?  Does it require building a custom
version of AbstractColumn?

Let me know and best regards as always,


Steve

--

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Extra control needed for PropertyColumn

Posted by Igor Vaynberg <ig...@gmail.com>.
you can also subclass propertycolumn itself

-igor

On Tue, Jun 3, 2008 at 2:36 PM, Steve Thompson <th...@gmail.com> wrote:
> I'm creating a AjaxFallbackDefaultDataTable, just as shown in the live
> examples, and things are working great.  My only problem though is
> that I would like to scramble one of the columns of information that I
> present depending on the user (in this case, the column holds SSN, and
> I want it to appear as XXX-XX-1234 for most users).
>
> Is there a way to do this easily?  Does it require building a custom
> version of AbstractColumn?
>
> Let me know and best regards as always,
>
>
> Steve
>
> --
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Extra control needed for PropertyColumn

Posted by Jeremy Thomerson <je...@wickettraining.com>.
You could do something like this:

        new PropertyColumn(new Model("your-object-model-replaces-this-one"),
"property.expression") {
            @Override
            protected IModel createLabelModel(final IModel embeddedModel) {
                return new Model() {
                    @Override
                    public Serializable getObject() {
                        PropertyModel pm = new PropertyModel(embeddedModel,
getPropertyExpression());
                        return mask((String) pm.getObject());
                    }

                    private Serializable mask(String string) {
                        return "XXX-XX-" + string.substring(string.length()
- 4);
                    }
                };
            }
        };


On Tue, Jun 3, 2008 at 4:36 PM, Steve Thompson <th...@gmail.com>
wrote:

> I'm creating a AjaxFallbackDefaultDataTable, just as shown in the live
> examples, and things are working great.  My only problem though is
> that I would like to scramble one of the columns of information that I
> present depending on the user (in this case, the column holds SSN, and
> I want it to appear as XXX-XX-1234 for most users).
>
> Is there a way to do this easily?  Does it require building a custom
> version of AbstractColumn?
>
> Let me know and best regards as always,
>
>
> Steve
>
> --
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Jeremy Thomerson
http://www.wickettraining.com