You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Pesia <ma...@wp.pl> on 2006/12/07 10:47:44 UTC

input inside datatable & submit action

Hi!
I have a problem with executing backing bean action on submit.
I have a form with dynamic number of fields (in dataTable),
and submit command link below table. Unfortunately action from 
command ling is not fired :( (although it is when I remove dataTable and use
fixed inputs).
here is my code that doestnt work:

	<t:dataTable id="editTable" var="col" value="#{table.currentRecord}">
       	<t:column>
              <h:inputText value="#{col.value}"/>
       	</t:column>
	</t:dataTable>
	<h:inputText value="#{table.sortColumn}"/>
        <h:commandButton id="table_update" action="#{table.update}"
value="Update table row"/>

action action="#{table.update}" is not fired here.
But if I just use:

    <h:inputText value="#{table.sortColumn}"/>
    <h:commandButton id="table_update" action="#{table.update}"
value="Update table row"/>

then it works!

table is a session bean with method "update" and currentRecord is a list of
column values.
Could sombody tell me what am I doing wrong here?

Thanks in advance!

-- 
View this message in context: http://www.nabble.com/input-inside-datatable---submit-action-tf2773289.html#a7735931
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: input inside datatable & submit action

Posted by Pesia <ma...@wp.pl>.
Thanks for fast reply!

I did it and I got a message:

    Bean: database.impl.DBValueWrapper, property: value (no write method for
property!)

Actually this is parametrized(generic) type and I have setter & getter in
there:

	public void setValue(Object value);
	public T getValue();

Where T is type parameter.

When I change the setter to
   public void setValue(T value);
Then my example works!

But it really does not solves my problem (as I need to exact know the type
of the object when set
it in other parts of my code).
Right now I have a "workaround" as my parametrized type T implements
Comparable interface
so I just cast every value-to-set to Comparable. But in this scenario I have
always type safety warning
and it's not very convenient (and also not general) solution.

So some questions:

- Does anybody have any experience with similar scenario with JSF?

- Do you know any "incompatibilities" when using JSF together with generic
objects?

- Isn't it possible in JSF to have setter that takes superclass of the
object-to-set as parameter?
  (Or mayby it just have problems with Object)
  (does value bidding supports type hierarchy?)

Answer to any of them appreciated. If I'm missing something obvious for you
please
provide at least a link for me to be able to understand it...












Volker Weber-4 wrote:
> 
> Hi,
> 
> sounds like a validation/conversion error with skipping of
> invokeApplication Phase.
> 
> add a h:messages tag to the page to exclude or view this errors.
> 
> Regards,
>   Volker
> 

-- 
View this message in context: http://www.nabble.com/input-inside-datatable---submit-action-tf2773289.html#a7737848
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: input inside datatable & submit action

Posted by Volker Weber <we...@googlemail.com>.
Hi,

sounds like a validation/conversion error with skipping of
invokeApplication Phase.

add a h:messages tag to the page to exclude or view this errors.

Regards,
  Volker

2006/12/7, Pesia <ma...@wp.pl>:
>
> Hi!
> I have a problem with executing backing bean action on submit.
> I have a form with dynamic number of fields (in dataTable),
> and submit command link below table. Unfortunately action from
> command ling is not fired :( (although it is when I remove dataTable and use
> fixed inputs).
> here is my code that doestnt work:
>
>         <t:dataTable id="editTable" var="col" value="#{table.currentRecord}">
>         <t:column>
>               <h:inputText value="#{col.value}"/>
>         </t:column>
>         </t:dataTable>
>         <h:inputText value="#{table.sortColumn}"/>
>         <h:commandButton id="table_update" action="#{table.update}"
> value="Update table row"/>
>
> action action="#{table.update}" is not fired here.
> But if I just use:
>
>     <h:inputText value="#{table.sortColumn}"/>
>     <h:commandButton id="table_update" action="#{table.update}"
> value="Update table row"/>
>
> then it works!
>
> table is a session bean with method "update" and currentRecord is a list of
> column values.
> Could sombody tell me what am I doing wrong here?
>
> Thanks in advance!
>
> --
> View this message in context: http://www.nabble.com/input-inside-datatable---submit-action-tf2773289.html#a7735931
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>