You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by mauro2java2011 <ma...@gmail.com> on 2014/02/12 14:19:21 UTC

add element at ArrayList not work

Hi all.
I have a bean sessionscoped with a List<MyType> list = new
ArrayList<MyType>();

Into a @PostConstruct annotated method i add 4 instances and from the get i
visualize into a table jsf.

I create a new page wiyh a form that set the  properties of the instance of
current object . 
With a command button i link a method that add the curret object at
arraylist and return at page with datatable but when i return i view  only 4
initials object of ArrayList generated wirh postcinstruct method.

Into the method of controller addCurrent(){ 

list.add(current) ;
return "listpage"; 
}

// current it is a field into the same controller .
//current is instance of MyType. 





--
View this message in context: http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: add element at ArrayList not work

Posted by mauro2java2011 <ma...@gmail.com>.
Into my app i not use db . I use only simple dto for test
Il giorno 12/feb/2014 14.36, "Romain Manni-Bucau [via OpenEJB]" <
ml-node+s979440n4667721h26@n4.nabble.com> ha scritto:

> so is it possible you don't use a transaction so add no object?
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014-02-12 14:28 GMT+01:00 mauro2java2011 <[hidden email]<http://user/SendEmail.jtp?type=node&node=4667721&i=0>>:
>
>
> > Yes
> > Il giorno 12/feb/2014 14.25, "Romain Manni-Bucau [via OpenEJB]" <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4667721&i=1>>
> ha scritto:
> >
> >> Hi
> >>
> >> is it the same instance of session bean?
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2014-02-12 14:19 GMT+01:00 mauro2java2011 <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=4667718&i=0>>:
> >>
> >>
> >> > Hi all.
> >> > I have a bean sessionscoped with a List<MyType> list = new
> >> > ArrayList<MyType>();
> >> >
> >> > Into a @PostConstruct annotated method i add 4 instances and from the
> >> get i
> >> > visualize into a table jsf.
> >> >
> >> > I create a new page wiyh a form that set the  properties of the
> instance
> >> of
> >> > current object .
> >> > With a command button i link a method that add the curret object at
> >> > arraylist and return at page with datatable but when i return i view
> >>  only 4
> >> > initials object of ArrayList generated wirh postcinstruct method.
> >> >
> >> > Into the method of controller addCurrent(){
> >> >
> >> > list.add(current) ;
> >> > return "listpage";
> >> > }
> >> >
> >> > // current it is a field into the same controller .
> >> > //current is instance of MyType.
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717.html
> >> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >>
> >>
> >> ------------------------------
> >>  If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667718.html
> >>  To unsubscribe from add element at ArrayList not work, click here<
> >> .
> >> NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667719.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667721.html
>  To unsubscribe from add element at ArrayList not work, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4667717&code=bWF1cm8yamF2YTIwMTFAZ21haWwuY29tfDQ2Njc3MTd8LTExMTcxODc2MjU=>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667724.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: add element at ArrayList not work

Posted by mauro2java2011 <ma...@gmail.com>.
I have writed from my mobile
Il giorno 12/feb/2014 14.46, "Romain Manni-Bucau [via OpenEJB]" <
ml-node+s979440n4667727h12@n4.nabble.com> ha scritto:

> well you need to check
> 1) if session bean is the same (= System.identityHashCode(this) is the
> same)
> 2) is the array list the same
> 3) is postcontruct called multiple times
>
>
> PS: no link but your mails are not that readable in gmail cause of
> typo + missing of space with previous messages
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014-02-12 14:39 GMT+01:00 mauro2java2011 <[hidden email]<http://user/SendEmail.jtp?type=node&node=4667727&i=0>>:
>
>
> > Tge id it is set from code
> > Il giorno 12/feb/2014 14.36, "Romain Manni-Bucau [via OpenEJB]" <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4667727&i=1>>
> ha scritto:
> >
> >> so is it possible you don't use a transaction so add no object?
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2014-02-12 14:28 GMT+01:00 mauro2java2011 <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=4667721&i=0>>:
> >>
> >>
> >> > Yes
> >> > Il giorno 12/feb/2014 14.25, "Romain Manni-Bucau [via OpenEJB]" <
> >> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4667721&i=1>>
>
> >> ha scritto:
> >> >
> >> >> Hi
> >> >>
> >> >> is it the same instance of session bean?
> >> >> Romain Manni-Bucau
> >> >> Twitter: @rmannibucau
> >> >> Blog: http://rmannibucau.wordpress.com/
> >> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> >> Github: https://github.com/rmannibucau
> >> >>
> >> >>
> >> >>
> >> >> 2014-02-12 14:19 GMT+01:00 mauro2java2011 <[hidden email]<
> >> http://user/SendEmail.jtp?type=node&node=4667718&i=0>>:
> >> >>
> >> >>
> >> >> > Hi all.
> >> >> > I have a bean sessionscoped with a List<MyType> list = new
> >> >> > ArrayList<MyType>();
> >> >> >
> >> >> > Into a @PostConstruct annotated method i add 4 instances and from
> the
> >> >> get i
> >> >> > visualize into a table jsf.
> >> >> >
> >> >> > I create a new page wiyh a form that set the  properties of the
> >> instance
> >> >> of
> >> >> > current object .
> >> >> > With a command button i link a method that add the curret object
> at
> >> >> > arraylist and return at page with datatable but when i return i
> view
> >> >>  only 4
> >> >> > initials object of ArrayList generated wirh postcinstruct method.
> >> >> >
> >> >> > Into the method of controller addCurrent(){
> >> >> >
> >> >> > list.add(current) ;
> >> >> > return "listpage";
> >> >> > }
> >> >> >
> >> >> > // current it is a field into the same controller .
> >> >> > //current is instance of MyType.
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > View this message in context:
> >> >>
> >>
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717.html
> >> >> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ------------------------------
> >> >>  If you reply to this email, your message will be added to the
> >> discussion
> >> >> below:
> >> >>
> >> >>
> >>
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667718.html
> >> >>  To unsubscribe from add element at ArrayList not work, click here<
> >> >> .
> >> >> NAML<
> >>
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >> >>
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667719.html
> >> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >>
> >>
> >> ------------------------------
> >>  If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667721.html
> >>  To unsubscribe from add element at ArrayList not work, click here<
> >> .
> >> NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667725.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667727.html
>  To unsubscribe from add element at ArrayList not work, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4667717&code=bWF1cm8yamF2YTIwMTFAZ21haWwuY29tfDQ2Njc3MTd8LTExMTcxODc2MjU=>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667752.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: add element at ArrayList not work

Posted by mauro2java2011 <ma...@gmail.com>.
i have tried to print the size of list int othe page with datatable.
The size is update each times that i add a object to ArrayList m, but the
dadtatable show only the 4 initial object instancied from @PostCOntruct



--
View this message in context: http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667732.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: add element at ArrayList not work

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
my responses inline below...


On Wed, Feb 12, 2014 at 9:53 AM, mauro2java2011 <ma...@gmail.com>wrote:

> @Named(value = "mauroController")
> @SessionScoped
> public class MauroController implements Serializable {
>
>
> private ConsultDTO current;
>
>
<snip>


> private List<ConsultDTO> list=new ArrayList<ConsultDTO>();
>

</snip>

My recommendation is to define the 'list'

private List<ConsultDTO> list;


>     /**
>      * Creates a new instance of MauroController
>      */
>     public MauroController() {
>     }
>

<snip>


>      @PostConstruct
>     public void init(){
>         if (current==null){
>             current = new ConsultDTO();
>         }
>

</snip>

and instantiate your list in @PostConstruct or somewhere in your bean
'after' @PostConstruct, depending on your app, use case(s), etc...

list=new ArrayList<ConsultDTO>();


just like you are instantiating other bean members 'below' in
@PostConstruct,



>
>
>     ConsultDTO c1, c2 ,c3 ,c4;
>     c1= new ConsultDTO("a");
>     c2=  new ConsultDTO("b");
>     c3= new ConsultDTO("c");
>     c4= new ConsultDTO("d");
>     c1.setDescription("first description");
>     c2.setDescription("second description");
>     c3.setDescription("terza descrione");
>     c4.setDescription("4 descrizione");
>     this.list.add(c1);
>     this.list.add(c2);
>     this.list.add(c3);
>     this.list.add(c4);
>
>     }
>

Re: add element at ArrayList not work

Posted by mauro2java2011 <ma...@gmail.com>.
the current it is instanciated then from the form on page create i set the
value of properties of current.
NExt i add it at List form the pethod add() .


i have tried to add a print of size of list into the page of datatable , and
it print the actually size. 
but i get only the first 4 objects
into datatable.

---source of page Create.xhtml...

 <h:body>
        <f:view>
            <h:form>
                <h:panelGrid columns="2" >
                             <h:outputText value="id ="></h:outputText>
                    <input type="text" name=""
value="#{mauroController.current.statusId}" />

                    <h:outputText value="description ="></h:outputText>
                    <input type="text" name="descrizione"
value="#{mauroController.current.description}" />
                    
                    
                    <h:outputText value="crea nuovo"></h:outputText>
                    <h:commandButton action="#{mauroController.creaNuovo()}"
value="crea nuovo"/> 
                    
                    <h:outputText value="cancella"></h:outputText>
                    <h:commandButton
action="#{mauroController.cancellaCurrent()}" value="cancella"/>
        
                    </h:panelGrid    >
                </h:form>
        </f:view>

    </h:body>

----------------------------------------------------------------------------
source  of page List.xhml

 <h:body>
        <f:view>

            list size: #{mauroController.elenco.size()}

            <h:form>
                
<h:outputText value="List"/>

                <h:dataTable value="#{mauroController.list}" var="item" 
                         
                   
                   >
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="StatusId"/>
                        </f:facet>
                        <h:outputText value="#{item.statusId}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Description"/>
                        </f:facet>
                        <h:outputText value="#{item.description}"/>
                    </h:column>
                
                </h:dataTable>
            </h:form>
            
            
            <h:link value="crea nuovo" outcome="Crea"/>
        </f:view>

    </h:body>




--
View this message in context: http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667746.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: add element at ArrayList not work

Posted by mauro2java2011 <ma...@gmail.com>.
now i have changed my code :

the new code :
------------------------------------------

  private ConsultDTO current;

    private List<ConsultDTO> list ;

 public MauroController() {
    }


 @PostConstruct
    public void init() {
        if (current == null) {
            current = new ConsultDTO();
        }
if (this.list==null){
list= new ArrayList<ConsultDTO>();
        ConsultDTO c1, c2, c3, c4;
        c1 = new ConsultDTO("a");
        c2 = new ConsultDTO("b");
        c3 = new ConsultDTO("c");
        c4 = new ConsultDTO("d");
        c1.setDescription("first description");
        c2.setDescription("second description");
        c3.setDescription("terza descrione");
        c4.setDescription("4 descrizione");
        this.list.add(c1);
        this.list.add(c2);
        this.list.add(c3);
        this.list.add(c4);

    }
}
    public String creaNuovo() {

        this.list.add(current);
        int size = this.list.size();
        System.out.println("the list size is= " + size);
current= new ConsultDTO();
        return "List";
        

    }

    public List<ConsultDTO> getElenco() {
        return this.list;
    }



--
View this message in context: http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667747.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: add element at ArrayList not work

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
On Wed, Feb 12, 2014 at 9:53 AM, mauro2java2011 <ma...@gmail.com>wrote:

>  public String  creaNuovo(){
>
> this.list.add(current) ;
> this.list.size();
>
>
> return"List";
>
>
>  }
>

why do you add the 'same' current over and over again, when creaNuovo() is
called?

this.list.add(current) ;

I would do something like this,

this.list.add(new ConsultDTO()) ;

or

current = new ConsultDTO();
this.list.add(current) ;

Re: add element at ArrayList not work

Posted by mauro2java2011 <ma...@gmail.com>.
i you send the source of my controller

ackage maurocontrollers;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.inject.Inject;
import javax.inject.Named;
import mieientity.ConsultDTO;

/**
 *
 * @author utente_javaee7
 */
@Named(value = "mauroController")
@SessionScoped
public class MauroController implements Serializable {
    
  
private ConsultDTO current;

private List<ConsultDTO> list=new ArrayList<ConsultDTO>();

    /**
     * Creates a new instance of MauroController
     */
    public MauroController() {
    }
     @PostConstruct
    public void init(){
        if (current==null){
            current = new ConsultDTO();
        }
        
  
    ConsultDTO c1, c2 ,c3 ,c4;
    c1= new ConsultDTO("a");
    c2=  new ConsultDTO("b");
    c3= new ConsultDTO("c");
    c4= new ConsultDTO("d");
    c1.setDescription("first description");
    c2.setDescription("second description");
    c3.setDescription("terza descrione");
    c4.setDescription("4 descrizione");
    this.list.add(c1);
    this.list.add(c2);
    this.list.add(c3);
    this.list.add(c4);
            
    }

 public String  creaNuovo(){
     
this.list.add(current) ;
this.list.size();


return"List";

 
 }
 public List<ConsultDTO> getElenco(){
 return this.list;
 }
 
             public String cancellaCurrent(){
             this.list.remove(current);
             this.current= new ConsultDTO();
             return "List";
             }

    
    public List<ConsultDTO> getList() {
        return list;
    }

    public void setList(List<ConsultDTO> list) {
        this.list = list;
    }

    public String getId() {
        return current.getStatusId();
    }

    public void setId(String id) {
        this.current.setStatusId(id);
    }

    public String getDescription() {
        return current.getDescription();
    }

    public void setDescription(String description) {
        this.current.setDescription(description);
    }

    public ConsultDTO getCurrent() {
        return current;
    }

    public void setCurrent(ConsultDTO current) {
        this.current = current;
    }
    
    
}





--
View this message in context: http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667730.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: add element at ArrayList not work

Posted by Romain Manni-Bucau <rm...@gmail.com>.
well you need to check
1) if session bean is the same (= System.identityHashCode(this) is the same)
2) is the array list the same
3) is postcontruct called multiple times


PS: no link but your mails are not that readable in gmail cause of
typo + missing of space with previous messages

Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-02-12 14:39 GMT+01:00 mauro2java2011 <ma...@gmail.com>:
> Tge id it is set from code
> Il giorno 12/feb/2014 14.36, "Romain Manni-Bucau [via OpenEJB]" <
> ml-node+s979440n4667721h26@n4.nabble.com> ha scritto:
>
>> so is it possible you don't use a transaction so add no object?
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2014-02-12 14:28 GMT+01:00 mauro2java2011 <[hidden email]<http://user/SendEmail.jtp?type=node&node=4667721&i=0>>:
>>
>>
>> > Yes
>> > Il giorno 12/feb/2014 14.25, "Romain Manni-Bucau [via OpenEJB]" <
>> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4667721&i=1>>
>> ha scritto:
>> >
>> >> Hi
>> >>
>> >> is it the same instance of session bean?
>> >> Romain Manni-Bucau
>> >> Twitter: @rmannibucau
>> >> Blog: http://rmannibucau.wordpress.com/
>> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> Github: https://github.com/rmannibucau
>> >>
>> >>
>> >>
>> >> 2014-02-12 14:19 GMT+01:00 mauro2java2011 <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=4667718&i=0>>:
>> >>
>> >>
>> >> > Hi all.
>> >> > I have a bean sessionscoped with a List<MyType> list = new
>> >> > ArrayList<MyType>();
>> >> >
>> >> > Into a @PostConstruct annotated method i add 4 instances and from the
>> >> get i
>> >> > visualize into a table jsf.
>> >> >
>> >> > I create a new page wiyh a form that set the  properties of the
>> instance
>> >> of
>> >> > current object .
>> >> > With a command button i link a method that add the curret object at
>> >> > arraylist and return at page with datatable but when i return i view
>> >>  only 4
>> >> > initials object of ArrayList generated wirh postcinstruct method.
>> >> >
>> >> > Into the method of controller addCurrent(){
>> >> >
>> >> > list.add(current) ;
>> >> > return "listpage";
>> >> > }
>> >> >
>> >> > // current it is a field into the same controller .
>> >> > //current is instance of MyType.
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >>
>> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717.html
>> >> > Sent from the OpenEJB User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ------------------------------
>> >>  If you reply to this email, your message will be added to the
>> discussion
>> >> below:
>> >>
>> >>
>> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667718.html
>> >>  To unsubscribe from add element at ArrayList not work, click here<
>> >> .
>> >> NAML<
>> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>> >>
>> >
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667719.html
>> > Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667721.html
>>  To unsubscribe from add element at ArrayList not work, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4667717&code=bWF1cm8yamF2YTIwMTFAZ21haWwuY29tfDQ2Njc3MTd8LTExMTcxODc2MjU=>
>> .
>> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667725.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: add element at ArrayList not work

Posted by mauro2java2011 <ma...@gmail.com>.
Tge id it is set from code
Il giorno 12/feb/2014 14.36, "Romain Manni-Bucau [via OpenEJB]" <
ml-node+s979440n4667721h26@n4.nabble.com> ha scritto:

> so is it possible you don't use a transaction so add no object?
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014-02-12 14:28 GMT+01:00 mauro2java2011 <[hidden email]<http://user/SendEmail.jtp?type=node&node=4667721&i=0>>:
>
>
> > Yes
> > Il giorno 12/feb/2014 14.25, "Romain Manni-Bucau [via OpenEJB]" <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=4667721&i=1>>
> ha scritto:
> >
> >> Hi
> >>
> >> is it the same instance of session bean?
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2014-02-12 14:19 GMT+01:00 mauro2java2011 <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=4667718&i=0>>:
> >>
> >>
> >> > Hi all.
> >> > I have a bean sessionscoped with a List<MyType> list = new
> >> > ArrayList<MyType>();
> >> >
> >> > Into a @PostConstruct annotated method i add 4 instances and from the
> >> get i
> >> > visualize into a table jsf.
> >> >
> >> > I create a new page wiyh a form that set the  properties of the
> instance
> >> of
> >> > current object .
> >> > With a command button i link a method that add the curret object at
> >> > arraylist and return at page with datatable but when i return i view
> >>  only 4
> >> > initials object of ArrayList generated wirh postcinstruct method.
> >> >
> >> > Into the method of controller addCurrent(){
> >> >
> >> > list.add(current) ;
> >> > return "listpage";
> >> > }
> >> >
> >> > // current it is a field into the same controller .
> >> > //current is instance of MyType.
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717.html
> >> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >>
> >>
> >> ------------------------------
> >>  If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667718.html
> >>  To unsubscribe from add element at ArrayList not work, click here<
> >> .
> >> NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
> >
> >
> >
> >
> > --
> > View this message in context:
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667719.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667721.html
>  To unsubscribe from add element at ArrayList not work, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4667717&code=bWF1cm8yamF2YTIwMTFAZ21haWwuY29tfDQ2Njc3MTd8LTExMTcxODc2MjU=>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667725.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: add element at ArrayList not work

Posted by Romain Manni-Bucau <rm...@gmail.com>.
so is it possible you don't use a transaction so add no object?
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-02-12 14:28 GMT+01:00 mauro2java2011 <ma...@gmail.com>:
> Yes
> Il giorno 12/feb/2014 14.25, "Romain Manni-Bucau [via OpenEJB]" <
> ml-node+s979440n4667718h33@n4.nabble.com> ha scritto:
>
>> Hi
>>
>> is it the same instance of session bean?
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2014-02-12 14:19 GMT+01:00 mauro2java2011 <[hidden email]<http://user/SendEmail.jtp?type=node&node=4667718&i=0>>:
>>
>>
>> > Hi all.
>> > I have a bean sessionscoped with a List<MyType> list = new
>> > ArrayList<MyType>();
>> >
>> > Into a @PostConstruct annotated method i add 4 instances and from the
>> get i
>> > visualize into a table jsf.
>> >
>> > I create a new page wiyh a form that set the  properties of the instance
>> of
>> > current object .
>> > With a command button i link a method that add the curret object at
>> > arraylist and return at page with datatable but when i return i view
>>  only 4
>> > initials object of ArrayList generated wirh postcinstruct method.
>> >
>> > Into the method of controller addCurrent(){
>> >
>> > list.add(current) ;
>> > return "listpage";
>> > }
>> >
>> > // current it is a field into the same controller .
>> > //current is instance of MyType.
>> >
>> >
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717.html
>> > Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667718.html
>>  To unsubscribe from add element at ArrayList not work, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4667717&code=bWF1cm8yamF2YTIwMTFAZ21haWwuY29tfDQ2Njc3MTd8LTExMTcxODc2MjU=>
>> .
>> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667719.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: add element at ArrayList not work

Posted by mauro2java2011 <ma...@gmail.com>.
Yes
Il giorno 12/feb/2014 14.25, "Romain Manni-Bucau [via OpenEJB]" <
ml-node+s979440n4667718h33@n4.nabble.com> ha scritto:

> Hi
>
> is it the same instance of session bean?
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014-02-12 14:19 GMT+01:00 mauro2java2011 <[hidden email]<http://user/SendEmail.jtp?type=node&node=4667718&i=0>>:
>
>
> > Hi all.
> > I have a bean sessionscoped with a List<MyType> list = new
> > ArrayList<MyType>();
> >
> > Into a @PostConstruct annotated method i add 4 instances and from the
> get i
> > visualize into a table jsf.
> >
> > I create a new page wiyh a form that set the  properties of the instance
> of
> > current object .
> > With a command button i link a method that add the curret object at
> > arraylist and return at page with datatable but when i return i view
>  only 4
> > initials object of ArrayList generated wirh postcinstruct method.
> >
> > Into the method of controller addCurrent(){
> >
> > list.add(current) ;
> > return "listpage";
> > }
> >
> > // current it is a field into the same controller .
> > //current is instance of MyType.
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667718.html
>  To unsubscribe from add element at ArrayList not work, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4667717&code=bWF1cm8yamF2YTIwMTFAZ21haWwuY29tfDQ2Njc3MTd8LTExMTcxODc2MjU=>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717p4667719.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: add element at ArrayList not work

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

is it the same instance of session bean?
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-02-12 14:19 GMT+01:00 mauro2java2011 <ma...@gmail.com>:
> Hi all.
> I have a bean sessionscoped with a List<MyType> list = new
> ArrayList<MyType>();
>
> Into a @PostConstruct annotated method i add 4 instances and from the get i
> visualize into a table jsf.
>
> I create a new page wiyh a form that set the  properties of the instance of
> current object .
> With a command button i link a method that add the curret object at
> arraylist and return at page with datatable but when i return i view  only 4
> initials object of ArrayList generated wirh postcinstruct method.
>
> Into the method of controller addCurrent(){
>
> list.add(current) ;
> return "listpage";
> }
>
> // current it is a field into the same controller .
> //current is instance of MyType.
>
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/add-element-at-ArrayList-not-work-tp4667717.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.