You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by CHAUVEL <mo...@gmail.com> on 2012/04/09 03:15:07 UTC

Re: HeavyComponent

Thanks for your answer and sorry for the delay.
Any idea on how could I start or any website that could help me?

Thanks

--
View this message in context: http://tapestry.1045711.n5.nabble.com/HeavyComponent-tp5602655p5626602.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: translate problem

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Hi!

On Mon, 09 Apr 2012 10:20:27 -0300, <mw...@kcp.com> wrote:

> I am writing a new component and this is first time I have needed to use
> the Translate parameter.
>
> I am getting this error :  Failure reading parameter 'translate' of
> component InfoTest:namesearch.name: Unknown translator type 'translator'.

You should contribute your translator to the TranslatorSource service.  
Something like this in your AppModule:

public static void contributeTranslatorSource(Configuration<Translator>  
configuration) {
	configuration.add(new YourTranslator()) {
}

This has the advantage of being your translator being used automatically  
used when it fits.

Another option is to use translate="prop:translator" instead of  
translate="translator", as the translate parameter default binding is  
'translate', not 'prop'.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


translate problem

Posted by mw...@kcp.com.
I am writing a new component and this is first time I have needed to use
the Translate parameter.

I am using version 5.3.1

I am getting this error :  Failure reading parameter 'translate' of
component InfoTest:namesearch.name: Unknown translator type 'translator'.

I know my code it incomplete and probably has errors in it, but I can't get
past this error that I don't understand.

Any help would be appreciated.

tml file

<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
>

	<t:textfield t:id="name" value="luser" translate="translator"
t:mixins="autocomplete"></t:textfield>
</t:container>


jave file

package hmits.components;

import java.util.ArrayList;
import java.util.List;
import hmits.business.LdapUser;
import org.apache.tapestry5.FieldTranslator;
import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.ValidationException;
import org.apache.tapestry5.annotations.Parameter;

public class NameSearch
{
	@Parameter(required = true )
	private LdapUser luser;

	public  List<LdapUser> onProvideCompletionsFromName(String partial)
	{
		LdapUser lu;
		List<LdapUser> result = new ArrayList<LdapUser>();
		lu = new LdapUser();
		lu.setName("name1");
		lu.setId("00001");
		result.add(lu);

		lu = new LdapUser();
		lu.setName("name2");
		lu.setId("00002");
		result.add(lu);

		return result;
	}

	public LdapUser getLuser()
	{
		return luser;
	}

	public void setLuser(LdapUser luser)
	{
		this.luser = luser;
	}

	public FieldTranslator<LdapUser> getTranslator()
	{
		return new FieldTranslator<LdapUser>()
		{
			public String toClient(LdapUser value)
			{
				String clientValue = "";
				if (value != null)
					clientValue = String.valueOf(value.getName
());

				return clientValue;
			}

			public Class<LdapUser> getType() { return LdapUser.class
; }

			public LdapUser parse(String clientValue) throws
ValidationException
			{
				LdapUser serverValue = new LdapUser();

				if (clientValue != null && clientValue.length() >
0 )
					serverValue.setName(clientValue);

				return serverValue;
			}
			public void render(MarkupWriter arg0)
			{

			}
		};
	}
}


Michael Williamson
Analyst Sr Applications Developer
Phone: 816/997-5994


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


Re: HeavyComponent

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Sun, 08 Apr 2012 22:15:07 -0300, CHAUVEL <mo...@gmail.com> wrote:

> Thanks for your answer and sorry for the delay.
> Any idea on how could I start or any website that could help me?

You're trying to use a webcam in HTML. That's not supported yet by any  
browser except alpha versions of Chrome and Opera. In addition, you're  
trying to use Java Swing GUI components in HTML. Again, this is  
impossible. On the other hand, you can use Swing components in applets,  
but then this wouldn't be related to Tapestry at all.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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