开发者

Wicket Palette - add values to left list

开发者 https://www.devze.com 2023-03-21 22:39 出处:网络
I have a question about Palette in Wicket, i would add values (on page loading) in the right list but i didn\'t find a solution. I can only add values to left list using the 开发者_运维技巧Model. So p

I have a question about Palette in Wicket, i would add values (on page loading) in the right list but i didn't find a solution. I can only add values to left list using the 开发者_运维技巧Model. So please help me. (here in the pic, i would that the list Selected contains values from the beginning)

Thanks


Palette has a constructor where you can pass two model objects: one for the items already selected and one for all the choices available.


I am not sure if you can do this using current APIs of Palette. Since Palatte is a Panel behind the scene, and they use wicket ids hard coded like this (left is choice - right is selection) to populate,you can not load choices on the right hand side.

<td class="pane choices">
    <select wicket:id="choices" class="choicesSelect">[choices]</select>    
</td></td>
<td class="pane selection">
    <select class="selectionSelect" wicket:id="selection">[selection]</select>  
</td>

What you can do in my opinion (I am a novice,so pardon me if I sound foolish), take the Palette.html ,customize it(toggle the TDs),make your own CustomPalette that extends the Palette,and provide your own template panel. like:

<td class="pane selection">
    <select class="selectionSelect" wicket:id="selection">[selection]</select>  
</td> 
 ........//buttons
<td class="pane choices">
    <select wicket:id="choices" class="choicesSelect">[choices]</select>    
</td>

I did not try it though. good luck.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号