Unicode data on the clipboard - not a supported DataFlavor

2010-10-20 Thread duncan787

My Wicket app needs to read the plain-text contents of the clipboard, but
Transferable.getTransferDataFlavors() is returning empty.

The really weird thing is that when I run the Wicket app in DEBUG mode, a
valid DataFlavor is returned and everything works!  Here is a pared down
source code listing:

Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable contents = clipboard.getContents(null);
int count = contents.getTransferDataFlavors().length;

count is 0 in DEBUG mode and is  0 in non-DEBUG mode (I tried it in
Wicket's  DEVELOPMENT and DEPLOYMENT modes, both fail).

Thoughts?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Unicode-data-on-the-clipboard-not-a-supported-DataFlavor-tp3004359p3004359.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How to trigger server-side method when user clicks on a Table Row

2010-10-12 Thread duncan787

I am implementing a DataView using an HTML Table and I need to allow the user
to select a row in the table to tell the Server Side which row they
selected.  I could implement this by using AjaxFallbackLink, but this would
only link the text in the row, the user needs to be able to click anywhere
in the row, so I need the ability to detect when the user clicks anywhere in
the row, like an onclick event on the TR element (or the TD elements). 
Is there a way to tell the server side when this happens?  Here is my markup
and I'm implementing DataView:

div wicket:id=projectListDataViewContainer
table
tr wicket:id=siteProjectList
td /td
td class=projectDesc/td
/tr
/table
/div

Thank you
duncan787
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-trigger-server-side-method-when-user-clicks-on-a-Table-Row-tp2991576p2991576.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to trigger server-side method when user clicks on a Table Row

2010-10-12 Thread duncan787

Its already attached to the DataView, see the relevant/simplified Java code
added below.  Would it best practice be to assign a WebMarkupContainer to
the TR element and add both an AjaxFallbackLink and a DataView to the
container?

DataViewSiteProject projectListDataView = 
new DataViewSiteProject(siteProjectList, getDataProvider(), 100)
{
@Override
protected void populateItem(final ItemSiteProject item)
{
SiteProject siteProject = item.getModelObject();
item.add(new Label(ProjectDesc,
siteProject.getProjectDesc()));
}
};

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-trigger-server-side-method-when-user-clicks-on-a-Table-Row-tp2991576p2991852.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Default Focus Behavior?

2009-12-28 Thread duncan787

Great tip, thanks!  After implementing, I see that the behavior is added to
the text field correctly, but the renderHead() method is not being called,
can you help me understand why that is?


jwcarman wrote:
 
 On 3/9/08, James Carman ja...@carmanconsulting.com wrote:
 On 3/9/08, Warren war...@clarksnutrition.com wrote:
   WebMarkupContainer bodyTag = new WebMarkupContainer(bodyTag);
bodyTag.add(new SimpleAttributeModifier(onload,
form.username.focus();));


 Ok, but wouldn't it be cooler/easier/more java-oriented to do:

  TextField userName = new TextField(userName);
  userName.addBehavior(new DefaultFocusBehavior());

  or

  Behaviors.defaultFocus(userName); // Assuming Behaviors existed.


 
 How about something like:
 
 public class DefaultFocusBehavior extends AbstractBehavior
 {
 private Component component;
 
 public void bind( Component component )
 {
 this.component = component;
 component.setOutputMarkupId(true);
 }
 
 public void renderHead( IHeaderResponse iHeaderResponse )
 {
 super.renderHead(iHeaderResponse);
 iHeaderResponse.renderOnLoadJavascript(document.getElementById('
 + component.getMarkupId() + ').focus(););
 }
 }
 
  
  
 -Original Message-
 From: jcar...@carmanconsulting.com
 [mailto:jcar...@carmanconsulting.com]on Behalf Of James Carman
 Sent: Sunday, March 09, 2008 7:58 AM
 To: users@wicket.apache.org
 Subject: Default Focus Behavior?


 Is there a behavior (or some other way) for having a field receive
 the
 focus when the page loads?  For instance, in a login form, you'd
 want
 the focus to go to the username field or perhaps the password field
 if
 you've got remember me turned on.

  
   
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org

  
  
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
  
  

 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Default-Focus-Behavior--tp15934889p26944784.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Default Focus Behavior?

2009-12-28 Thread duncan787

Thank you MartinM.  Your question caused me to question the other methods I
was overriding from the super...after removing those unnecessary overridden
methods, its working like a charm.

Thank you!


MartinM wrote:
 
 Hi!
 
 Did you implement the IHeaderContributor and mark @Override?
 
 2009/12/28 duncan787 duncan...@gmail.com:

 Great tip, thanks!  After implementing, I see that the behavior is added
 to
 the text field correctly, but the renderHead() method is not being
 called,
 can you help me understand why that is?

 
 **
 Martin
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Default-Focus-Behavior--tp15934889p26944984.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org