• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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.
 
Beware the other head of science - it bites! Nibble on this message:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic