Re: third-party grid

2012-03-26 Thread csckid
thanks I was looking for that.. But is it possible to make the UI like the
one on jqgrid. Can I change the css?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/third-party-grid-tp5592196p5594518.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: third-party grid

2012-03-25 Thread csckid
How do I use it? I am pretty novice

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/third-party-grid-tp5592196p5594350.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



third-party grid

2012-03-24 Thread csckid
I liked the grid in http://trirand.com/blog/jqgrid/jqgrid.html
so to use this grid everywhere on the page, what changes should I make in
tapestry? 

Can my tapestry files be named jsp instead of .tml?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/third-party-grid-tp5592196p5592196.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



javascript to java question

2012-03-09 Thread csckid
I have created a text field dynamically using javascript. 
How can I retrieve that textfield value in java file once a button is
clicked?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/javascript-to-java-question-tp5550571p5550571.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



jsp jstl in tapestry

2012-01-25 Thread csckid
Is it possible to write jstl or use jsp tag in tapestry?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/jsp-jstl-in-tapestry-tp5430730p5430730.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: jsp jstl in tapestry

2012-01-25 Thread csckid
there are few things which will take time if I do it with tapestry. I mean I
am quite beginner with tapestry and didn't feel like researching. But with
jsp I guess I can do it quickly.

In my country tapestry job is very very few. Most of the companies uses jsf. 
I really wonder whether I made the right decision or not? Sorry this is
going off the topic I am learning tapestry since I need to get familiar
with at least one framework.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/jsp-jstl-in-tapestry-tp5430730p5430810.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: jsp jstl in tapestry

2012-01-25 Thread csckid
Thiago I guess doing things using tapestry will be lot easier than jsp.
The thing is I haven't yet worked on javascript in tapestry, so it looks
little complicated to me. Moreover, as I have already mentioned my country
doesn't have much/or may be none at all jobs. So, I am in a doubt these
days, is it really worth studying.
But, after hearing from Taha.. I did gain little inspiration. 

Taha.. thanks.. For getting tapestry jobs on internet, do you look into
freelance sites? Do they specifically mention its a tapestry job? Sorry I am
new to this area and quite fresh graduate too.

The problem I was working on:
I am trying to make a medical prescription. The doctor will search for
medicine using autocomplete mixin and then he will write how many times
should that medicine be taken in a day and he will click on some button and
that medicine along with the dose will be added into a datagrid. Then the
doctor will search for another medicine and hit that fascinating button
again and second medicine will be added on to the same grid. Pretty simple!!


input t:id=medicineNameTf t:type=TextField t:mixins=autocomplete
/t:submit id=addToList/

When the submit button is clicked the value from medicineNameTf will be
added into an arraylist, and that arraylist is pointing to the datagrid.
Should I use a submit button here? If I add the medicine object to the
arraylist is this calling the server? 

Problem: I have passed patient id as context value. When the submit button
is clicked the context value disappears. 






--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/jsp-jstl-in-tapestry-tp5430730p5431022.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: Some tips... client side

2012-01-22 Thread csckid
Eventlink cannot retrieve the value of a textfield with or without
autocomplete mixin. However, submit button can retrieve the value.



 void onAddToPrescriptionTest(){
 System.out.println(\n\n\n + fNameTf + \n\n\n); //returns null
 } 
 void onSuccess(){
 System.out.println(\n\n\n + fNameTf + \n\n\n); //return
textfield value
 } 


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Some-tips-client-side-tp5163718p5163809.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



Some tips... client side

2012-01-21 Thread csckid
I need to populate a grid using values entered into a autocomplete textfield.
In order to enter the values into the grid what sort of button should I use?
Should I use an eventlink, or submit button or should I write javascript
code into the page? 


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Some-tips-client-side-tp5163718p5163718.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: Some tips... client side

2012-01-21 Thread csckid
eventlink cannot read the value of the autocomplete mixin textfield. 
fNameTf returns null

form t:type=form
Type in a First name:
 input t:id=fNameTf t:type=TextField 
t:mixins=autocomplete /
  # Add  
/form


@Property
private String fNameTf;

 void onAddToPrescriptionTest(){
System.out.println(\n\n\n + fNameTf + \n\n\n);  

}

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Some-tips-client-side-tp5163718p5163777.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: jquery

2012-01-03 Thread csckid
With this line
configuration.add(JQuerySymbolConstants.SUPPRESS_PROTOTYPE, false);

This code works

(function( $ ) {
$(document).ready(function(){
alert(ok);
});
}) ( jQuery );

But the problem is jquery/tooltip mixin doesn't work now.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/jquery-tp5113334p5116882.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: jquery

2012-01-03 Thread csckid
I wrote this two lines in the Appmodule
 configuration.add(JQuerySymbolConstants.JQUERY_ALIAS, $j); 
 configuration.add(JQuerySymbolConstants.SUPPRESS_PROTOTYPE, false);

Now everything is working i.e. autocomplete mixin, jquery/tooltip, tapestry
validation,
 (function( $ ) {
 $(document).ready(function(){
 alert(ok);
 });
 }) ( jQuery ); 

Only the simple jquery code isn't working
$(document).ready(function(){
$(#showid).click(function(){
$(#pelement).show();
});
$(#hideid).click(function(){
$(#pelement).hide();
});
});
Error: $(document).ready is not a function
Source File: http://localhost:8080/medical/about
Line: 29


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/jquery-tp5113334p5117610.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: jquery

2012-01-02 Thread csckid
I am using tapestry5-jquery version 2.6.1

When I wrote this line 
*configuration.add(JQuerySymbolConstants.SUPPRESS_PROTOTYPE, false);*
Mixin is working but simple jquery isn't working. This is the error message
for simple jquery method
*$(document).ready is not a function*


about.tml
html t:type=layout title=About tapestryHiber
  xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  xmlns:p=tapestry:parameter





p id=pelementIf you click on me, I will disappear./p
p id=showidshow/p
p id=hideidhide/p

/html



When I omited this line
*configuration.add(JQuerySymbolConstants.SUPPRESS_PROTOTYPE, false);*
mixin gives two error
Error: uncaught exception: controls.js requires including script.aculo.us'
effects.js library

Error: $T is not defined
Source File:
http://localhost:8080/medical/assets/1.0-SNAPSHOT/core/corelib/mixins/autocomplete.js
Line: 17






--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/jquery-tp5113334p5114790.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



jquery

2012-01-01 Thread csckid
I was using t:mixins=autocomplete and it worked fine.

Then recently I added jquery to my tapestry project
dependency
groupIdorg.got5/groupId
artifactIdtapestry5-jquery/artifactId
version2.1.1/version
/dependency

Now aucomplete mixin is not working. Any ideas?

I am using Tapestry 5.2.5

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/jquery-tp5113334p5113334.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: jquery

2012-01-01 Thread csckid
With this code
configuration.add(JQuerySymbolConstants.SUPPRESS_PROTOTYPE, false);

the mixin is working. However, simple jquery code is not working.
p id=pelementIf you click on me, I will disappear./p
p id=showidshow/p
p id=hideidhide/p






--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/jquery-tp5113334p5113973.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



shiro authentication

2011-12-28 Thread csckid
I am stuck with authenticating user from database table.

In this function doGetAuthenticationInfo() don't we need to set the Subject?

What is the purpose of SimpleAuthenticationInfo?

package com.kids.crm.services;

import java.util.HashSet;
import java.util.Set;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AccountException;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.authz.AuthorizationException;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.util.SimpleByteSource;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.springframework.beans.factory.annotation.Autowired;

import com.kids.crm.dao.DatabaseDao;
import com.kids.crm.dao.UserAccountDao;
import com.kids.crm.dao.impl.UserAccountDaoImpl;
import com.kids.crm.db.Role;
import com.kids.crm.db.UserAccount;


public class UserRealm extends AuthorizingRealm {
@Inject UserAccountDao userAccountDao;
public UserRealm() {
setName(localaccounts);
setAuthenticationTokenClass(UsernamePasswordToken.class);
}

private UserAccount findByUsername(String userName) {
return (UserAccount) userAccountDao.getUserByUserName(userName);
}

@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken
token) throws AuthenticationException {
//Subject currentUser = SecurityUtils.getSubject();
UsernamePasswordToken upToken = (UsernamePasswordToken) token;

String username = upToken.getUsername();
upToken.setRememberMe(true);
// Null username is invalid
if (username == null) { throw new 
AccountException(Null usernames are
not allowed by this realm.); } 
UserAccount user = findByUsername(username);

return new SimpleAuthenticationInfo(username, 
user.getEncodedPassword(),
new SimpleByteSource(user.getPasswordSalt()), getName());
}

}


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/shiro-authentication-tp5106945p5106945.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: shiro

2011-12-20 Thread csckid
I tried this

 public static void
contributeSecurityConfiguration(ConfigurationSecurityFilterChain
configuration,
SecurityFilterChainFactory factory) {

configuration.add(factory.createChain(/medicine/create).add(factory.roles(),employee,
doctor).build()); 
}   

and

@RequiresRoles(value = {doctor, employee})

None of them worked. :(
I wanted doctor and employee to access the page. But, with these code none
of them were working. 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/shiro-tp5082018p5088642.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



animated graph

2011-12-18 Thread csckid
Isn't there anything like animated graph. Like when use clicks on bar chart,
the bar shows some animation they display the graph(like flex).

There is a tapestry 5 and jquery integration. 
http://tapestry5-jquery.com/
If I want to use some other component from other jquery site, I mean can I
use it? Then why should we use this tapestry5-jquery project?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/animated-graph-tp5083674p5083674.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



shiro

2011-12-16 Thread csckid
I wrote this following code to restrict the user from accessing certain
pages. Problem is it isn't working correctly.
configuration.add(factory.createChain(/index).add(factory.authc()).build());
I wrote this code so that only authorized user view the page, But in my
program everyone can view.

configuration.add(factory.createChain(/medicine/**).add(factory.roles(),
employee).build());
configuration.add(factory.createChain(/medicine/**).add(factory.roles(),
doctor).build());
With this code employee cannot access tml file of medicine folder but doctor
can. Why is this so?

public static void
contributeSecurityConfiguration(ConfigurationSecurityFilterChain
configuration,
SecurityFilterChainFactory factory) {


configuration.add(factory.createChain(/signin).add(factory.anon()).build());

configuration.add(factory.createChain(/index).add(factory.authc()).build());


configuration.add(factory.createChain(/medicine/**).add(factory.roles(),
employee).build());

configuration.add(factory.createChain(/prescription/**).add(factory.roles(),
doctor).build());

configuration.add(factory.createChain(/medicine/**).add(factory.roles(),
doctor).build());
}   


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/shiro-tp5082018p5082018.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




ioc

2011-12-12 Thread csckid
I get this exception after I have added tapestry-ioc. I have included spring
too in my pom file

SEVERE: Exception starting filter app
java.lang.NoClassDefFoundError:
org/apache/tapestry5/ioc/services/SymbolProvider

Here is my AppModule.java
package com.kids.crm.services;

import java.io.IOException;

import org.apache.tapestry5.*;
import org.apache.tapestry5.ioc.Configuration;
import org.apache.tapestry5.ioc.MappedConfiguration;
import org.apache.tapestry5.ioc.OrderedConfiguration;
import org.apache.tapestry5.ioc.ServiceBinder;
import org.apache.tapestry5.ioc.annotations.InjectService;
import org.apache.tapestry5.ioc.annotations.Local;
import org.apache.tapestry5.services.Request;
import org.apache.tapestry5.services.RequestFilter;
import org.apache.tapestry5.services.RequestHandler;
import org.apache.tapestry5.services.Response;
import org.slf4j.Logger;

/**
 * This module is automatically included as part of the Tapestry IoC
Registry, it's a good place to
 * configure and extend Tapestry, or to place your own service definitions.
 */
public class AppModule
{
public static void bind(ServiceBinder binder)
{
// binder.bind(MyServiceInterface.class, MyServiceImpl.class);

}


public static void contributeApplicationDefaults(
MappedConfigurationString, String configuration)
{
   

configuration.add(SymbolConstants.SUPPORTED_LOCALES, en);

   
configuration.add(SymbolConstants.PRODUCTION_MODE, false);

configuration.add(SymbolConstants.APPLICATION_VERSION,
1.0-SNAPSHOT);
}

public RequestFilter buildTimingFilter(final Logger log)
{
return new RequestFilter()
{
public boolean service(Request request, Response response,
RequestHandler handler)
throws IOException
{
long startTime = System.currentTimeMillis();

try
{

return handler.service(request, response);
}
finally
{
long elapsed = System.currentTimeMillis() - startTime;

log.info(String.format(Request time: %d ms, elapsed));
}
}
};
}

public void contributeRequestHandler(OrderedConfigurationRequestFilter
configuration,
@Local
RequestFilter filter)
{

configuration.add(Timing, filter);
}

}





--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/ioc-tp5067699p5067699.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: ioc

2011-12-12 Thread csckid
I found out the problem.  This was my initial pom file
dependency
groupIdorg.apache.tapestry/groupId
artifactIdtapestry-ioc/artifactId
version${tapestry-release-version}/version
scopeprovided/scope
/dependency
I have removed scope section and it ran correctly. :D
Anyways, I would like to know what does it mean  by adding scope. Or never
mind I haven't google it yet. :D


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/ioc-tp5067699p5068378.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



tapestry-security shiro

2011-12-08 Thread csckid
I am trying to configure my tapestry project with tapestry-security, but
couldn't connect them. Right now I just want try it out with simple login
page. Roles user name and password will come from the database. 

Is there any simple tutorial just for this?

This is what I have done so far:
*SignIn.tml*
html t:type=layout title=Login
  xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  xmlns:p=tapestry:parameter
t:security.loginform /
/html

SignIn.java
public class Signin {
@Inject
private SecurityService securityService;

@Inject
private ApplicationStateManager applicationStateManager;

void onActivate() {
if (securityService.getSubject().isAuthenticated() ) {
//CurrentUser currentUser =
applicationStateManager.get(CurrentUser.class);

//currentUser.merge(securityService.getSubject().getPrincipal());
}

}
}

AppModule.java

  public static void contributeWebSecurityManager(ConfigurationRealm
configuration) {
ExtendedPropertiesRealm realm = new
ExtendedPropertiesRealm(classpath:shiro-users.properties);
configuration.add(realm);
}
public static void contributeFactoryDefaults(MappedConfigurationString,
String
configuration)
{

configuration.override(SecuritySymbols.LOGIN_URL, /signin);


}
public static void  contributeWebSecurityManager(ConfigurationRealm
configuration,  @Inject AuthorizingRealm realm)
{
configuration.add(realm);
}

public static void contributeSecurityRequestFilter(
OrderedConfigurationFilterChainDefinition configuration)
{
configuration.add(index-anon, new FilterChainDefinition(/index,
anon));
configuration.add(signup-anon, new FilterChainDefinition(/signup,
anon));
   configuration.add(signin-anon, new FilterChainDefinition(/signin,
anon));
}

*
shiro-users.properties*
//I really don't know what to write here
user.localuser = local, admin
role.admin = user:view


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/tapestry-security-shiro-tp5060704p5060704.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: security

2011-12-06 Thread csckid
Instead of downloading from tynamo.. Can't we directly use Apache Shiro?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/security-tp5045892p5052282.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



security

2011-12-04 Thread csckid
Can I use spring security in my tapestry project? though there is Tynamo
tapestry security

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/security-tp5045892p5045892.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



hosting

2011-11-29 Thread csckid
Is it possible to host tapestry site on google app engine? Isn't there any
free java hosting site?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/hosting-tp5032287p5032287.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: fault found

2011-11-28 Thread csckid
I tried with smaller project that has only hibernate and spring integrated
and no custom filters. It didn't work still. 

Is there any other way to download the file beside this procedure? Can I
link it through jsp? If that is possible can you please show me the way.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/fault-found-tp5026068p5028554.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: fault found

2011-11-28 Thread csckid
Found out the problem :D

All my downloads are done by Internet download manager. My problem was
actually similar to what 'Lance' said. Browser sends one request and 2 more
from IDM(thats makes it three times). Anyways, I have disabled IDM and went
with normal downloader that came out with the browser and my method was just
called once :).  

Now the question is, how would I tackle IDM? :S


Another question, what framework did this website
use(http://tapestry.1045711.n5.nabble.com)?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/fault-found-tp5026068p5029218.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: fault found

2011-11-27 Thread csckid
*Contact.java*

import java.io.InputStream;

import org.apache.tapestry5.StreamResponse;

import com.kids.crm.reports.pdf.PDFGenerator;
import com.kids.crm.reports.pdf.PDFStreamResponse;



public class Contact
{
public StreamResponse onSubmit() {
// Create PDF
InputStream is = PDFGenerator.generatePDF(This is the content of a
Dynamically Generated PDF);
// Return response
return new PDFStreamResponse(is,MyDynamicSample);
}
}



*Contact.tml*
html t:type=layout title=Contact com.kids.crm
  xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  xmlns:p=tapestry:parameter

pContact com.kids.crm .../p
t:form t:id=doReportsForm action=reportsForm target=_blank

   t:submit t:id=onSubmit name=Run Report value=Run Report /

/t:form
/html


PDFGenerator.java

package com.kids.crm.reports.pdf;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;

import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;

public class PDFGenerator {
public static InputStream generatePDF(String teststring) {
// step 1: creation of a document-object
Document document = new Document();

System.out.println(\n\n\n\n\ntold ya 1\n\n\n\n);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter writer = PdfWriter.getInstance(document, 
baos);
// step 3: we open the document
document.open();
// step 4: we add a paragraph to the document
document.add(new Paragraph(teststring));
} catch (DocumentException de) {
System.err.println(de.getMessage());
}
// step 5: we close the document
document.close();
ByteArrayInputStream bais = new 
ByteArrayInputStream(baos.toByteArray());
return bais;
}

}


*PDFStreamResponse.java*

package com.kids.crm.reports.pdf;

import java.io.IOException;
import java.io.InputStream;

import org.apache.tapestry5.StreamResponse;
import org.apache.tapestry5.services.Response;

public class PDFStreamResponse implements StreamResponse{
private InputStream is;
private String filename=default;

public PDFStreamResponse(InputStream is, String... args) {
this.is = is;
if (args != null) {
this.filename = args[0];
}
}

public String getContentType() {
return application/pdf;
}

public InputStream getStream() throws IOException {
return is;
}

public void prepareResponse(Response arg0) {
arg0.setHeader(Content-Disposition, attachment; filename=
+ filename + .pdf);
}


}





--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/fault-found-tp5026068p5026121.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: fault found

2011-11-27 Thread csckid
Smaller sample:

*Contact.tml*
html t:type=layout title=Contact com.kids.crm
  xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  xmlns:p=tapestry:parameter

pContact com.kids.crm .../p
t:form t:id=doReportsForm  
   t:submit t:id=onSubmit name=Run Report value=Run Report /
/t:form
/html



*Contact.java*
package com.kids.crm.pages;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;

import org.apache.tapestry5.StreamResponse;
import org.apache.tapestry5.annotations.InjectPage;

import com.kids.crm.reports.pdf.PDFGenerator;
import com.kids.crm.reports.pdf.PDFStreamResponse;



public class Contact
{
public StreamResponse onSubmit() {  
 try {
System.out.println(\n\n\n\n\nContact\n\n\n\n);
File tmpFile = File.createTempFile(hava, null);
BufferedWriter br = new BufferedWriter(new 
FileWriter(tmpFile));
br.append(something to test\nAnother line to test);
br.flush();
br.close();

return new PDFStreamResponse(new
FileInputStream(tmpFile.getAbsolutePath()), results_file);
 } catch (IOException e) {
 e.printStackTrace();
 }

   return null; 


}
}

*
PDFStreamResponse.java*
package com.kids.crm.reports.pdf;

import java.io.IOException;
import java.io.InputStream;

import javax.servlet.http.HttpServletResponse;

import org.apache.tapestry5.StreamResponse;
import org.apache.tapestry5.services.Response;

public class PDFStreamResponse implements StreamResponse{
private InputStream is;
private String filename=default;

public PDFStreamResponse(InputStream is, String args) {
this.is = is;
this.filename = args;
}

public String getContentType() {
return application/pdf;
}

public InputStream getStream() throws IOException {
return is;
}

public void prepareResponse(Response arg0) {
arg0.setHeader(Content-Disposition, attachment; filename=
+ filename + .pdf);
}


}




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/fault-found-tp5026068p5026316.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



user download file

2011-11-26 Thread csckid
I have an actionLink when it is clicked a pdf file is generated. I need to
prompt the user where he will save the pdf file. How can I do that?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/user-download-file-tp5024911p5024911.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



fault found

2011-11-26 Thread csckid
I tried the following example to generate pdf file and return to user
browser. 
http://wiki.apache.org/tapestry/Tapestry5HowToCreateADynamicPDF

The problem I found is method public StreamResponse onSubmit() is called
three times. I really couldn't understand why this was so, but it would be
really helpful if someone could help me out with this.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/fault-found-tp5026068p5026068.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



where to save image

2011-11-25 Thread csckid
User of web application needs to save customer images. Where do I place them?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/where-to-save-image-tp502p502.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



autocomplete

2011-10-27 Thread csckid
I am trying to test Autocomplete using tapestry5. I get the following
exception:

Render queue error in BeginRender[About:fnametf]: Parameter 'translate' of
component About:fnametf is bound to null. This parameter is not allowed to
be null.

About.tml
html t:type=layout title=About tapestryHiber
  xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  xmlns:p=tapestry:parameter

pAbout tapestryHiber application .../p
div style=margin: 20px;
form t:type=form
Type in a country name:
input t:id=fNameTf t:type=TextField 
t:mixins=autocomplete
value=matches/
/form
/div

/html


About.java
package com.kids.crm.pages;

import java.util.ArrayList;
import java.util.List;

import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.kids.crm.dao.DatabaseDao;
import com.kids.crm.dao.WholeSaleMemberDao;
import com.kids.crm.db.TruckWoodPrice;

public class About {

@Property
private ListString matches;

@Inject
private WholeSaleMemberDao wholeSaleMemberDao;

ListString onProvideCompletionsFromfNameTf(String partial) {
partial = partial.toUpperCase();
matches = 
wholeSaleMemberDao.getWholeSaleMembersPartialFName(partial);
return matches;
}

}





--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/autocomplete-tp4942541p4942541.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: autocomplete

2011-10-27 Thread csckid
Thank you I was able to do it.
How can I change the background color of autocomplete mixin?


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/autocomplete-tp4942541p4943300.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



table

2011-09-28 Thread csckid
The cell I have added using t:add doesn't show the sort button, on the thead.
How can I show the sort button? Please also let me know, whether this is the
right way to create table in tapestry?
table t:type=grid t:source=truckWoodPriceList t:row=truckWoodPrice
t:exclude=woodType, price,created, updated
  t:rowsPerPage=20 t:pagerPosition=top t:add=truck, cft, wood
p:empty
  pThere are no records to display; /p
/p:empty
p:truckCell
${truckWoodPrice.truck.id}
/p:truckCell
p:cftCell
 ${truckWoodPrice.truck.cft}
/p:cftCell
p:woodCell
 ${truckWoodPrice.woodType} @ ${truckWoodPrice.price}
/p:woodCell
 /table

public class TruckWoodPrice extends Persistent{
private Truck truck;
DateTime dateTime = new DateTime();
private WoodType woodType;
private Double price;
private Integer truckYear= dateTime.getYear();
//getters and setters
}

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/table-tp4849434p4849434.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



Change Name

2011-09-28 Thread csckid
If I make a form using beaneditform , how do I change the name of the field
of the form. e.g
class Truck{
private int id;
private int truckNumberVO;
//getters and setters
}

t:beaneditform submitlabel=Create object=truck /
I want the field/label name of truckNumberVO to be shown as Truck Number

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Change-Name-tp4851582p4851582.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



two object beaneditform

2011-09-26 Thread csckid
If I have two tables, can't I use beaneditform? In that case what should be
the way to take input of two model class?

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/two-object-beaneditform-tp4841107p4841107.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



tapestry select model

2011-09-20 Thread csckid
I am developing a page that will load value of combobox from a database
table. The table is loaded fine. But when I clicked on submit, I can't
access the data that is selected in the combobox.

 When I click on submit it says. I though I will be able to call
membersName.getId()




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/tapestry-select-model-tp4823674p4823674.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: tapestry select model

2011-09-20 Thread csckid
Select component is populated. But I wasn't able to fetch the id variable of
the selected object.
*CreateWMemberTruck.tml *
form t:type=form
   t:label for=members/:
t:select t:id=members value=membersName model=MemberSelectModel
/
t:submit value=save/
  /form

*CreateWMemberTruck.java *

public class CreateWMemberTruck {


@Inject
private WholeSaleMemberDao wholeSaleMemberDao;

@Property
private SelectModel memberSelectModel;
@Property
@Inject
private SelectModelFactory selectModelFactory;

@Property
private WholeSaleMember membersName;


void setupRender() {

ListWholeSaleMember members =
wholeSaleMemberDao.getWholeSaleMembers();


memberSelectModel = selectModelFactory.create(members, fName);
}

void onSuccess() {

System.out.println(\n\n\n+ membersName.getId()+\n\n\n\n);

}
}

 When I click on submit it says. I thought I will be able to call
membersName.getId()
*Exception*
org.apache.tapestry5.ioc.internal.OperationException
Could not find a coercion from type java.lang.String to type
com.kids.crm.db.WholeSaleMember.
#

location
classpath:com/kids/crm/pages/wholesalemember/CreateWMemberTruck.tml,
line 5
1   html t:type=layout title=Create Whole sale Member Truck
2   t:sidebarTitle=Browse Wood
3   xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
4   xmlns:p=tapestry:parameter
5   form t:type=form
6   t:label for=truckid/:
7   t:textfield t:id=truckid validate=required value=tbxValue/
8   t:label for=members/:
9   t:select t:id=members value=membersName model=MemberSelectModel
/
10  t:submit value=save/
trace

* Triggering event 'action' on
wholesalemember/CreateWMemberTruck:form

# org.apache.tapestry5.runtime.ComponentEventException
Could not find a coercion from type java.lang.String to type
com.kids.crm.db.WholeSaleMember.


*WholeSaleMember.java *
@Entity
@Table(name = whole_sale_member)
public class WholeSaleMember {
private Long id;
private String fName;
private String lName;
private String cellNumber;
private String officePhoneNumber;
private String address;
private TruckWoodPrice truckWoodPrice;
private Date created;
private Date updated;
..getters and setters
}

*WholeSaleMemberDaoImpl .java*
@Service(wholeSaleMemberDao)
@Transactional
public class WholeSaleMemberDaoImpl extends HibernateDaoSupport implements
WholeSaleMemberDao{
public ArrayList getWholeSaleMembers() {
return (ArrayList) getHibernateTemplate().find(from 
WholeSaleMember);
}
}

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/tapestry-select-model-tp4823674p4824898.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: tapestry select model

2011-09-20 Thread csckid
Now I have add an encoder
form t:type=form
t:label for=members/:
t:select t:id=members value=membersName model=MemberSelectModel
encoder=wholeSaleMemberEncoder /
t:submit value=save/
  /form


public class WholeSaleMemberEncoder implements
ValueEncoderWholeSaleMember, ValueEncoderFactoryWholeSaleMember { 

@Inject
private WholeSaleMemberDao wholeSaleMemberDao;
@Inject
private DatabaseDao databaseDao;

public String toClient(WholeSaleMember value) {
// return the given object's ID
return String.valueOf(value.getId()); 
}

public WholeSaleMember toValue(String id) { 

// find the color object of the given ID in the database
return (WholeSaleMember) databaseDao.load(Long.parseLong(id),
WholeSaleMember.class);
}

public ValueEncoderWholeSaleMember create(ClassWholeSaleMember 
type) {
// TODO Auto-generated method stub
return this;
}
} 



public class CreateWMemberTruck {


@Inject
private WholeSaleMemberDao wholeSaleMemberDao;
@Property
private WholeSaleMemberEncoder wholeSaleMemberEncoder;
@Property
private SelectModel memberSelectModel;
@Property
@Inject
private SelectModelFactory selectModelFactory;

@Property
private WholeSaleMember membersName;


void setupRender() {
// invoke my service to find all colors, e.g. in the database
ListWholeSaleMember members =
wholeSaleMemberDao.getWholeSaleMembers();

// create a SelectModel from my list of colors
memberSelectModel = selectModelFactory.create(members, fName);
}

void onSuccess() {

System.out.println(\n\n\n+membersName.getId()+\n\n\n\n);

}
}

Now t:select is not populated, that page gives an exception
org.apache.tapestry5.internal.services.RenderQueueException
Render queue error in
BeforeRenderTemplate[wholesalemember/CreateWMemberTruck:members]:
org.apache.tapestry5.ioc.internal.util.TapestryException

#

activeComponents

* wholesalemember/CreateWMemberTruck (class
com.kids.crm.pages.wholesalemember.CreateWMemberTruck)
* wholesalemember/CreateWMemberTruck:layout (class
com.kids.crm.components.Layout)
 
classpath:com/kids/crm/pages/wholesalemember/CreateWMemberTruck.tml, line 4
  1 html t:type=layout title=Create Whole sale Member Truck
  2 t:sidebarTitle=Browse Wood
  3 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  4 xmlns:p=tapestry:parameter
  5 form t:type=form

  8 t:label for=members/:
  9 t:select t:id=members value=membersName
model=MemberSelectModel encoder=wholeSaleMemberEncoder /
* wholesalemember/CreateWMemberTruck:form (class
org.apache.tapestry5.corelib.components.Form)
 
classpath:com/kids/crm/pages/wholesalemember/CreateWMemberTruck.tml, line 5
  1 html t:type=layout title=Create Whole sale Member Truck
  2 t:sidebarTitle=Browse Wood
  3 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  4 xmlns:p=tapestry:parameter
  5 form t:type=form
 
  8 t:label for=members/:
  9 t:select t:id=members value=membersName
model=MemberSelectModel encoder=wholeSaleMemberEncoder /
  10t:submit value=save/
* wholesalemember/CreateWMemberTruck:members (class
org.apache.tapestry5.corelib.components.Select)
 
classpath:com/kids/crm/pages/wholesalemember/CreateWMemberTruck.tml, line 9
  4 xmlns:p=tapestry:parameter
  5 form t:type=form
 
  8 t:label for=members/:
  9 t:select t:id=members value=membersName
model=MemberSelectModel encoder=wholeSaleMemberEncoder /
  10t:submit value=save/
  11/form
  12
  13p:sidebar
  14t:pagelink page=wholesalemember/CreateWholeSaleMemberCreate
W.Sale Member/t:pagelink

location
classpath:com/kids/crm/pages/wholesalemember/CreateWMemberTruck.tml,
line 9

# java.lang.NullPointerException

Hide uninteresting stack frames Stack trace

*
org.apache.tapestry5.internal.util.SelectModelRenderer.option(SelectModelRenderer.java:51)
 


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/tapestry-select-model-tp4823674p4825110.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



javascript

2011-09-07 Thread csckid
I have added this line in Layout.java
@Import(library={context:js/jquery-1.6.2.min.js,
context:js/hoverIntent.js,context:js/superfish.js},
stylesheet={context:css/superfish.css})

Now, the tapestry javascript isn't working. I want tapestry to work too.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/javascript-tp4778141p4778141.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: javascript

2011-09-07 Thread csckid
Thanks jQuery.noConflict(); worked 

I hope it won't cause any problem in future
Yes, I wasn't using https://github.com/got5/tapestry5-jquery. 

*Next Question*

I have add some images in menubar. The problem is that images are not found
on all the pages.
{code}
*resourcescom.myproject.kidscomponentsLayout.tml*
   ul
li #  icon/add.png  Add Item /li
li #  icon/delete.png  Delete /li
li #  icon/edit.png  Edit Item /li
li #  icon/view.png  View /li
/ul
{code}
icon are located inside webapp folder
webappiconadd.png

resourcescom.myproject.kidspagesIndex.tml
resourcescom.myproject.kidspagesGuess.tml
resourcescom.myproject.kidspagesaddressCreateAddress.tml
resourcescom.myproject.kidspagesaddressListAddress.tml
 
Images are found in Index.tml and Guess.tml but not in CreateAddress.tml and
ListAddress.tml.
I did understand why the images are not shown, but couldn't understand how
do I solve it.


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/javascript-tp4778141p4778228.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