You can do this when you create select model. For example, in my
application I have a drop down of catagories fetched by a DAO, with
first element being "-- Please Select":

        @Cached
        public SelectModel getCategoriesModel() {

                Schemed schema = _catalog.computeOdsSchema();
                WebDaoParameter<Integer> param = new WebDaoParameter<Integer>();
                param.setMode(PagingMode.NoPaging);
                param.setSchemed(schema);
                final List<NodeBean> categories = 
_promosDao.getCategories(param).get();

                return new SelectModel() {

                        private final SelectModel __model;

                        {
                                int modelSize = categories.size() + 1;
                                OptionModel[] options = new 
OptionModel[modelSize];
                                String blankLabel = "-- Please Select";
                                options[0] = new OptionModelImpl(blankLabel, 0);

                                int index = 1;
                                for (NodeBean category : categories) {
                                        String label = 
category.getDescription();
                                        int value = category.getId();
                                        options[index++] = new 
OptionModelImpl(label, value);
                                }

                                __model = new SelectModelImpl(options);
                        }

                        public List<OptionGroupModel> getOptionGroups() {
                                return __model.getOptionGroups();
                        }

                        public List<OptionModel> getOptions() {
                                return __model.getOptions();
                        }

                        public void visit(SelectModelVisitor aVisitor) {
                                __model.visit(aVisitor);
                        }

                };
        }

Then, in your TML reference this model as attribute value of your
select component.

On Thu, May 8, 2008 at 8:38 AM, Leon Derks <[EMAIL PROTECTED]> wrote:
> Hello
>
> Is it possible to overwrite the first element in a select box?
> At the moment this is an empty value, but can I for example overwrite this
> with "All"
>
> Leon
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to