It is OK to set constant ID for the wicket component
The only side effect you should be responsible for this ID being unique in
the hierarchy.


On Sun, Aug 4, 2013 at 11:51 AM, [email protected] <
[email protected]> wrote:

> I have checked your version and it seems to work fine.
>
> However I don't know how nice Wicket will play if we set a fixed id for
> that div.
> Normally Wicket would generate that ID and I just had a use-case where
> setting a fixed ID was the reason for a bug.
>
> But in theory it should all just work fine, so lets stay with what you
> have done.
>
> Thanks,
> Sebastian
>
>
>
> 2013/8/4 Maxim Solodovnik <[email protected]>
>
>> Could you please check if "revision 1510096" works better for you?
>> It seems to work as expected om my machine
>>
>>
>> On Sun, Aug 4, 2013 at 6:01 AM, [email protected] <
>> [email protected]> wrote:
>>
>>> But its kind of a fundamental bug,
>>> even when you resize the browser window... you can see the Calendar UI
>>> does not correctly resize when you load the UI for the second time by
>>> navigating somewhere else and then back to the Calendar UI.
>>>
>>> Sebastian
>>>
>>>
>>> 2013/8/4 [email protected] <[email protected]>
>>>
>>> Unfortunately the JavaScript function setCalendarHeight(); does not
>>>> really work as it should be.
>>>>
>>>> The first time you open the Calendar UI it does correctly resize the
>>>> Calendar to fit into the given space.
>>>> If you revisit the Panel by navigating using the top menu to some other
>>>> section and come back,
>>>> the Calendar UI will _not_ resize.
>>>>
>>>> So I will not apply this fix for now, probably something needs to be
>>>> fixed in the JavaScript function setCalendarHeight.
>>>>
>>>> This calculation just does not work the second time you visit the UI:
>>>> return $(window).height() - $('#${markupId}').position().top - 20;
>>>>
>>>> Sebastian
>>>>
>>>>
>>>> 2013/8/4 [email protected] <[email protected]>
>>>>
>>>> Yeah, makes sense, I did not see this JavaScript function.
>>>>>
>>>>> Sebastian
>>>>>
>>>>>
>>>>> 2013/8/4 Maxim Solodovnik <[email protected]>
>>>>>
>>>>>> Dear Sebastian, I would like to propose the following correction to
>>>>>> your fix, I believe it is better since doesn't require to hardcode header
>>>>>> height which can easily be changes in css file:
>>>>>>
>>>>>> Index:
>>>>>> src/org/apache/openmeetings/web/user/calendar/CalendarPanel.java
>>>>>> ===================================================================
>>>>>> --- src/org/apache/openmeetings/web/user/calendar/CalendarPanel.java 
>>>>>> (revision
>>>>>> 1509979)
>>>>>> +++ src/org/apache/openmeetings/web/user/calendar/CalendarPanel.java 
>>>>>> (working
>>>>>> copy)
>>>>>> @@ -45,17 +45,11 @@
>>>>>>  import com.googlecode.wicket.jquery.ui.calendar.CalendarView;
>>>>>>
>>>>>>  public class CalendarPanel extends UserPanel {
>>>>>> -
>>>>>>   private static final Logger log =
>>>>>> Red5LoggerFactory.getLogger(CalendarPanel.class, webAppRootKey);
>>>>>>   private static final long serialVersionUID = 1L;
>>>>>> + private static final String javaScriptMarkup =
>>>>>> "setCalendarHeight();";
>>>>>>   private Calendar calendar;
>>>>>>
>>>>>> - /**
>>>>>> - * This constant is needed to adjust the calendar by default to the
>>>>>> needed browser height
>>>>>> - * after loading it in the div.
>>>>>> - */
>>>>>> - private static int MENU_BAR_HEIGHT = 110;
>>>>>> -
>>>>>>   @Override
>>>>>>   public void onMenuPanelLoad(AjaxRequestTarget target) {
>>>>>>   }
>>>>>> @@ -76,9 +70,6 @@
>>>>>>   public void renderHead(IHeaderResponse response) {
>>>>>>   super.renderHead(response);
>>>>>>
>>>>>> - String javaScriptMarkup = "$('#" + calendar.getMarkupId() + "')."
>>>>>> - + "fullCalendar('option', 'height', $(window).height()-" +
>>>>>> MENU_BAR_HEIGHT + " );";
>>>>>> -
>>>>>>   AjaxRequestTarget target =
>>>>>> getRequestCycle().find(AjaxRequestTarget.class);
>>>>>>   if (target != null) {
>>>>>>   target.appendJavaScript(javaScriptMarkup);
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sat, Aug 3, 2013 at 12:13 PM, <[email protected]> wrote:
>>>>>>
>>>>>>> Author: sebawagner
>>>>>>> Date: Sat Aug  3 05:13:52 2013
>>>>>>> New Revision: 1509937
>>>>>>>
>>>>>>> URL: http://svn.apache.org/r1509937
>>>>>>> Log:
>>>>>>> OPENMEETINGS-736 Calendar UI - Month view does not resize to browser
>>>>>>> window by default
>>>>>>>
>>>>>>> Modified:
>>>>>>>
>>>>>>> openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/calendar/CalendarPanel.java
>>>>>>>
>>>>>>> Modified:
>>>>>>> openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/calendar/CalendarPanel.java
>>>>>>> URL:
>>>>>>> http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/calendar/CalendarPanel.java?rev=1509937&r1=1509936&r2=1509937&view=diff
>>>>>>>
>>>>>>> ==============================================================================
>>>>>>> ---
>>>>>>> openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/calendar/CalendarPanel.java
>>>>>>> (original)
>>>>>>> +++
>>>>>>> openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/user/calendar/CalendarPanel.java
>>>>>>> Sat Aug  3 05:13:52 2013
>>>>>>> @@ -32,6 +32,8 @@ import org.apache.wicket.ajax.AbstractAj
>>>>>>>  import org.apache.wicket.ajax.AjaxRequestTarget;
>>>>>>>  import org.apache.wicket.ajax.json.JSONArray;
>>>>>>>  import org.apache.wicket.ajax.json.JSONException;
>>>>>>> +import org.apache.wicket.markup.head.IHeaderResponse;
>>>>>>> +import org.apache.wicket.markup.head.JavaScriptHeaderItem;
>>>>>>>  import org.apache.wicket.markup.html.form.Form;
>>>>>>>  import org.apache.wicket.model.CompoundPropertyModel;
>>>>>>>  import org.apache.wicket.util.time.Duration;
>>>>>>> @@ -43,10 +45,17 @@ import com.googlecode.wicket.jquery.ui.c
>>>>>>>  import com.googlecode.wicket.jquery.ui.calendar.CalendarView;
>>>>>>>
>>>>>>>  public class CalendarPanel extends UserPanel {
>>>>>>> +
>>>>>>>         private static final Logger log =
>>>>>>> Red5LoggerFactory.getLogger(CalendarPanel.class, webAppRootKey);
>>>>>>>         private static final long serialVersionUID = 1L;
>>>>>>>         private Calendar calendar;
>>>>>>>
>>>>>>> +       /**
>>>>>>> +        * This constant is needed to adjust the calendar by default
>>>>>>> to the needed browser height
>>>>>>> +        * after loading it in the div.
>>>>>>> +        */
>>>>>>> +       private static int MENU_BAR_HEIGHT = 110;
>>>>>>> +
>>>>>>>         @Override
>>>>>>>         public void onMenuPanelLoad(AjaxRequestTarget target) {
>>>>>>>         }
>>>>>>> @@ -63,6 +72,21 @@ public class CalendarPanel extends UserP
>>>>>>>                 calendar.refresh(target);
>>>>>>>         }
>>>>>>>
>>>>>>> +       @Override
>>>>>>> +       public void renderHead(IHeaderResponse response) {
>>>>>>> +               super.renderHead(response);
>>>>>>> +
>>>>>>> +               String javaScriptMarkup = "$('#" +
>>>>>>> calendar.getMarkupId() + "')."
>>>>>>> +                               + "fullCalendar('option', 'height',
>>>>>>> $(window).height()-" + MENU_BAR_HEIGHT + " );";
>>>>>>> +
>>>>>>> +               AjaxRequestTarget target =
>>>>>>> getRequestCycle().find(AjaxRequestTarget.class);
>>>>>>> +               if (target != null) {
>>>>>>> +                       target.appendJavaScript(javaScriptMarkup);
>>>>>>> +               } else {
>>>>>>> +
>>>>>>> response.render(JavaScriptHeaderItem.forScript(javaScriptMarkup,
>>>>>>> this.getId()));
>>>>>>> +               }
>>>>>>> +       }
>>>>>>> +
>>>>>>>         public CalendarPanel(String id) {
>>>>>>>                 super(id);
>>>>>>>
>>>>>>> @@ -204,6 +228,7 @@ public class CalendarPanel extends UserP
>>>>>>>                                 //FIXME add feedback info
>>>>>>>                         }
>>>>>>>                 };
>>>>>>> +
>>>>>>>                 form.add(calendar);
>>>>>>>                 add(new
>>>>>>> AbstractAjaxTimerBehavior(Duration.seconds(10)) {
>>>>>>>                         private static final long serialVersionUID =
>>>>>>> -4353305314396043476L;
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> WBR
>>>>>> Maxim aka solomax
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Sebastian Wagner
>>>>> https://twitter.com/#!/dead_lock
>>>>> http://www.webbase-design.de
>>>>> http://www.wagner-sebastian.com
>>>>> [email protected]
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Sebastian Wagner
>>>> https://twitter.com/#!/dead_lock
>>>> http://www.webbase-design.de
>>>> http://www.wagner-sebastian.com
>>>> [email protected]
>>>>
>>>
>>>
>>>
>>> --
>>> Sebastian Wagner
>>> https://twitter.com/#!/dead_lock
>>> http://www.webbase-design.de
>>> http://www.wagner-sebastian.com
>>> [email protected]
>>>
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> [email protected]
>



-- 
WBR
Maxim aka solomax

Reply via email to