• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

Multiple JSF questions.

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. How do I make changes made to page using DHTML/JS apply to the bean (i.e.
if I were to add a row of <input type="text"> using DHTML and instead of calling an addRow() method on the bean. How do I get JSF to recognize that new row?

2. <h:commandButton id="submitAdd" action="#{CalcBean.addValue()}" value="Add Even Values" />

Can I pass arguments to addValue(..)???

3. I have the following object tree.

class Bean {
PurchaseOrder po;
}

class PurchaseOrder {
List<LineItem> lineItems
}

class LineItem {
String type
float price;
}

I want to show a list of textboxes of lineitems of only certain type.

<h ataTable id="items" value="#{bean.po.lineItems}"
var="lineItem"
>
<h:column>
<h:inputText id="custom" value="#{lineItem.price}" required="true"/>
</h:column>
</h ataTable>


However the above will show all lineItems, I only want of a particular type.. basically I am looking for a alterative to the #{bean.po.lineItems} JSF EL expression.
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Alok Pota:

2. <h:commandButton id="submitAdd" action="#{CalcBean.addValue()}" value="Add Even Values" />

Can I pass arguments to addValue(..)???



Actual syntax is action="#{CalcBean.addValue}" with no parens.

No you can't pass a value, at least that way. However, you have access to all of the data members through binding in your backing bean so you shouldn't have to pass params.
 
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic