I need more info... In which phase of the JSF request lifecycle do you evaluate or write out the selection? How do you submit the form, could you please post the code for the action or sth. else which does perform the submit.
 
-Matthias

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von [EMAIL PROTECTED]
Gesendet: Sonntag, 19. März 2006 08:27
An: 'MyFaces Discussion'
Betreff: RE: multi-selection in selectOneListBox

I am using String datatype…

 


De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Envoyé : samedi 18 mars 2006 20:24
À : MyFaces Discussion; [EMAIL PROTECTED]
Objet : AW: multi-selection in selectOneListBox

 

Which datatype do you use for the SelectItem's values?

 

-Matthias

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von [EMAIL PROTECTED]
Gesendet: Samstag, 18. März 2006 18:48
An: 'MyFaces Discussion'
Betreff: RE: multi-selection in selectOneListBox

I tried to use an array for the selectedTrades (String[nbTrades]) and an array for all my trades (SelectItem[nbTrades])

But that does not work, I have nbTrades selectedTrades that are all null.

 

Sophie

 


De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Envoyé : samedi 18 mars 2006 16:44
À : MyFaces Discussion; [EMAIL PROTECTED]
Objet : AW: multi-selection in selectOneListBox

 

I've never used the selectManyListbox action myself. But I remember a problem when using a List for the selected values of a selectManyCheckbox, which also didn't work. I used an Array with the type of the SelectItem values instead, and this did the trick. Maybe you want to try this.

 

-Matthias

 

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von [EMAIL PROTECTED]
Gesendet: Samstag, 18. März 2006 16:19
An: [EMAIL PROTECTED]; 'MyFaces Discussion'
Betreff: RE: multi-selection in selectOneListBox

 

Thanks for the answer. I was trying to use this selectManyListBox but I got into troubles to get the selected items.

Please would you mind telling me what I am doing wrong:

 

-          I initialized my list of trades:

protected List<SelectItem> allTrades = null;

allTrades = xmlParse.getAllActiveDimensions("Trade");     //all trades are correctly displayed in my jsp page

 

-          I initialized my list of selected trades:

protected List<String> selectedTrades = null;

this.selectedTrades =  new ArrayList<String>();

 

-          I have getters setters on them

public  List<SelectItem> getAllTrades(){

    return this.allTrades;

 }

public void setAllTrades(List<SelectItem> allTrades){

    this.allTrades = allTrades;

 }public  List<String> getSelectedTrades(){

    return this.selectedTrades;

 }

public void setSelectedTrades(List<String> selectedTrades) {

    this.selectedTrades = selectedTrades;

 }

-          I add the code to display the trades in my jsp page:

<td style="width:150px">

        <h:outputText value="#{Fmsg.authorizedTrades}" />:<BR>

<h:selectManyListbox id="trades1" value="#{MyClass.selectedTrades}" style="width:150px" >

            <f:selectItems value="#{MyClass.allTrades}" />

        </h:selectManyListbox>

   </td>

-          I write all the selected trades in a file but none are written:

try {

                  BufferedWriter out = new BufferedWriter(new FileWriter("selectedTrades.txt"));

                  for ( String sel : this.selectedTrades)

                             out.write( sel );

                  out.close();

         } catch (IOException ioe) {

           System.out.println(ioe.toString());

         }

But here the file is created but nothing is written inside! What do I do wrong?

Thanks again for help.

Sophie

 


De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Envoyé : samedi 18 mars 2006 15:19
À : MyFaces Discussion; [EMAIL PROTECTED]
Objet : AW: multi-selection in selectOneListBox

 

Hi,

 

you may use the selectManyListbox of the Standard HTML RenderKit Taglib. It displays all options at the same time and allows the user to mouse select many options while holding the CTRL-Key.

 

-Matthias

 

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von [EMAIL PROTECTED]
Gesendet: Samstag, 18. März 2006 11:41
An: 'MyFaces Discussion'
Betreff: multi-selection in selectOneListBox

Hi !

 

Is there a JSF tool to have a selectOneListBox that allows us to select several elements in this list at the same time ?

 

Thanks

 

 


De : Dave [mailto:[EMAIL PROTECTED]
Envoyé : samedi 18 mars 2006 09:24
À : [email protected]
Objet : myfaces source including sandbox

 

 

I try to use subForm.

I could not find sandbox in repos. In the nightly build area, there is no sandbox either.

I like to download all myfaces source including sandbox. thanks for info.


Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.



__________ NOD32 1.1449 (20060317) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



__________ NOD32 1.1449 (20060317) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



__________ NOD32 1.1450 (20060318) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com

Reply via email to