How to use Jquery with Tapestry

2013-08-04 Thread newbie newbie
Hi,
I am using jquery/datatable. I want to highlight selected row in the
datatable. There is sample jQuery code that implements that. Here is the
code
var oTable;
var giRedraw = false;
$(document).ready(function() {
/* Add a click handler to the rows - this could be used as a callback */
$("#example tbody").click(function(event) {
 $(oTable.fnSettings().aoData).each(function (){
 $(this.nTr).removeClass('row_selected');
  });
  $(event.target.parentNode).addClass('row_selected');
});
/* Init the table */
oTable = $('#example').dataTable( );

What I did is copy the code into a test.js file and import it. However, it
does not work. I even try changing $ to jQuery but it still does not work.
How do I use Jquery with Tapestry?
Any help would be much appreciated. Thanks.


How to scroll horizontal in Palette

2013-07-22 Thread newbie newbie
Hi,
**

I have items in Palette that is wider than the box width. The tail-end of
items is clipped and not visible. Palette has automatic vertical scrolling
but not horizontal scrolling. How do I make horizontal scrolling possible?

Here is what I have tried at my css.

DIV.t-palette SELECT { overflow-x: auto !important; }  and

DIV.t-palette-available { overflow-x: auto !important; }  and

DIV.t-palette { overflow-x: auto !important; }



Any help would be much appreciated. Thanks.


How to test using JUnit4 when there is @InjectComponent

2013-07-15 Thread newbie newbie
Hi,
**

I am testing using Junit4 with eclipse. I want to test the function
expandAll

public void expandAll(TreeExpansionModel expansionModel)
{
List> roots = getTreeModel().getRootNodes();
for (TreeNode root : roots)
{
expandAllNode(root, expansionModel);
}
}

private void expandAllNode(TreeNode node,
TreeExpansionModel expansionModel)
{
   if (node.getHasChildren())
  {
  expansionModel.markExpanded(node);
  for (TreeNode child : node.getChildren())
 {
 expandAllNode(child, expansionModel); // this is a recursive
call
  }
   }
}



The problem I am having is the expansionModel. In my program(not test), I
pass in the expansionModel using tree. Here is the code fragment from java.

@InjectComponent
private Tree tree;

public void onExpandAll()
{
 expansionModel = tree.getExpansionModel();
 treeFunction.expandAll(expansionModel);

 ajaxResponseRenderer.addRender(treeZone);

}

I have tried in my test using

tree = new Tree();
expansionModel = tree.getExpansionModel();
testing.expandAll(expansionModel);

but the expansionModel I get is null. How do I go about testing with
@InjectComponent tree? Any help would be appreciated. Thanks.


Re: How to set HTML checkbox from java page

2013-07-11 Thread newbie newbie
Hi.
I am using the HTML checkbox with a Tree. When I use the Checkbox
component(tapestry) with Tree, it gives me error and I don't know how to
solve it. So I try with HTML checkbox. Do you have any idea on how to use
Checkbox component(tapestry) with Tree?


On Fri, Jul 12, 2013 at 9:46 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Hi!
>
> Yeah, I think my suggestion wasn't correct. I apologize.
>
> One question: why don't you want to use the Checkbox component and use a
> regular HTML one instead?
>
>
> On Thu, 11 Jul 2013 22:04:23 -0300, newbie newbie 
> wrote:
>
>  Hi,
>> The solution below is not working
>> > checked="${checked}"/>
>>
>> public String getChecked() {
>> if (shouldBeChecked()) {
>> return "checked";
>> }
>> else {
>> return "";
>> The checkbox is always checked. I think once you write the "checked"
>> attribute, the checkbox will be checked. I need to checked some checkbox
>> but leave the rest unchecked.
>>
>>
>> On Thu, Jul 11, 2013 at 10:06 PM, Thiago H de Paula Figueiredo <
>> thiag...@gmail.com> wrote:
>>
>>  On Thu, 11 Jul 2013 05:12:53 -0300, newbie newbie 
>>> wrote:
>>>
>>>  Hi,
>>>
>>>> I am using plain HTML checkbox(not Tapestry type). I need to set the
>>>> checkbox to checked in my java page. How do I do that?
>>>>
>>>> Here is my tml code fragment
>>>>
>>>> 
>>>>
>>>>
>>> >> checked="${checked}"/>
>>>
>>> public String getChecked() {
>>> if (shouldBeChecked()) {
>>> return "checked";
>>> }
>>> else {
>>> return "";
>>>
>>> }
>>> }
>>>
>>>
>>>
>>>> Any help would be appreciated. Thanks.
>>>>
>>>>
>>>
>>> --
>>> Thiago H. de Paula Figueiredo
>>>
>>> --**
>>> --**-
>>> To unsubscribe, e-mail: 
>>> users-unsubscribe@tapestry.**a**pache.org<http://apache.org>
>>> 
>>> >
>>>
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>>
>
> --
> Thiago H. de Paula Figueiredo
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: How to set HTML checkbox from java page

2013-07-11 Thread newbie newbie
Hi,
The solution below is not working


public String getChecked() {
if (shouldBeChecked()) {
return "checked";
}
else {
return "";
The checkbox is always checked. I think once you write the "checked"
attribute, the checkbox will be checked. I need to checked some checkbox
but leave the rest unchecked.


On Thu, Jul 11, 2013 at 10:06 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Thu, 11 Jul 2013 05:12:53 -0300, newbie newbie 
> wrote:
>
>  Hi,
>> I am using plain HTML checkbox(not Tapestry type). I need to set the
>> checkbox to checked in my java page. How do I do that?
>>
>> Here is my tml code fragment
>>
>> 
>>
>
>  checked="${checked}"/>
>
> public String getChecked() {
> if (shouldBeChecked()) {
> return "checked";
> }
> else {
> return "";
>
> }
> }
>
>
>>
>> Any help would be appreciated. Thanks.
>>
>
>
> --
> Thiago H. de Paula Figueiredo
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.**apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


How to set HTML checkbox from java page

2013-07-11 Thread newbie newbie
Hi,
I am using plain HTML checkbox(not Tapestry type). I need to set the
checkbox to checked in my java page. How do I do that?

Here is my tml code fragment




Any help would be appreciated. Thanks.


How to write HTML from java page

2013-07-11 Thread newbie newbie
Hi,

I need to write HTML from my .java page. Here is what I have tried

This is my tml code fragment

${testFunction()}



This is my java code fragment

public String testFunction()

{

 return ""

}



The result I want is a checkbox. What I get is a string "input
type='checkbox' name='leaf' id='leaf' value='leaf'".
Any help would be appreciated Thanks.


How to use Checkbox with Tree

2013-07-09 Thread newbie newbie
Hi,
I am trying to implement a tree. I want users to be able to select leaf
nodes by clicking on checkbox at each leaf nodes. But it is currently not
working with the checkbox. The tree cannot expand.

Here is my tml code fragment


 
  


${treeNode.label}


 ${treeNode.label}


   
   


If I take away ,
then the tree can expand. But I need the checkbox. Any help would be
appreciated. Thanks.


Re: Ways to do page refresh

2013-06-28 Thread newbie newbie
Hi,
I would like to do a page refresh in my program. I know how to do it with
zone, using AjaxResponseRenderer. I am not quite sure how to do it with
page.


On Sat, Jun 29, 2013 at 3:54 AM, Norman Franke  wrote:

> I think the correct answer in this case is, "yes". There are certainly
> ways, probably dozens. :)
>
> Norman Franke
> Answering Service for Directors, Inc.
> www.myasd.com
>
>
>
> On Jun 28, 2013, at 12:01 PM, Howard Lewis Ship  wrote:
>
> > Why do people think that they can use a term like "page refresh" without
> > reference or definition, and expect to get any kind of response?
> >
> >
> > On Fri, Jun 28, 2013 at 8:11 AM, newbie newbie 
> wrote:
> >
> >> Hi,
> >> What are the ways to do a page refresh?
> >> Any help would be much appreciated. Thanks.
> >>
> >
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator of Apache Tapestry
> >
> > The source for Tapestry training, mentoring and support. Contact me to
> > learn how I can get you up and productive in Tapestry fast!
> >
> > (971) 678-5210
> > http://howardlewisship.com
>
>


Ways to do page refresh

2013-06-28 Thread newbie newbie
Hi,
What are the ways to do a page refresh?
Any help would be much appreciated. Thanks.


jquery/datatable goes back to first page on reload

2013-06-26 Thread newbie newbie
Hi,
My jquery/datatable is in a zone. It has a column with eventlinks. It has
many records, thus many pages. If I press on an eventlink on page 5 for
example, and reload the datatable, it will go back to page 1. I want it to
stay at the current page, page 5. The solution I found for jquery is
"bStateSave":
true. I tried putting that into my JSONObject getOptions() but it doesn't
work. How do I make the page stay at the current page in Tapestry?

Here is my tml file

 
  Test
 

Here is my java file
public JSONObject getOptions() {
JSONObject options = new JSONObject();
options.put("bJQueryUI", true);
options.put("sDom", "<\"H\"lfr>t<\"F\"ip>");
options.put("bStateSave", true);

return options;
}


Any help would be much appreciated. Thanks.


Re: Mixin Autocomplete pop-up floats up and down the page with webpage scrollbar

2013-06-26 Thread newbie newbie
Hi,
Do you have any idea what to look for in the css?


On Wed, Jun 26, 2013 at 3:25 PM, Taha Hafeez Siddiqi <
tawus.tapes...@gmail.com> wrote:

> I don't think it is a tapestry issue. You should check your css/js.
> Something must be wrong there.
>
>
> On 26-Jun-2013, at 12:29 PM, newbie newbie  wrote:
>
> > Hi,
> > It happens in both IE and Chrome. In the jumpstart example, it stays at
> one
> > place. That is what I want. How do I do that?
> >
> >
> > On Wed, Jun 26, 2013 at 2:46 PM, Taha Hafeez Siddiqi <
> > tawus.tapes...@gmail.com> wrote:
> >
> >> Hi
> >>
> >> This might be a css issue. Does it happen on all browsers ?
> >>
> >> Do you see the same behaviour in this example
> >>
> >>
> >>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/autocompletemixin
> ?
> >>
> >> Taha
> >>
> >> On 26-Jun-2013, at 12:05 PM, newbie newbie 
> wrote:
> >>
> >>> Hi,
> >>> I have a autocomplete mixin. When the list of suggestions pop-up, it
> >>> doesn't stay put in one place. If you scroll down the webpage, it will
> >>> float down. If you scroll up, it will float up. I want it to stay at my
> >>> TextField where the Autocomplete mixin is at.
> >>>
> >>> Here is my tml file
> >>>
> >>>  >>> value="email"/>
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Mixin Autocomplete pop-up floats up and down the page with webpage scrollbar

2013-06-26 Thread newbie newbie
Hi,
It happens in both IE and Chrome. In the jumpstart example, it stays at one
place. That is what I want. How do I do that?


On Wed, Jun 26, 2013 at 2:46 PM, Taha Hafeez Siddiqi <
tawus.tapes...@gmail.com> wrote:

> Hi
>
> This might be a css issue. Does it happen on all browsers ?
>
> Do you see the same behaviour in this example
>
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/autocompletemixin?
>
> Taha
>
> On 26-Jun-2013, at 12:05 PM, newbie newbie  wrote:
>
> > Hi,
> > I have a autocomplete mixin. When the list of suggestions pop-up, it
> > doesn't stay put in one place. If you scroll down the webpage, it will
> > float down. If you scroll up, it will float up. I want it to stay at my
> > TextField where the Autocomplete mixin is at.
> >
> > Here is my tml file
> >
> >  > value="email"/>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Mixin Autocomplete pop-up floats up and down the page with webpage scrollbar

2013-06-25 Thread newbie newbie
Hi,
I have a autocomplete mixin. When the list of suggestions pop-up, it
doesn't stay put in one place. If you scroll down the webpage, it will
float down. If you scroll up, it will float up. I want it to stay at my
TextField where the Autocomplete mixin is at.

Here is my tml file




How to overlay DateField pop-up over jquery/datatable

2013-06-24 Thread newbie newbie
Hi,
When I have a DateField component above a grid, the DateField
pop-up(calendar style) overlays the grid. However, when I use
jquery/datatable, the DateField pop-up is obstructed by the datatable. How
can I have the DateField pop-up overlays the datatable?


Re: Error using jquery/datatable with t:mode="true"

2013-06-23 Thread newbie newbie
  Other recipients:

Hi,
>
I have solve the slow loading issue. It has got to do with logging
properties. It is logging too much stuff, so the whole thing slows down.
Anyway, I still don't know how to use t:mode="true". Any help would be much
appreciated. Thanks.


On Fri, Jun 21, 2013 at 10:47 AM, newbie newbie wrote:

> Hi,
> I am trying to use jquery/datatable with 500 records. It seems slow in
> loading but it is working fine. So I was thinking of ajax to solve the slow
> loading issue. When I set t:mode="true", i get an error "JSON data from
> server could not be parsed. This is caused by a JSON formatting error."
>
> Here is my tml file
>
>  t:source="dataList" t:row="rowData" t:options="options" t:mode="true"
>
>
>
> Here is my java file
>
>  @Property
>
> @Persist
>
> private List dataList;
>
>
>
> @Property
>
> private Test rowData;
>
>
>
>
> public JSONObject getOptions() {
>
>   JSONObject options = new JSONObject();
>
>options.put("bJQueryUI", true);
>
> options.put("sDom", "<\"H\"lfr>t<\"F\"ip>");
>
>  return options;
>
> }
>
>
> Any help would be appreciated. Thanks.
>


How to use checkbox with jquery/datatable

2013-06-21 Thread newbie newbie
Hi,
I am currently using checkbox with grid in Tapestry. With grid, the
t:row="rowData" parameter can be accessed during setCheckbox. But it seems
that t:row="rowData" parameter is null with jquery/datatable. Anyone knows
how to use checkbox with jquery/datatable?


How to pass an Object using t:context

2013-06-20 Thread newbie newbie
Hi,
I am using an eventLink. I can pass String and other primitive types using
t:context. But I want to pass a whole Object using t:context. I get the
error "Could not find a coercion from type java.lang.String to type
test.ViewUsers". I am using valueEncoder but it is not called.

Here is my tml file



   

   

Testing

   


Here is my Java file. The valueEncoder is not called. The logger.error did
not output anything.

boolean onReview(ViewUsers object) {

logger.error("Testing. Inside onReview");

 return false;

}

public ValueEncoder getEncoder()

{

return new ValueEncoder()

{

 @Override

  public String toClient(ViewUsers user)

   {

logger.error("Testing. Inside toClient");

if(user == null)

{

  return null;

}

  return user.getId().toString();

 }

@Override

public ViewUsers toValue(String clientValue)

   {

   logger.error("Testing. Inside toValue");

  for(ViewUsers user : users)

  {

if(user.getId().toString().equals(clientValue))

{

return user;

 }

 }

   return null;

  }

  };

 }


Any help would be appreciated. Thanks.


Error using jquery/datatable with t:mode="true"

2013-06-20 Thread newbie newbie
Hi,
I am trying to use jquery/datatable with 500 records. It seems slow in
loading but it is working fine. So I was thinking of ajax to solve the slow
loading issue. When I set t:mode="true", i get an error "JSON data from
server could not be parsed. This is caused by a JSON formatting error."

Here is my tml file

 dataList;



@Property

private Test rowData;




public JSONObject getOptions() {

  JSONObject options = new JSONObject();

   options.put("bJQueryUI", true);

options.put("sDom", "<\"H\"lfr>t<\"F\"ip>");

 return options;

}


Any help would be appreciated. Thanks.


Clear t:alerts messages

2013-06-20 Thread newbie newbie
Hi,
I use alertManager.success to output t:alerts messages after the use press
the Save button. If the user press the Save button multiple times, I would
get multiple t:alerts messages displayed. How do I clear the previous
t:alerts messages so that only 1 message is displayed?

Here is my tml file







**





**

**


Any help would be appreciated. Thanks.
**