RE: Hidden or not Hidden for dynamic Label in Form

"Jean Gidcumb" <[email protected]> Fri, 4 Aug 2006 09:51:59 -0400
Newsgroups gmane.comp.lang.4gl.fourjs.user
Message-ID <[email protected]>
Hi,

 

This may help. I hide a label and the field in this function.

 

 

#_This function will hide a label and field on the form. 

function hide_field(p_field, p_label)                    

    define p_field       STRING,                          

           p_label       STRING,                          

           p_window      ui.Window,                       

           w_node        om.DomNode,                      

           fd_node       om.DomNode,                      

           l_node        om.DomNode                       

                                                          

    LET p_window = ui.Window.getCurrent()                 

    LET w_node   = p_window.getNode()                     

    LET fd_node  = p_window.findNode("FormField",p_field) 

    IF fd_node IS NOT NULL THEN                           

       CALL fd_node.setAttribute("hidden", 1)             

    END IF                                                

    LET l_node = p_window.findNode("Label", p_label)      

    IF l_node IS NOT NULL THEN                            

       CALL l_node.setAttribute("hidden", 1)              

    END IF                                                

                                                          

end function    

 

Regards,

Jean                                          

________________________________

From: [email protected] [mailto:[email protected]] On
Behalf Of Schlykow
Sent: Friday, August 04, 2006 8:19 AM
To: [email protected]
Subject: [fourjs-users] Hidden or not Hidden for dynamic Label in Form

 

Hello genero freaks,

 

perhaps somebody has a solution for the following problem:

 

In a form there are some edit fields and some dynamic labels.

 

I wish to hide a special edit field depending from the user.

That's no problem:

 

CALL f.setElementHidden("customer.custid",1)

 

It works, but the corresponding label does not hide!

It is a label similar like this:

label mx33 = txx_Preis

 

After the opening of the form a function displays 'Price' to txx_Preis.

(THIS IS UNCHANGBLE FOR ME !!!)

 

If I do the statement: CALL f.setElementHidden("FORMONLY.txx_Preis",1)
 
the Word 'Price' is visible, not unvisible!
The only solution for me is DISPLAY "      " TO txx_Preis.
 
This works, but is not very smart, because the runtime systems
can not regognize, that the form is less large then before and
ornaments the form with a scrollbar which is actually unnecessary.
 
2. Question:
How can I make invisible some formfields outside(!) of the
INPUT BY NAME statement, and not changing the form with 'HIDDEN'
in the Attributes of the field?
is this possible ?
 
any hints welcome
Georg