Hi there,
I am using a listBox from the Backbase Explorer which can be found here: http://demo.backbase.com/explorer/#|examples/move_command.xml
The problem is, when I transfer one listBoxOption from left to the right (or the other way arround), it doesn't update the view node I guess.
When I use the firebug inspector, there is a hidden select in the body. When I transfer a listBoxOption, that select doesn't update.
Am I doing something wrong, or is this a bug in backbase?
<form action="profiel.xml?user={inlognaam}" method="post">
<b:panelLayout columns="45% 10% 45%" height="150px">
<b:panelLayoutItem>
<b:listBox id="fromList" name="fromList" size="6" multiple="true">
<b:listBoxOption>HTML</b:listBoxOption>
<b:listBoxOption>PHP</b:listBoxOption>
<b:listBoxOption>CSS</b:listBoxOption>
</b:listBox>
</b:panelLayoutItem>
<b:panelLayoutItem style="text-align: center;">
<b:button>
<e:handler event="click" type="text/xml">
<e:if test="id('fromList')/b:listBoxOption[property::selected]">
<c:move with="id('fromList')/b:listBoxOption[property::selected]" destination="id('toList')" mode="appendChild" />
</e:if>
</e:handler>
<img src="/custom-files/images/img-buttonNext.gif" alt="move right" />
</b:button>
<br />
<br />
<b:button>
<e:handler event="click" type="text/xml">
<e:if test="id('toList')/b:listBoxOption[property::selected]">
<c:move with="id('toList')/b:listBoxOption[property::selected]" destination="id('fromList')" mode="appendChild" />
</e:if>
</e:handler>
<img src="/custom-files/images/img-buttonPrevious.gif" alt="move left" />
</b:button>
</b:panelLayoutItem>
<b:panelLayoutItem>
<b:listBox id="toList" name="toList" size="6" multiple="true">
<b:listBoxOption>Roxen</b:listBoxOption>
<b:listBoxOption>XML</b:listBoxOption>
<b:listBoxOption>Pike</b:listBoxOption>
</b:listBox>
</b:panelLayoutItem>
</b:panelLayout>
<b:panelLayout columns="45% 10% 45%" height="150px">
<b:panelLayoutItem>
<b:listBox id="fromList" name="fromList" size="6" multiple="true">
<b:listBoxOption>HTML</b:listBoxOption>
<b:listBoxOption>PHP</b:listBoxOption>
<b:listBoxOption>CSS</b:listBoxOption>
</b:listBox>
</b:panelLayoutItem>
<b:panelLayoutItem style="text-align: center;">
<b:button>
<e:handler event="click" type="text/xml">
<e:if test="id('fromList')/b:listBoxOption[property::selected]">
<c:move with="id('fromList')/b:listBoxOption[property::selected]" destination="id('toList')" mode="appendChild" />
</e:if>
</e:handler>
<img src="/custom-files/images/img-buttonNext.gif" alt="move right" />
</b:button>
<br />
<br />
<b:button>
<e:handler event="click" type="text/xml">
<e:if test="id('toList')/b:listBoxOption[property::selected]">
<c:move with="id('toList')/b:listBoxOption[property::selected]" destination="id('fromList')" mode="appendChild" />
</e:if>
</e:handler>
<img src="/custom-files/images/img-buttonPrevious.gif" alt="move left" />
</b:button>
</b:panelLayoutItem>
<b:panelLayoutItem>
<b:listBox id="toList" name="toList" size="6" multiple="true">
<b:listBoxOption>Roxen</b:listBoxOption>
<b:listBoxOption>XML</b:listBoxOption>
<b:listBoxOption>Pike</b:listBoxOption>
</b:listBox>
</b:panelLayoutItem>
</b:panelLayout>
I want to post everything that is in the "toList", so I made a button which selects al the items in it:
<input name="profielSubmit" type="submit" value="Opslaan">
<e:handler event="click" type="text/javascript">
var aItems = bb.document.getElementById('toList').selectNodes('b:listBoxOption');
for (var i=0;i<aItems.length;i++) {
console.info('item: ' + i);
bb.setProperty(aItems[i],'selected',true);
}
</e:handler>
</input>
</form>
<e:handler event="click" type="text/javascript">
var aItems = bb.document.getElementById('toList').selectNodes('b:listBoxOption');
for (var i=0;i<aItems.length;i++) {
console.info('item: ' + i);
bb.setProperty(aItems[i],'selected',true);
}
</e:handler>
</input>
</form>

listbox move
10 November, 2008 - 17:50 — andysHi evdpol,
You mean that you want to move the listBoxOption from id "fromList" to id "toList", right?
If that is the case, in your input event handler, you type something like this below
var aItems = bb.document.getElementById('toList').selectNodes('b:listBoxOption');
shouldn't it be 'fromList' instead of 'toList' ?
Hope this helps
-- Andys --