Adding calendar/Radio button to a form widget

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Adding calendar/Radio button to a form widget

G.Ben
This post was updated on .
Hi everyone,

Is it possible to add a calendar in a widget form ?
I want to include it in order to let the user select a date from it,


[This is not included in the form widgets]
And also I want to display a calendar with informations in it,
Do I need to write the code for the whole calendar ?

I want the syntax for adding radio buttons to the form widget, I've searched & I noticed that I should create dropdown list rather than radio buttons so is it true ?


Anyhelp ??

Thank you.

Regards.

G.Ben.
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

Foo Shyn Chung
Hi,

Do you mean a date field? If so you can use the <date> or <date-time> tag
on your form definition in the xml to create the date field widget.

Thanx
FooShyn

On Mon, Jun 4, 2012 at 6:41 AM, G.Ben <[hidden email]> wrote:

> Hi everyone,
>
> Is it possible to add a calendar in a widget form ?
> I want to include it in order to let the user select a date from it,
>
>
> [This is not included in the form widgets]
> And also I want to display a calendar with informations in it,
> Do I need to write the code for the whole calendar ?
>
> Anyhelp ??
>
> Thank you.
>
> Regards.
>
> G.Ben.
>
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Adding-calendar-to-a-form-widget-tp4633145.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

Arun Kumar Batham
In reply to this post by G.Ben
Hi G. Ben,

You can take reference from this lines for adding calender in form widget:

<form name="NewForm" type="single" target="formTarget"
          header-row-style="header-row" default-table-style="basic-table">
<field name="yourDate" title="Select Date"><date-time
type="timestamp"/></field>
</form>

I think this this information helps you.

Thank you.

Regards
Arun Kumar Batham
Hotwax Media Pvt. Ltd.
http://www.hotwaxmedia.com/


On Monday 04 June 2012 04:11 AM, G.Ben wrote:

> Hi everyone,
>
> Is it possible to add a calendar in a widget form ?
> I want to include it in order to let the user select a date from it,
>
>
> [This is not included in the form widgets]
> And also I want to display a calendar with informations in it,
> Do I need to write the code for the whole calendar ?
>
> Anyhelp ??
>
> Thank you.
>
> Regards.
>
> G.Ben.
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Adding-calendar-to-a-form-widget-tp4633145.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

Foo Shyn Chung
In reply to this post by Foo Shyn Chung
Ops i mean <date-time type="date" />

Thanx
FooShyn

On Mon, Jun 4, 2012 at 12:05 PM, Foo Shyn Chung <[hidden email]> wrote:

> Hi,
>
> Do you mean a date field? If so you can use the <date> or <date-time> tag
> on your form definition in the xml to create the date field widget.
>
> Thanx
> FooShyn
>
>
> On Mon, Jun 4, 2012 at 6:41 AM, G.Ben <[hidden email]> wrote:
>
>> Hi everyone,
>>
>> Is it possible to add a calendar in a widget form ?
>> I want to include it in order to let the user select a date from it,
>>
>>
>> [This is not included in the form widgets]
>> And also I want to display a calendar with informations in it,
>> Do I need to write the code for the whole calendar ?
>>
>> Anyhelp ??
>>
>> Thank you.
>>
>> Regards.
>>
>> G.Ben.
>>
>>
>> --
>> View this message in context:
>> http://ofbiz.135035.n4.nabble.com/Adding-calendar-to-a-form-widget-tp4633145.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

Jacques Le Roux
Administrator
In reply to this post by G.Ben
https://demo-trunk.ofbiz.apache.org/example/control/FormWidgetExamples

Jacques

From: "G.Ben" <[hidden email]>

> Hi everyone,
>
> Is it possible to add a calendar in a widget form ?
> I want to include it in order to let the user select a date from it,
>
>
> [This is not included in the form widgets]
> And also I want to display a calendar with informations in it,
> Do I need to write the code for the whole calendar ?
>
> Anyhelp ??
>
> Thank you.
>
> Regards.
>
> G.Ben.
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Adding-calendar-to-a-form-widget-tp4633145.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

G.Ben
Thank you all for your replies,

Arun Kumar Batham I did it, but it doesn't work, when I click at the calendar to select a date, nothing appears at all, Should I add something like Javascript ?

Thank you.

G.Ben.

Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

martin.kaiser@gmail.com
Hi,

I have a similar problem. The calendar icon is created but when
clicking on it nothing happens. The code generated by OFBiz looks as
follows:

<a class="hasDatepicker"
href="javascript:call_cal(document.updateUserLoginSecurity.disabledDateTime,'2012-06-04%2012:03:45.34');"><img
src="/images/cal.gif" width="16" height="16" border="0" alt="Kalender
einsehen" title="Kalender einsehen"></a>

I found that the call_cal function is not available, and somewhere I
found that it is deprecated (?)
(https://issues.apache.org/jira/browse/OFBIZ-4311).

But from the bugs description I don't see what I have to do.

The same form is also rendered by the request to
https://https://demo-trunk.ofbiz.apache.org/partymgr/control/ProfileEditUserLogin,
where the javascript is correct.

best regards,
Martin

On 4 June 2012 09:28, G.Ben <[hidden email]> wrote:

> Thank you all for your replies,
>
> Arun Kumar Batham I did it, but it doesn't work, when I click at the
> calendar to select a date, nothing appears at all, Should I add something
> like Javascript ?
>
> Thank you.
>
> G.Ben.
>
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Adding-calendar-Radio-button-to-a-form-widget-tp4633145p4633164.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

G.Ben
Yeah,

That's exactly what's happening to me.
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

Foo Shyn Chung
Hi,

Which version of Ofbiz that you're using? Button tag is generated instead
of a 'a' tag for the calendar image when i use the date-time tag in the
Form xml.

<button class="ui-datepicker-trigger" type="button"></button>

FYI the version i'm using is 11.04

Thanx
FooShyn

On Mon, Jun 4, 2012 at 6:32 PM, G.Ben <[hidden email]> wrote:

> Yeah,
>
> That's exactly what's happening to me.
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Adding-calendar-Radio-button-to-a-form-widget-tp4633145p4633179.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

G.Ben
Thank you,

I think that I'm working with 10.04 and I'm going to work with 12.04 so is it a good version ?
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar/Radio button to a form widget

Mohd Viqar
In reply to this post by G.Ben
 You can use this :      

<field name="field1" title="${uiLabelMap.ExampleDateField1Title}">
            <date-time/>
</field>

You can see this file explaining most of the form fields.
ofbizDir/framework/example/widget/example/FormWidgetExampleForms.xml
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar/Radio button to a form widget

G.Ben
Thank you,

I'm working with it.

Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

Foo Shyn Chung
In reply to this post by G.Ben
Am not sure about version 12.04, but 11.04 has some enhancement that
personally i think is great over 10.04 so likewise i think 12.04 should be
the same =)

Thanx
FooShyn

On Mon, Jun 4, 2012 at 11:07 PM, G.Ben <[hidden email]> wrote:

> Thank you,
>
> I think that I'm working with 10.04 and I'm going to work with 12.04 so is
> it a good version ?
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Adding-calendar-Radio-button-to-a-form-widget-tp4633145p4633192.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

martin.kaiser@gmail.com
Hi all,

for me it's still not working. I just did a minimal setup with files
containing only the xml responsible for the date picker.

form file:
<?xml version="1.0" encoding="UTF-8"?>
<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/widget-form.xsd">
    <form name="testform" type="single" list-name="mytest" target="mytest"
        odd-row-style="alternate-row" header-row-style="header-row-2"
default-table-style="basic-table hover-bar">
    <field name="aDate" title="aDate"><date-time/></field>
    </form>
</forms>

screen file:
<?xml version="1.0" encoding="UTF-8"?>
<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
    <screen name="testScreen">
    <section>
    <widgets><include-form
location="component://test/widget/test/TestForm.xml" name="testform"
/></widgets>
    </section>
    </screen>
 </screens>

and then everything was hooked in controller.xml. Still the result is
[...]
<form method="post"  action="/crm/control/mytest"  id="testform"
class="basic-form"
onsubmit="javascript:submitFormDisableSubmits(this)" name="testform">
 <table cellspacing="0" class="basic-table hover-bar">
  <tr>
   <td class="label">aDate</td>
   <td colspan="4"><input type="text" name="aDate" title="" size="25"
maxlength="30" id="testform_aDate"/><a class="hasDatepicker"
href="javascript:call_cal(document.testform.aDate,'2012-06-05%2010&#58;18&#58;56.41');"><img
src="/images/cal.gif" width="16" height="16" border="0" alt=""
title=""/></a></td>
  </tr>
 </table>
</form>
[...]

and not the expected button. What am I doing wrong here?

Thx,
Martin

On 4 June 2012 19:01, Foo Shyn Chung <[hidden email]> wrote:

> Am not sure about version 12.04, but 11.04 has some enhancement that
> personally i think is great over 10.04 so likewise i think 12.04 should be
> the same =)
>
> Thanx
> FooShyn
>
> On Mon, Jun 4, 2012 at 11:07 PM, G.Ben <[hidden email]> wrote:
>
>> Thank you,
>>
>> I think that I'm working with 10.04 and I'm going to work with 12.04 so is
>> it a good version ?
>>
>> --
>> View this message in context:
>> http://ofbiz.135035.n4.nabble.com/Adding-calendar-Radio-button-to-a-form-widget-tp4633145p4633192.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

Martin Kaiser
Ok, I think I solved the problem. My "template" for the controller.xml
file was based on the book "Apache OFBiz Development - The beginners
tutorial", which seems to be not state of the art. So I registered an
older handler for screens:

<handler name="screen" type="view"
class="org.ofbiz.widget.screen.ScreenWidgetViewHandler"/>

I replaced it now by

<handler name="screen" type="view"
class="org.ofbiz.widget.screen.MacroScreenViewHandler"/>

which produces much more JavaScript.

best regards,
Martin


On 5 June 2012 10:20, Martin Kaiser <[hidden email]> wrote:

> Hi all,
>
> for me it's still not working. I just did a minimal setup with files
> containing only the xml responsible for the date picker.
>
> form file:
> <?xml version="1.0" encoding="UTF-8"?>
> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/widget-form.xsd">
>    <form name="testform" type="single" list-name="mytest" target="mytest"
>        odd-row-style="alternate-row" header-row-style="header-row-2"
> default-table-style="basic-table hover-bar">
>        <field name="aDate" title="aDate"><date-time/></field>
>    </form>
> </forms>
>
> screen file:
> <?xml version="1.0" encoding="UTF-8"?>
> <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
>    <screen name="testScreen">
>        <section>
>                <widgets><include-form
> location="component://test/widget/test/TestForm.xml" name="testform"
> /></widgets>
>        </section>
>    </screen>
>  </screens>
>
> and then everything was hooked in controller.xml. Still the result is
> [...]
> <form method="post"  action="/crm/control/mytest"  id="testform"
> class="basic-form"
> onsubmit="javascript:submitFormDisableSubmits(this)" name="testform">
>  <table cellspacing="0" class="basic-table hover-bar">
>  <tr>
>   <td class="label">aDate</td>
>   <td colspan="4"><input type="text" name="aDate" title="" size="25"
> maxlength="30" id="testform_aDate"/><a class="hasDatepicker"
> href="javascript:call_cal(document.testform.aDate,'2012-06-05%2010&#58;18&#58;56.41');"><img
> src="/images/cal.gif" width="16" height="16" border="0" alt=""
> title=""/></a></td>
>  </tr>
>  </table>
> </form>
> [...]
>
> and not the expected button. What am I doing wrong here?
>
> Thx,
> Martin
>
> On 4 June 2012 19:01, Foo Shyn Chung <[hidden email]> wrote:
>> Am not sure about version 12.04, but 11.04 has some enhancement that
>> personally i think is great over 10.04 so likewise i think 12.04 should be
>> the same =)
>>
>> Thanx
>> FooShyn
>>
>> On Mon, Jun 4, 2012 at 11:07 PM, G.Ben <[hidden email]> wrote:
>>
>>> Thank you,
>>>
>>> I think that I'm working with 10.04 and I'm going to work with 12.04 so is
>>> it a good version ?
>>>
>>> --
>>> View this message in context:
>>> http://ofbiz.135035.n4.nabble.com/Adding-calendar-Radio-button-to-a-form-widget-tp4633145p4633192.html
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

Jacques Le Roux
Administrator
Prefer https://demo-trunk.ofbiz.apache.org/example/control/FormWidgetExamples
For more lastest/up to date examples

Jacques

Martin Kaiser wrote:

> Ok, I think I solved the problem. My "template" for the controller.xml
> file was based on the book "Apache OFBiz Development - The beginners
> tutorial", which seems to be not state of the art. So I registered an
> older handler for screens:
>
> <handler name="screen" type="view"
> class="org.ofbiz.widget.screen.ScreenWidgetViewHandler"/>
>
> I replaced it now by
>
> <handler name="screen" type="view"
> class="org.ofbiz.widget.screen.MacroScreenViewHandler"/>
>
> which produces much more JavaScript.
>
> best regards,
> Martin
>
>
> On 5 June 2012 10:20, Martin Kaiser <[hidden email]> wrote:
>> Hi all,
>>
>> for me it's still not working. I just did a minimal setup with files
>> containing only the xml responsible for the date picker.
>>
>> form file:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/widget-form.xsd">
>> <form name="testform" type="single" list-name="mytest" target="mytest"
>> odd-row-style="alternate-row" header-row-style="header-row-2"
>> default-table-style="basic-table hover-bar">
>> <field name="aDate" title="aDate"><date-time/></field>
>> </form>
>> </forms>
>>
>> screen file:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
>> <screen name="testScreen">
>> <section>
>> <widgets><include-form
>> location="component://test/widget/test/TestForm.xml" name="testform"
>> /></widgets>
>> </section>
>> </screen>
>> </screens>
>>
>> and then everything was hooked in controller.xml. Still the result is
>> [...]
>> <form method="post" action="/crm/control/mytest" id="testform"
>> class="basic-form"
>> onsubmit="javascript:submitFormDisableSubmits(this)" name="testform">
>> <table cellspacing="0" class="basic-table hover-bar">
>> <tr>
>> <td class="label">aDate</td>
>> <td colspan="4"><input type="text" name="aDate" title="" size="25"
>> maxlength="30" id="testform_aDate"/><a class="hasDatepicker"
>> href="javascript:call_cal(document.testform.aDate,'2012-06-05%2010&#58;18&#58;56.41');"><img
>> src="/images/cal.gif" width="16" height="16" border="0" alt=""
>> title=""/></a></td>
>> </tr>
>> </table>
>> </form>
>> [...]
>>
>> and not the expected button. What am I doing wrong here?
>>
>> Thx,
>> Martin
>>
>> On 4 June 2012 19:01, Foo Shyn Chung <[hidden email]> wrote:
>>> Am not sure about version 12.04, but 11.04 has some enhancement that
>>> personally i think is great over 10.04 so likewise i think 12.04 should be
>>> the same =)
>>>
>>> Thanx
>>> FooShyn
>>>
>>> On Mon, Jun 4, 2012 at 11:07 PM, G.Ben <[hidden email]> wrote:
>>>
>>>> Thank you,
>>>>
>>>> I think that I'm working with 10.04 and I'm going to work with 12.04 so is
>>>> it a good version ?
>>>>
>>>> --
>>>> View this message in context:
>>>> http://ofbiz.135035.n4.nabble.com/Adding-calendar-Radio-button-to-a-form-widget-tp4633145p4633192.html
>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

martin.kaiser@gmail.com
Thanks Jacques, I already found this resource. But in my case just the
controller.xml was configured in the wrong way, using an older
renderer (ScreenWidgetViewHandler). By replacing this I successfully
produced the code which I expected. Now also some other things like
the autocompletion fields etc. are working.

By the way, is the ScreenWidgetViewHandler deprecated? If so, is it
possible to print a warning message to the console to make this
visible to the developer that he is using a deprecated function? Or is
such an mechanism not wanted?

Martin

On 5 June 2012 14:27, Jacques Le Roux <[hidden email]> wrote:

> Prefer
> https://demo-trunk.ofbiz.apache.org/example/control/FormWidgetExamples
> For more lastest/up to date examples
>
> Jacques
>
>
> Martin Kaiser wrote:
>>
>> Ok, I think I solved the problem. My "template" for the controller.xml
>> file was based on the book "Apache OFBiz Development - The beginners
>> tutorial", which seems to be not state of the art. So I registered an
>> older handler for screens:
>>
>> <handler name="screen" type="view"
>> class="org.ofbiz.widget.screen.ScreenWidgetViewHandler"/>
>>
>> I replaced it now by
>>
>> <handler name="screen" type="view"
>> class="org.ofbiz.widget.screen.MacroScreenViewHandler"/>
>>
>> which produces much more JavaScript.
>>
>> best regards,
>> Martin
>>
>>
>> On 5 June 2012 10:20, Martin Kaiser <[hidden email]> wrote:
>>>
>>> Hi all,
>>>
>>> for me it's still not working. I just did a minimal setup with files
>>> containing only the xml responsible for the date picker.
>>>
>>> form file:
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>
>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/widget-form.xsd">
>>> <form name="testform" type="single" list-name="mytest" target="mytest"
>>> odd-row-style="alternate-row" header-row-style="header-row-2"
>>> default-table-style="basic-table hover-bar">
>>> <field name="aDate" title="aDate"><date-time/></field>
>>> </form>
>>> </forms>
>>>
>>> screen file:
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>
>>> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
>>> <screen name="testScreen">
>>> <section>
>>> <widgets><include-form
>>> location="component://test/widget/test/TestForm.xml" name="testform"
>>> /></widgets>
>>> </section>
>>> </screen>
>>> </screens>
>>>
>>> and then everything was hooked in controller.xml. Still the result is
>>> [...]
>>> <form method="post" action="/crm/control/mytest" id="testform"
>>> class="basic-form"
>>> onsubmit="javascript:submitFormDisableSubmits(this)" name="testform">
>>> <table cellspacing="0" class="basic-table hover-bar">
>>> <tr>
>>> <td class="label">aDate</td>
>>> <td colspan="4"><input type="text" name="aDate" title="" size="25"
>>> maxlength="30" id="testform_aDate"/><a class="hasDatepicker"
>>>
>>> href="javascript:call_cal(document.testform.aDate,'2012-06-05%2010&#58;18&#58;56.41');"><img
>>> src="/images/cal.gif" width="16" height="16" border="0" alt=""
>>> title=""/></a></td>
>>> </tr>
>>> </table>
>>> </form>
>>> [...]
>>>
>>> and not the expected button. What am I doing wrong here?
>>>
>>> Thx,
>>> Martin
>>>
>>> On 4 June 2012 19:01, Foo Shyn Chung <[hidden email]> wrote:
>>>>
>>>> Am not sure about version 12.04, but 11.04 has some enhancement that
>>>> personally i think is great over 10.04 so likewise i think 12.04 should
>>>> be
>>>> the same =)
>>>>
>>>> Thanx
>>>> FooShyn
>>>>
>>>> On Mon, Jun 4, 2012 at 11:07 PM, G.Ben <[hidden email]> wrote:
>>>>
>>>>> Thank you,
>>>>>
>>>>> I think that I'm working with 10.04 and I'm going to work with 12.04 so
>>>>> is
>>>>> it a good version ?
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>>
>>>>> http://ofbiz.135035.n4.nabble.com/Adding-calendar-Radio-button-to-a-form-widget-tp4633145p4633192.html
>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

Jacques Le Roux
Administrator
From: "Martin Kaiser" <[hidden email]>

> Thanks Jacques, I already found this resource. But in my case just the
> controller.xml was configured in the wrong way, using an older
> renderer (ScreenWidgetViewHandler). By replacing this I successfully
> produced the code which I expected. Now also some other things like
> the autocompletion fields etc. are working.
>
> By the way, is the ScreenWidgetViewHandler deprecated? If so, is it
> possible to print a warning message to the console to make this
> visible to the developer that he is using a deprecated function? Or is
> such an mechanism not wanted?

Yes you can say that now MacroScreenViewHandler is used and ScreenWidgetViewHandler
BTW if you search ScreenWidgetViewHandler in all files you will only find 5 references. I even wonder if at this point all these old
stuff should not be moved to Attic

Jacques

> Martin
>
> On 5 June 2012 14:27, Jacques Le Roux <[hidden email]> wrote:
>> Prefer
>> https://demo-trunk.ofbiz.apache.org/example/control/FormWidgetExamples
>> For more lastest/up to date examples
>>
>> Jacques
>>
>>
>> Martin Kaiser wrote:
>>>
>>> Ok, I think I solved the problem. My "template" for the controller.xml
>>> file was based on the book "Apache OFBiz Development - The beginners
>>> tutorial", which seems to be not state of the art. So I registered an
>>> older handler for screens:
>>>
>>> <handler name="screen" type="view"
>>> class="org.ofbiz.widget.screen.ScreenWidgetViewHandler"/>
>>>
>>> I replaced it now by
>>>
>>> <handler name="screen" type="view"
>>> class="org.ofbiz.widget.screen.MacroScreenViewHandler"/>
>>>
>>> which produces much more JavaScript.
>>>
>>> best regards,
>>> Martin
>>>
>>>
>>> On 5 June 2012 10:20, Martin Kaiser <[hidden email]> wrote:
>>>>
>>>> Hi all,
>>>>
>>>> for me it's still not working. I just did a minimal setup with files
>>>> containing only the xml responsible for the date picker.
>>>>
>>>> form file:
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>
>>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/widget-form.xsd">
>>>> <form name="testform" type="single" list-name="mytest" target="mytest"
>>>> odd-row-style="alternate-row" header-row-style="header-row-2"
>>>> default-table-style="basic-table hover-bar">
>>>> <field name="aDate" title="aDate"><date-time/></field>
>>>> </form>
>>>> </forms>
>>>>
>>>> screen file:
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>
>>>> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
>>>> <screen name="testScreen">
>>>> <section>
>>>> <widgets><include-form
>>>> location="component://test/widget/test/TestForm.xml" name="testform"
>>>> /></widgets>
>>>> </section>
>>>> </screen>
>>>> </screens>
>>>>
>>>> and then everything was hooked in controller.xml. Still the result is
>>>> [...]
>>>> <form method="post" action="/crm/control/mytest" id="testform"
>>>> class="basic-form"
>>>> onsubmit="javascript:submitFormDisableSubmits(this)" name="testform">
>>>> <table cellspacing="0" class="basic-table hover-bar">
>>>> <tr>
>>>> <td class="label">aDate</td>
>>>> <td colspan="4"><input type="text" name="aDate" title="" size="25"
>>>> maxlength="30" id="testform_aDate"/><a class="hasDatepicker"
>>>>
>>>> href="javascript:call_cal(document.testform.aDate,'2012-06-05%2010&#58;18&#58;56.41');"><img
>>>> src="/images/cal.gif" width="16" height="16" border="0" alt=""
>>>> title=""/></a></td>
>>>> </tr>
>>>> </table>
>>>> </form>
>>>> [...]
>>>>
>>>> and not the expected button. What am I doing wrong here?
>>>>
>>>> Thx,
>>>> Martin
>>>>
>>>> On 4 June 2012 19:01, Foo Shyn Chung <[hidden email]> wrote:
>>>>>
>>>>> Am not sure about version 12.04, but 11.04 has some enhancement that
>>>>> personally i think is great over 10.04 so likewise i think 12.04 should
>>>>> be
>>>>> the same =)
>>>>>
>>>>> Thanx
>>>>> FooShyn
>>>>>
>>>>> On Mon, Jun 4, 2012 at 11:07 PM, G.Ben <[hidden email]> wrote:
>>>>>
>>>>>> Thank you,
>>>>>>
>>>>>> I think that I'm working with 10.04 and I'm going to work with 12.04 so
>>>>>> is
>>>>>> it a good version ?
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>>
>>>>>> http://ofbiz.135035.n4.nabble.com/Adding-calendar-Radio-button-to-a-form-widget-tp4633145p4633192.html
>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

Adrian Crum-3
On 6/9/2012 2:20 PM, Jacques Le Roux wrote:

> From: "Martin Kaiser" <[hidden email]>
>> Thanks Jacques, I already found this resource. But in my case just the
>> controller.xml was configured in the wrong way, using an older
>> renderer (ScreenWidgetViewHandler). By replacing this I successfully
>> produced the code which I expected. Now also some other things like
>> the autocompletion fields etc. are working.
>>
>> By the way, is the ScreenWidgetViewHandler deprecated? If so, is it
>> possible to print a warning message to the console to make this
>> visible to the developer that he is using a deprecated function? Or is
>> such an mechanism not wanted?
>
> Yes you can say that now MacroScreenViewHandler is used and
> ScreenWidgetViewHandler
> BTW if you search ScreenWidgetViewHandler in all files you will only
> find 5 references. I even wonder if at this point all these old stuff
> should not be moved to Attic

+1

Add it to the cleanup Jira issue.

-Adrian

Reply | Threaded
Open this post in threaded view
|

Re: Adding calendar to a form widget

Jacques Le Roux
Administrator
Done see Attic page in Wiki https://cwiki.apache.org/confluence/display/OFBADMIN/OFBiz+Attic

Jacques

From: "Adrian Crum" <[hidden email]>

> On 6/9/2012 2:20 PM, Jacques Le Roux wrote:
>> From: "Martin Kaiser" <[hidden email]>
>>> Thanks Jacques, I already found this resource. But in my case just the
>>> controller.xml was configured in the wrong way, using an older
>>> renderer (ScreenWidgetViewHandler). By replacing this I successfully
>>> produced the code which I expected. Now also some other things like
>>> the autocompletion fields etc. are working.
>>>
>>> By the way, is the ScreenWidgetViewHandler deprecated? If so, is it
>>> possible to print a warning message to the console to make this
>>> visible to the developer that he is using a deprecated function? Or is
>>> such an mechanism not wanted?
>>
>> Yes you can say that now MacroScreenViewHandler is used and
>> ScreenWidgetViewHandler
>> BTW if you search ScreenWidgetViewHandler in all files you will only
>> find 5 references. I even wonder if at this point all these old stuff
>> should not be moved to Attic
>
> +1
>
> Add it to the cleanup Jira issue.
>
> -Adrian
>
12