try using a object with a getter and setter for your input value.

So you have:

<h:dataTable id="params_dt" value="#{scriptHandler.parameterModel}"
var="param">
      <h:column id="params_c1">
            <h:inputText value="#{param.value}" />
      </h:column>
      <f:facet name="footer">
            <h:commandButton value="Preview Job"
action="#{scriptHandler.updateJob}" />
      </f:facet>
</h:dataTable>


-----Original Message-----
From: Jason Nichols [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 04, 2005 11:16 PM
To: 'MyFaces Discussion'
Subject: possible to edit Tabular data?


Hello:
  I can't find a way to do this using myEclipse JRI and was wondering if
anyone knew a way with myFaces.

I'd have a table of <h:inputText> elements bound to an ArrayList. I
display it and have the user type in new values, but those new values
are never saved. Since the ArrayList is generated dynamically and there
could be up to 50 entries I'd like to avoid having a commandButton in
each row, and I'm not sure if that would work either. Is this possible
with myFaces or even at all?
Any help is greatly appreciated,
Jason


Here's the interface:
<h:dataTable id="params_dt" value="#{scriptHandler.parameterModel}"
var="params">
      <h:column id="params_c1">
            <h:inputText value="#{params}" />
      </h:column>
      <f:facet name="footer">
            <h:commandButton value="Preview Job"
action="#{scriptHandler.updateJob}" />
      </f:facet>
</h:dataTable>

And here's the Java code I'm currently using:
public class ScriptHandler {
            private DataModel parameterModel;

            ...(other methods assign a filled ArrayList to
parameterModel)...

public String updateJob(){
            ArrayList al = (ArrayList) parameterModel.getWrappedData();
            System.err.println(al.toString());
            return "reviewJob";
    }
}

Any help is greatly appreciated,
Jason

Reply via email to