hi, i tried much to find exapmle on <h:panelGrid value="#{backingBean.all}"> but couldnt find that. Can you give me 1 example how to do that.
Thnaks, Nishita
Nishita
deepak reads
Greenhorn
Joined: Nov 01, 2004
Posts: 13
posted
0
This is taken from Kitto D. Mann which i bought yesterday
This will appear in two rows..
Nishita Jain
Ranch Hand
Joined: Mar 30, 2006
Posts: 97
posted
0
hi, Thnaks for reply. but this is not what i want. i actually want example on how u can relate panelgrid with attribute Value. like, <h:panelGrid value="#{backingBean.all}">
Thank you.
Rajeev Ravindran
Ranch Hand
Joined: Aug 27, 2002
Posts: 455
posted
0
What do you mean by relating panelGrid with attribute values ? Can you elaborate on that ?
Thanks,
madhuri madhuri
Ranch Hand
Joined: Jan 18, 2006
Posts: 58
posted
0
Originally posted by Nishita Jain: hi, Thnaks for reply. but this is not what i want. i actually want example on how u can relate panelgrid with attribute Value. like, <h: panelGrid value="#{backingBean.all}">
Thank you.
If I understood what you mean to say correctly, <h: panelGrid> doesnot have an attribute called "value". It has a "binding" attribute. You may want to check that if you want to bind it to a value in your backing bean. <h: panelGrid>
and if that tag is not available then how to achieve that functionality which we can do aby Value attribute
Thank you, Nishita
Rajeev Ravindran
Ranch Hand
Joined: Aug 27, 2002
Posts: 455
posted
0
Hi Nishita, If you explain your requirement, somebody can help you with example code or provide you an alternate solution. I would say dont waste time for something which is not provided by the framework. I remember once wanted to remove <table> from the JSF generated html file but what you required was to keep text fields beside radio buttons. It was not required to remove <table> from html for that scenario. Can you explain what you want to acheive with panelGrid? Are are trying to add components to the grid or trying to create a new grid dynamically ?
hello Rajeev, yes i think you are right. ok what i actually want to do is that i want achieve the same functionality which we can ,by using h:datatable
i mean i want to make loop of listing of some Tests from database so its dynamic. and in every row there is a checkbox to select the Test and you can select multiple test.now the problem is that if i use h:datatable for every checkbox table is generated and for that problem i found the solution in this forum only . you can refer it if you want . its Subject name is in h:selectOneRadio automatically creates Table posted by me. from that i got solution of using h:panelgrid. but i come up with one problem that how to loop using h:panelgrid. i even try using SelectBooleanChkbox . in that case table is not generated with every checkbox . but i couldnt find out which test is selected. For every test there is testid related to that.That is it. any other solution from your side is valuable. Thnak you. Nishita
Rajeev Ravindran
Ranch Hand
Joined: Aug 27, 2002
Posts: 455
posted
0
If you are trying to generate the ouput in the same page, you can go to the root component and write code in your backing bean to generating panelgrid and adding components to the grid. I have done something similar to this and its pretty simple. Instaed of value binding from panelGrid, did you try creating the panelGrid from the backing bean and adding the new panelgrid to the root componenet (this root component could be a form for you, in my case it is an HtmlTabItem)
hello,can u please give me a example on this. i tried finding but not got for the Htmlpanelgrid what i got i can be like this public class BackingBean {
now here i have only 1 colum i mean i want to display like
TestName Checkbox
1(name) [] 2(name) []
now here 1 2 coming from database so must fire a query and i must relate this name with panel grid how can i do that? and can u give me any example or link for that.
change setColumns to 2. panelGrid1_1.setColumns(2);
now the grid has 2 columns, so when you add four components, each row will contain 2 components. hope it expalins..
Since you are retreiving data from database, store it in a list , iterate through the list , create new components and add it to your panelgrid ? cant you do it yourself
Thanks,
Nishita Jain
Ranch Hand
Joined: Mar 30, 2006
Posts: 97
posted
0
Hi Rajeev , as per you said i did that using PanelGrid with List . but then again 1 problem is there, i m fetching test names fro database . i created panelGird for that and for each test i also put 1 checkbox and i created column for that. but i dont know how to get the values for the selected chkbox. i dont know how to givw different name related to each chkbox. i dont give any name it generates like <input name="addUserForm:_id9" value="194" type="checkbox"> </input> <input name="addUserForm:_id10" value="194" type="checkbox"> </input> . . . is there any way so that i can give name like <input name="addUser[0]" value="194" type="checkbox"> </input> <input name="addUser[1]" value="194" type="checkbox"> </input> ... my coding for that column is like this and it displays perfectly. while (rs.next()) { for (int i = 1; i <= rslist.size(); i++) { HtmlOutputText text = new HtmlOutputText(); text.setValue(rs.getString(i)); panelChildren.add(text); if(i == 1) testId = (String)text.getValue();; if(i%4 == 0){ List valueList = new ArrayList();
We're a friendly group, but we do require members to have valid display names.
Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.
Please edit your profile and correct your display name since accounts with display names get deleted, often without warning
thanks, Dave
Brunda Gundamaraj
Greenhorn
Joined: Aug 13, 2008
Posts: 11
posted
0
["Brunda G", please post your questions in a new topic rather than hi-jacking someone else's. Also check your private messages for an important administrative matter.] [ August 13, 2008: Message edited by: Bear Bibeault ]