Re: org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible

2010-07-12 Thread vov

Thanks. It working. But the button visibility will never be changed and
button will be visible in this case even if 'visibleFlag' changed to false.
This mean that is your change 'visibleFlag' to false than method onSubmit()
will be call
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-WicketRuntimeException-Submit-Button-is-not-visible-tp2282413p2285760.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: org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible

2010-07-09 Thread Conny Kühne


vov wrote:
 
 But question is still open:)
 
 Look to example
 
 public static boolean visibleFlag = true;
 
   public VisibilityButtonTest()
   {
 FormVoid form = new FormVoid(form);
 add(form);
 AjaxButton ajaxButton = new AjaxButton(button1)
 {
   @Override
   public boolean isVisible()
   {
 return visibleFlag;
   }
 
   @Override
   protected void onSubmit(AjaxRequestTarget target, Form? form)
   {
 // do nothing
   }
 };
 form.add(ajaxButton);
 form.add(new AjaxButton(button2)
 {
   @Override
   protected void onSubmit(AjaxRequestTarget target, Form? form)
   {
 visibleFlag = false;
   }
 });
   }
 
 after open this page press to button2 and after to button1
 

In that case Sven's solution should work.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-WicketRuntimeException-Submit-Button-is-not-visible-tp2282413p2283188.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: org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible

2010-07-09 Thread vov

It can't work. 
Please, see org.apache.wicket.Component.internalBeforeRender() method.
Method onBeforeRendering() colling only in case when visibility of component
is true.
In our example boolean variable 'available' false by default. This mean that
component never be rendered.

Can someone explain what I do not understand?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-WicketRuntimeException-Submit-Button-is-not-visible-tp2282413p2283191.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: org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible

2010-07-09 Thread Sven Meier

callOnBeforeRenderIfNotVisible() ?

On 07/09/2010 12:26 PM, vov wrote:

It can't work.
Please, see org.apache.wicket.Component.internalBeforeRender() method.
Method onBeforeRendering() colling only in case when visibility of component
is true.
In our example boolean variable 'available' false by default. This mean that
component never be rendered.

Can someone explain what I do not understand?

   



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



org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible

2010-07-08 Thread Conny Kühne

I have an AjaxButton with

@Override
public boolean isVisible() {
  return  someFlag;
}

In a race condition, if user B sets someFlag to false, and then user A
clicks the button A gets the following exception

org.apache.wicket.WicketRuntimeException: Submit Button buttonName ... is
not visible

Any ideas how to circumvent this?

Conny

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-WicketRuntimeException-Submit-Button-is-not-visible-tp2282413p2282413.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: org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible

2010-07-08 Thread vov

Hi!
It is not a best solutions but you can try it

ajaxButton.add(new AjaxSelfUpdatingTimerBehavior(Duration.milliseconds(1)));
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-WicketRuntimeException-Submit-Button-is-not-visible-tp2282413p2282506.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: org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible

2010-07-08 Thread Pedro Santos
someFlag is an static variable?

2010/7/8 Conny Kühne conny.kue...@gmail.com


 I have an AjaxButton with

 @Override
 public boolean isVisible() {
  return  someFlag;
 }

 In a race condition, if user B sets someFlag to false, and then user A
 clicks the button A gets the following exception

 org.apache.wicket.WicketRuntimeException: Submit Button buttonName ... is
 not visible

 Any ideas how to circumvent this?

 Conny

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-WicketRuntimeException-Submit-Button-is-not-visible-tp2282413p2282413.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




-- 
Pedro Henrique Oliveira dos Santos


Re: org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible

2010-07-08 Thread Sven Meier

new AjaxButton() {
  private boolean available;

  onBeforeRender() {
available = someFlag();
 }

  isVisible() {
return available;
  }

  onSubmit() {
if (!available) {
  error(no longer available);
}
  }
}

Sven

On 07/08/2010 04:48 PM, Conny Kühne wrote:

I have an AjaxButton with

@Override
public boolean isVisible() {
   return  someFlag;
}

In a race condition, if user B sets someFlag to false, and then user A
clicks the button A gets the following exception

org.apache.wicket.WicketRuntimeException: Submit Button buttonName ... is
not visible

Any ideas how to circumvent this?

Conny

   



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



Re: org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible

2010-07-08 Thread Conny Kühne

Thanks. That would have solved it. I am using setVisible(someFlag) now. Doh!
;)
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-WicketRuntimeException-Submit-Button-is-not-visible-tp2282413p2282534.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: org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible

2010-07-08 Thread vov

But question is still open:)

Look to example

public static boolean visibleFlag = true;

  public VisibilityButtonTest()
  {
FormVoid form = new FormVoid(form);
add(form);
AjaxButton ajaxButton = new AjaxButton(button1)
{
  @Override
  public boolean isVisible()
  {
return visibleFlag;
  }

  @Override
  protected void onSubmit(AjaxRequestTarget target, Form? form)
  {
// do nothing
  }
};
form.add(ajaxButton);
form.add(new AjaxButton(button2)
{
  @Override
  protected void onSubmit(AjaxRequestTarget target, Form? form)
  {
visibleFlag = false;
  }
});
  }

after open this page press to button2 and after to button1
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-WicketRuntimeException-Submit-Button-is-not-visible-tp2282413p2282540.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