Leonardo Valentin Zeferino
Posts: 0
Joined: Fri May 29, 2015 2:07 pm

Using instead of in html screen code

Hi!

I'd like to know if I can use in html screen (feed.html) code:

code
<div class="cell-wrapper"><span name="n_comments_lb" id="feed_n_comments_lb" dsid="n_comments_lb" data-role="appery_label">0</span><>
/code

insted of

code
<div class="cell-wrapper"><div name="n_comments_lb" id="feed_n_comments_lb" dsid="n_comments_lb" data-role="appery_label">0<><>
/code

if not, why and what can I do?

Thanks!

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Using instead of in html screen code

Hello,

1) You can change type of the HTML component: http://prntscr.com/8g4t45
2) You can use CSS for changing div's display attribute

Leonardo Valentin Zeferino
Posts: 0
Joined: Fri May 29, 2015 2:07 pm

Using instead of in html screen code

Hi Sergiy!

Thanks for helping me!

I'm coding directly in web_resources.

My template has this code:
code
<div class="feed-item-actions-inner">
<li>
<a href="#">
<i class="zmdi zmdi-likes"></i>
<span>0</span>
</a>
</li>
<>
/code

But when I change the code to bellow, appears the "c15r: component facade not found" error.

code
<div class="feed-item-actions-inner">
<li>
<a href="#">
<i class="zmdi zmdi-likes"></i>
<div class="cell-wrapper">
<span name="n_likes_lb" id="feed_n_likes_lb" dsid="n_likes_lb" data-role="appery_label">0</span>
<>
</a>
</li>
<>
/code

I tried too to use only div as bellow but without success.

code
<div class="feed-item-actions-inner">
<li>
<a href="#">
<i class="zmdi zmdi-likes"></i>
<div class="cell-wrapper">
<div name="n_likes_lb" id="feed_n_likes_lb" dsid="n_likes_lb" data-role="appery_label">0<>
<>
</a>
</li>
<>
/code

As you said above, I tried to use in div the css attribute bellow but, again, without success

code
style="display: inline"
/code

Do you have any suggestion?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Using instead of in html screen code

Could you show us screenshot with mapping? And JS code from it.

Leonardo Valentin Zeferino
Posts: 0
Joined: Fri May 29, 2015 2:07 pm

Using instead of in html screen code

Hi Sergiy!

Here, the problem isn't the mapping or JS code. They are okay. Here, the problem is how can I adapt my html code to show the data without it breaks the layout.

If I use the code bellow using DIV, the data will show correct but the layout will break.
code
<div class="feed-item-actions-inner">
<li>
<a href="#">
<i class="zmdi zmdi-likes"></i>
<div class="cell-wrapper">
<div style="display: inline" name="n_likes_lb" id="feed_n_likes_lb" dsid="n_likes_lb" data-role="appery_label">0<>
<>
</a>
</li>
<>
/code

If I use the code bellow using SPAN, the layout will be correct but appear the error "c15r: component facade not found".
code
<div class="feed-item-actions-inner">
<li>
<a href="#">
<i class="zmdi zmdi-likes"></i>
<div class="cell-wrapper">
<span name="n_likes_lb" id="feed_n_likes_lb" dsid="n_likes_lb" data-role="appery_label">0</span>
<>
</a>
</li>
<>
/code

How can I show the layout and data correctly?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Using instead of in html screen code

Leonardo error "c15r" fires when service with mapping executes and some components doesn't exist.
Could you clarify have you changed anything on Source tab? This (http://devcenter.appery.io/tutorials/...) doc should help.

Leonardo Valentin Zeferino
Posts: 0
Joined: Fri May 29, 2015 2:07 pm

Using instead of in html screen code

Hi Seargiy!

4 days and you didn't understand my problem yet.

Yes, I'm programming directly in source tab.
As I said in my last post, the "c15r" issue occurs only if I change DIV to SPAN tag. I guarantee that isn't a mapping issue.

code
<div name="n_likes_lb" id="feed_n_likes_lb" dsid="n_likes_lb" data-role="appery_label">0<>
/code

My question is very simple: I need to use a SPAN tag to not break my layout. All data shown by Appery when you map by screenshow uses DIV tag (as above). Is there a solution to use a SPAN tag instead of DIV?

I tried code bellow but the "c15r" issue appears. Not because the mapping, but I think the system doesn't accept use SPAN tag to show data.

code
<span name="n_likes_lb" id="feed_n_likes_lb" dsid="n_likes_lb" data-role="appery_label">0</span>
/code

Please, if you don't know how can you help me, I'd like to ask support to other employee.

Obs: There isn't any possibility to not use the source tab. Suggestions like "make refresh" in source code isn't an option. I need to program directly in source code because my layout is customized.

Thanks.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Using instead of in html screen code

Hi Leonardo -

You can't edit source files directly as they are involved in code generation in Appery.io.

As Sergiy said you can use HTML component in components palette, if this is not an option for you can make any source code editing outside Appery.io platform.

Leonardo Valentin Zeferino
Posts: 0
Joined: Fri May 29, 2015 2:07 pm

Using instead of in html screen code

Hi IIlya!!

I'm using only the Appery.io plataform.

Look at this bellow:

1- This is how it should work:

Image

Image

2- Here, using DIV tag (layout broken):

Image

Image

3- Here, using SPAN tag (c15r issue):

Image

Image

How can I use SPAN tag like the template (1) and get the value (3) without breaking the layout?

Thanks!

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Using instead of in html screen code

Leonardo -

As I understand you are using service mapping into your custom html.
You can try this solution:

  1. Create empty HTML component on your page.

  2. Upon service susses event use mapping into your HTML component.

  3. On the mapping use following JS code:
    pre
    codevar data = restservice1&#46;response&#46;body;
    /* where restservice1 - is a name of your data service */

    return "comments <span>" + data&#46;comments + "</span>"
    + " And likes is&#46;&#46;&#46; <b>" + data&#46;likes + "</b>&quot
    /* in "return" you can define any HTML structure that you need *//code
    /pre

Return to “Issues”