Re: T5Components Inside AjaxResult - delay in loading javascript files

2008-09-22 Thread Anteneh Alemayehu

I got it!

It was not a delay. Tapestry.DEBUG_ENABLED was set true. 

I used the renderSupport to turn it off.

public void afterRender()
{
renderSupport.addScript("Tapestry.DEBUG_ENABLED = false;");
}

Now it is working fine!

Thank you,

Anteneh






Anteneh Alemayehu wrote:
> 
> Hi All,
> 
> When I use any of the T5Components inside the Ajax Result there is a
> remarkable delay in loading and checking previously loaded .js files. 
> 
> The T5Component, InPlaceCheckbox, is inside someBlock which is the result
> of an Ajax Call. 
> 
> Find the java and tml code below.
> 
> Is there any one who can help me to avoid the delay?
> 
> Thank you,
> 
> Anteneh
> 
> -- Java code -Start --
> 
> private boolean checked;
> 
>   @Inject
>   private Block someBlock;
> 
>   @Component(parameters = { "value=checked",
> "onCompleteCallback=onCompleteFunction" })
>   private InPlaceCheckbox myInPlaceCheckbox;
> 
>   public boolean isChecked()
>   {
>   return checked;
>   }
> 
>   public void setChecked(boolean checked)
>   {
>   this.checked = checked;
>   }
> 
>   @OnEvent(component = "myInPlaceCheckbox", value =
> InPlaceCheckbox.EVENT_NAME)
>   public boolean inPlaceCheckbox(boolean checked)
>   {
>   return checked;
>   }
> 
>   Block onActionFromTheLink()
>   {
>   return someBlock;
>   }
> 
>   public InPlaceCheckbox getMyInPlaceCheckbox()
>   {
>   return myInPlaceCheckbox;
>   }
> 
> 
> -- Java code -End--
> 
> 
> -- tml code -Start --
> 
>   function onCompleteFunction(response)
>   {
>   if (response.evalJSON().value == "true") {
>   $('checkboxResult').update("<strong>checked</strong>");
>   } else {
>   $('checkboxResult').update("<strong>un-checked</strong>");
>   }
>   }
>   
>   To display the Inplace checkbox  t:zone="updateZone">Click here
>   
>   Initial content
>   
>   
>   Checkbox: 
> t:id="myInPlaceCheckbox"
>   
> t:type="t5components/InPlaceCheckbox"/> 
>   
>   
>   Checkbox state : state will 
> display here
>   
> 
> -- tml code -End--
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5Components-Inside-AjaxResult---delay-in-loading-javascript-files-tp19575134p19615736.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5Components Inside AjaxResult - delay in loading javascript files

2008-09-19 Thread Anteneh Alemayehu

Hi All,

When I use any of the T5Components inside the Ajax Result there is a
remarkable delay in loading and checking previously loaded .js files. 

The T5Component, InPlaceCheckbox, is inside someBlock which is the result of
an Ajax Call. 

Find the java and tml code below.

Is there any one who can help me to avoid the delay?

Thank you,

Anteneh

-- Java code -Start --

private boolean checked;

@Inject
private Block someBlock;

@Component(parameters = { "value=checked",
"onCompleteCallback=onCompleteFunction" })
private InPlaceCheckbox myInPlaceCheckbox;

public boolean isChecked()
{
return checked;
}

public void setChecked(boolean checked)
{
this.checked = checked;
}

@OnEvent(component = "myInPlaceCheckbox", value =
InPlaceCheckbox.EVENT_NAME)
public boolean inPlaceCheckbox(boolean checked)
{
return checked;
}

Block onActionFromTheLink()
{
return someBlock;
}

public InPlaceCheckbox getMyInPlaceCheckbox()
{
return myInPlaceCheckbox;
}


-- Java code -End--


-- tml code -Start --

function onCompleteFunction(response)
{
if (response.evalJSON().value == "true") {
$('checkboxResult').update("checked");
} else {
$('checkboxResult').update("un-checked");
}
}

To display the Inplace checkbox  Click here 

Initial content


Checkbox:   


Checkbox state : state will display here


-- tml code -End--



-- 
View this message in context: 
http://www.nabble.com/T5Components-Inside-AjaxResult---delay-in-loading-javascript-files-tp19575134p19575134.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Tapestry 5]-JSCookMenu

2008-02-06 Thread Anteneh Alemayehu

Hi Everyone,

Is there any one who use a cool menu in Tapestry 5?
Is JSCookMenu can be used for Tapestry 5? If yes, how?

Thank you,

Anteneh


-- 
View this message in context: 
http://www.nabble.com/-Tapestry-5--JSCookMenu-tp15307078p15307078.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry[5] - Overriding the form error messages

2008-02-05 Thread Anteneh Alemayehu

Yes I am using beaneditform, ON T5-version 5.0.7

Thank you,
Anteneh



Adam Zimowski wrote:
> 
> what version of T5 are you on? are you using beanedit form? I was
> using just a regular form and Tapestry didn't display errors if there
> was no 
> 
> On Feb 5, 2008 10:58 AM, Anteneh Alemayehu <[EMAIL PROTECTED]> wrote:
>>
>> Good, it is working.
>>
>> But, how can I stop displaying the tapestry error messages.
>>
>> I didn't include t:errors tag in my form, but the errors (NOT the
>> bubbles)
>> are keep on displaying. Unless I clear out the errors from the tracker, I
>> couldn't stop the errors to display.
>>
>> Thank you,
>> Anteneh
>>
>>
>>
>>
>>
>> Adam Zimowski wrote:
>> >
>> > Okay,
>> >
>> > I created new component "errorMsg" which can be used anywhere on the
>> > page to display individual error. Enhancements welcome.
>> >
>> > This component takes two arguments, a literal string denoting field
>> > for which error should be rendered, and form to which field is bound.
>> > The form must be accessible via getter from the class page.
>> >
>> > import org.apache.tapestry.Field;
>> > import org.apache.tapestry.MarkupWriter;
>> > import org.apache.tapestry.ValidationTracker;
>> > import org.apache.tapestry.annotations.BeginRender;
>> > import org.apache.tapestry.annotations.Parameter;
>> > import org.apache.tapestry.corelib.components.Form;
>> >
>> > public class ErrorMsg {
>> >
>> >   @Parameter
>> >   private String _fieldName;
>> >
>> >   @Parameter
>> >   private Form _form;
>> >
>> >
>> >   public void setFieldName(String aFieldName) {
>> >   _fieldName = aFieldName;
>> >   }
>> >
>> >   @BeginRender
>> > void renderMessage(MarkupWriter writer)
>> > {
>> >   Field f = new Field() {
>> >   public String getElementName() { return
>> _fieldName; }
>> >   public String getLabel() { return null; }
>> >   public boolean isDisabled() { return false; }
>> >   public String getClientId() { return _fieldName;
>> }
>> >   };
>> >
>> >   ValidationTracker tracker = _form.getDefaultTracker();
>> >   String err = tracker.getError(f);
>> >
>> >   writer.write(err);
>> > }
>> >
>> >   public void setForm(Form aForm) {
>> >   _form = aForm;
>> >   }
>> > }
>> >
>> > To display individual error messages simply place 
>> > anywhere on the page. It will render the error if there is one for a
>> > field.
>> >
>> > > xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>> >
>> > 
>> >
>> > 
>> > User Name:
>> >   > > t:validate="required,minlength=3,maxlength=8"/>
>> > Foo:
>> >   > > t:validate="required"/>
>> >   
>> >   > value="Submit"/>
>> >   
>> >   
>> > 
>> > 
>> > 
>> >
>> > 
>> >
>> >
>> > Page Class:
>> >
>> > public class Start {
>> >
>> >   @Persist
>> >   private String _foo;
>> >
>> >   @Persist
>> >   private String _bar;
>> >
>> >   @Component(id="myform")
>> >   private Form _form;
>> >
>> >   public Form getForm() {
>> >   return _form;
>> >   }
>> >
>> >   public String getBar() {
>> >   return _bar;
>> >   }
>> >
>> >   public String getFoo() {
>> >   return _foo;
>> >   }
>> > }
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Tapestry-5Overriding-the-form-error-messages-tp15183424p15292922.html
>>
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Tapestry-5Overriding-the-form-error-messages-tp15183424p15295418.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry[5] - Overriding the form error messages

2008-02-05 Thread Anteneh Alemayehu

Good, it is working.

But, how can I stop displaying the tapestry error messages. 

I didn't include t:errors tag in my form, but the errors (NOT the bubbles)
are keep on displaying. Unless I clear out the errors from the tracker, I
couldn't stop the errors to display.

Thank you,
Anteneh




Adam Zimowski wrote:
> 
> Okay,
> 
> I created new component "errorMsg" which can be used anywhere on the
> page to display individual error. Enhancements welcome.
> 
> This component takes two arguments, a literal string denoting field
> for which error should be rendered, and form to which field is bound.
> The form must be accessible via getter from the class page.
> 
> import org.apache.tapestry.Field;
> import org.apache.tapestry.MarkupWriter;
> import org.apache.tapestry.ValidationTracker;
> import org.apache.tapestry.annotations.BeginRender;
> import org.apache.tapestry.annotations.Parameter;
> import org.apache.tapestry.corelib.components.Form;
> 
> public class ErrorMsg {
>   
>   @Parameter
>   private String _fieldName;
>   
>   @Parameter
>   private Form _form;
>   
> 
>   public void setFieldName(String aFieldName) {
>   _fieldName = aFieldName;
>   }
> 
>   @BeginRender
> void renderMessage(MarkupWriter writer)
> {
>   Field f = new Field() {
>   public String getElementName() { return _fieldName; }
>   public String getLabel() { return null; }
>   public boolean isDisabled() { return false; }
>   public String getClientId() { return _fieldName; }
>   };
>   
>   ValidationTracker tracker = _form.getDefaultTracker();
>   String err = tracker.getError(f);
> 
>   writer.write(err);
> }
> 
>   public void setForm(Form aForm) {
>   _form = aForm;
>   }
> }
> 
> To display individual error messages simply place 
> anywhere on the page. It will render the error if there is one for a
> field.
> 
> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
> 
> 
>   
> 
> User Name:
>t:validate="required,minlength=3,maxlength=8"/>
> Foo:
>t:validate="required"/>
>   
>value="Submit"/>
>   
>   
> 
> 
> 
> 
> 
> 
> 
> Page Class:
> 
> public class Start {
> 
>   @Persist
>   private String _foo;
> 
>   @Persist
>   private String _bar;
>   
>   @Component(id="myform")
>   private Form _form;
> 
>   public Form getForm() {
>   return _form;
>   }
> 
>   public String getBar() {
>   return _bar;
>   }
> 
>   public String getFoo() {
>   return _foo;
>   }
> }
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Tapestry-5Overriding-the-form-error-messages-tp15183424p15292922.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tapestry[5] - Overriding the form error messages

2008-02-01 Thread Anteneh Alemayehu

Hi Everyone,

Please see the following fragment code which I tried to override the form
error messages:

The plan is to copy the errors from the validation tracker in to my error
model, and clear the errors from the validation tracker. (At this point I
have the errors in my errors model and also the form is free from errors to
display). 

My problem is either
 to get the error from the validation tracker by property name
 or to get the Field object dynamically from property name

1. Validation tracker has no functionality to get error by property name
2. There is getError by Field, this will be to much work to declare a
component for each field in my form

I can get the List errors from the tracker, but I need Map errors, where property name is a field, to use the information in
MyLabel component, which will take care to hilight the labels.

@Inject
private Environment environment;

MyErrorModel myErrorModel;

private Object onSubmit() {
ValidationTracker tracker = environment.peek(ValidationTracker.class);

Map errors = tracker.getErrorsMap();

if (null != getSystemMessages() && !getSystemMessages().isEmpty()) {

List propertyNames = userModel.getPropertyNames();
for(String propertyName: propertyNames) {
myErrorModel.addError(propertyName, NEED_YOUR_HELP);
}

beanEditForm.clearErrors();
return null;
}

displayEmployee.setup(employee);

return displayEmployee;
}





Adam Zimowski wrote:
> 
> I'm also interested to know if individual error messages are
> completely customisable in a way that a particular error message can
> be styled (bubble or not) and placed *anywhere* on the page
> irrespective of where other error messages and form components are.
> 
> Without a clear answer so far, does it mean that it is not possible at
> the moment?
> 
> -adam
> 
> On Jan 31, 2008 8:48 AM, Geoff Callender
> <[EMAIL PROTECTED]> wrote:
>> I agree.  I do like the bubbles and I do like the previous style, but
>> to maximise uptake of T5 it may be best to make the choice of message
>> display configurable in AppModule and overridable at the page level.
>> A third display type could also be offered - message alongside/below/
>> above the field in error (not hovering).  CSS for each type would
>> allow fine-tuning.
>>
>> Just my two cents worth,
>>
>> Geoff
>>
>>
>> On 31/01/2008, at 8:41 AM, Anteneh Alemayehu wrote:
>>
>> >
>> > Thanks Howard,
>> >
>> > I saw that and I personally like the popup bubbles feature,
>> >
>> > But there is a requierement to override and display all the error
>> > messages
>> > in one specific Message area.
>> >
>> > Thanks again,
>> > Anteneh
>> >
>> >
>> >
>> > Howard Lewis Ship wrote:
>> >>
>> >> Starting with 5.0.9, the validation errors appear as popup bubbles
>> >> adjacent to the fields.
>> >>
>> >> On Jan 30, 2008 7:15 AM, Anteneh Alemayehu <[EMAIL PROTECTED]> wrote:
>> >>>
>> >>> Hi Everyone,
>> >>>
>> >>> I have a specific message area on the top of the page to display
>> >>> the eror
>> >>> messages.
>> >>>
>> >>> I might have more than one form per page,
>> >>>
>> >>> How can I overide the error messges from the form validation and
>> >>> display
>> >>> on
>> >>> the message area.
>> >>>
>> >>> Any Idea?
>> >>>
>> >>> Thank you,
>> >>> Anteneh
>> >>> --
>> >>> View this message in context:
>> >>>
>> http://www.nabble.com/Tapestry-5Overriding-the-form-error-messages-tp15183424p15183424.html
>> >>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>> >>>
>> >>>
>> >>> -
>> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >>> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>>
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> Howard M. Lewis Ship
>> >>
>> >> Creator Apache Tapestry and Apache HiveMind
>> >>
>> >> --

Re: Tapestry[5] - Overriding the form error messages

2008-01-30 Thread Anteneh Alemayehu

Thanks Howard,

I saw that and I personally like the popup bubbles feature,

But there is a requierement to override and display all the error messages
in one specific Message area.

Thanks again,
Anteneh



Howard Lewis Ship wrote:
> 
> Starting with 5.0.9, the validation errors appear as popup bubbles
> adjacent to the fields.
> 
> On Jan 30, 2008 7:15 AM, Anteneh Alemayehu <[EMAIL PROTECTED]> wrote:
>>
>> Hi Everyone,
>>
>> I have a specific message area on the top of the page to display the eror
>> messages.
>>
>> I might have more than one form per page,
>>
>> How can I overide the error messges from the form validation and display
>> on
>> the message area.
>>
>> Any Idea?
>>
>> Thank you,
>> Anteneh
>> --
>> View this message in context:
>> http://www.nabble.com/Tapestry-5Overriding-the-form-error-messages-tp15183424p15183424.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Tapestry-5Overriding-the-form-error-messages-tp15183424p15192789.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tap

2008-01-30 Thread Anteneh Alemayehu

Thank you,


=)=)=)

Best regards!
Anteneh


Hi Anteneh,

you can try this:
@Inject
private BeanModelSource _beanModelSource;

@Inject
private ComponentResources _resources;

@Retain
private BeanModel _model;

public void pageLoaded() {
   _model = _beanModelSource.create(SomeBean.class, true, _resources);//
where SomeBean is the bean of the list
   _model.get("some_attribute").sortable(false); //and some_attribute is
an attribute of SomeBean
}

and put this on your template:
   

2008/1/29, Sven Homburg <[EMAIL PROTECTED]>:
>
> great news !!
>
> 2008/1/29, Anteneh Bayouh <[EMAIL PROTECTED]>:
> >
> >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/tap-tp15169809p15169809.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> with regards
> Sven Homburg
>



-- 
Atenciosamente,
Marcelo Lotif



-- 
View this message in context: 
http://www.nabble.com/Tapestry-5Removing-Sort-from-the-GridColumns-Header-tp15169809p15184539.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tapestry[5] - Overriding the form error messages

2008-01-30 Thread Anteneh Alemayehu

Hi Everyone,

I have a specific message area on the top of the page to display the eror
messages.

I might have more than one form per page, 

How can I overide the error messges from the form validation and display on
the message area.

Any Idea?

Thank you,
Anteneh
-- 
View this message in context: 
http://www.nabble.com/Tapestry-5Overriding-the-form-error-messages-tp15183424p15183424.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]