2016-09-12 4 views
1

:最初WicketのパレットAvailableリストの問題

Palette example

は、我々は、説明=「pH値」、「てpH1」との項目があり、利用可能なリストの "pH2"。

「pH1」と「pH2」を選択リストに移動して保存すると、「pH」が「使用可能」リストに表示されなくなります。

項目の説明を「pH」から「PH」に変更すると、再び表示されます。

は、ここでは、コードの一部です: -

回帰は、Wicketの7.xで導入しているように見える
private List<LabMethod> availableMethods = new ArrayList<LabMethod>(); 
private List<LabMethod> selectedMethods = new ArrayList<LabMethod>(); 
.... 

//Get all the methods 
availableMethods = labMethodService.getLabMethods(); 
//Get the methods for this user 
if (user.getId()!=null) 
    selectedMethods = lookupService.getMethodsForUser(user); 
else 
    selectedMethods = Collections.emptyList(); 

IChoiceRenderer<LabMethod> renderer = new ChoiceRenderer<LabMethod>("description", "description"); 

final Palette<LabMethod> palette = 
    new Palette<LabMethod>("methodPalette", 
    new ListModel<LabMethod>(selectedMethods), 
    new CollectionModel<LabMethod>(availableMethods), 
    renderer, 10, true); 

palette.add(new DefaultTheme()); 
+1

多くの異なる原因がある可能性があるため、コードを見なければ問題がどのようになるかは分かりません。パレットをどのように構築するか(特にそのモデルと選択したレンダラー)を見ることは、スタートに非常に役立ちます。 – WiseTree

+0

ありがとう私はいくつかのコードを追加しました。 – NeillR

+0

pHが消えたら、pH1とpH2を使用可能に戻して保存すると、pHは消えませんか? – WiseTree

答えて

2

パレットは、オプションIDがお互いを含むサポートしていませんが:

例えばレコーダー#getUnselectedList()は、選択肢( "AA"、 "AAA"、 "AAAA")から "AAAA"が選択された場合、すべてが選択されたものとして返されます。

+0

私は既に問題を作りました:https://issues.apache.org/jira/browse/WICKET-6244 – svenmeier