• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

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.
 
When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic