Re: tapestry5-jquery tabs

2014-08-11 Thread Basile Chandesris

With https://github.com/uklance/tapestry-stitch

http://tapestry.apache.org/schema/tapestry_5_4.xsd";
  xmlns:p="tapestry:parameter">


  
  

  
  

  
 

 


import cnx.services.AppModule;
import cnx.services.MyService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.tapestry5.annotations.*;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tynamo.security.services.SecurityService;

@Secure
@RequiresPermissions({AppModule.PERMISSION_XXX})
public class Index {
private final static Logger LOG = LoggerFactory.getLogger(Index.class);

@Persist
@Property
private String project;

@Persist
@Property
private List projects;

@Inject
private MyService service;

@Inject
private SecurityService securityService;

@PageActivationContext
@Property
private String projectsTab;

private static final String XXX = "XXX";
private static final String HELP = "Help";

@SetupRender
void initializeValue() {
projects = service.getAllCustomersProjects();

// Move XXX at the end and check authorisation
projects.remove(XXX);
try {
if (!securityService.hasRole(AppModule.ROLE_XXX)) 
projects.add(XXX);

} catch (Exception e) {
LOG.error("", e);
}

// Caused by: java.lang.IllegalStateException: Duplicate tab 
name Help

if (!projects.contains(HELP)) projects.add(HELP);
}

   public boolean isHelp(){
if (HELP.equals(project)) return true;
return false;
}
}

https://issues.apache.org/jira/browse/TAP5-2373

Le 08/08/14 23:45, Chris Mylonas a écrit :

Hi John,
Not really a tapestry question but it's something I need to do for a
"project-of-the-future"

Maybe checking jquery-ui will help
e.g.
http://stackoverflow.com/questions/14702631/in-jquery-ui-1-9-how-do-you-create-new-tabs-dynamically

Chris



On Tue, Aug 5, 2014 at 3:56 PM, John  wrote:


Has anyone got code to share for a jquery tabs example where the tabs are
created dynamiclly? The given example only allows for a fixed number of
tabs.

John

---
This email is free from viruses and malware because avast! Antivirus
protection is active.
http://www.avast.com





Re: tapestry5-jquery tabs

2014-08-08 Thread Chris Mylonas
Hi John,
Not really a tapestry question but it's something I need to do for a
"project-of-the-future"

Maybe checking jquery-ui will help
e.g.
http://stackoverflow.com/questions/14702631/in-jquery-ui-1-9-how-do-you-create-new-tabs-dynamically

Chris



On Tue, Aug 5, 2014 at 3:56 PM, John  wrote:

> Has anyone got code to share for a jquery tabs example where the tabs are
> created dynamiclly? The given example only allows for a fixed number of
> tabs.
>
> John
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com
>