Topic
  • 5 replies
  • Latest Post - ‏2012-10-11T10:34:43Z by Jhonmail
Jhonmail
Jhonmail
27 Posts

Pinned topic Problem with custom widget for input field

‏2012-10-07T16:22:22Z |
Hi all

i have a Hats project that execute the transformation of a iSeries Subfile;
1- i have created a Screen customization for the subfile screen
2- i have created a default rendering for the screen where i have selected a customized widget for subfile and selected at field input level, my customized widget

when i run my application, the customized subfile widget works fine, but the customized field widget don't works (is not performed) i have insert in the java source a "System.out.println(" test ")" and in the console i don't see it. If I change the priority of execution Input field before of subfile, the customized field widget works but don't works the customized subfile widget. I Also tried to use the standard Hats calendar widget at field level but the situation is the same (so i think not depends from my customized widget).

at this point my great doubt is: i can't use in a subfile screen a field level widget ? i yes (i can use it) why i have this problem ? how can i find where i'm wrong ?

Thanks in advance
J.
Updated on 2012-10-11T10:34:43Z at 2012-10-11T10:34:43Z by Jhonmail
  • Jhonmail
    Jhonmail
    27 Posts

    Re: Problem with custom widget for input field

    ‏2012-10-08T16:07:57Z  
    Hi All

    Nobody can help me to understand where i'm wrong ??

    Thanks anyway

    J.
  • RonCraig
    RonCraig
    72 Posts

    Re: Problem with custom widget for input field

    ‏2012-10-10T00:38:09Z  
    • Jhonmail
    • ‏2012-10-08T16:07:57Z
    Hi All

    Nobody can help me to understand where i'm wrong ??

    Thanks anyway

    J.
    Patience, Jonmail. :-)

    As you know, the system calls each host component in the order you list, giving the section of the screen you define. The host component decides if it recognizes itself in that region of the screen. If it does, then the configured widget is called to render that part of the screen. That part of the screen is then UNAVAILABLE for the next host component to render -- it's already rendered.

    My guess is that if you carefully look at the regions of the screen that are being searched, you might find that the area is consumed by the first host component, and so the following component does not even look at that part of the screen.

    Good luck.
  • Jhonmail
    Jhonmail
    27 Posts

    Re: Problem with custom widget for input field

    ‏2012-10-10T09:02:18Z  
    • RonCraig
    • ‏2012-10-10T00:38:09Z
    Patience, Jonmail. :-)

    As you know, the system calls each host component in the order you list, giving the section of the screen you define. The host component decides if it recognizes itself in that region of the screen. If it does, then the configured widget is called to render that part of the screen. That part of the screen is then UNAVAILABLE for the next host component to render -- it's already rendered.

    My guess is that if you carefully look at the regions of the screen that are being searched, you might find that the area is consumed by the first host component, and so the following component does not even look at that part of the screen.

    Good luck.
    Hi RonCraig

    Many thanks for your reply. So if i well understand what you explained me, if in the default rendering i have associated to my sreen customization a subfile widget that has the priority to the input fields widget, this last one don't came executed... so if i want change the HTML of my input fields form <input type"text"/> to <input type='number'/>, i have to work in my subfile widget . right ?

    how can i do it ? where can i find some example

    Thanks in advance
  • Jhonmail
    Jhonmail
    27 Posts

    Re: Problem with custom widget for input field

    ‏2012-10-11T10:19:08Z  
    • Jhonmail
    • ‏2012-10-10T09:02:18Z
    Hi RonCraig

    Many thanks for your reply. So if i well understand what you explained me, if in the default rendering i have associated to my sreen customization a subfile widget that has the priority to the input fields widget, this last one don't came executed... so if i want change the HTML of my input fields form <input type"text"/> to <input type='number'/>, i have to work in my subfile widget . right ?

    how can i do it ? where can i find some example

    Thanks in advance
    Hi

    as with custom widget, i'm not able to solve the problem, i would try to use javascritp ; i have added :

    -in my customized widget this :

    tr.setAttribute("onmousemove", "javascript:onclick_show(eventthis," )");
    -in the lxgwfunctions.js file the following function :

    var element = e.srcElement || e.target;
    if(element != null){
    if(element.tagName == "INPUT") {
    + //alert("Name >" );+
    + element.+
    + element.setAttribute('type','password');+
    + alert("Tipo: " + element.type);+
    + +
    + +
    }

    but also with this i'm not able to succed to solce my problem. Can some one help me saying, where i'm wrong with this javascript ?

    Thanks in advance

    J.
  • Jhonmail
    Jhonmail
    27 Posts

    Re: Problem with custom widget for input field

    ‏2012-10-11T10:34:43Z  
    • Jhonmail
    • ‏2012-10-11T10:19:08Z
    Hi

    as with custom widget, i'm not able to solve the problem, i would try to use javascritp ; i have added :

    -in my customized widget this :

    tr.setAttribute("onmousemove", "javascript:onclick_show(eventthis," )");
    -in the lxgwfunctions.js file the following function :

    var element = e.srcElement || e.target;
    if(element != null){
    if(element.tagName == "INPUT") {
    + //alert("Name >" );+
    + element.+
    + element.setAttribute('type','password');+
    + alert("Tipo: " + element.type);+
    + +
    + +
    }

    but also with this i'm not able to succed to solce my problem. Can some one help me saying, where i'm wrong with this javascript ?

    Thanks in advance

    J.
    Hi
    sorry correction of a mistake

    as with custom widget, i'm not able to solve the problem, i would try to use javascritp ; i have added :

    -in my customized widget this :

    tr.setAttribute("onmousemove", "javascript:onclick_show(event,this," )");

    -in the lxgwfunctions.js file the following function :

    var element = e.srcElement || e.target;
    if(element != null){
    if(element.tagName == "INPUT") {
    ++ //alert("Name >" );++
    ++ element.++
    ++ element.setAttribute('type','number');++
    ++ alert("Type: " + element.type);++
    ++ ++
    ++ ++
    }

    but also with this i'm not able to succed to solce my problem. Can some one help me saying, where i'm wrong with this javascript ?

    Thanks in advance

    J.