list of checkboxe's

8 messages - 1951 views

My questions how to set fokus directly on the "box"

the folowing xml then generating results that user have to press left key to go to the  box itself and then press select

I would like to check box then user pressed down/select command.

 

<list>
    <_renderer>
        <![CDATA[
                <checkbox onAction="selected(this.id)"><_ID>@{id}</_ID>
                    @{value_1} @{value_2}
        </checkbox>
               
        ]]>
    </_renderer>
    <_items>@{contact}</_items>
 </list>

 

css:

listitem {
  gap: 5 0;
}

listitem:hover {
  bg-color: #edf2f6;
  color: #6d9fcc;
}

checkbox {
    bg-image: url(chk_off.png);
    bg-align: left;
    bg-repeat: 1 1;
    padding: 0 0 0 20;
    align: left;
}

checkbox:selected {
    bg-image: url(chk_on.png);
}

checkbox:hover {
    bg-image: url(o_chk_off.png);
}

checkbox:hover:selected {
    bg-image: url(o_chk_on.png);
}

the only soliution I found was to "pretend" checkbox and use listiteam

<list>
    <_renderer>
        <![CDATA[
                <listitem onAction="selected(this.id)">
                <_ID>@{id}</_ID>
                    <picture>
                        @{selected}
                    </picture>
                    <textarea>
                        @{value_1} @{value_2}
                    </textarea>
                </listitem>
        ]]>
    </_renderer>
    <_items>@{contact}</_items>
</list>

then call toogleSelect() and change picture

All  dynamic children of a list are automaticaly ListItem, then in your case, you've got a checkbox (focusableWidget) in a listitem (focusablewidget too).

Then you can list listitem has non focusable  like this :

...

<![CDATA[<listitem focusable="false"><checkbox onAction="...">...</checkbox></listitem>]]>

...

 

But I understand that is not a real elegant way to to a list of checkboxes. I think it would be better if we could put any kind of widget as a child of list dynamic and not only listitems ...

Checkout the lastest sources of Kaprice and check how it could works in the next release.

@see how products are selectable.

since you conver all children into listitem the one elegant way would by to assige type to the list item like checkbox, radiobutton, etc

thus depenting on the type select command would auto-magicly understand to check the box or radiobutton, while keeping hover on whole list item.

 

But to keep flexibility it would by conviniot to have a multiselectible="true" atribute whitch would release the focus to all children in the list item.

 

 

If you take a look at last changes, list children are no more converted into listitems.

Here you need to view List widget only as a component designed to managed repetitive content as described in the renderer attribute.

Because the philosophy of Kuix is be flexible while staying simple, I think it woulds be wrong to add a "type" attribute to the list.

In this case a list is not more a checkbox list than a radiobutton list. Because of the special management of radio buttons, the dedicated radioButton list is the RadioGroup which extends List class.

 

That's what the lastest modifications propose :

for checkbox list :

<list>

<_renderer><![CDATA[<checkbox>...</checkbox>]]></_renderer>

<_items>@{items}</_items>

</list>

 

for radiobutton list :

<radiogroup>

<_renderer><![CDATA[<radiobutton>...</radiobutton>]]></_renderer>

<_items>@{items}</_items>

</radiogroup>

 

But you're right that a all in one list would be easier to use and understand, but less flexible.

it allways that hard question, how to keep simplicity and gain flexibility power.

But I think you are doing grate jobb! And have developed very good framework.

undfortenotly it's not well documented and it would be nice if you had snipets available, were user could both post and read how-to's

 

anyhow, keep upp good work!

Ho yes ... community snipets is a realy good idea !