• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Add component on a button click

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have been trying to add componenets checkbox and an input text box since last week. I was using selectmany check box ,that didn't work out. Now when I went through the forum, I found that I can use selectBooleanCheckbox for dynamically adding. Now, when I press the button for the first time I got a checkbox and an input text. But when I press the button second time, nothing happens instead of adding one more checkbox and input text.

I am confused now. I am putting my code here, please anyone direct me from here ?

jsp:


bean:


More clearly, if I press the Add button two time, I need to get 2 checkboxes and input boxes.
Bauke gave me initial idea, but still am confused.
Please help me.

Thanks,
Joe.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have suggested you to use DTO's instead.
https://coderanch.com/t/212251/JSF/java/selectManyCheckbox
Check my posting there at October 11, 2006 08:44 AM.
 
Joe Jose
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have tried with DTO. But the added values doesn't diplay in datatable.

What I am trying to do is, enter value through input text and display it in a datatable.

Here is my code :

jsp:
<h:commandButton id="addAdhocs" action="#{CreateQuoteBean.addAdhocs}"
value="Add" styleClass="focusButton" />

<h:dataTable value="#{CreateQuoteBean.taskDataList}">
<h:column>
<h:outputText id ="tk" value="#{TaskSelected.taskData}" />
<h:message for="tk"/>
</h:column>
<h:column>
<h:outputText id="td" value="#{TaskSelected.taskQt}" />
</h:column>
</h:dataTable> [/CODE]

bean:



I don't understand why the values not setting in output text. Please help me.

Thanks,
Joe.
 
Joe Jose
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it. I hadn't given var attribute in datatable tag.

Thank you very much Bauke.
 
reply
    Bookmark Topic Watch Topic
  • New Topic