Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple JSF questions.  RSS feed

 
Alok Pota
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • 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.
 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!