Re: [T5] Select, palette, multiselect

2012-09-24 Thread nkv1
Martin Grotzke wrote
 On Fri, 2007-07-27 at 17:37 -0300, Thiago H de Paula Figueiredo wrote:
 And has anyone implemented a Select-like component for multiple option  
 selection? It would be very nice to have both multiselect and palette, as  
 T4 has.
 Take a look at this thread, it's really easy to implement multiselect
 with T5:
 http://www.nabble.com/T5%3A-select-component-with-support-for-attribute-%22multiple%22-tf3880056.html#a10996038
 
 Cheers,
 Martin
 
 
 
 Thiago
 
 -
 To unsubscribe, e-mail: 

 users-unsubscribe@.apache

 For additional commands, e-mail: 

 users-help@.apache

 
 
 
 signature.asc (196 bytes)
 lt;http://tapestry.1045711.n5.nabble.com/attachment/2408345/0/signature.ascgt;

link no longer exists



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-Select-palette-multiselect-tp2408343p5716472.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Palette with GenericValueEncoder, GenericMultipleSelectModel

2012-09-24 Thread nkv1
/I am trying to make a palette with using http://chenillekit.codehaus.org/
generics with database entity objects.
This i my page template/
t:layout t:pageTitle=${message:title}
  xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  xmlns:tx=tapestry-library:tapx
  section
header
  
Detalji o studentu

/header
article 
  t:if test=about
t:beandisplay object=about/
  /t:if
  t:if negate=true test=about
Entitet ${about} does not exist.
br/
br/
  /t:if
/article
header
  
Lista Grupa

/header
t:zone t:id=lista
  t:form t:id=form
  t:Palette t:model=grupaModels
t:selected=paletteSelectedValues t:encoder=grupaEncoder/
t:submit t:id=submit value=message:update/
  /t:form
/t:zone
footer
  t:pagelink page=PageAddStudent
${message:back}
  /t:pagelink
/footer
  /section
/t:layout

/And this is my page class/

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package projekat.pages;

import java.util.ArrayList;
import java.util.List;
import org.apache.tapestry5.annotations.InjectComponent;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.chenillekit.tapestry.core.encoders.GenericValueEncoder;
import org.chenillekit.tapestry.core.models.GenericMultipleSelectModel;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import projekat.entities.Grupa;
import projekat.entities.Korisnik;
import projekat.entities.Student;
import projekat.services.ProtectedPage;

@ProtectedPage
public class PageDetailStudent {

  /**
   * Student
   */
  @Persist
  @Property
  private Student about;
  /**
   * Groups
   */
  @Persist
  @Property
  private Grupa isIn;
  /**
   * List of Groups
   */
  @Persist
  private ListGrupa isInList;
  /**
   * database session
   */
  @Inject
  private Session hibernate;
  /**
   * zone
   */
  @InjectComponent
  private Zone lista;
  /**
   * user
   */
  @SessionState
  @Property
  private Korisnik asoKorisnik;
  /**
   * userexistance
   */
  @Property
  private boolean asoKorisnikExists;
  //editing start
 
/**http://chenillekit.codehaus.org/chenillekit-tapestry/apidocs/org/chenillekit/tapestry/core/encoders/GenericValueEncoder.html*/
  @Persist
  private GenericValueEncoderGrupa grupaEncoder = new
GenericValueEncoderGrupa(isInList, null, null);
 
/**http://chenillekit.codehaus.org/chenillekit-tapestry/apidocs/org/chenillekit/tapestry/core/models/GenericMultipleSelectModel.html*/
  @Persist
  private GenericMultipleSelectModelGrupa grupaModels = new
GenericMultipleSelectModelGrupa(isInList, null, null, null, null);
  /**
   * list of selected values from palette
   */
  @Property
  @Persist
  private ListGrupa paletteSelectedValues;

  void setupRender() {

if (paletteSelectedValues == null) {
  paletteSelectedValues = new ArrayListGrupa();
}
  }
  //editing end

  /**
   * on page activation get student from database
   * with id
   */
  void onActivate(long kljuc) {
this.about = (Student)
hibernate.createCriteria(Student.class).add(Restrictions.eq(kljuc,
kljuc)).uniqueResult();
  }

  /**
   * list all groups from database
   *
   * @return
   */
  public ListGrupa getIsInList() {
return (ListGrupa) hibernate.createCriteria(Grupa.class).list();
  }

  /**
   * add selected groups to student and saves to database
   *
   * @return
   */
  public Object onActionFromSubmit() {
about.getGrupaList().addAll(paletteSelectedValues);
hibernate.persist(about);
return lista;
  }
}

/So my main problem with what to fill null values on class page/



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Palette-with-GenericValueEncoder-GenericMultipleSelectModel-tp5716473.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: choose multiple entity's of object

2012-05-09 Thread nkv1
I belive i have done what i have been asked to do

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/choose-multiple-entity-s-of-object-tp5695777p5696727.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org