# Disabled + invisible field is it possible?

**URL:** <https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628>\
**Category:** Forum\
**Tags:** Former-Crossvision-Products, Application-Composer\
**Created:** [April 11, 2007, 12:27am UTC](https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628 "2007-04-11T00:27:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![consros](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@consros](https://techcommunity.softwareag.com/u/consros)\
**Post date:** [April 11, 2007, 12:27am UTC](https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628/1 "2007-04-11T00:27:53Z")

</div>

Hello,

we want to show a button, which behavior depends on current user state.  
F.i. \<Dial|Answer|Transfer|Dial(Disabled)\>. One of these three actions can be available or a disabled button with text “Dial” should be shown in case of wrong configuration.  
At the moment we see two ways to go:

1. Dynamically change button text and use visibleprop in conjunction with invisiblemode=“disabled”.
2. Provide four buttons and use visibleprop in conjunction with invisiblemode=“invisible”.

But both ways are not good enough. The lacks are following:

1. We have not found how to access multilingual resources in order to set the text according to selected language except of direct csv file parsing.
2. It seems to be completely impossible to disable a button if its invisiblemode is not “disabled”.

Could you please give us a hint how we can proceed with one of described methods, or may be with some completely different one?

Thank you in advance,  
consros

---

<div class="post-metadata">

**Author:** ![Bjoern\_Mueller](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@Bjoern\_Mueller](https://techcommunity.softwareag.com/u/Bjoern_Mueller)\
**Post date:** [April 11, 2007, 2:23pm UTC](https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628/2 "2007-04-11T14:23:18Z")

</div>

Hi,  
ad 1.) you can accesse the multi language CSV resources via replaceLiteratl()-methods in the adapter, or - if you are outside adapter processing - via MLManagerFactor.getMLManager() + corresponding methods.  
ad 2.) yes, that’s right: vai button-visibleprop (true/false) you can control the button’s state - via the button-invisiblemode you control how “false” is interpreted: either invisible (default) or disabled (as you mention).  
Hope this helps…  
Bj

---

<div class="post-metadata">

**Author:** ![consros](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@consros](https://techcommunity.softwareag.com/u/consros)\
**Post date:** [April 11, 2007, 4:44pm UTC](https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628/3 "2007-04-11T16:44:19Z")

</div>

Hi, thanks for your answer!

> [@Bjoern Mueller](#):
>
> you can accesse the multi language CSV resources via replaceLiteratl()-methods in the adapter, or …

This seems to be exactly what we are looking for, but I cannot get the thing working. And the JavaDoc is a bit unclear at this point. F.i. I have no idea what for replaceLiterals with additional parameters are provided: “…same as replaceLiteral(application,literal) but now with one additional parameter.”  
I’ve prepared a simple example.

In application designer I defined a follofing literal:

```auto

File Content  
  ...
btnDial;Dial
  ...
```

Here is my code:

```auto

        String app = findPageApplication();
        System.out.println("app = " + app);

        String lit = "btnDial";
        System.out.println("lit = " + lit);
        System.out.println("lit = " + replaceLiteral(app, lit));
```

And here is the output I get:

```auto

app = MyApp
lit = btnDial
lit = $en/default/btnDial$
```

I would expect to get my “Dial” in the last line.  
But maybe it’s not the last step? Maybe now I should proceed further with “$en/default/btnDial$” ? Could you please tell me what else should I check?

---

<div class="post-metadata">

**Author:** ![consros](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@consros](https://techcommunity.softwareag.com/u/consros)\
**Post date:** [April 11, 2007, 5:32pm UTC](https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628/4 "2007-04-11T17:32:31Z")

</div>

> [@Bjoern Mueller](#):
>
> or - if you are outside adapter processing - via MLManagerFactor.getMLManager() + corresponding methods.

The same:

```auto

        String prj = "cis";
        System.out.println("prj = " + prj);
        
        String app = findPageApplication();
        System.out.println("app = " + app);

        String lit = "btnContact";
        System.out.println("lit = " + lit);
                
        IMLManager man = MLManagerFactory.getMLManager();
        lit = man.getString("de", prj, app, lit);
        
        System.out.println("lit = " + lit);                        
```

(Language and literal are different as above)

```auto

prj = cis
app = MyApp
lit = btnContact
lit = $de/default/btnContact$
```

---

<div class="post-metadata">

**Author:** ![Bjoern\_Mueller](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@Bjoern\_Mueller](https://techcommunity.softwareag.com/u/Bjoern_Mueller)\
**Post date:** [April 11, 2007, 6:24pm UTC](https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628/5 "2007-04-11T18:24:04Z")

</div>

Hi,

I just refer to replaceLiteral(), this is the easier one 😉 Well the problem is the word “application”, this is not the page\_s project, but the name of the CSV file (or in terms of a page definition: the name of the “language reference”).

…replaceLiteral(“demo”,“btnDial”);…  
looks for “btnDial” in “demo.csv”.

And the other replaceLiterals? - Inside a message you can define variables to be replaced at runtime, e.g. the message is “Document &1 was saved in &2.” You can pass the variables by using the call:  
replaceLiteral(“demo”,“msgSaved”,“xyz.xml”,“/project/xyz”);

Bj

---

<div class="post-metadata">

**Author:** ![consros](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@consros](https://techcommunity.softwareag.com/u/consros)\
**Post date:** [April 11, 2007, 6:35pm UTC](https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628/6 "2007-04-11T18:35:43Z")

</div>

Thanks, not it works indeed!  
One small additional question - can I read somewhere the “translationreference” field of the page - it’s the value of application parameter - to make implementation more abstract?  
Thanks once again!

---

<div class="post-metadata">

**Author:** ![consros](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@consros](https://techcommunity.softwareag.com/u/consros)\
**Post date:** [April 11, 2007, 6:36pm UTC](https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628/7 "2007-04-11T18:36:11Z")

</div>

> no[W] it works indeed!

---

<div class="post-metadata">

**Author:** ![Bjoern\_Mueller](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@Bjoern\_Mueller](https://techcommunity.softwareag.com/u/Bjoern_Mueller)\
**Post date:** [April 11, 2007, 6:40pm UTC](https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628/8 "2007-04-11T18:40:08Z")

</div>

There’s no API for reading it. - But I would make it as simple as possible: typically you have exactly one translation reference per project in which you collect all the literals in order to avoid redundant maintenance. Name it “translation” or whatever, use it consitently throughout all your pages and define a Java constant “as API” 😉

Bj

---

<div class="post-metadata">

**Author:** ![consros](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@consros](https://techcommunity.softwareag.com/u/consros)\
**Post date:** [April 12, 2007, 3:24am UTC](https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628/9 "2007-04-12T03:24:31Z")

</div>

Thank you very much, clear!

---

<div class="post-metadata">

**Author:** ![salman](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@salman](https://techcommunity.softwareag.com/u/salman)\
**Post date:** [June 19, 2007, 8:47pm UTC](https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628/10 "2007-06-19T20:47:52Z")

</div>

Hi, This post is very informative, however I would like some specific information. If someone can help me then please send me a private message. Best Regards,

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:38pm UTC](https://techcommunity.softwareag.com/t/disabled-invisible-field-is-it-possible/57628/11 "2021-04-02T14:38:46Z")

</div>


