Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 82133 invoked from network); 16 Nov 2006 09:08:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Nov 2006 09:08:01 -0000 Received: (qmail 99226 invoked by uid 500); 16 Nov 2006 09:08:03 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 99196 invoked by uid 500); 16 Nov 2006 09:08:03 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 99185 invoked by uid 99); 16 Nov 2006 09:08:03 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2006 01:08:03 -0800 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=HTML_MESSAGE,MAILTO_TO_SPAM_ADDR,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of popcorn09@gmail.com designates 64.233.166.177 as permitted sender) Received: from [64.233.166.177] (HELO py-out-1112.google.com) (64.233.166.177) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2006 01:07:50 -0800 Received: by py-out-1112.google.com with SMTP id z74so334325pyg for ; Thu, 16 Nov 2006 01:07:29 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=RmFc+KXBLmo66B4cHyQjo+FhDIhoM8Fa7cKzcDyS/zDGZEReqHxgLlTAImRSBOLr4Z8k2EsXSHpRDzjFt3n0UJf3sglt1rpnPMU8lLdPPu2YO7WsYzWYADJTWO6Nc/09+d1mUUsGq0Vv6tD9fTvdyDvgD8VhPv0JqV9+H3qtMSg= Received: by 10.35.107.20 with SMTP id j20mr349275pym.1163668049615; Thu, 16 Nov 2006 01:07:29 -0800 (PST) Received: by 10.35.14.18 with HTTP; Thu, 16 Nov 2006 01:07:29 -0800 (PST) Message-ID: <142ae0b30611160107j41bb7571y63557e2f41197bd1@mail.gmail.com> Date: Thu, 16 Nov 2006 14:37:29 +0530 From: "Aneesha Govil" To: "MyFaces Discussion" Subject: Re: creating a dynamic code for a group of radio buttons In-Reply-To: <9BDB3947E63672408FCC6388C5CDE5260AAF7D@infodomain.InfoSolvInc.local> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_65555_30935454.1163668049553" References: <9BDB3947E63672408FCC6388C5CDE5260AAF7D@infodomain.InfoSolvInc.local> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_65555_30935454.1163668049553 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Yaron, Can you post the updated code? I think you had missed this step earlier - > selectOneRadio.getChildren().add(radio); Aneesha On 11/15/06, Yaron Spektor wrote: > > Thanks Aneesha, > > I did have the IDs unique. I also tried setting the valueBinding to an > HtmlSelectOneRadio that I put on the bean (with getters and setters of > course) nothing seemed to work. > > Just to make sure my question is clear I need to create a dynamic view > similar to this: > > |*column1|column2**|column3|* > > *|radio1 |radio 2 |radio3 |* > > *|radio4 |radio5 |* | > > > > > > The number of columns and number of rows is not fixed and all the radio > buttons need to be in the same group. > > > > Any advice would be appreciated, > > > ------------------------------ > > *From:* Aneesha Govil [mailto:popcorn09@gmail.com] > *Sent:* Tuesday, November 14, 2006 4:58 AM > *To:* MyFaces Discussion > *Subject:* Re: creating a dynamic code for a group of radio buttons > > > > Hi, > > I haven't constructed radio buttons dynamically but in general, to do > something like this.. > HtmlSelectOneRadio selectOneRadio = new HtmlSelectOneRadio(); > selectOneRadio.setId("choicesRadioButtons");//TODO: componentID > selectOneRadio.setLayout("spread"); > selectOneRadio.setValue(displayValue); > > // If you are setting IDs for radio instances here, make sure each is > unique > HtmlRadio radio = new HtmlRadio(); > radio.setFor("choicesRadioButtons"); > radio.setIndex("0"); > > selectOneRadio.getChildren ().add(radio); > > panelGroup.getChildren().add(selectOneRadio); > > Hope that helps! > > Aneesha > > On 11/14/06, *Yaron Spektor* wrote: > > Hi there, > > I would like to convert this code to dynamic components (I can not use > tableData with newspaperColumn because I want multiple columns with the same > button group and I need a header aligned with each such column). I would > like to be able to set the t:radio in a panelGrid with X number of > columns: > > > > forceIdIndex="false" value="hello"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > This is the code I started writing but I have a problem making it work > especially setting the "for" > > HtmlPanelGroup panelGroup= new HtmlPanelGroup(); > > HtmlPanelGrid htmlPanelGrid = new HtmlPanelGrid(); > > List panelGroupChildren = panelGroup.getChildren(); > > panelGroupChildren.clear(); > > HtmlRadio radio; > > > > HtmlSelectOneRadio selectOneRadio = new HtmlSelectOneRadio(); > > selectOneRadio.setId("choicesRadioButtons");//TODO: componentID > > selectOneRadio.setLayout("spread"); > > selectOneRadio.setValue(displayValue); > > > > htmlPanelGrid.setColumns(5); > > htmlPanelGrid.setColumnClasses(Constants.cColumnClasses+ > ","+Constants.cColumnClassesCurrency); > > htmlPanelGrid.setRendered(true); > > > > for(int i=0;i<9;i++){ > > radio = new HtmlRadio(); > > radio.setId("selectOneRadio"); > > ValueBinding vb =app.createValueBinding("buttons"); > > radio.setValueBinding("for", vb); > > radio.setIndex(i); > > htmlPanelGrid.getChildren().add(radio); > > } > > > > > > panelGroupChildren.add(selectOneRadio); > > panelGroupChildren.add(htmlPanelGrid); > > > > return panelGroup; > > > > any ideas? > > > > > > > > > ------=_Part_65555_30935454.1163668049553 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Yaron,

Can you post the updated code? I think you had missed this step earlier -

> selectOneRadio.getChildren().add(radio);

Aneesha

On 11/15/06, Yaron Spektor < yaron.spektor@b6systems.com> wrote:

Thanks Aneesha,

I did have the IDs unique. I also tried setting the valueBinding to an HtmlSelectOneRadio that I put on the bean (with getters and setters of course) nothing seemed to work.

Just to make sure my question is clear I need to create a dynamic view similar to this:

|column1|column2|column3 |

|radio1    |radio 2   |radio3    |

|radio4    |radio5    |              |

 

 

The number of columns and number of rows is not fixed and all the radio buttons need to be in the same group.

 

Any advice would be appreciated,

 


From: Aneesha Govil [mailto:popcorn09@gmail.com]
Sent: Tuesday, November 14, 2006 4:58 AM
To: MyFaces Discussion
Subject: Re: creating a dynamic code for a group of radio buttons

 

Hi,

I haven't constructed radio buttons dynamically but in general, to do something like this..
HtmlSelectOneRadio selectOneRadio = new HtmlSelectOneRadio();   selectOneRadio.setId("choicesRadioButtons");//TODO: componentID  selectOneRadio.setLayout("spread");
selectOneRadio.setValue(displayValue);

// If you are setting IDs for radio instances here, make sure each is unique
HtmlRadio radio = new HtmlRadio();
radio.setFor("choicesRadioButtons");
radio.setIndex("0");

selectOneRadio.getChildren ().add(radio);

panelGroup.getChildren().add(selectOneRadio);

Hope that helps!

Aneesha

On 11/14/06, Yaron Spektor < yaron.spektor@b6systems.com> wrote:

Hi there,

I would like to convert this code to dynamic components (I can not use tableData with newspaperColumn because I want multiple columns with the same button group and I need a header aligned with each such column). I would like to be able to set the  t:radio in a panelGrid with X number of  columns:

<h:panelGroup>

      <t:selectOneRadio id="buttons" layout="spread" forceId="true" forceIdIndex="false" value="hello">

            <f:selectItems value="#{pc_Wizard.choicesDisplayValue}" />

      </t:selectOneRadio>     

     

            

      <h:panelGrid columns="5" >                                                                                                                       

        <t:radio for="buttons" index="0" />

        <t:radio for="buttons" index="1" />

        <t:radio for="buttons" index="2" />

        <t:radio for="buttons" index="3" />

        <t:radio for="buttons" index="4" />       

        <t:radio for="buttons" index="5" />

        <t:radio for="buttons" index="6" />

        <t:radio for="buttons" index="7" />

        <t:radio for="buttons" index="8" />

      </h:panelGrid>

 </h:panelGroup>

 

This is the code I started writing but I have a problem making it work especially setting the "for"

  HtmlPanelGroup panelGroup= new HtmlPanelGroup();

  HtmlPanelGrid htmlPanelGrid = new HtmlPanelGrid();

  List panelGroupChildren = panelGroup.getChildren();

  panelGroupChildren.clear();

  HtmlRadio radio;

 

  HtmlSelectOneRadio selectOneRadio = new HtmlSelectOneRadio();

  selectOneRadio.setId("choicesRadioButtons");//TODO: componentID

  selectOneRadio.setLayout("spread"); 

  selectOneRadio.setValue(displayValue);

     

  htmlPanelGrid.setColumns(5); 

  htmlPanelGrid.setColumnClasses(Constants.cColumnClasses+","+Constants.cColumnClassesCurrency);

  htmlPanelGrid.setRendered(true); 

     

for(int i=0;i<9;i++){

  radio = new HtmlRadio();

  radio.setId("selectOneRadio");     

  ValueBinding vb =app.createValueBinding("buttons");

  radio.setValueBinding("for", vb); 

  radio.setIndex(i);

  htmlPanelGrid.getChildren().add(radio);

}

     

     

panelGroupChildren.add(selectOneRadio);

panelGroupChildren.add(htmlPanelGrid);

 

return panelGroup;

 

any ideas?

 

 

 

 


------=_Part_65555_30935454.1163668049553--