Results 1 to 12 of 12
  1. #1
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default problem including libruaries in jsf 2.0

    hi all
    i have one question:
    in jsf 1.2 i can add
    <%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
    <%@taglib prefix="rich" uri="http://richfaces.org/rich"%>
    but in jsf 2.0 when i write
    xmlns:a4j="http://richfaces.org/a4j"
    there was error "No libruary for this namespace"

    so how i can use a4j and rich for xhtml?

  2. #2
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default

    i added but it can't run
    The module has not been deployed
    Last edited by irakli_java_dev; 02-24-2011 at 11:59 AM.

  3. #3
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default

    i using netbeans and trying to deploy on tomcat, i added primefaces-2.2.1.jar
    and jsf-impl.jar, jsf-api.jar witch was in mojjara/lib directory, but no action, is not deploing

  4. #4
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default

    i always used visual jsf, so i'm begginer in jsf 2.0 technologies and i want to use richfaces but when i including richfaces jar s to my classpath project isn't compile and i wonder why my even empty project not compiling when i add richfaces jar s to my classpath

  5. #5
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default

    thx for this and do u know how to delete row from dataTable? i doing this such
    <h:dataTable value="#{order.orderList}" var="o">

    <h:column>

    <f:facet name="header">Action</f:facet>

    <h:commandLink value="Delete" action="#{order.deleteAction(o)}" />

    </h:column>
    following How to delete row in JSF dataTable
    but it raising exception, that deleteAction has parameter

  6. #6
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default

    thanks i'll try

  7. #7
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default

    i'm using xmlns:f="http://java.sun.com/jsf/core" and f has not setProperty
    f only has f:setPropertyActionListener

    so i wrote this
    <h:commandLink value="Delete" action="#{order.deleteAction}" >
    <f:setPropertyActionListener value="#{o.orderNo}" target="#{order.deleteAction}" />
    </h:commandLink>
    but there is exception
    Property 'deleteAction' not found on type newpackage.OrderBean
    if write
    <h:commandLink value="Delete" action="#{order.deleteAction}" >
    <f:setPropertyActionListener value="#{o.orderNo}" target="#{order.deleteAction}" />
    </h:commandLink>
    there is exception
    Cannot convert A0001 of type class java.lang.String to class java.util.ArrayList
    so what me to do?
    Last edited by irakli_java_dev; 03-06-2011 at 03:54 PM.

  8. #8
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default

    this is learning example, i programming on netbeans 6.7's visual jsf and now i want to start programming on netbeans 6.9 jsf2


    package newpackage;

    @ManagedBean(name = "order")
    @SessionScoped
    public class OrderBean implements Serializable {

    private static final long serialVersionUID = 1L;
    private String orderNo;
    private String productName;
    private BigDecimal price;
    private int qty;
    //getter and setter methods
    private static final ArrayList<Order> orderList =
    new ArrayList<Order>(Arrays.asList(
    new Order("A0001", "Intel CPU",
    new BigDecimal("700.00"), 1),
    new Order("A0002", "Harddisk 10TB",
    new BigDecimal("500.00"), 2),
    new Order("A0003", "Dell Laptop",
    new BigDecimal("11600.00"), 8),
    new Order("A0004", "Samsung LCD",
    new BigDecimal("5200.00"), 3),
    new Order("A0005", "A4Tech Mouse",
    new BigDecimal("100.00"), 10)));

    public ArrayList<Order> getOrderList() {

    return orderList;

    }

    public String addAction() {

    Order order = new Order(this.getOrderNo(), this.getProductName(), this.getPrice(), this.getQty());

    orderList.add(order);
    return "welcome";
    }

    public String deleteAction(Order order) {

    orderList.remove(order);
    return null;
    }

    //getter and setter methods

    public static class Order {

    private String orderNo;
    private String productName;
    private BigDecimal price;
    private int qty;
    private boolean editable;


    public Order(String orderNo, String productName,
    BigDecimal price, int qty) {

    this.orderNo = orderNo;
    this.productName = productName;
    this.price = price;
    this.qty = qty;
    }
    //getter and setter methods
    }
    }

  9. #9
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default

    when i changed deleteAction methode like this code

    public String deleteAction() {
    Order orderById = new Order();
    for (int i=0;i<orderList.size();i++){
    if(orderList.get(i).orderNo.equal(orderNo))

    orderById = orderList.get(i);
    }
    orderList.remove(orderById);
    return null;
    }
    it was needed to add constructor
    private Order() {
    throw new UnsupportedOperationException("Not yet implemented");
    }
    and when i write this
    <h:commandLink value="Delete" action="#{order.deleteAction}" >
    <f:setPropertyActionListener value="#{o.orderNo}" target="#{orderBean.orderNo}" />
    </h:commandLink>
    there was several error
    "target="#{orderBean.orderNo}": Target Unreachable, identifier 'orderBean' resolved to null"

    when i presses ctrl+space after orderBean. there was telling "no suggestion"
    and when i write
    <h:commandLink value="Delete" action="#{order.deleteAction}" >
    <f:setPropertyActionListener value="#{o.orderNo}" target="#{order.orderNo}" />
    </h:commandLink>
    is was error
    "java.lang.UnsupportedOperationException: Not yet implemented"
    Last edited by irakli_java_dev; 03-09-2011 at 12:48 PM.

  10. #10
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default

    i have getter and setter in orther bean but orderBean isn't appares in #{}
    i think this is because of
    @ManagedBean(name = "order")
    @SessionScoped
    public class OrderBean implements Serializable

  11. #11
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

    Default

    i wrote in my orderbean
    private String orderNo;
    //getters and setters
    and its working but
    when orderNo has value 643531, getting error "java.lang.IndexOutOfBoundsException: Index: 643533, Size: 19"
    when orderNo has value 2, it's ok
    can u help me?

  12. #12
    Join Date
    Jan 2011
    Posts
    21
    Rep Power
    0

Similar Threads

  1. Can i including methods into a class ?
    By kizzie33 in forum New To Java
    Replies: 9
    Last Post: 12-21-2010, 04:33 PM
  2. Including Perl in java
    By swati.jyoti in forum New To Java
    Replies: 1
    Last Post: 05-13-2010, 05:31 PM
  3. Sum of all even numbers up to but not including 100
    By bigpips305 in forum New To Java
    Replies: 41
    Last Post: 02-09-2010, 04:16 PM
  4. Replies: 0
    Last Post: 09-11-2009, 07:29 PM
  5. Including JAR in applications
    By bugger in forum New To Java
    Replies: 0
    Last Post: 01-11-2008, 10:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •